Initial commit
This commit is contained in:
16
app/views/shared/_address_fields.html.erb
Normal file
16
app/views/shared/_address_fields.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<% field_name_prefix = subject.present? ? "#{subject}_" : "" %>
|
||||
|
||||
<div class="form-row">
|
||||
<%= form.text_field "#{field_name_prefix}address_street1", wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field "#{field_name_prefix}address_street2", wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.text_field "#{field_name_prefix}address_city", wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field "#{field_name_prefix}address_state", wrapper_class: "col-sm-3" %>
|
||||
<%= form.text_field "#{field_name_prefix}address_zip", wrapper_class: "col-sm-3" %>
|
||||
</div>
|
||||
<%= form.form_group "#{field_name_prefix}address_country" do %>
|
||||
<%= form.label "#{field_name_prefix}address_country" %>
|
||||
<%= form.country_select "#{field_name_prefix}address_country", { priority: %w(US CA), prompt: true }, class: "form-control custom-select" %>
|
||||
<% end %>
|
||||
|
||||
12
app/views/shared/_contract_fields.html.erb
Normal file
12
app/views/shared/_contract_fields.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<div class="form-row">
|
||||
<%= form.file_field :contract, wrapper_class: "col-sm-6 required", accept: "application/pdf", direct_upload: true %>
|
||||
<%= form.hidden_field :contract, value: form.object.contract.signed_id if release.contract.attached? %>
|
||||
</div>
|
||||
<% if release.contract.attached? %>
|
||||
<p>
|
||||
<%= link_to release.contract do %>
|
||||
<%= fa_icon "file-text-o" %> <%= release.contract.filename %>
|
||||
<% end %>
|
||||
<span class="text-muted"><%= fa_icon "long-arrow-left" %> <em>Current contract</em></span>
|
||||
</p>
|
||||
<% end %>
|
||||
23
app/views/shared/_exploitable_rights_fields.html.erb
Normal file
23
app/views/shared/_exploitable_rights_fields.html.erb
Normal file
@@ -0,0 +1,23 @@
|
||||
<div class="form-row">
|
||||
<div class="col-sm-6">
|
||||
<%= form.collection_select :applicable_medium_id, ApplicableMedium.all.reverse, :id, :label, { label: "Applicable Media", include_blank: true }, class: "form-control custom-select" %>
|
||||
<%= form.text_field :applicable_medium_text, hide_label: true, placeholder: "Describe other applicable media" %>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<%= form.collection_select :territory_id, Territory.all.reverse, :id, :label, { include_blank: true }, class: "form-control custom-select" %>
|
||||
<%= form.text_field :territory_text, hide_label: true, placeholder: "Describe other territory" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="col-sm-6">
|
||||
<%= form.collection_select :term_id, Term.all.reverse, :id, :label, { include_blank: true }, class: "form-control custom-select" %>
|
||||
<%= form.text_field :term_text, hide_label: true, placeholder: "Describe other term" %>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<%= form.collection_select :restriction_id, Restriction.all.reverse, :id, :label, { include_blank: true }, class: "form-control custom-select" %>
|
||||
<%= form.text_field :restriction_text, hide_label: true, placeholder: "Describe other restrictions" %>
|
||||
</div>
|
||||
</div>
|
||||
18
app/views/shared/_file_infos_dropzone.html.erb
Normal file
18
app/views/shared/_file_infos_dropzone.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<div class="field d-none">
|
||||
<%= form.fields_for :file_infos do |file_info_form| %>
|
||||
<% unless file_info_form.object.persisted? %>
|
||||
<%= file_info_form.hidden_field :filename, value: file_info_form.object.filename %>
|
||||
<%= file_info_form.hidden_field :byte_size, value: file_info_form.object.byte_size %>
|
||||
<%= file_info_form.hidden_field :content_type, value: file_info_form.object.content_type %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="dropzone field border-dashed"
|
||||
data-accepted-files="<%= dropzone_accepted_files_for(releasable) %>"
|
||||
data-behavior="file-info-dropzone"
|
||||
data-input-name-prefix="<%= releasable.model_name.param_key %>[file_infos_attributes]"
|
||||
data-existing-files="<%= mock_file_infos_json(releasable.file_infos) %>"
|
||||
data-placeholder="<%= dropzone_placeholder_message_for(releasable) %>"
|
||||
data-submit-button="#submit_release">
|
||||
</div>
|
||||
|
||||
17
app/views/shared/_files_dropzone_fields.html.erb
Normal file
17
app/views/shared/_files_dropzone_fields.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="field d-none">
|
||||
<%= form.label :files %>
|
||||
<%= form.file_field :files, disable: true, direct_upload: true, multiple: true, id: "directory_files", hide_label: true %>
|
||||
<% directory.files.each do |file| %>
|
||||
<% unless file.persisted? %>
|
||||
<%= hidden_field_tag "#{directory.model_name.param_key}[files][]", file.signed_id %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="dropzone field border-dashed"
|
||||
data-accepted-files="audio/*,image/*,video/*,application/*"
|
||||
data-behavior="dropzone"
|
||||
data-file-input-id="directory_files"
|
||||
data-existing-files="<%= mock_photos_json(directory.files) %>"
|
||||
data-placeholder="<%= dropzone_placeholder_message_for(directory) %>"
|
||||
data-submit-button="#submit_folder"></div>
|
||||
17
app/views/shared/_photos_dropzone_fields.html.erb
Normal file
17
app/views/shared/_photos_dropzone_fields.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="field d-none">
|
||||
<%= form.label :photos %>
|
||||
<%= form.file_field :photos, disable: true, direct_upload: true, multiple: true, id: "release_photos", hide_label: true %>
|
||||
<% release.photos.each do |photo| %>
|
||||
<% unless photo.persisted? %>
|
||||
<%= hidden_field_tag "#{release.model_name.param_key}[photos][]", photo.signed_id %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="dropzone field border-dashed"
|
||||
data-accepted-files="<%= dropzone_accepted_files_for(release) %>"
|
||||
data-behavior="dropzone"
|
||||
data-file-input-id="release_photos"
|
||||
data-existing-files="<%= mock_photos_json(release.photos) %>"
|
||||
data-placeholder="<%= dropzone_placeholder_message_for(release) %>"
|
||||
data-submit-button="#submit_release">
|
||||
</div>
|
||||
15
app/views/shared/_signature_fields.html.erb
Normal file
15
app/views/shared/_signature_fields.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<canvas class="border bg-light w-100" data-behavior="digital-signature" data-signature-input="[data-ujs-target=signature-input]" style="height: 150px"></canvas>
|
||||
|
||||
<% if local_assigns[:instruction] %>
|
||||
<small class="form-text text-muted">
|
||||
<%= instruction %>
|
||||
</small>
|
||||
<% end %>
|
||||
|
||||
<%= form.hidden_field :signature_base64, data: { ujs_target: "signature-input" } %>
|
||||
<div class="text-right">
|
||||
<%= button_tag class: "btn btn-sm btn-danger", data: { behavior: "clear-digital-signature" } do %>
|
||||
<%= fa_icon "refresh" %> <%= t "shared.clear" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user