fix MR comments
This commit is contained in:
@@ -6,7 +6,7 @@ class BroadcastRecordingsController < ApplicationController
|
|||||||
before_action :set_recording
|
before_action :set_recording
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@recording.update(star: !@recording.star)
|
@recording.toggle_star
|
||||||
set_recordings
|
set_recordings
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -18,4 +18,8 @@ class BroadcastRecording < ApplicationRecord
|
|||||||
def download_file_name
|
def download_file_name
|
||||||
"#{broadcast_name}_Date_#{created_at.in_time_zone(broadcast.shoot_location_time_zone).strftime("%Y-%m-%d")}_Time_#{created_at.in_time_zone(broadcast.shoot_location_time_zone).strftime("%T")}".parameterize
|
"#{broadcast_name}_Date_#{created_at.in_time_zone(broadcast.shoot_location_time_zone).strftime("%Y-%m-%d")}_Time_#{created_at.in_time_zone(broadcast.shoot_location_time_zone).strftime("%T")}".parameterize
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def toggle_star
|
||||||
|
toggle! :starred
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
var dom_id = "<%= dom_id(@recording) %>"
|
$('[data-id="<%= dom_id(@recording) %>"]').remove();
|
||||||
$('[data-id="' + dom_id + '"]').remove();
|
|
||||||
<% if @recordings.empty? %>
|
<% if @recordings.empty? %>
|
||||||
$("#broadcast_recordings_nav").append('<p class="dropdown-item text-muted">Recordings will appear here</p>')
|
$("#broadcast_recordings_nav").append('<p class="dropdown-item text-muted">Recordings will appear here</p>')
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
<% if (controller.class.module_parent.to_s != "Public" && policy(BroadcastRecording).destroy?) %>
|
<% if (controller.class.module_parent.to_s != "Public" && policy(BroadcastRecording).destroy?) %>
|
||||||
<%= link_to "Hide", [broadcast.project, broadcast, recording], class: "btn-sm btn-primary ml-1 text-decoration-none", remote: true, method: :delete, data: { confirm: t('.confirm_hide') } %>
|
<%= link_to "Hide", [broadcast.project, broadcast, recording], class: "btn-sm btn-primary ml-1 text-decoration-none", remote: true, method: :delete, data: { confirm: t('.confirm_hide') } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if (controller.class.module_parent.to_s != "Public" && policy(BroadcastRecording).destroy?) %>
|
<% if (controller.class.module_parent.to_s != "Public" && policy(BroadcastRecording).update?) %>
|
||||||
<%= link_to fa_icon("#{recording.star ? 'star' : 'star-o'} fw"), [broadcast.project, broadcast, recording], class: "text-warning", method: :put, remote: true %>
|
<%= link_to fa_icon("#{recording.starred ? 'star' : 'star-o'} fw"), [broadcast.project, broadcast, recording], class: "text-warning", method: :put, remote: true %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class AddStarToBroadcastRecordings < ActiveRecord::Migration[6.0]
|
class AddStarToBroadcastRecordings < ActiveRecord::Migration[6.0]
|
||||||
def change
|
def change
|
||||||
add_column :broadcast_recordings, :star, :boolean
|
add_column :broadcast_recordings, :starred, :boolean, default: false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -542,7 +542,7 @@ CREATE TABLE public.broadcast_recordings (
|
|||||||
updated_at timestamp(6) without time zone NOT NULL,
|
updated_at timestamp(6) without time zone NOT NULL,
|
||||||
duration double precision,
|
duration double precision,
|
||||||
hidden boolean DEFAULT false,
|
hidden boolean DEFAULT false,
|
||||||
star boolean
|
starred boolean DEFAULT false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user