Initial commit
This commit is contained in:
25
app/views/account_auths/_account_auth.html.erb
Normal file
25
app/views/account_auths/_account_auth.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<tr id="<%= dom_id(account_auth) %>">
|
||||
<td style="width:3rem">
|
||||
<%= image_or_text_avatar(account_auth.user) %>
|
||||
</td>
|
||||
<td><%= account_auth.user.email %></td>
|
||||
<td><%= account_auth.user.full_name %></td>
|
||||
<td>
|
||||
<% if account_auth.user == Current.user %>
|
||||
<%= account_auth.role.to_s.titleize %>
|
||||
<% else %>
|
||||
<%= bootstrap_form_with model: account_auth, local: true, layout: :inline do |form| %>
|
||||
<%= form.select :role, options_for_role_select, { hide_label: true, append: form.button("Change Role", class: "btn btn-success btn-sm") }, { class: "form-control custom-select" } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= pluralize(account_auth.user.accessible_projects_for(account_auth.account).size, "Project") %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<% if policy(account_auth).destroy? && account_auth.user != Current.user %>
|
||||
<%= link_to t(".actions.remove"), account_auth_path(account_auth), method: :delete, data: { confirm: t(".confirm") }, class: "btn btn-light btn-sm border" %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
4
app/views/account_auths/_account_logo_form.html.erb
Normal file
4
app/views/account_auths/_account_logo_form.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<%= bootstrap_form_with model: account, url: account_path, html: { autocorrect: :off, autocapitalize: :none, autocomplete: :off, spellcheck: false }, layout: :inline, remote: true do |form| %>
|
||||
<%= form.file_field :logo, hide_label: true, accept: "image/*", placeholder: "Upload Logo", direct_upload: true, wrapper_class: "mr-1" %>
|
||||
<%= form.button(fa_icon("upload", text: t(".submit")), class: "btn btn-md btn-primary", data: { disable_with: t("shared.disable_with") }) %>
|
||||
<% end %>
|
||||
4
app/views/account_auths/_form.html.erb
Normal file
4
app/views/account_auths/_form.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<%= bootstrap_form_with model: [account_auth], html: { autocorrect: :off, autocapitalize: :none, autocomplete: :off, spellcheck: false } do |form| %>
|
||||
<%= form.email_field :user_email, hide_label: true, append: form.button(fa_icon("paper-plane-o", text: t(".submit")), class: "btn btn-primary"), placeholder: true %>
|
||||
<%= form.hidden_field :account_id, { value: account_id } %>
|
||||
<% end %>
|
||||
39
app/views/account_auths/index.html.erb
Normal file
39
app/views/account_auths/index.html.erb
Normal file
@@ -0,0 +1,39 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), subtext: @account.name, close_action_path: ( Current.user.admin? ? admin_accounts_path : projects_path) %>
|
||||
|
||||
<div class="card-body p-3">
|
||||
<section class="py-2">
|
||||
<h2 class="h6"><%= t(".logo.heading") %></h2>
|
||||
<div class="mb-2" id="account_logo_display">
|
||||
<%= render "accounts/logo", account: @account %>
|
||||
</div>
|
||||
<%= render "account_logo_form", account: @account %>
|
||||
</section>
|
||||
<hr>
|
||||
<% if policy(AccountAuth).new? %>
|
||||
<section class="py-2">
|
||||
<h2 class="h6"><%= t(".invitation.heading") %></h2>
|
||||
<%= render "form", account_auth: @account_auth, account_id: @account.id %>
|
||||
</section>
|
||||
<% end %>
|
||||
|
||||
<h2 class="h6"><%= pluralize(@members.size, "Account Member") %></h2>
|
||||
<div class="pt-2 mx-n3">
|
||||
<table class="table table-striped tr-px-4 align-all-middle">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Email</th>
|
||||
<th>Name</th>
|
||||
<th>Role</th>
|
||||
<th>No. Projects</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%= render @members %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
13
app/views/accounts/_form.html.erb
Normal file
13
app/views/accounts/_form.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= bootstrap_form_with scope: :user, url: account_path, method: :post do |form| %>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :first_name, wrapper_class: "col-md-6" %>
|
||||
<%= form.text_field :last_name, wrapper_class: "col-md-6" %>
|
||||
</div>
|
||||
<%= form.email_field :email, class: "form-group" %>
|
||||
<%= form.password_field :password %>
|
||||
<%= form.text_field :account_name, label: 'Account Name' %>
|
||||
<%= form.select :interested_product_name, options_for_select(["I'm interested in all products", "DirectME", "ReleaseME", "CastME", "EditME", "DeliverME", "ExpenseME"]), { label: "What product are you most interested in?" }, { class: "form-control custom-select" } %>
|
||||
<div class="pt-3">
|
||||
<%= form.submit "Start Free Trial", class: "btn btn-block btn-danger font-weight-bold" %>
|
||||
</div>
|
||||
<% end %>
|
||||
3
app/views/accounts/_logo.html.erb
Normal file
3
app/views/accounts/_logo.html.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
<% if account.logo.attached? %>
|
||||
<%= image_tag(account_logo_variant(account.logo), class: "img-thumbnail", alt: "Logo") %>
|
||||
<% end %>
|
||||
52
app/views/accounts/new.html.erb
Normal file
52
app/views/accounts/new.html.erb
Normal file
@@ -0,0 +1,52 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-6 col-lg-6 mb-5">
|
||||
<h3>Welcome To <%= suite_wordmark("d-inline-block") %></h3>
|
||||
<div class="mt-4">
|
||||
<p>Sign up for a <strong>14 Day Free Trial</strong> which includes full access to the following products. No credit card required!</p>
|
||||
<div class="d-flex justify-content-between pb-2">
|
||||
<div><%= image_tag "logo_directme.png", width: "90%" %></div>
|
||||
<div><%= image_tag "logo_releaseme.png", width: "90%" %></div>
|
||||
<div><%= image_tag "logo_deliverme.png", width: "90%" %></div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between pb-2">
|
||||
<div><%= image_tag "logo_editme.png", width: "90%" %></div>
|
||||
<div><%= image_tag "logo_castme.png", width: "90%" %></div>
|
||||
<div><%= image_tag "logo_expenseme.png", width: "90%" %></div>
|
||||
</div>
|
||||
</div>
|
||||
<p>Want to know more? <%= link_to "Schedule a free demo", "javascript:void(0)", class: "text-danger", data: { toggle: "modal", target: "#demo_modal" } %></p>
|
||||
<div class="modal fade" id="demo_modal" tabindex="-1" role="dialog" aria-labelledby="demoModal" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header border-0 pb-0">
|
||||
<%= button_tag class: "close", data: { dismiss: "modal" }, aria: { label: "Close" } do %>
|
||||
<span aria-hidden="true">×</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!--[if lte IE 8]>
|
||||
<script charset="utf-8" type="text/javascript" src="https://js.hsforms.net/forms/v2-legacy.js"></script>
|
||||
<![endif]-->
|
||||
<script charset="utf-8" type="text/javascript" src="https://js.hsforms.net/forms/v2.js"></script>
|
||||
<%= javascript_tag nonce: true do %>
|
||||
hbspt.forms.create({
|
||||
portalId: "7344617",
|
||||
formId: "ac9ebc7e-adfd-4308-ac5a-3052b6891b64"
|
||||
});
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6 col-lg-6">
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: "Sign Up Below For Instant Access" %>
|
||||
<div class="card-body">
|
||||
<%= render "form" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
2
app/views/accounts/update.js.erb
Normal file
2
app/views/accounts/update.js.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
$("#account_logo_display").html("<%= j render(partial: 'logo', locals: { account: @account }) %>");
|
||||
$("#account_logo").prop('disabled', false);
|
||||
@@ -0,0 +1,48 @@
|
||||
<tr id="<%= dom_id(acquired_media_release) %>">
|
||||
<td data-behavior="select"><%= check_box_tag "acquired_media_release_ids[]", acquired_media_release.id, false %></td>
|
||||
<td>
|
||||
<%= acquired_media_release.name %>
|
||||
</td>
|
||||
<td>
|
||||
<% if acquired_media_release.file_infos.any? %>
|
||||
<%= acquired_media_release.file_infos.size %>
|
||||
<% else %>
|
||||
<%= fa_icon("warning", text: t(".no_media"), class: "text-danger") %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= notes_preview acquired_media_release.notes.order_by_recent %>
|
||||
</td>
|
||||
<td id="<%= dom_id acquired_media_release, "tags_preview" %>">
|
||||
<%= tags_preview acquired_media_release, acquired_media_release.tags %>
|
||||
</td>
|
||||
<td>
|
||||
<%= acquired_media_release.signed_on %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<%= button_tag t(".actions.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(Note).new? %>
|
||||
<%= link_to fa_icon("sticky-note fw", text: "Notes"), [:new, acquired_media_release, :note], class: "dropdown-item", remote: true %>
|
||||
<% end %>
|
||||
<% if policy(acquired_media_release.tags).new? %>
|
||||
<%= link_to fa_icon("tags fw", text: "Tags"), [:new, acquired_media_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %>
|
||||
<% end %>
|
||||
<% if policy(acquired_media_release).edit_file_infos? %>
|
||||
<%= link_to fa_icon("file fw", text: "Add Media"), [:edit, acquired_media_release, :file_infos], class: "dropdown-item" %>
|
||||
<% end %>
|
||||
<% if policy(Contract).show? && (acquired_media_release.contract.attached? || acquired_media_release.contract_template.present?) %>
|
||||
<%= link_to fa_icon("download fw", text: "Download"), [acquired_media_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>
|
||||
<% end %>
|
||||
<% if policy(acquired_media_release).edit? %>
|
||||
<%= link_to fa_icon("pencil fw", text: "Edit"), [:edit, acquired_media_release], class: "dropdown-item" %>
|
||||
<% end %>
|
||||
<% if policy(acquired_media_release).destroy? %>
|
||||
<%= link_to fa_icon("trash fw", text: "Delete"), acquired_media_release, class: "dropdown-item", method: :delete, data: { confirm: "Are you sure?" } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
37
app/views/acquired_media_releases/_form.html.erb
Normal file
37
app/views/acquired_media_releases/_form.html.erb
Normal file
@@ -0,0 +1,37 @@
|
||||
<%= errors_summary_for acquired_media_release %>
|
||||
<%= bootstrap_form_with model: model, local: true do |form| %>
|
||||
<%= field_set_tag content_tag(:span, t(".acquired_media_details.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :name, required: true, wrapper_class: "col-12" %>
|
||||
</div>
|
||||
<%= form.form_group :categories, label: { text: "Categories" } do %>
|
||||
<% AcquiredMediaRelease::CATEGORIES.each do |category| %>
|
||||
<%= form.check_box :categories, { multiple: true, label: category }, category, false %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= field_set_tag content_tag(:span, t(".files.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<div class="alert alert-warning text-center text-md-left">
|
||||
<%= fa_icon "warning" %>
|
||||
<strong>For optimal accuracy, please ensure video file names and photo file names match the source file name in the editing sequence.</strong>
|
||||
</div>
|
||||
<%= render "shared/file_infos_dropzone", form: form, releasable: acquired_media_release %>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= field_set_tag content_tag(:span, t(".contract_and_rights.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<%= render "shared/contract_fields", form: form, release: acquired_media_release %>
|
||||
<%= render "shared/exploitable_rights_fields", form: form %>
|
||||
<% end %>
|
||||
|
||||
<div class="row align-items-center text-center mt-4">
|
||||
<%= link_to t("shared.cancel"), [acquired_media_release.project, :acquired_media_releases], class: "col-3 text-reset" %>
|
||||
<div class="col-9">
|
||||
<%= form.button id: "submit_release", class: class_string("btn btn-block", ["btn-success", "btn-primary"] => acquired_media_release.new_record?), data: { disable_with: t("shared.disable_with") } %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
6
app/views/acquired_media_releases/edit.html.erb
Normal file
6
app/views/acquired_media_releases/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), close_action_path: [@project, :acquired_media_releases] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", model: @acquired_media_release, acquired_media_release: @acquired_media_release %>
|
||||
</div>
|
||||
</div>
|
||||
51
app/views/acquired_media_releases/index.html.erb
Normal file
51
app/views/acquired_media_releases/index.html.erb
Normal file
@@ -0,0 +1,51 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="d-md-flex d-sm-flex flex-sm-column flex-md-row flex-md-wrap mb-3">
|
||||
<% if policy(AcquiredMediaRelease).new? %>
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :acquired_media_release], class: "btn btn-primary mr-2 mb-2" %>
|
||||
<% end %>
|
||||
|
||||
<% if @acquired_media_releases.any? && policy(AcquiredMediaRelease).tag_multiple? %>
|
||||
<%= button_to_bulk_tagging(@project) %>
|
||||
<% end %>
|
||||
|
||||
<% if @acquired_media_releases.any? && policy(AcquiredMediaRelease).download_multiple? %>
|
||||
<%= link_to "Download All", [@project, :contract_downloads, release_type: @acquired_media_releases.name], method: :post, remote: true, class: "btn btn-light border ml-auto mr-2 mb-2", data: {
|
||||
disable_with: "Please wait..." } %>
|
||||
<% end %>
|
||||
|
||||
<%= bootstrap_form_with url: [@project, :acquired_media_releases], method: :get, remote: true, layout: :inline, id: "search" do |form| %>
|
||||
<%= form.search_field :query, hide_label: true, placeholder: t(".actions.search"), class: "rounded-pill-right", value: params[:query], prepend: form.button(fa_icon("search"), class: "btn btn-light border mb-2 rounded-pill-left") %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="border bg-white rounded shadow-sm pb-3 table-responsive">
|
||||
<table class="table table-striped tr-px-4 align-all-middle">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th data-behavior="all-selectable"><%= check_box_tag "acquired_media_release_ids[]", false, false %></th>
|
||||
<th><%= AcquiredMediaRelease.human_attribute_name(:name) %></th>
|
||||
<th><%= t(".table_headers.file_infos_count") %></th>
|
||||
<th><%= t(".table_headers.notes") %></th>
|
||||
<th><%= t(".table_headers.tags") %></th>
|
||||
<th><%= t(".table_headers.signed_at") %></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="acquired_media_releases">
|
||||
<% if @acquired_media_releases.any? %>
|
||||
<%= render @acquired_media_releases %>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="12" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="acquired_media_releases_pagination" class="mt-3">
|
||||
<%= will_paginate @acquired_media_releases %>
|
||||
</div>
|
||||
3
app/views/acquired_media_releases/index.js.erb
Normal file
3
app/views/acquired_media_releases/index.js.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
$("#acquired_media_releases").html("<%= j render(@acquired_media_releases) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
$("#acquired_media_releases_pagination").html("<%= j will_paginate(@acquired_media_releases) %>");
|
||||
6
app/views/acquired_media_releases/new.html.erb
Normal file
6
app/views/acquired_media_releases/new.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), close_action_path: [@project, :acquired_media_releases] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", model: [@project, @acquired_media_release], acquired_media_release: @acquired_media_release %>
|
||||
</div>
|
||||
</div>
|
||||
14
app/views/active_storage/blobs/_blob.html.erb
Normal file
14
app/views/active_storage/blobs/_blob.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> attachment--<%= blob.filename.extension %>">
|
||||
<% if blob.representable? %>
|
||||
<%= image_tag blob.representation(resize_to_fit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %>
|
||||
<% end %>
|
||||
|
||||
<figcaption class="attachment__caption">
|
||||
<% if caption = blob.try(:caption) %>
|
||||
<%= caption %>
|
||||
<% else %>
|
||||
<span class="attachment__name"><%= blob.filename %></span>
|
||||
<span class="attachment__size"><%= number_to_human_size blob.byte_size %></span>
|
||||
<% end %>
|
||||
</figcaption>
|
||||
</figure>
|
||||
33
app/views/admin/accounts/_account.html.erb
Normal file
33
app/views/admin/accounts/_account.html.erb
Normal file
@@ -0,0 +1,33 @@
|
||||
<tr id="<%= dom_id(account) %>">
|
||||
<td>
|
||||
<%= account.name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= account.plan_name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= account.projects.size %>
|
||||
</td>
|
||||
<td>
|
||||
<%= number_with_delimiter convert_duration(account.current_month_video_duration_total, from: :seconds, to: :minutes).round %> minutes
|
||||
</td>
|
||||
<td>
|
||||
<%= number_with_delimiter convert_duration(account.video_duration_total, from: :seconds, to: :minutes).round %> minutes
|
||||
</td>
|
||||
<td>
|
||||
<%= number_to_human_size account.storage_total %>
|
||||
</td>
|
||||
<td>
|
||||
<%= time_ago_in_words(account.created_at) %> ago
|
||||
</td>
|
||||
<td>
|
||||
<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("arrow-right", text: "Overview"), admin_account_path(account), class: "dropdown-item" %>
|
||||
<%= link_to fa_icon("pencil", text: "Edit"), edit_admin_account_path(account), class: "dropdown-item" %>
|
||||
<%= link_to fa_icon("arrow-right", text: "Account Managers"), account_auths_path({ account_id: account.id}), class: "dropdown-item" %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
14
app/views/admin/accounts/_form.html.erb
Normal file
14
app/views/admin/accounts/_form.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<%= errors_summary_for account %>
|
||||
<%= bootstrap_form_with model: [:admin, account], local: true do |form| %>
|
||||
<%= field_set_tag content_tag(:span, "Account Details", class: "h6 text-muted text-uppercase") do %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.select :plan_uid, options_for_account_plan_select, { label: "Plan" }, class: "form-control custom-select" %>
|
||||
<% end %>
|
||||
|
||||
<div class="row align-items-center text-center mt-4">
|
||||
<%= link_to t("shared.cancel"), [:admin, :accounts], class: "col-3 text-reset" %>
|
||||
<div class="col-9">
|
||||
<%= form.button class: class_string("btn btn-block", ["btn-success", "btn-primary"] => account.new_record?), data: { disable_with: t("shared.disable_with") } %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
16
app/views/admin/accounts/_user.html.erb
Normal file
16
app/views/admin/accounts/_user.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<tr>
|
||||
<td><%= user.email %></td>
|
||||
<td><%= user.account_auths.map(&:role).join(',') %></td>
|
||||
<td class="text-right">
|
||||
<% if user != Current.user %>
|
||||
<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("user-secret", text: "Masquerade"), [:admin, user, :masquerade], method: :post, class: "dropdown-item" %>
|
||||
<%= link_to fa_icon("pencil", text: "Edit"), [:edit, :admin, user], class: "dropdown-item" %>
|
||||
<%= link_to fa_icon("trash", text: "Delete"), [:admin, user], class: "dropdown-item", remote: true, method: :delete, data: { confirm: "Are you sure?" } %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
13
app/views/admin/accounts/_video.html.erb
Normal file
13
app/views/admin/accounts/_video.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<tr>
|
||||
<td><%= video.project.name %></td>
|
||||
<td><%= video.name %></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("sticky-note fw", text: "Analysis"), [video, :video_analyses, locale: I18n.locale], class: "dropdown-item" %>
|
||||
<%= link_to fa_icon("tags fw", text: "Re-analyze"), [video, :video_analyses, locale: I18n.locale], method: "post", class: "dropdown-item" %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
6
app/views/admin/accounts/edit.html.erb
Normal file
6
app/views/admin/accounts/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: "Edit Account", close_action_path: [:admin, :accounts] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", account: @account %>
|
||||
</div>
|
||||
</div>
|
||||
39
app/views/admin/accounts/index.html.erb
Normal file
39
app/views/admin/accounts/index.html.erb
Normal file
@@ -0,0 +1,39 @@
|
||||
<div class="d-flex flex-row-reverse justify-content-between align-items-right mb-3">
|
||||
<%= bootstrap_form_with url: admin_accounts_path, method: :get, remote: true, layout: :inline, id: "search" do |form| %>
|
||||
<%= form.search_field :query, hide_label: true, placeholder: t(".actions.search"), class: "rounded-pill-right", value: params[:query], prepend: form.button(fa_icon("search"), id: "search-button", class: "btn btn-light border rounded-pill-left") %>
|
||||
<% end%>
|
||||
<% if policy(Account).new? %>
|
||||
<%= link_to fa_icon("plus", text: "New Account"), [:new, :admin, :account], class: "btn btn-primary mb-3" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="border bg-white rounded shadow-sm pb-3 table-responsive">
|
||||
<table class="table table-striped tr-px-4 align-all-middle">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Plan</th>
|
||||
<th># Projects</th>
|
||||
<th>Monthly Video Upload Minutes</th>
|
||||
<th>Total Video Upload Minutes</th>
|
||||
<th>Total Storage</th>
|
||||
<th>Created At</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="accounts">
|
||||
<% if @accounts.any? %>
|
||||
<%= render @accounts %>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="6" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="accounts_pagination" class="mt-3">
|
||||
<%= will_paginate @accounts %>
|
||||
</div>
|
||||
3
app/views/admin/accounts/index.js.erb
Normal file
3
app/views/admin/accounts/index.js.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
$("#accounts").html("<%= j render @accounts %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
$("#accounts_pagination").html("<%= j will_paginate @accounts %>");
|
||||
6
app/views/admin/accounts/new.html.erb
Normal file
6
app/views/admin/accounts/new.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: "New Account", close_action_path: [:admin, :accounts] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", account: @account %>
|
||||
</div>
|
||||
</div>
|
||||
38
app/views/admin/accounts/show.html.erb
Normal file
38
app/views/admin/accounts/show.html.erb
Normal file
@@ -0,0 +1,38 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: @account.name, close_action_path: [:admin, :accounts] %>
|
||||
<div class="card-body">
|
||||
<%= card_field_set_tag "Account Details" do %>
|
||||
<dl class="row">
|
||||
<dt class="col-sm-2">Plan</dt>
|
||||
<dd class="col-sm-10"><%= @account.plan_name %></dd>
|
||||
<dt class="col-sm-2">Users</dt>
|
||||
<dd class="col-sm-10"><%= @account.users.size %></dd>
|
||||
<dt class="col-sm-2">Created at</dt>
|
||||
<dd class="col-sm-10"><%= time_ago_in_words(@account.created_at) %> ago</dd>
|
||||
</dl>
|
||||
<% end %>
|
||||
|
||||
<%= card_field_set_tag "Videos" do %>
|
||||
<%= bootstrap_form_with url: [:admin, @account], method: :get, remote: true, layout: :inline, id: "search" do |form| %>
|
||||
<%= form.search_field :query, hide_label: true, placeholder: t("shared.search"), class: "rounded-pill-right", value: params[:query], prepend: form.button(fa_icon("search"), id: "search-button", class: "btn btn-light border rounded-pill-left") %>
|
||||
<% end%>
|
||||
<div class="table-responsive-sm">
|
||||
<table class="table table-striped tr-px-4 align-all-middle">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>Project</th>
|
||||
<th>Name</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="videos">
|
||||
<%= render partial: "admin/accounts/video", collection: @videos %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="videos_pagiantion">
|
||||
<%= will_paginate @videos %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
2
app/views/admin/accounts/show.js.erb
Normal file
2
app/views/admin/accounts/show.js.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
$("#videos").html("<%= j render partial: "admin/accounts/video", collection: @videos %>");
|
||||
$("#videos_pagination").html("<%= j will_paginate @videos %>");
|
||||
36
app/views/admin/application/_header.html.erb
Normal file
36
app/views/admin/application/_header.html.erb
Normal file
@@ -0,0 +1,36 @@
|
||||
<header class="container-fluid bg-light border-bottom py-3 sticky-top">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-4">
|
||||
<%= link_to signed_in_root_path, class: "navbar-brand" do %>
|
||||
<%= suite_wordmark %>
|
||||
<% end %>
|
||||
<%= link_to fa_icon("arrow-circle-left", text: "Back To Account"), :projects, class: "text-reset text-decoration-none" %>
|
||||
</div>
|
||||
<div class="col-4 text-center">
|
||||
<h1 class="h4 m-0">Admin</h1>
|
||||
</div>
|
||||
<div class="col-4 text-right">
|
||||
<div class="btn-group">
|
||||
<%= link_to :profile, class: "text-decoration-none text-reset dropdown-toggle", data: { toggle: "dropdown" } do %>
|
||||
<span class="mr-2"><%= get_name_or_email(Current.user) %></span>
|
||||
<%= image_or_text_avatar(Current.user) %>
|
||||
<% end %>
|
||||
|
||||
<div class="dropdown-menu">
|
||||
<% if Current.user.admin? %>
|
||||
<%= link_to "BIG Admin", [:admin, :signed_in_root], class: "dropdown-item" %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to "Profile Settings", profile_path, class: "dropdown-item" %>
|
||||
|
||||
<% # TODO: Use null object pattern %>
|
||||
<% if Current.account && Current.user.account_manager?(Current.account) %>
|
||||
<%= link_to "Account Settings", [:account_auths], class: "dropdown-item" %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to t(".sign_out"), :session, method: :delete, class: "dropdown-item" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
20
app/views/admin/application/_side_nav.html.erb
Normal file
20
app/views/admin/application/_side_nav.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<aside class="bg-dark text-white p-4 rounded">
|
||||
<nav>
|
||||
<ul class="nav nav-pills nav-pills-dark flex-column">
|
||||
<li class="nav-item">
|
||||
<%= link_to fa_icon("globe fw", text: "Accounts"), [:admin, :accounts], class: class_string("nav-link", "active" => controller_name == "accounts") %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to fa_icon("users fw", text: "Users"), [:admin, :users], class: class_string("nav-link", "active" => controller_name == "users") %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to fa_icon("bug fw", text: "Errors"), "https://sentry.io/bigmedia/", class: "nav-link", target: :_blank %>
|
||||
</li>
|
||||
<% if ENV["REDIS_URL"] %>
|
||||
<li class="nav-item">
|
||||
<%= link_to fa_icon("cogs fw", text: "Background Queue"), [:admin, :background_queue], class: "nav-link" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</nav>
|
||||
</aside>
|
||||
24
app/views/admin/users/_form.html.erb
Normal file
24
app/views/admin/users/_form.html.erb
Normal file
@@ -0,0 +1,24 @@
|
||||
<%= errors_summary_for user %>
|
||||
<%= bootstrap_form_with model: [:admin, user], local: true, html: { autocorrect: :off, autocapitalize: :none, autocomplete: :off, spellcheck: false } do |form| %>
|
||||
<%= form.email_field :email %>
|
||||
|
||||
<%# autocomplete: 'new-password' prevent the existing password value from showing up %>
|
||||
<%= form.password_field :password, autocomplete: "new-password" %>
|
||||
|
||||
<% if user.new_record? %>
|
||||
<%= form.collection_select :account_id, accounts, :id, :name, { prompt: "Select an Account", required: true }, class: "form-control custom-select" %>
|
||||
<%= form.select :role, options_for_role_select, {}, class: "form-control custom-select" %>
|
||||
<% end %>
|
||||
|
||||
<div class="mb-4">
|
||||
<%= form.check_box :admin, label: "Admin User" %>
|
||||
<div class="help-block text-muted"><%= fa_icon :warning, text: "This option grants access to the Admin dashboard. This should only be for trusted BiG employees." %></div>
|
||||
</div>
|
||||
|
||||
<div class="row align-items-center text-center mt-4">
|
||||
<%= link_to t("shared.cancel"), [:admin, :users], class: "col-3 text-reset" %>
|
||||
<div class="col-9">
|
||||
<%= form.button class: class_string("btn btn-block", ["btn-success", "btn-primary"] => user.new_record?), data: { disable_with: t("shared.disable_with") } %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
32
app/views/admin/users/_user.html.erb
Normal file
32
app/views/admin/users/_user.html.erb
Normal file
@@ -0,0 +1,32 @@
|
||||
<tr id="<%= dom_id(user) %>">
|
||||
<td>
|
||||
<%= user.email %>
|
||||
</td>
|
||||
<td>
|
||||
<%= user.first_name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= user.last_name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= user.account_auths.map(&:role).compact.join(",") %>
|
||||
</td>
|
||||
<td>
|
||||
<%= user.accounts.map(&:name).join(",") %>
|
||||
</td>
|
||||
<td>
|
||||
<%= time_ago_in_words(user.created_at) %> ago
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<% if user != Current.user %>
|
||||
<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("user-secret", text: "Masquerade"), [:admin, user, :masquerade], method: :post, class: "dropdown-item" %>
|
||||
<%= link_to fa_icon("pencil", text: "Edit"), [:edit, :admin, user], class: "dropdown-item" %>
|
||||
<%= link_to fa_icon("trash", text: "Delete"), [:admin, user], class: "dropdown-item", remote: true, method: :delete, data: { confirm: "Are you sure?" } %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
6
app/views/admin/users/edit.html.erb
Normal file
6
app/views/admin/users/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: "Edit User", close_action_path: [:admin, :users] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", user: @user, accounts: @accounts %>
|
||||
</div>
|
||||
</div>
|
||||
34
app/views/admin/users/index.html.erb
Normal file
34
app/views/admin/users/index.html.erb
Normal file
@@ -0,0 +1,34 @@
|
||||
<div class="d-flex flex-row justify-content-between align-items-center mb-3">
|
||||
<% if policy(User).new? %>
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, :admin, :user], class: "btn btn-primary mb-3" %>
|
||||
<% end %>
|
||||
|
||||
<%= bootstrap_form_with url: admin_users_path, method: :get, remote: true, layout: :inline, id: "search" do |form| %>
|
||||
<%= form.search_field :query, hide_label: true, placeholder: t(".actions.search"), class: "rounded-pill-right", value: params[:query], prepend: form.button(fa_icon("search"), class: "btn btn-light border rounded-pill-left") %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="border bg-white rounded shadow-sm pb-3 table-responsive">
|
||||
<table class="table table-striped tr-px-4 align-all-middle">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>Email</th>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Role</th>
|
||||
<th>Account Name</th>
|
||||
<th>Created At</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="users">
|
||||
<% if @users.any? %>
|
||||
<%= render @users %>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="5" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
2
app/views/admin/users/index.js.erb
Normal file
2
app/views/admin/users/index.js.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
$("#users").html("<%= j render(@users) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
6
app/views/admin/users/new.html.erb
Normal file
6
app/views/admin/users/new.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: "New User", close_action_path: [:admin, :users] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", user: @user, accounts: @accounts %>
|
||||
</div>
|
||||
</div>
|
||||
12
app/views/admin_mailer/new_video.html.erb
Normal file
12
app/views/admin_mailer/new_video.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<p>Hi BiG Team,</p>
|
||||
|
||||
<p>A new video titled "<%= @video.name || @video.file.filename %>" has been uploaded to <%= @video.project.account.name %>'s "<%= @video.project.name %>" project.</p>
|
||||
|
||||
<p>
|
||||
<%= link_to "Click here", [@video, :video_analyses, locale: I18n.locale, host: AppHost.new.domain_with_port] %>
|
||||
to begin analyzing this video.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
- BiG Notifier
|
||||
</p>
|
||||
8
app/views/admin_mailer/new_video.text.erb
Normal file
8
app/views/admin_mailer/new_video.text.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
Hi BiG Team,
|
||||
|
||||
A new video titled "<%= @video.name || @video.file.filename %>" has been uploaded to <%= @video.project.account.name %>'s "<%= @video.project.name %>" project.
|
||||
|
||||
Use the URL below to begin analyzing this video:
|
||||
<%= url_for [@video, :video_analyses, locale: I18n.locale, host: AppHost.new.domain_with_port] %>
|
||||
|
||||
- BiG Notifier
|
||||
12
app/views/admin_mailer/updated_video_edl_file.html.erb
Normal file
12
app/views/admin_mailer/updated_video_edl_file.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<p>Hi BiG Team,</p>
|
||||
|
||||
<p><%= @edl_type_updated %> file has been updated for video titled "<%= @video.name || @video.file.filename %>" for <%= @video.project.account.name %>'s "<%= @video.project.name %>" project.</p>
|
||||
|
||||
<p>
|
||||
<%= link_to "Click here", [@video, :video_analyses, locale: I18n.locale, host: AppHost.new.domain_with_port] %>
|
||||
to begin re-analyzing this video.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
- BiG Notifier
|
||||
</p>
|
||||
8
app/views/admin_mailer/updated_video_edl_file.text.erb
Normal file
8
app/views/admin_mailer/updated_video_edl_file.text.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
Hi BiG Team,
|
||||
|
||||
<%= @edl_type_updated %> file has been updated for video titled "<%= @video.name || @video.file.filename %>" for <%= @video.project.account.name %>'s "<%= @video.project.name %>" project.
|
||||
|
||||
Use the URL below to begin re-analyzing this video:
|
||||
<%= url_for [@video, :video_analyses, locale: I18n.locale, host: AppHost.new.domain_with_port] %>
|
||||
|
||||
- BiG Notifier
|
||||
51
app/views/appearance_releases/_appearance_release.html.erb
Normal file
51
app/views/appearance_releases/_appearance_release.html.erb
Normal file
@@ -0,0 +1,51 @@
|
||||
<tr id="<%= dom_id(appearance_release) %>">
|
||||
<td data-behavior="select"><%= check_box_tag "appearance_release_ids[]", appearance_release.id, false %></td>
|
||||
<td>
|
||||
<% if appearance_release.photo.attached? %>
|
||||
<%= image_tag medium_variant(appearance_release.photo) %>
|
||||
<% else %>
|
||||
<%= fa_icon("warning", text: t(".no_photos"), class: "text-danger") %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= appearance_release.name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= contact_info(
|
||||
address: appearance_release.person_address,
|
||||
phone: appearance_release.person_phone,
|
||||
email: appearance_release.person_email
|
||||
) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= notes_preview appearance_release.notes.order_by_recent %>
|
||||
</td>
|
||||
<td id="<%= dom_id appearance_release, "tags_preview" %>">
|
||||
<%= tags_preview appearance_release, appearance_release.tags %>
|
||||
</td>
|
||||
<td>
|
||||
<%= appearance_release.signed_on %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<%= button_tag t(".actions.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(Note).new? %>
|
||||
<%= link_to fa_icon("sticky-note fw", text: "Notes"), [:new, appearance_release, :note], class: "dropdown-item", remote: true %>
|
||||
<% end %>
|
||||
<% if policy(appearance_release.tags).new? %>
|
||||
<%= link_to fa_icon("tags fw", text: "Tags"), [:new, appearance_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %>
|
||||
<% end %>
|
||||
<% if policy(Contract).show? && (appearance_release.contract.attached? || appearance_release.contract_template.present?) %>
|
||||
<%= link_to fa_icon("download fw", text: "Download"), [appearance_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>
|
||||
<% end %>
|
||||
<% if policy(appearance_release).edit? %>
|
||||
<%= link_to fa_icon("pencil fw", text: "Edit"), [:edit, appearance_release], class: "dropdown-item" %>
|
||||
<% end %>
|
||||
<% if policy(appearance_release).destroy? %>
|
||||
<%= link_to fa_icon("trash fw", text: "Delete"), appearance_release, class: "dropdown-item", method: :delete, data: { confirm: "Are you sure?" } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
86
app/views/appearance_releases/_form.html.erb
Normal file
86
app/views/appearance_releases/_form.html.erb
Normal file
@@ -0,0 +1,86 @@
|
||||
<%= errors_summary_for appearance_release %>
|
||||
<%= bootstrap_form_with model: model, local: true, validation_context: :non_native do |form| %>
|
||||
<%= field_set_tag content_tag(:span, t(".person_details.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<%= form.form_group :minor do %>
|
||||
<%= form.check_box :minor, label: t("helpers.label.appearance_release.minor"), data: { target: "[data-ujs-target=guardian-fields]", toggle: "collapse" } %>
|
||||
<% end %>
|
||||
|
||||
<div class="form-row">
|
||||
<%= form.text_field :person_first_name, required: true, wrapper_class: "col-sm-3" %>
|
||||
<%= form.text_field :person_last_name, required: true, wrapper_class: "col-sm-3" %>
|
||||
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.email_field :person_email, wrapper_class: "col-sm-6" %>
|
||||
<%= form.date_field :person_date_of_birth, wrapper_class: "col-sm-6", placeholder: Date.current %>
|
||||
<%= form.text_field :person_address, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
|
||||
<div class="<%= class_string("collapse" => !appearance_release.minor?) %>" data-ujs-target="guardian-fields">
|
||||
<div class="form-row">
|
||||
<%= form.text_field :guardian_first_name, required: appearance_release.minor?, wrapper_class: "col-sm-3" %>
|
||||
<%= form.text_field :guardian_last_name, required: appearance_release.minor?, wrapper_class: "col-sm-3" %>
|
||||
<%= form.phone_field :guardian_phone, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :guardian_address, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= field_set_tag content_tag(:span, t(".contract_and_rights.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<%= render "shared/contract_fields", form: form, release: appearance_release %>
|
||||
<%= render "shared/exploitable_rights_fields", form: form %>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= field_set_tag content_tag(:span, t(".photos.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<div class="text-left">
|
||||
<p class="<%= class_string("collapse" => !appearance_release.minor?) %>" data-ujs-target="guardian-fields"><%= t(".photos.person_photo.heading") %></p>
|
||||
<div class="d-inline-block mb-2" data-behavior="person-photo-preview" data-file-input="[data-ujs-target=person-photo-input]">
|
||||
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
|
||||
<span>No photo yet</span>
|
||||
</div>
|
||||
</div>
|
||||
<% if appearance_release.person_photo.attached? %>
|
||||
<%= javascript_tag nonce: true do %>
|
||||
App.PhotoPreview.set("[data-behavior=person-photo-preview]", "<%= url_for(appearance_release.person_photo.variant(auto_orient: true, resize: '200x200')) %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="d-inline-block">
|
||||
<%= form.hidden_field :person_photo, value: form.object.person_photo.signed_id if appearance_release.person_photo.attached?%>
|
||||
<%= form.file_field :person_photo, hide_label: true, data: { ujs_target: "person-photo-input" }, help: "PNG or JPG only", accept: appearance_release.class.face_photo_acceptable_content_types.join(",") %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="<%= class_string("collapse" => !appearance_release.minor?) %>" data-ujs-target="guardian-fields">
|
||||
<div class="text-left">
|
||||
<p><%= t(".photos.guardian_photo.heading") %></p>
|
||||
<div class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-photo-input]">
|
||||
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
|
||||
<span>No photo yet</span>
|
||||
</div>
|
||||
</div>
|
||||
<% if appearance_release.guardian_photo.attached? %>
|
||||
<%= javascript_tag nonce: true do %>
|
||||
App.PhotoPreview.set("[data-behavior=guardian-photo-preview]", "<%= url_for(appearance_release.guardian_photo.variant(auto_orient: true, resize: '200x200')) %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="d-inline-block">
|
||||
<%= form.hidden_field :guardian_photo, value: form.object.guardian_photo.signed_id if appearance_release.guardian_photo.attached?%>
|
||||
<%= form.file_field :guardian_photo, hide_label: true, data: { ujs_target: "guardian-photo-input" }, help: "PNG or JPG only", accept: appearance_release.class.face_photo_acceptable_content_types.join(",") %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="row align-items-center text-center mt-4">
|
||||
<%= link_to t("shared.cancel"), [appearance_release.project, :appearance_releases], class: "col-3 text-reset" %>
|
||||
<div class="col-9">
|
||||
<%= form.button id: "submit_release", class: class_string("btn btn-block", ["btn-success", "btn-primary"] => appearance_release.new_record?), data: { disable_with: t("shared.disable_with") } %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
11
app/views/appearance_releases/_type_filter_actions.html.erb
Normal file
11
app/views/appearance_releases/_type_filter_actions.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<ul class="nav nav-pills nav-pills-white rounded-pill p-1 bg-semi-transparent">
|
||||
<li class="nav-item">
|
||||
<%= link_to t('.all_releases'), project_appearance_releases_path(type_filter: 'all', query: params[:query]), data: {type_filter: 'all'}, remote: true, class: class_string('nav-link rounded-pill py-1 px-3', "active shadow-sm" => params[:type_filter] == 'all' || params[:type_filter].nil?) %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to t('.complete_releases'), project_appearance_releases_path(type_filter: 'complete', query: params[:query]), data: {type_filter: 'complete'}, remote: true, class: class_string('nav-link rounded-pill py-1 px-3', "active shadow-sm" => params[:type_filter] == 'complete') %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to t('.incomplete_releases'), project_appearance_releases_path(type_filter: 'incomplete', query: params[:query]), data: {type_filter: 'incomplete'}, remote: true, class: class_string('nav-link rounded-pill py-1 px-3', "active shadow-sm" => params[:type_filter] == 'incomplete') %>
|
||||
</li>
|
||||
</ul>
|
||||
6
app/views/appearance_releases/edit.html.erb
Normal file
6
app/views/appearance_releases/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), close_action_path: [@project, :appearance_releases] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", model: @appearance_release, appearance_release: @appearance_release %>
|
||||
</div>
|
||||
</div>
|
||||
70
app/views/appearance_releases/index.html.erb
Normal file
70
app/views/appearance_releases/index.html.erb
Normal file
@@ -0,0 +1,70 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="upload-progress-container" class="mb-1"></div>
|
||||
<div class="d-md-flex d-sm-flex flex-sm-column flex-md-row flex-md-wrap mb-2">
|
||||
<% if policy(AppearanceRelease).new? %>
|
||||
<div class="mr-auto">
|
||||
<%= bootstrap_form_with url: project_appearance_release_imports_path, method: :post, id: "appearance_releases_import", remote: true, layout: :inline do |form| %>
|
||||
<%= form.file_field :attachments, disable: true, direct_upload: true, multiple: true, accept: AppearanceRelease.acceptable_import_file_extensions.join(','), id: "appearance_release_file_upload", hide_label: true, hidden: true %>
|
||||
<%= form.button fa_icon('plus', text: t('.actions.new')), class: 'btn btn-primary mr-2 mb-2', type: :button, id: 'import_appearance_releases' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if @appearance_releases.any? && policy(AppearanceRelease).tag_multiple? %>
|
||||
<%= button_to_bulk_tagging(@project) %>
|
||||
<% end %>
|
||||
|
||||
<% if @appearance_releases.any? && policy(AppearanceRelease).download_multiple? %>
|
||||
<%= link_to "Download All", [@project, :contract_downloads, release_type: @appearance_releases.name], method: :post, remote: true, class: "btn btn-light border mr-2 mb-2", data: { disable_with: "Please wait..." } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="d-md-flex d-sm-flex flex-sm-column flex-md-row flex-md-wrap mb-2">
|
||||
<div id="type_filter_actions">
|
||||
<%= render 'type_filter_actions' %>
|
||||
</div>
|
||||
|
||||
<div class="ml-auto">
|
||||
<%= bootstrap_form_with url: [@project, :appearance_releases], method: :get, remote: true, layout: :inline, id: "search" do |form| %>
|
||||
<%= form.hidden_field :type_filter, value: params[:type_filter] || 'all', id: 'type_filter_value' %>
|
||||
<%= form.search_field :query, hide_label: true, placeholder: t(".actions.search"), class: "rounded-pill-right", value: params[:query], prepend: form.button(fa_icon("search"), class: "btn btn-light border mb-2 rounded-pill-left") %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="border bg-white rounded shadow-sm pb-3 table-responsive">
|
||||
<table class="table table-striped tr-px-4 align-all-middle">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th data-behavior="all-selectable"><%= check_box_tag "appearance_release_ids[]", false, false %></th>
|
||||
<th></th>
|
||||
<th><%= AppearanceRelease.human_attribute_name(:person_name) %></th>
|
||||
<th><%= AppearanceRelease.human_attribute_name(:contact_info) %></th>
|
||||
<th><%= t(".table_headers.notes") %></th>
|
||||
<th><%= t(".table_headers.tags") %></th>
|
||||
<th><%= t(".table_headers.signed_at") %></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="appearance_releases">
|
||||
<% if @appearance_releases.any? %>
|
||||
<%= render @appearance_releases %>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="12" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="appearance_releases_pagination" class="mt-3">
|
||||
<%= will_paginate @appearance_releases %>
|
||||
</div>
|
||||
5
app/views/appearance_releases/index.js.erb
Normal file
5
app/views/appearance_releases/index.js.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
$("#appearance_releases").html("<%= j render(@appearance_releases) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
$("#type_filter_actions").html("<%= j render 'type_filter_actions' %>");
|
||||
$("#appearance_releases_pagination").html("<%= j will_paginate(@appearance_releases) %>");
|
||||
$('#type_filter_value').val("<%= params[:type_filter] %>");
|
||||
6
app/views/appearance_releases/new.html.erb
Normal file
6
app/views/appearance_releases/new.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), close_action_path: [@project, :appearance_releases] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", model: [@project, @appearance_release], appearance_release: @appearance_release %>
|
||||
</div>
|
||||
</div>
|
||||
11
app/views/application/_breadcrumbs.html.erb
Normal file
11
app/views/application/_breadcrumbs.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<% if breadcrumbs? %>
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb small">
|
||||
<% breadcrumb_trail do |crumb| %>
|
||||
<li class="breadcrumb-item <%= crumb.current? ? "active" : "" %>">
|
||||
<%= link_to_unless crumb.current?, crumb.name, crumb.url, (crumb.current? ? {"aria-current" => "page"} : {}) %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ol>
|
||||
</nav>
|
||||
<% end %>
|
||||
5
app/views/application/_flash.html.erb
Normal file
5
app/views/application/_flash.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<% if flash.alert.present? %>
|
||||
<div class="alert alert-danger text-center text-md-left"><%= flash.alert.html_safe %></div>
|
||||
<% elsif flash.notice.present? %>
|
||||
<div class="alert alert-primary text-center text-md-left"><%= flash.notice.html_safe %></div>
|
||||
<% end %>
|
||||
58
app/views/application/_header.html.erb
Normal file
58
app/views/application/_header.html.erb
Normal file
@@ -0,0 +1,58 @@
|
||||
<header class="container-fluid bg-light border-bottom py-3 sticky-top">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-4">
|
||||
<%= link_to signed_in_root_path, class: "navbar-brand" do %>
|
||||
<%= suite_wordmark %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="col-4 text-center">
|
||||
<h1 class="h4 m-0">
|
||||
<% if signed_in? %>
|
||||
<% if Current.user.accounts.size > 1 %>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<%= Current.account.name %>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<% Current.user.accounts.each do |account| %>
|
||||
<%= link_to(account.name, account_session_path({ account_session: { account_id: account.id } }), class: "dropdown-item", method: :put) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= Current.account.name if Current.account %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= yield :page_title %>
|
||||
<% end %>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="col-4 text-right">
|
||||
<% if signed_in? %>
|
||||
<div class="btn-group">
|
||||
<%= link_to :profile, class: "text-decoration-none text-reset dropdown-toggle", data: { toggle: "dropdown" } do %>
|
||||
<span class="mr-2"><%= get_name_or_email(Current.user) %></span>
|
||||
<%= image_or_text_avatar(Current.user) %>
|
||||
<% end %>
|
||||
|
||||
<div class="dropdown-menu">
|
||||
<% if Current.user.admin? %>
|
||||
<%= link_to "BIG Admin", [:admin, :signed_in_root], class: "dropdown-item" %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to "Profile Settings", profile_path, class: "dropdown-item" %>
|
||||
|
||||
<% if Current.account && Current.user.account_manager?(Current.account) %>
|
||||
<%= link_to "Account Settings", [:account_auths], class: "dropdown-item" %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to t(".sign_out"), :session, method: :delete, class: "dropdown-item" %>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif params[:controller] != "sessions" %>
|
||||
<span class="navbar-text">Already Have a ME Suite Account?</span>
|
||||
<%= link_to "Sign In", [:new, :session], class: "btn btn-sm btn-light border" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
3
app/views/application/_masquerade.html.erb
Normal file
3
app/views/application/_masquerade.html.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
<div class="alert alert-warning fixed-bottom mb-0 text-center">
|
||||
<%= link_to fa_icon("user-secret", text: "Stop Masquerading"), admin_masquerade_path, method: :delete %>
|
||||
</div>
|
||||
50
app/views/application/_sidebar.html.erb
Normal file
50
app/views/application/_sidebar.html.erb
Normal file
@@ -0,0 +1,50 @@
|
||||
<aside class="bg-dark text-white p-4 rounded">
|
||||
<h1 class="h4 mb-0"><%= project.name %></h1>
|
||||
<small class="font-weight-bold text-primary text-uppercase"><%= project.client_name %></small>
|
||||
<nav class="mt-3">
|
||||
<ul class="nav nav-pills nav-pills-dark flex-column">
|
||||
<li class="nav-item">
|
||||
<%= link_to fa_icon("folder fw", text: t(".files")), project, class: class_string("nav-link" => true, active: sidenav_files_nav_link_active?(project)) %>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<hr class="divider-light mx-n4">
|
||||
<nav>
|
||||
<ul class="nav nav-pills nav-pills-dark flex-column">
|
||||
<li class="nav-item">
|
||||
<%= link_to [project, :contract_templates], class: class_string("nav-link", "active" => %w(contract_templates release_template_imports).include?(controller_name)) do %>
|
||||
<%= lock_icon_for Current.account, :releaseme %>
|
||||
<%= product_wordmark :release_me, class: class_string("d-inline-block", "disabled" => !Current.account.releaseme_enabled?) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to [project, :broadcasts], class: class_string("nav-link", "active" => controller_name == "broadcasts") do %>
|
||||
<%= lock_icon_for(Current.account, :directme) %>
|
||||
<%= product_wordmark :direct_me, class: class_string("d-inline-block", "disabled" => !Current.account.directme_enabled?) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "#", class: "nav-link" do %>
|
||||
<%= lock_icon_for(Current.account, :editme) %>
|
||||
<%= product_wordmark :edit_me, class: "d-inline-block disabled" %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to [project, :videos], class: class_string("nav-link", "active" => controller_name == "videos") do %>
|
||||
<%= lock_icon_for(Current.account, :deliverme) %>
|
||||
<%= product_wordmark :deliver_me, class: class_string("d-inline-block", "disabled" => !Current.account.deliverme_enabled?) %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<hr class="divider-light mx-n4">
|
||||
<div class="d-flex justify-content-between">
|
||||
<%= pluralize project.members.size, t(".team_member") %>
|
||||
<%= link_to fa_icon("gear"), [project, :project_memberships], class: "text-muted" %>
|
||||
</div>
|
||||
<ul class="list-unstyled d-flex flex-row flex-wrap justify-content-start align-items-center">
|
||||
<% project.members.each do |member| %>
|
||||
<li class="list-inline-item mt-2"><%= image_or_text_avatar(member) %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</aside>
|
||||
1
app/views/blank_contracts/_logo.html.erb
Normal file
1
app/views/blank_contracts/_logo.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= image_tag logo.variant(auto_orient: true, resize: "100x100") %><br />
|
||||
9
app/views/blank_contracts/_project_info.html.erb
Normal file
9
app/views/blank_contracts/_project_info.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<p class="heading"><strong><u><%= t ".heading" %></u></strong></p>
|
||||
<dl>
|
||||
<%= description_list_pair_for project, :producer_name, append: ":" %>
|
||||
<%= description_list_pair_for project, :producer_address, append: ":" %>
|
||||
<%= description_list_pair_for project, :name, append: ":" %>
|
||||
<%= description_list_pair_for project, :client_name, append: ":" %>
|
||||
<%= description_list_pair_for project, :description, append: ":" %>
|
||||
<%= description_list_pair_for project, :details, append: ":" %>
|
||||
</dl>
|
||||
39
app/views/blank_contracts/_signature_page.html.erb
Normal file
39
app/views/blank_contracts/_signature_page.html.erb
Normal file
@@ -0,0 +1,39 @@
|
||||
<p class="heading"><strong><u><%= t ".heading" %></u></strong></p>
|
||||
<p><%= t ".instructions", releasable_name: "#{releasable.model_name.name.titleize}" %></p>
|
||||
|
||||
<% # Signer information %>
|
||||
<dl>
|
||||
<% # Only guardian signs if talent is a minor %>
|
||||
<% if contract_template.guardian_clause.blank? %>
|
||||
<%= description_list_pair "Signature:", "___________________________________________" %>
|
||||
<% end %>
|
||||
<%= description_list_pair "Name:", "___________________________________________" %>
|
||||
<%= description_list_pair "Contact Address:", "___________________________________________" %>
|
||||
<%= description_list_pair "Contact Phone:", "___________________________________________" %>
|
||||
<%= description_list_pair "Contact Email:", "___________________________________________" %>
|
||||
<% if releasable.model_name == "AppearanceRelease" %>
|
||||
<%= description_list_pair "Person Date of Birth:", "___________________________________________" %>
|
||||
<% end %>
|
||||
<%= description_list_pair "Signed On:", "___________________________________________" %>
|
||||
<% if releasable.model_name == "LocationRelease" %>
|
||||
<%= description_list_pair "Filming Started On:", "___________________________________________" %>
|
||||
<%= description_list_pair "Filming Ended On:", "___________________________________________" %>
|
||||
<% end %>
|
||||
<% if contract_template.fee? %>
|
||||
<%= description_list_pair "Fee:", number_to_currency(contract_template.fee) %>
|
||||
<% end %>
|
||||
</dl>
|
||||
|
||||
<% if contract_template.guardian_clause.present? %>
|
||||
<% # Guardian information %>
|
||||
<br/>
|
||||
<p class="text-left"><strong>Guardian Information</strong></p>
|
||||
<dl>
|
||||
<%= description_list_pair "Signature:", "___________________________________________" %>
|
||||
<%= description_list_pair "Guardian Name:", "___________________________________________" %>
|
||||
<%= description_list_pair "Guardian Address:", "___________________________________________" %>
|
||||
<%= description_list_pair "Guardian Phone:", "___________________________________________" %>
|
||||
<%= description_list_pair "Signed On:", "___________________________________________" %>
|
||||
</dl>
|
||||
|
||||
<% end %>
|
||||
8
app/views/blank_contracts/new.html.erb
Normal file
8
app/views/blank_contracts/new.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<%= bootstrap_form_with url: contract_template_blank_contracts_path, local: true, layout: :inline do |form| %>
|
||||
<%= form.number_field :number_of_copies, value: 1 %>
|
||||
<%= form.submit t 'shared.print' %>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
<h3 class="text-center"><%= t ".preview_heading" %></h3>
|
||||
<embed class="embeded-contract-preview" type="application/pdf" src="../blank_contracts" width="80%" height="1200" />
|
||||
39
app/views/blank_contracts/pdf.html.erb
Normal file
39
app/views/blank_contracts/pdf.html.erb
Normal file
@@ -0,0 +1,39 @@
|
||||
<% copies.times do |copy_index| %>
|
||||
<div class="page">
|
||||
<% has_logo = local_assigns[:logo] %>
|
||||
<table class="heading-table">
|
||||
<tr>
|
||||
<td>
|
||||
<% if has_logo %>
|
||||
<div class="logo">
|
||||
<%= render "blank_contracts/logo", logo: logo %>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<img src="<%= qr_codes[copy_index] %>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td class="serial-number"><%= serial_numbers[copy_index] %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><strong><%= t '.do_not_copy_warning' %></strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
<% if contract_template.body.present? %>
|
||||
<%= contract_template.body %>
|
||||
<br/>
|
||||
<% end %>
|
||||
<% if contract_template.guardian_clause.present? %>
|
||||
<p class="text-left"><strong>Guardian Clause</strong></p>
|
||||
<%= contract_template.guardian_clause %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="page">
|
||||
<%= render "blank_contracts/signature_page", releasable: releasable, contract_template: contract_template %>
|
||||
</div>
|
||||
<% end %>
|
||||
26
app/views/bookmarks/_bookmark.html.erb
Normal file
26
app/views/bookmarks/_bookmark.html.erb
Normal file
@@ -0,0 +1,26 @@
|
||||
<tr id="<%= dom_id(bookmark) %>">
|
||||
<td>
|
||||
<%= bookmark.category %>
|
||||
</td>
|
||||
<td>
|
||||
<%= bookmark.notes %>
|
||||
</td>
|
||||
<td>
|
||||
<a data-behavior="seekable-timecode">
|
||||
<%= bookmark.appears_at %>
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="dropdown">
|
||||
<%= button_tag t(".actions.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" aria-labelledby="dropdownMenuButton">
|
||||
<% if policy(bookmark).edit? %>
|
||||
<%= link_to fa_icon("pencil fw", text: "Edit"), [:edit, bookmark], class: "dropdown-item", remote: true %>
|
||||
<% end %>
|
||||
<% if policy(bookmark).destroy? %>
|
||||
<%= link_to fa_icon("trash fw", text: "Delete"), [bookmark], class: "dropdown-item", method: :delete, remote: true %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
13
app/views/bookmarks/_edit_bookmark_modal.html.erb
Normal file
13
app/views/bookmarks/_edit_bookmark_modal.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= content_tag :div, class: "modal modal-right", id: "edit_bookmark_modal", aria: { labelledby: "modalLabel", hidden: true }, role: "dialog", tabindex: -1 do %>
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="modalLabel">Edit Note</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<%= render "form", bookmark: bookmark, model: [bookmark] %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
3
app/views/bookmarks/_empty_bookmarks.html.erb
Normal file
3
app/views/bookmarks/_empty_bookmarks.html.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
<tr>
|
||||
<td colspan="4" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
||||
</tr>
|
||||
18
app/views/bookmarks/_form.html.erb
Normal file
18
app/views/bookmarks/_form.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<%= bootstrap_form_with model: model, layout: :horizontal, label_col: "col-3", control_col: "col-9" do |form| %>
|
||||
<div class="modal-body">
|
||||
<%= form.hidden_field :time_elapsed, value: bookmark.time_elapsed %>
|
||||
<%= form.static_control nil, name: nil, label: "Video Timecode", value: bookmark.appears_at %>
|
||||
|
||||
<% Bookmark.categories.keys.each do |category| %>
|
||||
<%= form.radio_button :category, category, label: category %>
|
||||
<% end %>
|
||||
|
||||
<div class="mt-3">
|
||||
<%= form.text_area :notes, control_col: "col-12", hide_label: true, placeholder: true, rows: 4 %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<%= form.button "Close", class: "btn btn-secondary", data: { dismiss: "modal" } %>
|
||||
<%= form.submit class: "btn btn-primary", data: { disable_with: t("shared.disable_with") } %>
|
||||
</div>
|
||||
<% end %>
|
||||
13
app/views/bookmarks/_new_bookmark_modal.html.erb
Normal file
13
app/views/bookmarks/_new_bookmark_modal.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= content_tag :div, class: "modal modal-right", id: "new_bookmark_modal", aria: { labelledby: "modalLabel", hidden: true }, role: "dialog", tabindex: -1 do %>
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="modalLabel">New Note</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<%= render "form", bookmark: bookmark, model: [bookmark.video, bookmark] %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
7
app/views/bookmarks/create.js.erb
Normal file
7
app/views/bookmarks/create.js.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<% # Add a marker to the timeline %>
|
||||
$(document).trigger("addBookmark-<%= @video.id %>", [<%= raw @bookmark.to_json %>]);
|
||||
|
||||
<% # Close the bookmark modal %>
|
||||
$("#new_bookmark_modal").modal("toggle");
|
||||
|
||||
$("#video_bookmarks").html("<%= j render @bookmarks %>");
|
||||
5
app/views/bookmarks/destroy.js.erb
Normal file
5
app/views/bookmarks/destroy.js.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
$("#video_bookmarks tr#<%= dom_id(@bookmark) %>").remove();
|
||||
|
||||
<% unless @bookmarks.any? %>
|
||||
$("#video_bookmarks").html("<%= j render(partial: 'empty_bookmarks') %>");
|
||||
<% end %>
|
||||
9
app/views/bookmarks/edit.js.erb
Normal file
9
app/views/bookmarks/edit.js.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
$("[data-toggle=tooltip]").tooltip("dispose");
|
||||
<% # Remove the modal if it already exists %>
|
||||
|
||||
$("#edit_bookmark_modal").remove();
|
||||
$("#new_bookmark_modal").remove();
|
||||
|
||||
<% # Create and show the modal %>
|
||||
$("body").append("<%= j render('edit_bookmark_modal', bookmark: @bookmark) %>");
|
||||
$("#edit_bookmark_modal").modal("toggle");
|
||||
8
app/views/bookmarks/new.js.erb
Normal file
8
app/views/bookmarks/new.js.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
$("[data-toggle=tooltip]").tooltip("dispose");
|
||||
<% # Remove the modal if it already exists %>
|
||||
$("#new_bookmark_modal").remove();
|
||||
$("#edit_bookmark_modal").remove();
|
||||
|
||||
<% # Create and show the modal %>
|
||||
$("body").append("<%= j render('new_bookmark_modal', bookmark: @bookmark) %>");
|
||||
$("#new_bookmark_modal").modal("toggle");
|
||||
8
app/views/bookmarks/update.js.erb
Normal file
8
app/views/bookmarks/update.js.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<% # Remove the modal if it already exists %>
|
||||
$("#edit_bookmark_modal").toggle();
|
||||
$(".modal-backdrop").remove();
|
||||
<% # Create and show the modal %>
|
||||
$("#video_bookmarks").html("<%= j render @bookmarks %>");
|
||||
|
||||
<%# Replacing html removes the scroll bar %>
|
||||
$("body").css({"overflow": "visible"});
|
||||
27
app/views/broadcasts/_broadcast.html.erb
Normal file
27
app/views/broadcasts/_broadcast.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<tr>
|
||||
<td data-behavior="select_broadcast"><%= check_box_tag "broadcast_ids[]", broadcast.id, false %></td>
|
||||
<td>
|
||||
<%= broadcast.name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= broadcast.status.titleize %>
|
||||
</td>
|
||||
<td>
|
||||
<%= time_ago_in_words(broadcast.created_at) %> ago
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<%= button_tag t(".actions.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("link fw", text: "Copy Stream URL"), ENV['MUX_BROADCAST_SERVER_URL'], class: "dropdown-item", data: { behavior: "clipboard" } %>
|
||||
<%= link_to fa_icon("key fw", text: "Copy Stream Key"), broadcast.stream_key, class: "dropdown-item", data: { behavior: "clipboard" } %>
|
||||
<% if policy(broadcast).show? %>
|
||||
<%= link_to fa_icon("file-video-o fw", text: "View"), [broadcast.project, broadcast], class: "dropdown-item", target: '_blank' %>
|
||||
<% end %>
|
||||
<% if policy(broadcast).destroy? %>
|
||||
<%= link_to fa_icon("trash fw", text: "Delete"), [broadcast.project, broadcast], class: "dropdown-item", method: :delete, data: { confirm: "Are you sure?" } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
2
app/views/broadcasts/_broadcast_recording_nav.html.erb
Normal file
2
app/views/broadcasts/_broadcast_recording_nav.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<%= link_to broadcast_recording.download_file_name, "javascript:void(0);", class: "dropdown-item", data: { behavior: "play_recording", playback_url: broadcast_recording.playback_url } %>
|
||||
|
||||
13
app/views/broadcasts/_broadcast_recordings.html.erb
Normal file
13
app/views/broadcasts/_broadcast_recordings.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<% if recordings.present? %>
|
||||
<p>Click below to download the recordings of the live stream.</p>
|
||||
<ul class="mt-2">
|
||||
<% recordings.each do |recording| %>
|
||||
<li><%= link_to(recording.download_file_name, recording.download_url, target: "_blank") %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div id="recordings_pagination" class="row mt-5 justify-content-center">
|
||||
<%= will_paginate(recordings, params: {controller: "broadcasts", action: "show", project_id: broadcast.project_id, id: broadcast.id, page: params[:page], active_tab: 'recordings'}) %>
|
||||
</div>
|
||||
<% else %>
|
||||
<p>Recording of the live stream will appear here.</p>
|
||||
<% end %>
|
||||
21
app/views/broadcasts/_broadcast_status.html.erb
Normal file
21
app/views/broadcasts/_broadcast_status.html.erb
Normal file
@@ -0,0 +1,21 @@
|
||||
<% if broadcast.streamer_connected? || (broadcast.streamer_recording? && !broadcast.active?) %>
|
||||
<div class="alert alert-info text-center text-md-left">
|
||||
<%= fa_icon "info-circle" %>
|
||||
<strong>Live stream has connected successfully and will be available soon.</strong>
|
||||
</div>
|
||||
<% elsif broadcast.streamer_recording? && broadcast.active? %>
|
||||
<div class="alert alert-success text-center text-md-left">
|
||||
<%= fa_icon "success" %>
|
||||
<strong>Live stream has begun, click play to watch it.</strong>
|
||||
</div>
|
||||
<% elsif broadcast.streamer_disconnected? %>
|
||||
<div class="alert alert-warning text-center text-md-left">
|
||||
<%= fa_icon "warning" %>
|
||||
<strong>Live stream got disconnected.</strong>
|
||||
</div>
|
||||
<% elsif (broadcast.idle? && broadcast.streamer_idle?) || (broadcast.created? && broadcast.streamer_idle?) %>
|
||||
<div class="alert alert-info text-center text-md-left">
|
||||
<%= fa_icon "info-circle" %>
|
||||
<strong>Live stream is waiting to begin.</strong>
|
||||
</div>
|
||||
<% end %>
|
||||
12
app/views/broadcasts/_file.html.erb
Normal file
12
app/views/broadcasts/_file.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<li class="my-2" id="<%= dom_id(file) %>">
|
||||
<% if file.variable? %>
|
||||
<%= link_to image_tag(file.variant(resize_and_pad: [300, 300, background: "#F7F8F9"]), class: "bg-light img-thumbnail img-fluid"), file, target: "_blank" %>
|
||||
<% else %>
|
||||
<div class="border rounded bg-light text-muted d-flex justify-content-center align-items-center fix-h-and-w">
|
||||
<%= link_to file, target: "_blank" do %>
|
||||
<%= fa_icon("file", style: "font-size: 2rem") %>
|
||||
<div class="mt-2"><%= file.filename %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</li>
|
||||
4
app/views/broadcasts/_file_form.html.erb
Normal file
4
app/views/broadcasts/_file_form.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<%= bootstrap_form_for model, layout: :inline, remote: true do |form| %>
|
||||
<%= form.file_field :files, direct_upload: true, multiple: true, accept: "*", hide_label: true, wrapper_class: "w-65 mr-2" %>
|
||||
<%= form.button fa_icon("upload", text: "Add File"), class: "btn btn-primary", type: :submit, data: { disable_with: fa_icon("spinner", text: "Adding File") } %>
|
||||
<% end %>
|
||||
12
app/views/broadcasts/_form.html.erb
Normal file
12
app/views/broadcasts/_form.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<%= errors_summary_for broadcast %>
|
||||
|
||||
<%= bootstrap_form_with model: model, local: true do |form| %>
|
||||
<%= form.text_field :name %>
|
||||
|
||||
<div class="row align-items-center text-center mt-4">
|
||||
<%= link_to t("shared.cancel"), [project, :broadcasts], class: "col-3 text-reset" %>
|
||||
<div class="col-9">
|
||||
<%= form.submit class: class_string("btn btn-block", ["btn-success", "btn-primary"] => broadcast.new_record?), data: { disable_with: t("shared.disable_with") } %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
15
app/views/broadcasts/_video.html.erb
Normal file
15
app/views/broadcasts/_video.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<% if broadcast.streamer_recording? && broadcast.active? %>
|
||||
<div id="broadcast_video" class="embed-responsive-item"></div>
|
||||
<% else %>
|
||||
<div id="broadcast_video" class="embed-responsive-item">
|
||||
<table class="w-100 h-100 bg-secondary">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center align-middle text-white">
|
||||
Video player will appear here when the stream becomes available.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
44
app/views/broadcasts/index.html.erb
Normal file
44
app/views/broadcasts/index.html.erb
Normal file
@@ -0,0 +1,44 @@
|
||||
<%= product_wordmark :direct_me, class: "small mb-3" %>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="d-md-flex d-sm-flex flex-sm-column flex-md-row flex-md-wrap mb-3" data-project-id="<%= @project.id %>" data-broadcast-ids="[]">
|
||||
<% if policy(Broadcast).new? %>
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :broadcast], class: "btn btn-primary mb-2" %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to "Multi-View", "javascript:void(0);", class: "btn btn-light border disabled ml-auto mr-2 mb-2", id: "multi_view_broadcasts" %>
|
||||
|
||||
<%= bootstrap_form_with url: [@project, :broadcasts], method: :get, remote: true, layout: :inline, id: "search" do |form| %>
|
||||
<%= form.search_field :query, hide_label: true, placeholder: t("shared.search"), value: params[:query], prepend: form.button(fa_icon("search"), class: "btn btn-light border mb-2") %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="border bg-white rounded shadow-sm pb-3 table-responsive">
|
||||
<table class="table table-striped tr-px-4 align-all-middle">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><%= t(".table_headers.broadcast_name") %></th>
|
||||
<th><%= t(".table_headers.broadcast_status") %></th>
|
||||
<th><%= t(".table_headers.broadcast_created_at") %></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="broadcasts">
|
||||
<% if @broadcasts.any? %>
|
||||
<%= render @broadcasts %>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="5" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="broadcasts_pagination" class="mt-3">
|
||||
<%= will_paginate @broadcasts %>
|
||||
</div>
|
||||
3
app/views/broadcasts/index.js.erb
Normal file
3
app/views/broadcasts/index.js.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
$("#broadcasts").html("<%= j render(@broadcasts) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
$("#broadcasts_pagination").html("<%= j will_paginate(@broadcasts) %>");
|
||||
6
app/views/broadcasts/new.html.erb
Normal file
6
app/views/broadcasts/new.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), close_action_path: [@project, :broadcasts] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", model: [@project, @broadcast], broadcast: @broadcast, project: @project %>
|
||||
</div>
|
||||
</div>
|
||||
153
app/views/broadcasts/show.html.erb
Normal file
153
app/views/broadcasts/show.html.erb
Normal file
@@ -0,0 +1,153 @@
|
||||
<%= content_for :meta do %>
|
||||
<% if @project %>
|
||||
<meta name="project-id" content="<%= @project.id %>">
|
||||
<% end %>
|
||||
<% if @broadcast %>
|
||||
<meta name="broadcast-token" content="<%= @broadcast.token %>">
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header do %>
|
||||
<header class="container-fluid py-3 border-bottom sticky-top bg-light">
|
||||
<div class="row align-items-center justify-content-center">
|
||||
<div class="col-4 text-center">
|
||||
<%= product_wordmark(:direct_me, class: 'navbar-brand') %>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<% end %>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-12 mb-3">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h1 class="h3 m-0"><%= @broadcast.name %></h1>
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-light border dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Switch View
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
|
||||
<h5 class="dropdown-header">Live Streams</h5>
|
||||
<span class="dropdown-item active"><%= fa_icon("check", text: @broadcast.name.titleize) %></span>
|
||||
<% @multi_view_broadcasts.each do |broadcast| %>
|
||||
<% if broadcast.id != @broadcast.id %>
|
||||
<%= link_to broadcast.name.titleize, broadcast.url, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<h5 class="dropdown-header">Previous Sessions</h5>
|
||||
<div id="broadcast_recordings_nav">
|
||||
<% if @recordings.any? %>
|
||||
<%= render partial: "broadcasts/broadcast_recording_nav", collection: @recordings, as: :broadcast_recording %>
|
||||
<% else %>
|
||||
<p class="dropdown-item text-muted">Recordings will appear here</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="embed-responsive embed-responsive-16by9">
|
||||
<%= render partial: 'broadcasts/video', locals: { broadcast: @broadcast } %>
|
||||
<% if @broadcast.streamer_recording? && @broadcast.active? %>
|
||||
<%= javascript_tag nonce: true do %>
|
||||
new Clappr.Player({
|
||||
parentId: '#broadcast_video',
|
||||
source: "<%= @broadcast.stream_playback_url %>",
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
mute: true,
|
||||
autoPlay: true,
|
||||
hlsMinimumDvrSize: 1
|
||||
});
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-12 mb-3">
|
||||
<div class="card shadow-sm mb-3">
|
||||
<div class="card-header">
|
||||
<ul class="nav nav-tabs card-header-tabs">
|
||||
<li class="nav-item">
|
||||
<a class="<%= class_string("nav-link", "active" => !params[:active_tab].present?) %>" href="#home" data-toggle="tab">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="<%= class_string("nav-link", "active" => params[:active_tab] == "files") %>" href="#files" data-toggle="tab">Files</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="<%= class_string("nav-link", "active" => params[:active_tab] == "recordings") %>" href="#recordings" data-toggle="tab">Previous Sessions</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-body p-3">
|
||||
<div class="tab-content">
|
||||
<div class="<%= class_string("tab-pane fade show", "active" => !params[:active_tab].present?) %>" id="home">
|
||||
<div id="broadcast_updates">
|
||||
<%= render partial: 'broadcasts/broadcast_status', locals: { broadcast: @broadcast } %>
|
||||
</div>
|
||||
<% unless controller.class.module_parent.to_s == "Public" %>
|
||||
<hr>
|
||||
<div class="form-group">
|
||||
<label for="broadcast_share_url">To share the stream, copy the URL below. Anyone with the link can view the stream.</label>
|
||||
<div class="input-group">
|
||||
<% if @multi_view_broadcasts.present? %>
|
||||
<% tokens = @multi_view_broadcasts.map(&:token) %>
|
||||
<input type="text" class="form-control" value="<%= broadcast_url(@broadcast.token, multi_view_tokens: tokens) %>" readonly>
|
||||
<div class="input-group-append">
|
||||
<button type="button" id="broadcast_share_url" class="btn btn-success" data-behavior="clipboard" href="<%= broadcast_url(@broadcast.token, multi_view_tokens: tokens) %>">
|
||||
<i class="fa fa-clipboard"></i>
|
||||
Copy URL
|
||||
</button>
|
||||
</div>
|
||||
<% else %>
|
||||
<input type="text" class="form-control" value="<%= broadcast_url(@broadcast.token) %>" readonly>
|
||||
<div class="input-group-append">
|
||||
<button type="button" id="broadcast_share_url" class="btn btn-success" data-behavior="clipboard" href="<%= broadcast_url(@broadcast.token) %>">
|
||||
<i class="fa fa-clipboard"></i>
|
||||
Copy URL
|
||||
</button>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<% end %>
|
||||
<p class="card-text">If you want to join the ZOOM meeting dedicated to this broadcast, follow the link below.</p>
|
||||
<%= link_to 'Video Conference', @conference_url, class: 'btn btn-primary btn-block', target: '_blank' %>
|
||||
</div>
|
||||
<div class="<%= class_string("tab-pane fade show", "active" => params[:active_tab] == 'files') %>" id="files">
|
||||
<div class="text-center pb-2" id="broadcast_file_form">
|
||||
<% if controller.class.module_parent.to_s == "Public" %>
|
||||
<%= render partial: "public/broadcasts/file_form", locals: { model: [@broadcast], token: @broadcast.token } %>
|
||||
<% else %>
|
||||
<%= render partial: "broadcasts/file_form", locals: { model: [@project, @broadcast] } %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="overflow-auto mh-30">
|
||||
<ul class="list-unstyled d-flex flex-column align-items-center text-center" id="broadcast_file_list">
|
||||
<% if @files.present? %>
|
||||
<%= render partial: "broadcasts/file", collection: @files %>
|
||||
<% else %>
|
||||
<li class="my-3">
|
||||
Files will appear here.
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="d-flex mt-2 justify-content-center" id="broadcast_files_pagination">
|
||||
<%= will_paginate(@files, params: { active_tab: 'files' }) if @files.present? %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="<%= class_string("tab-pane fade show", "active" => params[:active_tab] == 'recordings') %>" id="recordings">
|
||||
<div id="broadcast_recordings">
|
||||
<%= render partial: 'broadcasts/broadcast_recordings', locals: { recordings: @recordings, broadcast: @broadcast } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
9
app/views/broadcasts/update.js.erb
Normal file
9
app/views/broadcasts/update.js.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
$("#broadcast_file_form").html("<%= j render(partial: "broadcasts/file_form", locals: { model: [@project, @broadcast] }) %>");
|
||||
|
||||
var file_id = "#<%= dom_id(@files.first) %>"
|
||||
if ($("#broadcast_file_list").has(file_id).length == 0) {
|
||||
$("#broadcast_file_list").html("<%= j render(partial: "broadcasts/file", collection: @files) %>");
|
||||
$("#broadcast_files_pagination").html("<%= j will_paginate(@files) %>");
|
||||
}
|
||||
|
||||
bsCustomFileInput.init();
|
||||
23
app/views/bulk_taggings/_new_bulk_tag_modal.html.erb
Normal file
23
app/views/bulk_taggings/_new_bulk_tag_modal.html.erb
Normal file
@@ -0,0 +1,23 @@
|
||||
<div class="modal" id="tag_multiple_releases" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Tag releases</h5>
|
||||
<%= button_tag type: "button", class: "close", data: { dismiss: "modal" }, aria: { label: "Close" } do %>
|
||||
<span aria-hidden="true">×</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<%= bootstrap_form_tag url: [:bulk_taggings], remote: true do |form| %>
|
||||
<%= form.hidden_field :releasable_ids, value: releasable_ids.to_s, hide_label: true %>
|
||||
<%= form.hidden_field :project_id, value: project_id, hide_label: true %>
|
||||
<%= form.hidden_field :releasable_name, value: params[:releasable_name], hide_label: true %>
|
||||
<%= form.text_field :name, hide_label: true, placeholder: "Tag name", append: form.submit(t(".submit"), class: "btn btn-primary", data: { disable_with: t("shared.disable_with") }) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<%= button_tag "Close", class: "btn btn-secondary", type: "button", data: { dismiss: "modal" } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
5
app/views/bulk_taggings/create.js.erb
Normal file
5
app/views/bulk_taggings/create.js.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
$("#tag_multiple_releases").modal("toggle");
|
||||
$("#<%= params[:releasable_name] %>").html("<%= j render(@all_releasables) %>");
|
||||
$("#<%= params[:releasable_name] %>_pagination").html("<%= j will_paginate(@all_releasables) %>");
|
||||
$("#tag_all").parent().replaceWith("<%= j button_to_bulk_tagging(@project) %>");
|
||||
$("[data-behavior=all-selectable]").prop("checked", false);
|
||||
11
app/views/bulk_taggings/new.js.erb
Normal file
11
app/views/bulk_taggings/new.js.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
var modalSelector = "#tag_multiple_releases"
|
||||
var modal = "<%= j render("new_bulk_tag_modal", releasable_ids: @releasable_ids, releasable_name: @releasable_name, project_id: @project.id) %>"
|
||||
|
||||
// If the modal already exists, replace it. Otherwise, create it
|
||||
if ($(modalSelector).length > 0) {
|
||||
$(modalSelector).replaceWith(modal)
|
||||
} else {
|
||||
$('body').append(modal)
|
||||
}
|
||||
|
||||
$(modalSelector).modal("toggle")
|
||||
@@ -0,0 +1,14 @@
|
||||
<p>Your <%= release_type.titleize %> contracts are being prepared for download. You will be notified when it's ready.
|
||||
</p>
|
||||
<p class="mt-3">The following downloads are also in progress:</p>
|
||||
<ul>
|
||||
<% downloads.each do |download| %>
|
||||
<% if download.release_type == "reports"%>
|
||||
<li><%= download.release_type.titleize %> (as of <%= time_ago_in_words(download.created_at) %> ago)
|
||||
</li>
|
||||
<% else %>
|
||||
<li><%= download.release_type.titleize %> contracts (as of <%= time_ago_in_words(download.created_at) %> ago)
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
32
app/views/contract_downloads/index.html.erb
Normal file
32
app/views/contract_downloads/index.html.erb
Normal file
@@ -0,0 +1,32 @@
|
||||
<div class="d-flex flex-row justify-content-between flex-row-reverse align-items-center mb-3">
|
||||
<%= bootstrap_form_with url: project_downloads_path, method: :get, remote: true, layout: :inline, id: "search" do |form| %>
|
||||
<%= form.search_field :query, hide_label: true, placeholder: t(".actions.search"), class: "rounded-pill-right", value: params[:query], prepend: form.button(fa_icon("search"), id: "search-button", class: "btn btn-light border rounded-pill-left") %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="border bg-white rounded shadow-sm pb-3 table-responsive">
|
||||
<table class="table table-striped tr-px-4 align-all-middle">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th><%= t(".table_headers.download_name") %></th>
|
||||
<th><%= t(".table_headers.download_type") %></th>
|
||||
<th><%= t(".table_headers.download_status") %></th>
|
||||
<th><%= t(".table_headers.download_created_at") %></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="downloads">
|
||||
<% if @downloads.any? %>
|
||||
<%= render @downloads %>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="4" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="downloads_pagination" class="mt-3">
|
||||
<%= will_paginate @downloads %>
|
||||
</div>
|
||||
36
app/views/contract_templates/_contract_template.html.erb
Normal file
36
app/views/contract_templates/_contract_template.html.erb
Normal file
@@ -0,0 +1,36 @@
|
||||
<tr>
|
||||
<td>
|
||||
<%= contract_template.name %>
|
||||
</td>
|
||||
<td>
|
||||
<% if contract_template.fee? %>
|
||||
<%= number_to_currency(contract_template.fee) %>
|
||||
<% else %>
|
||||
<%= t(".no_fee") %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= release_type_title(contract_template.release_type) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= contract_template.releases.size %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<%= button_tag t(".actions.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(QrCode).show? %>
|
||||
<%= link_to fa_icon("qrcode", text: t(".actions.qr_code")), [contract_template, :qr_codes], class: "dropdown-item", target: :_blank %>
|
||||
<% end %>
|
||||
<%= link_to fa_icon("clipboard", text: t(".actions.copy_url")), [:new, contract_template.project.account, contract_template.project, contract_template, "#{contract_template.release_type}_release", only_path: false], class: "dropdown-item", data: { behavior: "clipboard" } %>
|
||||
<% if policy(BlankContract).new? %>
|
||||
<%= link_to fa_icon("print", text: "Print"), [:new, contract_template, :blank_contracts], class: "dropdown-item", target: :_blank %>
|
||||
<% end %>
|
||||
<% if policy(contract_template).destroy? %>
|
||||
<%= link_to fa_icon("archive", text: "Archive"), contract_template, class: "dropdown-item", method: :delete, data: { confirm: "Are you sure?" } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%= link_to t(".actions.sign"), [:new, contract_template.project.account, contract_template.project, contract_template, "#{contract_template.release_type}_release"], class: "btn btn-sm btn-primary", target: :_blank %>
|
||||
</td>
|
||||
</tr>
|
||||
40
app/views/contract_templates/_form.html.erb
Normal file
40
app/views/contract_templates/_form.html.erb
Normal file
@@ -0,0 +1,40 @@
|
||||
<%= bootstrap_form_with model: [project, contract_template], local: true do |form| %>
|
||||
<%= field_set_tag content_tag(:span, t(".release_info.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :name, wrapper_class: "col-sm-6" %>
|
||||
<%= form.select :release_type, options_for_release_type_select(project, @release_type), { wrapper_class: "col-sm-6" }, data: { toggle: "collapse-select", target: "#guardian_clause", show_values: %w(appearance talent) }, class: "form-control custom-select" %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.number_field :fee, min:"0", max:"99999999", step: "0.01", prepend: "$", help: "Leave at $0.00 for no-fee", wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= field_set_tag content_tag(:span, t(".exploitable_rights.heading"), class: "h6 text-muted text-uppercase")do %>
|
||||
<%= render "shared/exploitable_rights_fields", form: form %>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= field_set_tag content_tag(:span, t(".legal.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<%= form.form_group do %>
|
||||
<%= form.rich_text_area :body %>
|
||||
<% end %>
|
||||
<div id="guardian_clause">
|
||||
<%= form.form_group do %>
|
||||
<%= form.rich_text_area :guardian_clause %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="row align-items-center text-center mt-4">
|
||||
<%= link_to t("shared.cancel"), [project, :contract_templates], class: "col-3 text-reset" %>
|
||||
<div class="col-3">
|
||||
<%= form.button "Preview", name: "commit", value: "preview", class: 'btn btn-info btn-block', formtarget: "_blank" %>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<%= form.submit class: "btn btn-success btn-block", data: { disable_with: false } %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
35
app/views/contract_templates/index.html.erb
Normal file
35
app/views/contract_templates/index.html.erb
Normal file
@@ -0,0 +1,35 @@
|
||||
<%= product_wordmark :release_me, class: "small mb-3" %>
|
||||
|
||||
<p>
|
||||
<% if policy(ContractTemplate).new? %>
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :contract_template], class: "btn btn-primary" %>
|
||||
<%= link_to fa_icon("clone", text: t(".actions.import")), [:new, @project, :release_template_imports], class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<div class="border bg-white rounded shadow-sm pb-3 table-responsive">
|
||||
<table class="table table-striped tr-px-4 align-all-middle">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th><%= ContractTemplate.human_attribute_name(:name) %></th>
|
||||
<th><%= ContractTemplate.human_attribute_name(:fee) %></th>
|
||||
<th><%= t(".table_headers.release_type") %></th>
|
||||
<th><%= t(".table_headers.signed_release_count") %></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if @contract_templates.any? %>
|
||||
<%= render @contract_templates %>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="5" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<%= will_paginate @contract_templates %>
|
||||
</div>
|
||||
6
app/views/contract_templates/new.html.erb
Normal file
6
app/views/contract_templates/new.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), close_action_path: [@project, :contract_templates] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", project: @project, contract_template: @contract_template %>
|
||||
</div>
|
||||
</div>
|
||||
46
app/views/contracts/_files.html.erb
Normal file
46
app/views/contracts/_files.html.erb
Normal file
@@ -0,0 +1,46 @@
|
||||
<% if preview %>
|
||||
<h1>PREVIEW ONLY</h1>
|
||||
<% end %>
|
||||
|
||||
<p class="heading"><strong><u>Files</u></strong></p>
|
||||
<% unless release.description.blank? %>
|
||||
<p>
|
||||
Description: <%= release.description %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% photos = release.file_infos.photo %>
|
||||
<% unless photos.empty? %>
|
||||
<h3>Photos</h3>
|
||||
<ul>
|
||||
<% photos.each do |file_info| %>
|
||||
<li>
|
||||
<%= file_info.filename %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% videos = release.file_infos.video %>
|
||||
<% unless videos.empty? %>
|
||||
<h3>Videos</h3>
|
||||
<ul>
|
||||
<% videos.each do |file_info| %>
|
||||
<li>
|
||||
<%= file_info.filename %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% other = release.file_infos.other %>
|
||||
<% unless other.empty? %>
|
||||
<h3>Other files</h3>
|
||||
<ul>
|
||||
<% other.each do |file_info| %>
|
||||
<li>
|
||||
<%= file_info.filename %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
2
app/views/contracts/_logo.html.erb
Normal file
2
app/views/contracts/_logo.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<%= image_tag account_logo_variant(logo) %>
|
||||
<br />
|
||||
12
app/views/contracts/_notes.html.erb
Normal file
12
app/views/contracts/_notes.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<p class="heading"><strong><u>Notes</u></strong></p>
|
||||
<ul>
|
||||
<% notable.notes.order(created_at: :desc).each do |note| %>
|
||||
<li>
|
||||
<%= note.content %>
|
||||
<br>
|
||||
<%= note.email %>
|
||||
<br>
|
||||
<%= note.created_at.strftime("%D %l:%M %p") %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
34
app/views/contracts/_photos.html.erb
Normal file
34
app/views/contracts/_photos.html.erb
Normal file
@@ -0,0 +1,34 @@
|
||||
<% if preview %>
|
||||
<h1>PREVIEW ONLY</h1>
|
||||
<% end %>
|
||||
<% @total_photos_count = release.photos.size %>
|
||||
<% if release.respond_to? :guardian_photo %>
|
||||
<% @total_photos_count += release.guardian_photo.attached? ? 1 : 0 %>
|
||||
<% end %>
|
||||
<p class="heading"><strong><u><%= t '.heading', count: @total_photos_count %></u></strong></p>
|
||||
|
||||
<ul>
|
||||
<% if preview %>
|
||||
<%= image_tag dummy_photo, size: "200x200" %>
|
||||
Dummy photo
|
||||
<% else %>
|
||||
<% if release.minor? %>
|
||||
<p class="heading"><strong><%= t '.minor_photos_heading', count: release.photos.size %></strong></p>
|
||||
<% end %>
|
||||
<% release.photos.each do |photo| %>
|
||||
<li>
|
||||
<%= image_tag photo.variant(auto_orient: true, resize: "200x200") %><br />
|
||||
<%= photo.filename.to_s %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if release.respond_to?(:guardian_photo) && release.guardian_photo.attached? %>
|
||||
<br>
|
||||
<p class="heading"><strong><%= t '.guardian_photo_heading' %></strong></p>
|
||||
<li>
|
||||
<%= image_tag release.guardian_photo.variant(auto_orient: true, resize: "200x200") %><br />
|
||||
<%= release.guardian_photo.filename.to_s %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
9
app/views/contracts/_project_info.html.erb
Normal file
9
app/views/contracts/_project_info.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<p class="heading"><strong><u><%= t ".heading" %></u></strong></p>
|
||||
<dl>
|
||||
<%= description_list_pair_for project, :producer_name, append: ":" %>
|
||||
<%= description_list_pair_for project, :producer_address, append: ":" %>
|
||||
<%= description_list_pair_for project, :name, append: ":" %>
|
||||
<%= description_list_pair_for project, :client_name, append: ":" %>
|
||||
<%= description_list_pair_for project, :description, append: ":" %>
|
||||
<%= description_list_pair_for project, :details, append: ":" %>
|
||||
</dl>
|
||||
61
app/views/contracts/_signature_page.html.erb
Normal file
61
app/views/contracts/_signature_page.html.erb
Normal file
@@ -0,0 +1,61 @@
|
||||
<% if preview %>
|
||||
<h1>PREVIEW ONLY</h1>
|
||||
<% end %>
|
||||
|
||||
<p class="heading"><strong><u><%= t ".heading" %></u></strong></p>
|
||||
<p><%= t ".instructions", releasable_name: "#{releasable.model_name.name.titleize}" %></p>
|
||||
|
||||
<% # Signer information %>
|
||||
<dl>
|
||||
<% # Only guardian signs if talent is a minor %>
|
||||
<% unless releasable.minor? %>
|
||||
<dt><%= AppearanceRelease.human_attribute_name(:signature) %>:</dt>
|
||||
<dd>
|
||||
<% if preview %>
|
||||
<%= image_tag dummy_signature %>
|
||||
<% elsif releasable.signature.attached? %>
|
||||
<%= image_tag releasable.signature.variant(auto_orient: true, resize: "200x200") %>
|
||||
<% end %>
|
||||
</dd>
|
||||
<% end %>
|
||||
<%= description_list_pair_for releasable, :name, append: ":" %>
|
||||
<%= description_list_pair "Contact Address:", releasable.contact_person.address %>
|
||||
<%= description_list_pair "Contact Phone:", releasable.contact_person.phone %>
|
||||
<%= description_list_pair "Contact Email:", releasable.contact_person.email %>
|
||||
<% if releasable.model_name == "AppearanceRelease" %>
|
||||
<%= description_list_pair "Person Date of Birth:", releasable&.person_date_of_birth&.strftime("%D") %>
|
||||
<% end %>
|
||||
<%= description_list_pair_for releasable, :signed_on, append: ":" %>
|
||||
<% if releasable.model_name == "LocationRelease" %>
|
||||
<%= description_list_pair "Filming Started On:", releasable&.filming_started_on&.strftime("%D") %>
|
||||
<%= description_list_pair "Filming Ended On:", releasable&.filming_ended_on&.strftime("%D") %>
|
||||
<% end %>
|
||||
<% if contract_template.fee? %>
|
||||
<%= description_list_pair "Fee:", number_to_currency(contract_template.fee) %>
|
||||
<% end %>
|
||||
<% if releasable.model_name == "MaterialRelease" %>
|
||||
<%= description_list_pair "Description:", releasable.description %>
|
||||
<% end %>
|
||||
</dl>
|
||||
|
||||
<% if releasable.minor? %>
|
||||
<br/>
|
||||
<p class="text-left"><strong>Guardian Information</strong></p>
|
||||
|
||||
<% # Guardian information %>
|
||||
<dl>
|
||||
<dt><%= AppearanceRelease.human_attribute_name(:signature) %>:</dt>
|
||||
<dd>
|
||||
<% if preview %>
|
||||
<%= image_tag dummy_signature %>
|
||||
<% elsif releasable.signature.attached? %>
|
||||
<%= image_tag releasable.signature.variant(auto_orient: true, resize: "200x200") %>
|
||||
<% end %>
|
||||
</dd>
|
||||
<%= description_list_pair_for releasable, :guardian_name, append: ":" %>
|
||||
<%= description_list_pair_for releasable, :guardian_address, append: ":" %>
|
||||
<%= description_list_pair_for releasable, :guardian_phone, append: ":" %>
|
||||
<%= description_list_pair_for releasable, :signed_on, append: ":" %>
|
||||
</dl>
|
||||
|
||||
<% end %>
|
||||
8
app/views/contracts/_tags.html.erb
Normal file
8
app/views/contracts/_tags.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<p class="heading"><strong><u>Tags</u></strong></p>
|
||||
<ul>
|
||||
<% taggable.tags.each do |tag| %>
|
||||
<li>
|
||||
<%= tag %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
41
app/views/contracts/pdf.html.erb
Normal file
41
app/views/contracts/pdf.html.erb
Normal file
@@ -0,0 +1,41 @@
|
||||
<% if local_assigns[:logo] %>
|
||||
<div class="logo">
|
||||
<%= render "contracts/logo", logo: logo %>
|
||||
</div>
|
||||
<hr>
|
||||
<% end %>
|
||||
<% if preview %>
|
||||
<h1>PREVIEW ONLY</h1>
|
||||
<% end %>
|
||||
<% if contract_template.body.present? %>
|
||||
<%= contract_template.body %>
|
||||
<br/>
|
||||
<% end %>
|
||||
<% if releasable.minor? && contract_template.guardian_clause.present? %>
|
||||
<p class="text-left"><strong>Guardian Clause</strong></p>
|
||||
<%= contract_template.guardian_clause %>
|
||||
<% end %>
|
||||
<div class="page">
|
||||
<%= render "contracts/signature_page", releasable: releasable, contract_template: contract_template, preview: preview %>
|
||||
</div>
|
||||
<% if releasable.class == AcquiredMediaRelease %>
|
||||
<div class="page">
|
||||
<%= render "contracts/files", release: releasable, preview: preview %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if releasable.try(:photos).present? %>
|
||||
<div class="page">
|
||||
<%= render "contracts/photos", release: releasable, preview: preview %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if releasable.notes.any? %>
|
||||
<div class="page">
|
||||
<%= render "contracts/notes", notable: releasable %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if releasable.tags.any? %>
|
||||
<div class="page">
|
||||
<%= render "contracts/tags", taggable: releasable %>
|
||||
</div>
|
||||
<% end %>
|
||||
16
app/views/directories/_directories.html.erb
Normal file
16
app/views/directories/_directories.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<section class="mt-5">
|
||||
<h1 class="h3"><%= t(".heading") %> (<%= directories.size %>)</h1>
|
||||
<ul class="list-unstyled mt-2 row">
|
||||
<div class="col-sm-6 col-md-4 col-lg-3 mt-4">
|
||||
<li class="card h-100 shadow-sm">
|
||||
<div class="card-body d-flex flex-column justify-content-center align-items-center">
|
||||
<%= fa_icon("plus-circle", class: "text-success", style: "font-size:4rem") %>
|
||||
<% if policy(Directory).new? %>
|
||||
<%= link_to t("projects.index.actions.folder"), [:new, @project, :directory], class: "mt-4 text-reset text-decoration-none stretched-link" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
<%= render directories, project: @project %>
|
||||
</ul>
|
||||
</section>
|
||||
29
app/views/directories/_directory.html.erb
Normal file
29
app/views/directories/_directory.html.erb
Normal file
@@ -0,0 +1,29 @@
|
||||
<div class="col-sm-6 col-md-4 col-lg-3 mt-4">
|
||||
<li class="card h-100 shadow-sm">
|
||||
<div class="card-header d-flex justify-content-between align-items-end bg-white border-bottom-0 pr-2">
|
||||
<small class="text-more-muted text-uppercase font-weight-bold"><%= directory.permissions %></small>
|
||||
<div class="dropdown">
|
||||
<%= button_tag fa_icon("gear"), class: "btn btn-white btn-sm border text-muted", data: { toggle: "dropdown" }, aria: { haspopup: true, expanded: false } %>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<% if policy(directory).edit? %>
|
||||
<%= link_to fa_icon("pencil fw", text: t(".actions.edit")), [:edit, project, directory], class: "dropdown-item" %>
|
||||
<% end %>
|
||||
<% if policy(directory).destroy? %>
|
||||
<%= link_to fa_icon("trash fw", text: t(".actions.delete")), [project, directory], method: :delete, class: "dropdown-item", data: { confirm: t(".confirm_delete", count: directory.files.count) } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body py-0">
|
||||
<%= link_to [project, directory], class: "d-block pb-5 text-decoration-none text-reset link-stretched" do %>
|
||||
<h2 class="h5"><%= directory.name %></h2>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="card-footer bg-white border-top-0 px-2">
|
||||
<div class="d-flex flex-row justify-content-start align-items-center flex-wrap">
|
||||
<%#= team_member_list project.users.first(3) %>
|
||||
<small class="ml-1"><%#= link_to pluralize(project.account.users.size, t(".team_member")), [project, :project_memberships], class: "text-muted" %></small>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
21
app/views/directories/_file.html.erb
Normal file
21
app/views/directories/_file.html.erb
Normal file
@@ -0,0 +1,21 @@
|
||||
<tr id="<%= dom_id(file) %>">
|
||||
<td>
|
||||
<%= file.filename %>
|
||||
</td>
|
||||
<td>
|
||||
<%= file.created_at %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<%= button_tag t(".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(Directory).download_file? %>
|
||||
<%= link_to fa_icon("download fw", text: "Download File"), file, class: "dropdown-item", target: "_blank" %>
|
||||
<% end %>
|
||||
<% if policy(Directory).destroy_file? %>
|
||||
<%= link_to fa_icon("trash fw", text: "Delete File"), [:destroy_file, @project, @directory, { file_id: file.id }], class: "dropdown-item", method: :delete, data: { confirm: "Are you sure?" } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
8
app/views/directories/_file_form.html.erb
Normal file
8
app/views/directories/_file_form.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<%= bootstrap_form_with model: model do |form| %>
|
||||
<%= field_set_tag content_tag(:span, t(".heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<%= render "shared/files_dropzone_fields", form: form, directory: directory %>
|
||||
<% end %>
|
||||
<div class="pt-3">
|
||||
<%= form.submit t(".submit"), class: "btn btn-block btn-success", data: { disable_with: t("shared.disable_with") } %>
|
||||
</div>
|
||||
<% end %>
|
||||
21
app/views/directories/_form.html.erb
Normal file
21
app/views/directories/_form.html.erb
Normal file
@@ -0,0 +1,21 @@
|
||||
<%= errors_summary_for directory %>
|
||||
|
||||
<%= bootstrap_form_with model: model, local: true do |form| %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.select :category, Directory.categories.keys, {}, class: "form-control custom-select" %>
|
||||
<% if policy(@directory).can_view_permissions_settings? %>
|
||||
<%= form.form_group :permissions, label: { text: "Access Permissions:" }, help: t(".permissions_help") do %>
|
||||
<% if Current.user.manager?(Current.account) %>
|
||||
<%= form.radio_button :permissions, "Everyone", label: "Everyone" %>
|
||||
<%= form.radio_button :permissions, "Account Managers & Project Managers", label: "Account Managers & Project Managers" %>
|
||||
<% elsif Current.user.account_manager?(Current.account) %>
|
||||
<%= form.radio_button :permissions, "Everyone", label: "Everyone" %>
|
||||
<%= form.radio_button :permissions, "Account Managers & Project Managers", label: "Account Managers & Project Managers" %>
|
||||
<%= form.radio_button :permissions, "Account Managers Only", label: "Account Managers Only" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="pt-3">
|
||||
<%= form.submit class: class_string("btn btn-block", ["btn-success", "btn-primary"] => directory.new_record?), data: { disable_with: t("shared.disable_with") } %>
|
||||
</div>
|
||||
<% end %>
|
||||
6
app/views/directories/edit.html.erb
Normal file
6
app/views/directories/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), close_action_path: @project %>
|
||||
<div class="card-body">
|
||||
<%= render "form", model: [@project, @directory], directory: @directory %>
|
||||
</div>
|
||||
</div>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user