Initial commit

This commit is contained in:
Senad Uka
2020-05-31 22:38:19 +02:00
commit 858fafc3c5
1280 changed files with 65918 additions and 0 deletions

View 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>

View 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 %>

View 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>

View 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>