Initial commit
This commit is contained in:
56
app/views/location_releases/_form.html.erb
Normal file
56
app/views/location_releases/_form.html.erb
Normal file
@@ -0,0 +1,56 @@
|
||||
<%= errors_summary_for location_release %>
|
||||
<%= bootstrap_form_with model: model, local: true do |form| %>
|
||||
<%= field_set_tag content_tag(:span, t(".location_details.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :name, required: true, wrapper_class: "col-12" %>
|
||||
</div>
|
||||
<%= render "shared/address_fields", form: form, subject: "" %>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= field_set_tag content_tag(:span, t(".signer_details.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :person_first_name, wrapper_class: "col-sm-3" %>
|
||||
<%= form.text_field :person_last_name, 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" %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :person_company, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_title, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<%= render "shared/address_fields", form: form, subject: "person" %>
|
||||
<% 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: location_release %>
|
||||
<%= render "shared/exploitable_rights_fields", form: form %>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= field_set_tag t(".filming_info.heading") do %>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :filming_started_on, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
|
||||
<%= form.text_field :filming_ended_on, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= field_set_tag content_tag(:span, t(".photos.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<%= render "shared/photos_dropzone_fields", form: form, release: location_release %>
|
||||
<% end %>
|
||||
|
||||
<div class="row align-items-center text-center mt-4">
|
||||
<%= link_to t("shared.cancel"), [location_release.project, :location_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"] => location_release.new_record?), data: { disable_with: t("shared.disable_with") } %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
52
app/views/location_releases/_location_release.html.erb
Normal file
52
app/views/location_releases/_location_release.html.erb
Normal file
@@ -0,0 +1,52 @@
|
||||
<tr id="<%= dom_id(location_release) %>">
|
||||
<td data-behavior="select"><%= check_box_tag "location_release_ids[]", location_release.id, false %></td>
|
||||
<td>
|
||||
<% if location_release.photo.attached? %>
|
||||
<%= image_tag medium_variant(location_release.photo), class: "img-fluid" %>
|
||||
<% else %>
|
||||
<%= fa_icon("warning", text: t(".no_photos"), class: "text-danger") %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= location_release.name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= contact_info address: location_release.address %>
|
||||
</td>
|
||||
<td>
|
||||
<%= notes_preview location_release.notes.order_by_recent %>
|
||||
</td>
|
||||
<td id="<%= dom_id location_release, "tags_preview" %>">
|
||||
<%= tags_preview location_release, location_release.tags %>
|
||||
</td>
|
||||
<td>
|
||||
<%= location_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, location_release, :note], class: "dropdown-item", remote: true %>
|
||||
<% end %>
|
||||
<% if policy(location_release.tags).new? %>
|
||||
<%= link_to fa_icon("tags fw", text: "Tags"), [:new, location_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %>
|
||||
<% end %>
|
||||
<% if policy(location_release).edit_photos? %>
|
||||
<%= link_to fa_icon("picture-o fw", text: "Photos"), [:edit, location_release, :photos], class: "dropdown-item" %>
|
||||
<% end %>
|
||||
<% if policy(Contract).show? && (location_release.contract.attached? || location_release.contract_template.present?) %>
|
||||
<%= link_to fa_icon("download fw", text: "Download"), [location_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>
|
||||
<% end %>
|
||||
<% if policy(location_release).edit? %>
|
||||
<%= link_to fa_icon("pencil fw", text: "Edit"), [:edit, location_release], class: "dropdown-item" %>
|
||||
<% end %>
|
||||
<% if policy(location_release).destroy? %>
|
||||
<%= link_to fa_icon("trash fw", text: "Delete"), location_release, class: "dropdown-item", method: :delete, data: { confirm: "Are you sure?" } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
6
app/views/location_releases/edit.html.erb
Normal file
6
app/views/location_releases/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), close_action_path: [@project, :location_releases] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", model: @location_release, location_release: @location_release %>
|
||||
</div>
|
||||
</div>
|
||||
53
app/views/location_releases/index.html.erb
Normal file
53
app/views/location_releases/index.html.erb
Normal file
@@ -0,0 +1,53 @@
|
||||
<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(LocationRelease).new? %>
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :location_release], class: "btn btn-primary mr-2 mb-2" %>
|
||||
<% end %>
|
||||
|
||||
<% if @location_releases.any? && policy(LocationRelease).tag_multiple? %>
|
||||
<%= button_to_bulk_tagging(@project) %>
|
||||
<% end %>
|
||||
|
||||
<% if @location_releases.any? && policy(LocationRelease).download_multiple? %>
|
||||
<%= link_to "Download All", [@project, :contract_downloads, release_type: @location_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, :location_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 "location_release_ids[]", false, false %></th>
|
||||
<th></th>
|
||||
<th><%= LocationRelease.human_attribute_name(:name) %></th>
|
||||
<th><%= t(".table_headers.address") %>
|
||||
<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="location_releases">
|
||||
<% if @location_releases.any? %>
|
||||
<%= render @location_releases %>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="12" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="location_releases_pagination" class="mt-3">
|
||||
<%= will_paginate @location_releases %>
|
||||
</div>
|
||||
3
app/views/location_releases/index.js.erb
Normal file
3
app/views/location_releases/index.js.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
$("#location_releases").html("<%= j render(@location_releases) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
$("#location_releases_pagination").html("<%= j will_paginate(@location_releases) %>");
|
||||
6
app/views/location_releases/new.html.erb
Normal file
6
app/views/location_releases/new.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), close_action_path: [@project, :location_releases] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", model: [@project, @location_release], location_release: @location_release %>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user