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,6 +11,7 @@ $body-color: #4A4A4A;
$primary: #6F89FF;
$blue: #0092ff;
$red: #F9002B;
$dark-red: #CE004A;
$green: #51B61B;
$teal: #32C498;
$purple: #5139EE;

View File

@@ -69,6 +69,13 @@ label {
}
}
&.cast-me {
span:last-child {
background-color: $dark-red;
color: $white;
}
}
&.disabled {
span:last-child {
background-color: $gray-500 !important;

View File

@@ -1,61 +0,0 @@
class Admin::CastingCallInterviewsController < Admin::ApplicationController
before_action :set_casting_call_interview, only: [:edit, :update, :show, :complete]
before_action :build_casting_call_interview, only: [:new, :create]
before_action :set_accounts, only: %i[new create edit]
def index
@casting_call_interviews = casting_call_interviews.order_by_recent.paginate(page: params[:page])
end
def create
@casting_call_interview.attributes = casting_call_interview_params
if @casting_call_interview.save
redirect_to [:admin, :casting_call_interviews], notice: t(".notice")
else
render :new
end
end
def update
if @casting_call_interview.update(casting_call_interview_params)
redirect_to [:admin, :casting_call_interviews], notice: t(".notice")
else
render :edit
end
end
def complete
if @casting_call_interview.update(interviewed_at: Time.zone.now)
redirect_to [:admin, :casting_call_interviews], notice: t(".notice")
else
redirect_to [:admin, :casting_call_interviews], notice: t(".alert")
end
end
private
def set_accounts
@accounts = accounts
end
def casting_call_interview_params
params.require(:casting_call_interview).permit(:casting_call_id, :performer_name, :interview_date, :zoom_meeting_url)
end
def casting_call_interviews
policy_scope CastingCallInterview
end
def set_casting_call_interview
@casting_call_interview = authorize policy_scope(CastingCallInterview).find(params[:id])
end
def accounts
policy_scope Account
end
def build_casting_call_interview
@casting_call_interview = authorize policy_scope(CastingCallInterview).build
end
end

View File

@@ -0,0 +1,61 @@
class Admin::CastingSubmissionsController < Admin::ApplicationController
before_action :set_casting_submission, only: [:edit, :update, :show, :complete]
before_action :build_casting_submission, only: [:new, :create]
before_action :set_accounts, only: %i[new create edit]
def index
@casting_submissions = casting_submissions.order_by_recent.paginate(page: params[:page])
end
def create
@casting_submission.attributes = casting_submission_params
if @casting_submission.save
redirect_to [:admin, :casting_submissions], notice: t(".notice")
else
render :new
end
end
def update
if @casting_submission.update(casting_submission_params)
redirect_to [:admin, :casting_submissions], notice: t(".notice")
else
render :edit
end
end
def complete
if @casting_submission.update(interviewed_at: Time.zone.now)
redirect_to [:admin, :casting_submissions], notice: t(".notice")
else
redirect_to [:admin, :casting_submissions], notice: t(".alert")
end
end
private
def set_accounts
@accounts = accounts
end
def casting_submission_params
params.require(:casting_submission).permit(:casting_call_id, :performer_name, :interview_date, :zoom_meeting_url)
end
def casting_submissions
policy_scope CastingSubmission
end
def set_casting_submission
@casting_submission = authorize policy_scope(CastingSubmission).find(params[:id])
end
def accounts
policy_scope Account
end
def build_casting_submission
@casting_submission = authorize policy_scope(CastingSubmission).build
end
end

View File

@@ -1,28 +0,0 @@
class CastingCallInterviewsController < ApplicationController
before_action :set_project
before_action :set_casting_call_interview, only: [:show]
include ProjectLayout
def index
@casting_call_interviews = casting_call_interviews.completed.order_by_recent.paginate(page: params[:page])
end
def show
@files = @casting_call_interview.files.paginate(page: params[:page])
end
private
def set_project
@project = policy_scope(Project).find(params[:project_id])
end
def set_casting_call_interview
@casting_call_interview = authorize casting_call_interviews.find(params[:id])
end
def casting_call_interviews
authorize policy_scope(CastingCallInterview)
end
end

View File

@@ -0,0 +1,30 @@
class CastingSubmissionDownloadsController < ApplicationController
include ProjectContext
before_action :set_project, only: [:create]
before_action :set_casting_submission, only: :create
include ProjectLayout
def create
download = @project.downloads.create!(name: @casting_submission.zip_file_name, release_type: "CastingSubmission")
other_downloads_in_progress = @project.downloads.unfinished_desc_order.offset(1)
if other_downloads_in_progress.any?
in_progress_downloads_details = render_to_string "_other_pending_downloads", locals: { downloads: other_downloads_in_progress, release_type: "CastingSubmission" }, :layout => false
ProjectsChannel.broadcast_download_generation_update(download, in_progress_downloads_details)
else
ProjectsChannel.broadcast_download_generation_update(download, I18n.t("casting_submission_downloads.download.pending", release_type: "CastingSubmission"))
end
GenerateCastingSubmissionFilesZipJob.perform_later(@project, download, @casting_submission)
end
private
def set_casting_submission
authorize(Download)
@casting_submission = policy_scope(@project.casting_submissions).find(params[:casting_submission_id])
end
end

View File

@@ -0,0 +1,28 @@
class CastingSubmissionsController < ApplicationController
before_action :set_project
before_action :set_casting_submission, only: [:show]
include ProjectLayout
def index
@casting_submissions = casting_submissions.completed.order_by_recent.paginate(page: params[:page])
end
def show
@files = @casting_submission.files.paginate(page: params[:page])
end
private
def set_project
@project = policy_scope(Project).find(params[:project_id])
end
def set_casting_submission
@casting_submission = authorize casting_submissions.find(params[:id])
end
def casting_submissions
authorize policy_scope(CastingSubmission)
end
end

View File

@@ -1,30 +0,0 @@
class InterviewDownloadsController < ApplicationController
include ProjectContext
before_action :set_project, only: [:create]
before_action :set_casting_call_interview, only: :create
include ProjectLayout
def create
download = @project.downloads.create!(name: @casting_call_interview.zip_file_name, release_type: "CastingCallInterview")
other_downloads_in_progress = @project.downloads.unfinished_desc_order.offset(1)
if other_downloads_in_progress.any?
in_progress_downloads_details = render_to_string "_other_pending_downloads", locals: { downloads: other_downloads_in_progress, release_type: "CastingCallInterview" }, :layout => false
ProjectsChannel.broadcast_download_generation_update(download, in_progress_downloads_details)
else
ProjectsChannel.broadcast_download_generation_update(download, I18n.t("interview_downloads.download.pending", release_type: "Casting Call Interview"))
end
GenerateInterviewFilesZipJob.perform_later(@project, download, @casting_call_interview)
end
private
def set_casting_call_interview
authorize(Download)
@casting_call_interview = policy_scope(@project.casting_call_interviews).find(params[:casting_call_interview_id])
end
end

View File

@@ -1,25 +0,0 @@
class Public::CastingCallInterviewsController < Public::BaseController
skip_after_action :verify_authorized
before_action :set_casting_call_interview, only: [:show, :update]
def show
end
def update
if @casting_call_interview.update(casting_call_interview_params)
redirect_to casting_call_interview_url(token: @casting_call_interview.token), notice: t(".notice")
else
render :show
end
end
private
def set_casting_call_interview
@casting_call_interview = CastingCallInterview.find_by_token(params[:token])
end
def casting_call_interview_params
params.require(:casting_call_interview).permit(files: [])
end
end

View File

@@ -0,0 +1,25 @@
class Public::CastingSubmissionsController < Public::BaseController
skip_after_action :verify_authorized
before_action :set_casting_submission, only: [:show, :update]
def show
end
def update
if @casting_submission.update(casting_submission_params)
redirect_to casting_submission_url(token: @casting_submission.token), notice: t(".notice")
else
render :show
end
end
private
def set_casting_submission
@casting_submission = CastingSubmission.find_by_token(params[:token])
end
def casting_submission_params
params.require(:casting_submission).permit(files: [])
end
end

View File

@@ -1,4 +1,4 @@
class GenerateInterviewFilesZipJob < ApplicationJob
class GenerateCastingSubmissionFilesZipJob < ApplicationJob
queue_as :default
include Rails.application.routes.url_helpers
include ActionView::Helpers::UrlHelper
@@ -6,12 +6,12 @@ class GenerateInterviewFilesZipJob < ApplicationJob
before_perform do |job|
@project = job.arguments.first
@download = job.arguments.second
@casting_call_interview = job.arguments.third
@casting_submission = job.arguments.third
@download.update!(status: :pending)
end
def perform(project, download, casting_call_interview)
::InterviewFilesCollectionService.new(casting_call_interview.files, @download.name).build do |dir, files|
def perform(project, download, casting_submission)
::CastingSubmissionFilesCollectionService.new(casting_submission.files, @download.name).build do |dir, files|
zipfile_name = "#{dir}/#{@download.name}.zip"
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
files.each do |attachment|
@@ -24,11 +24,11 @@ class GenerateInterviewFilesZipJob < ApplicationJob
rescue StandardError => e
Raven.extra_context(
message: "Failed to generate download for project (##{project.id})",
release_type: "CastingCallInterview"
release_type: "CastingSubmission"
)
@download.failure!
ProjectsChannel.broadcast_download_generation_update(@download, I18n.t("interview_downloads.download.failure"))
ProjectsChannel.broadcast_download_generation_update(@download, I18n.t("casting_submission_downloads.download.failure"))
end
after_perform do |job|
@@ -37,7 +37,7 @@ class GenerateInterviewFilesZipJob < ApplicationJob
downloads_folder_link = link_to("Files > Downloads", project_downloads_path(I18n.locale, @project))
download_button = link_to("Download", rails_blob_path(@download.file, disposition: "attachment", only_path: true), class: "btn btn-success", target: :_blank)
ProjectsChannel.broadcast_download_generation_update(@download, I18n.t("interview_downloads.download.success", downloads_folder_link: downloads_folder_link, download_button: download_button, release_type: "Casting Call Interview"))
ProjectsChannel.broadcast_download_generation_update(@download, I18n.t("casting_submission_downloads.download.success", downloads_folder_link: downloads_folder_link, download_button: download_button, release_type: "Casting Submission"))
end
end
end

View File

@@ -5,7 +5,7 @@ class Account < ApplicationRecord
has_many :users, through: :account_auths
has_many :projects, dependent: :destroy
has_many :casting_calls, through: :projects
has_many :casting_call_interviews, through: :projects
has_many :casting_submissions, through: :projects
has_many :videos, through: :projects
has_many :contract_templates, through: :projects
@@ -62,7 +62,7 @@ class Account < ApplicationRecord
MiscRelease.where(project: projects),
MatchingRequest.where(project: projects),
CastingCall.where(project: projects),
self.casting_call_interviews,
self.casting_submissions,
self
])).sum(:byte_size).to_f
end

