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