Cast me sync

This commit is contained in:
Senad Uka
2020-07-17 04:50:04 +02:00
parent 96b31b71cf
commit e3acdb4d0e
53 changed files with 678 additions and 635 deletions

View File

@@ -11,7 +11,7 @@
<%= link_to fa_icon("tasks fw", text: "Task Requests"), [:admin, :task_requests], class: class_string("nav-link", "active" => controller_name == "task_requests") %>
</li>
<li class="nav-item">
<%= link_to fa_icon("video-camera fw", text: "Casting Call Interviews"), [:admin, :casting_call_interviews], class: class_string("nav-link", "active" => controller_name == "casting_call_interviews") %>
<%= link_to fa_icon("video-camera fw", text: "Casting Submissions"), [:admin, :casting_submissions], class: class_string("nav-link", "active" => controller_name == "casting_submissions") %>
</li>
<li class="nav-item">
<%= link_to fa_icon("bug fw", text: "Errors"), "https://sentry.io/bigmedia/", class: "nav-link", target: :_blank %>

View File

@@ -1,6 +0,0 @@
<div class="card shadow-sm">
<%= card_header text: "Edit Casting Call Interview", close_action_path: [:admin, :casting_call_interviews] %>
<div class="card-body">
<%= render "form", model: [:admin, @casting_call_interview], casting_call_interview: @casting_call_interview %>
</div>
</div>

View File

@@ -1,6 +0,0 @@
<div class="card shadow-sm">
<%= card_header text: t(".heading"), close_action_path: [:admin, :casting_call_interviews] %>
<div class="card-body">
<%= render "form", model: [:admin, @casting_call_interview], casting_call_interview: @casting_call_interview, casting_calls: @casting_calls %>
</div>
</div>

View File

@@ -1,24 +1,24 @@
<tr id="<%= dom_id(casting_call_interview) %>">
<tr id="<%= dom_id(casting_submission) %>">
<td>
<%= casting_call_interview.casting_call.project.account.name.titleize %>
<%= casting_submission.casting_call.project.account.name.titleize %>
</td>
<td>
<%= casting_call_interview.casting_call.title.titleize %>
<%= casting_submission.casting_call.title.titleize %>
</td>
<td>
<%= casting_call_interview.performer_name %>
<%= casting_submission.performer_name %>
</td>
<td>
<%= casting_call_interview.interview_date %>
<%= casting_submission.interview_date %>
</td>
<td class="text-right">
<div class="btn-group">
<%= button_tag "Manage", class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
<div class="dropdown-menu dropdown-menu-right">
<%= link_to fa_icon("video-camera", text: "View"), casting_call_interview_url(token: casting_call_interview.token), target: "_blank", class: "dropdown-item" %>
<%= link_to fa_icon("pencil", text: "Edit"), [:edit, :admin, casting_call_interview], class: "dropdown-item" %>
<% unless casting_call_interview.interviewed_at.present? %>
<%= link_to fa_icon("check", text: "Complete"), [:complete, :admin, casting_call_interview], method: :post, class: "dropdown-item" %>
<%= link_to fa_icon("video-camera", text: "View"), casting_submission_url(token: casting_submission.token), target: "_blank", class: "dropdown-item" %>
<%= link_to fa_icon("pencil", text: "Edit"), [:edit, :admin, casting_submission], class: "dropdown-item" %>
<% unless casting_submission.interviewed_at.present? %>
<%= link_to fa_icon("check", text: "Complete"), [:complete, :admin, casting_submission], method: :post, class: "dropdown-item" %>
<% end %>
</div>
</div>

View File

@@ -1,4 +1,4 @@
<%= errors_summary_for casting_call_interview %>
<%= errors_summary_for casting_submission %>
<%= bootstrap_form_with model: model, local: true do |form| %>
<%= form.text_field :performer_name, required: true %>
@@ -7,9 +7,9 @@
<%= form.text_field :zoom_meeting_url %>
<div class="row align-items-center text-center mt-4">
<%= link_to t("shared.cancel"), [:admin, :casting_call_interviews], class: "col-3 text-reset" %>
<%= link_to t("shared.cancel"), [:admin, :casting_submissions], class: "col-3 text-reset" %>
<div class="col-9">
<%= form.submit class: class_string("btn btn-block", ["btn-success", "btn-primary"] => casting_call_interview.new_record?), data: { disable_with: t("shared.disable_with") } %>
<%= form.submit class: class_string("btn btn-block", ["btn-success", "btn-primary"] => casting_submission.new_record?), data: { disable_with: t("shared.disable_with") } %>
</div>
</div>
<% end %>

View File