View File

@@ -1,6 +1,6 @@
class CastingCall < ApplicationRecord
belongs_to :project
has_many :casting_call_interviews, dependent: :destroy
has_many :casting_submissions, dependent: :destroy
has_secure_token

View File

@@ -1,4 +1,4 @@
class CastingCallInterview < ApplicationRecord
class CastingSubmission < ApplicationRecord
belongs_to :casting_call
has_many_attached :files
@@ -33,6 +33,6 @@ class CastingCallInterview < ApplicationRecord
private
def invalid_meeting_url_message
I18n.t('casting_call_interviews.validation_errors.invalid_meeting_url')
I18n.t('casting_submissions.validation_errors.invalid_meeting_url')
end
end

View File

@@ -16,7 +16,7 @@ class Project < ApplicationRecord
has_many :medical_releases, dependent: :destroy
has_many :misc_releases, dependent: :destroy
has_many :casting_calls, dependent: :destroy
has_many :casting_call_interviews, through: :casting_calls
has_many :casting_submissions, through: :casting_calls
has_many :videos, dependent: :destroy
has_many :imports, dependent: :destroy
has_many :contract_templates, dependent: :destroy

View File

@@ -1,4 +1,4 @@
class CastingCallInterviewPolicy < ApplicationPolicy
class CastingSubmissionPolicy < ApplicationPolicy
def index?
true
end

View File

@@ -41,7 +41,7 @@ class ProjectPolicy < ApplicationPolicy
show?
end
def show_casting_call_interview_results?
def show_casting_submission_results?
show?
end
end

View File

@@ -1,4 +1,4 @@
class InterviewFilesCollectionService
class CastingSubmissionFilesCollectionService
def initialize(files, folder_name)
@files = files
@folder_name = folder_name
@@ -21,4 +21,4 @@ class InterviewFilesCollectionService
private
attr_reader :files, :folder_name
end
end

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>