@@ -0,0 +1,6 @@
<div class="card shadow-sm">
<%= card_header text: "Edit Casting Submission", close_action_path: [:admin, :casting_submissions] %>
<div class="card-body">
<%= render "form", model: [:admin, @casting_submission], casting_submission: @casting_submission %>
</div>
</div>

View File

@@ -1,6 +1,6 @@
<div class="d-flex flex-row justify-content-between align-items-center mb-3">
<% if policy(CastingCall).new? %>
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, :admin, :casting_call_interview], class: "btn btn-primary mb-3" %>
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, :admin, :casting_submission], class: "btn btn-primary mb-3" %>
<% end %>
</div>
@@ -16,8 +16,8 @@
</tr>
</thead>
<tbody id="users">
<% if @casting_call_interviews.any? %>
<%= render @casting_call_interviews %>
<% if @casting_submissions.any? %>
<%= render @casting_submissions %>
<% else %>
<tr>
<td colspan="20" class="py-4 text-center text-muted"><%= t(".empty") %></td>
@@ -27,6 +27,6 @@
</table>
</div>
<div id="casting_call_interviews_pagination" class="mt-3">
<%= will_paginate @casting_call_interviews %>
<div id="casting_submissions_pagination" class="mt-3">
<%= will_paginate @casting_submissions %>
</div>

View File

@@ -0,0 +1,6 @@
<div class="card shadow-sm">
<%= card_header text: t(".heading"), close_action_path: [:admin, :casting_submissions] %>
<div class="card-body">
<%= render "form", model: [:admin, @casting_submission], casting_submission: @casting_submission, casting_calls: @casting_calls %>
</div>
</div>

View File

@@ -1,27 +0,0 @@
<tr id="<%= dom_id(casting_call_interview) %>">
<td>
<%= casting_call_interview.casting_call.project.account.name.titleize %>
</td>
<td>
<%= casting_call_interview.casting_call.title&.titleize %>
</td>
<td>
<%= casting_call_interview.performer_name %>
</td>
<td>
<%= casting_call_interview.interviewed_at %>
</td>
<td class="text-right">
<div class="btn-group">
<%= button_tag "Manage", class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
<div class="dropdown-menu dropdown-menu-right">
<% if policy(CastingCallInterview).show? %>
<%= link_to fa_icon("video-camera", text: "View"), [@project, casting_call_interview], target: "_blank", class: "dropdown-item" %>
<% end %>
<% if policy(CastingCallInterview).download? %>
<%= link_to fa_icon("download", text: "Download"), [@project, :interview_downloads, casting_call_interview_id: casting_call_interview.id], method: :post, remote: true, class: "dropdown-item" %>
<% end %>
</div>
</div>
</td>
</tr>

View File

@@ -6,12 +6,14 @@
<strong><%= t '.info_message' %></strong>
</div>
<%= form.text_field :title, label: t('.labels.title') %>
<%= form.text_area :description, label: t('.labels.description') %>
<%= form.text_area :project_description, label: t('.labels.project_description') %>
<%= form.text_area :interview_instructions, label: t('.labels.interview_instructions') %>
<%= form.text_area :interview_requirements, label: t('.labels.interview_requirements') %>
<%= form.text_area :questions, label: t('.labels.questions') %>
<%= form.text_field :title %>
<%= form.text_area :description %>
<%= form.text_area :project_description %>
<%= field_set_tag "Chatbot" do %>
<%= form.text_area :interview_instructions, rows: 6 %>
<%= form.text_area :questions, rows: 8 %>
<%= form.text_area :interview_requirements, rows: 6 %>
<% end %>
<div class="row align-items-center text-center mt-4">
<%= link_to t("shared.cancel"), [project, :casting_calls], class: "col-3 text-reset" %>
@@ -19,4 +21,4 @@
<%= form.submit class: class_string("btn btn-block", ["btn-success", "btn-primary"] => casting_call.new_record?), data: { disable_with: t("shared.disable_with") } %>
</div>
</div>
<% end %>
<% end %>

View File

@@ -6,7 +6,7 @@
<% if download.release_type == "reports"%>
<li><%= download.release_type.titleize %> (as of <%= time_ago_in_words(download.created_at) %> ago)
</li>
<% elsif download.release_type == "CastingCallInterview"%>
<% elsif download.release_type == "CastingSubmission"%>
<li><%= download.release_type.titleize %> files (as of <%= time_ago_in_words(download.created_at) %> ago)
</li>
<% else %>

View File

@@ -0,0 +1,27 @@
<tr id="<%= dom_id(casting_submission) %>">
<td>
<%= casting_submission.casting_call.project.account.name.titleize %>
</td>
<td>
<%= casting_submission.casting_call.title&.titleize %>
</td>
<td>
<%= casting_submission.performer_name %>
</td>
<td>
<%= casting_submission.interviewed_at %>
</td>
<td class="text-right">
<div class="btn-group">
<%= button_tag "Manage", class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
<div class="dropdown-menu dropdown-menu-right">
<% if policy(CastingSubmission).show? %>
<%= link_to fa_icon("video-camera", text: "View"), [@project, casting_submission], target: "_blank", class: "dropdown-item" %>
<% end %>
<% if policy(CastingSubmission).download? %>
<%= link_to fa_icon("download", text: "Download"), [@project, :casting_submission_downloads, casting_submission_id: casting_submission.id], method: :post, remote: true, class: "dropdown-item" %>
<% end %>
</div>
</div>
</td>
</tr>

View File

@@ -10,8 +10,8 @@
</tr>
</thead>
<tbody id="users">
<% if @casting_call_interviews.any? %>
<%= render @casting_call_interviews %>
<% if @casting_submissions.any? %>
<%= render @casting_submissions %>
<% else %>
<tr>
<td colspan="20" class="py-4 text-center text-muted"><%= t(".empty") %></td>
@@ -21,6 +21,6 @@
</table>
</div>
<div id="casting_call_interviews_pagination" class="mt-3">
<%= will_paginate @casting_call_interviews %>
<div id="casting_submissions_pagination" class="mt-3">
<%= will_paginate @casting_submissions %>
</div>

View File

@@ -21,9 +21,9 @@
<%= link_to t("projects.show.tasks"), [@project, :tasks], class: "text-decoration-none text-reset stretched-link" %>
<% end %>
<% end %>
<% if policy(Project).show_casting_call_interview_results? %>
<% if policy(Project).show_casting_submission_results? %>
<%= render "folder_card" do %>
<%= link_to t("projects.show.casting_call_interviews"), [@project, :casting_call_interviews], class: "text-decoration-none text-reset stretched-link" %>
<%= link_to t("projects.show.casting_submissions"), [@project, :casting_submissions], class: "text-decoration-none text-reset stretched-link" %>
<% end %>
<% end %>
</div>

View File

@@ -1,11 +1,11 @@
<div class="card shadow-sm">
<%= card_header text: "Casting call interview details" %>
<%= card_header text: "Casting submission details" %>
<div class="card-body">
<div class="row">
<div class="col-lg-12">
<dl>
<%= description_list_pair_for @casting_call_interview, :performer_name, append: ":" %>
<%= description_list_pair_for @casting_call_interview, :interview_date, append: ":" %>
<%= description_list_pair_for @casting_submission, :performer_name, append: ":" %>
<%= description_list_pair_for @casting_submission, :interview_date, append: ":" %>
</dl>
</div>
</div>
@@ -16,14 +16,14 @@
<div class="card shadow-sm">
<%= card_header text: t(".heading") %>
<div class="card-body">
<%= errors_summary_for @casting_call_interview %>
<%= bootstrap_form_with model: @casting_call_interview, url: casting_call_interview_path(token: @casting_call_interview.token), local: true do |form| %>
<%= errors_summary_for @casting_submission %>
<%= bootstrap_form_with model: @casting_submission, url: casting_submission_path(token: @casting_submission.token), local: true do |form| %>
<div class="field d-none">
<%= form.label :files %>
<%= form.file_field :files, disable: true, direct_upload: true, multiple: true, id: "casting_call_interivew_files", hide_label: true %>
<% @casting_call_interview.files.each do |file| %>
<% @casting_submission.files.each do |file| %>
<% unless file.persisted? %>
<%= hidden_field_tag "#{@casting_call_interview.model_name.param_key}[files][]", file.signed_id %>
<%= hidden_field_tag "#{@casting_submission.model_name.param_key}[files][]", file.signed_id %>
<% end %>
<% end %>
</div>
@@ -32,8 +32,8 @@
data-accepted-files="audio/*,image/*,video/*"
data-behavior="dropzone"
data-file-input-id="casting_call_interivew_files"
data-existing-files="<%= mock_photos_json(@casting_call_interview.files) %>"
data-placeholder="<%= dropzone_placeholder_message_for(@casting_call_interview) %>"
data-existing-files="<%= mock_photos_json(@casting_submission.files) %>"
data-placeholder="<%= dropzone_placeholder_message_for(@casting_submission) %>"
data-submit-button="#submit_folder"></div>
<div class="mt-5">
@@ -45,7 +45,7 @@
</div>
</div>
<div class="row align-items-center justify-content-center mt-3">
<%= link_to "Start Interview", @casting_call_interview.join_zoom_meeting_url, target: "_blank", class: "btn btn-primary" %>
<%= link_to "Start Interview", @casting_submission.join_zoom_meeting_url, target: "_blank", class: "btn btn-primary" %>
</div>
</div>
</div>