263 lines
10 KiB
Plaintext
263 lines
10 KiB
Plaintext
<% # encoding: utf-8 %>
|
|
<% content_for :page_specific_css do %>
|
|
<%= stylesheet_link_tag "lib/main-forms" %>
|
|
<%= stylesheet_link_tag "lib/fileupload" %>
|
|
<%= stylesheet_link_tag "lib/main-list" %>
|
|
<% end %>
|
|
<% content_for :page_specific_javascript do %>
|
|
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
|
|
<%= javascript_include_tag "lib/file-type" %>
|
|
<%= javascript_include_tag "lib/module-area" %>
|
|
<% end %>
|
|
<!-- Input Area -->
|
|
<div class="input-area">
|
|
|
|
<!-- Module Tabs -->
|
|
<div class="nav-name"><strong><%= t(:module) %></strong></div>
|
|
<ul class="nav nav-pills module-nav">
|
|
<li></li>
|
|
<li class="active">
|
|
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
|
|
</li>
|
|
<li>
|
|
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
|
|
</li>
|
|
</ul>
|
|
|
|
<!-- Module -->
|
|
<div class="tab-content module-area">
|
|
|
|
<!-- Basic Module -->
|
|
<div class="tab-pane fade in active" id="basic">
|
|
|
|
<!-- Category -->
|
|
<div class="control-group">
|
|
<label class="control-label muted"><%= t(:category) %></label>
|
|
<div class="controls">
|
|
<%= select_category(f, @module_app) %>
|
|
</div>
|
|
</div>
|
|
<!-- Size -->
|
|
<div class="control-group input-title">
|
|
<label class="control-label muted"><%= t("digital_archive.size") %></label>
|
|
<div class="controls">
|
|
<%= f.text_field :size , class: "input-block-level",value: (@digital_archive.size rescue nil) %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Item ID -->
|
|
<div class="control-group input-title">
|
|
<label class="control-label muted"><%= t("digital_archive.item_number") %></label>
|
|
<div class="controls">
|
|
<%= f.text_field :item_id ,class: "input-block-level",value: (@digital_archive.item_id rescue nil) %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Item Date -->
|
|
<div class="control-group input-title">
|
|
<label class="control-label muted"><%= t("digital_archive.item_date") %></label>
|
|
<div class="controls">
|
|
<%= f.date_field :item_date , class: "input-block-level",value: (@digital_archive.item_date rescue nil) %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Tag Module -->
|
|
<div class="tab-pane fade" id="tag">
|
|
<!-- Tag -->
|
|
<div class="control-group">
|
|
<label class="control-label muted"><%= t(:tags) %></label>
|
|
<%= select_tags(f, @module_app) %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Language Tabs -->
|
|
<div class="nav-name"><strong><%= t(:language) %></strong></div>
|
|
<ul class="nav nav-pills language-nav">
|
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
|
<li class="<%= 'active' if i == 0 %>">
|
|
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale.to_s) %></a>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
|
|
<!-- Language -->
|
|
<div class="tab-content language-area">
|
|
|
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
|
|
|
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
|
|
|
|
<!-- Title-->
|
|
<div class="control-group input-title">
|
|
<label class="control-label muted"><%= t(:title) %></label>
|
|
<div class="controls">
|
|
<%= f.fields_for :title_translations do |f| %>
|
|
<%= f.text_field locale, class: "input-block-level", placeholder: t(:title), value: (@digital_archive.title_translations[locale] rescue nil)%>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Location -->
|
|
<div class="control-group input-title">
|
|
<label class="control-label muted"><%= t("digital_archive.location") %></label>
|
|
<div class="controls">
|
|
<%= f.fields_for :location_translations do |f| %>
|
|
<%= f.text_field locale, class: "input-block-level", placeholder: t("digital_archive.location"),value: (@digital_archive.location_translations[locale] rescue nil) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Character -->
|
|
<div class="control-group input-title">
|
|
<label class="control-label muted"><%= t("digital_archive.character") %></label>
|
|
<div class="controls">
|
|
<%= f.fields_for :character_translations do |f| %>
|
|
<%= f.text_field locale, class: "input-block-level", placeholder: t("digital_archive.character"),value: (@digital_archive.character_translations[locale] rescue nil) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Department -->
|
|
<div class="control-group input-title">
|
|
<label class="control-label muted"><%= t("digital_archive.department") %></label>
|
|
<div class="controls">
|
|
<%= f.fields_for :department_translations do |f| %>
|
|
<%= f.text_field locale, class: "input-block-level",placeholder: t("digital_archive.department"),value: (@digital_archive.department_translations[locale] rescue nil) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Description -->
|
|
<div class="control-group input-title">
|
|
<label class="control-label muted"><%= t("digital_archive.description") %></label>
|
|
<div class="controls">
|
|
<%= f.fields_for :description_translations do |f| %>
|
|
<%= f.text_field locale, class: "input-block-level",placeholder: t("digital_archive.description"),value: (@digital_archive.description_translations[locale] rescue nil) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Detail Description -->
|
|
<div class="control-group input-title">
|
|
<label class="control-label muted"><%= t("digital_archive.detail_description") %></label>
|
|
<div class="controls">
|
|
<%= f.fields_for :detail_description_translations do |f| %>
|
|
<%= f.text_area locale, class: "input-block-level",value: (@digital_archive.detail_description_translations[locale] rescue nil) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Material -->
|
|
<div class="control-group input-title">
|
|
<label class="control-label muted"><%= t("digital_archive.material") %></label>
|
|
<div class="controls">
|
|
<%= f.fields_for :material_translations do |f| %>
|
|
<%= f.text_field locale, class: "input-block-level",placeholder: t("digital_archive.material"),value: (@digital_archive.material_translations[locale] rescue nil) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Item From -->
|
|
<div class="control-group input-title">
|
|
<label class="control-label muted"><%= t("digital_archive.item_from") %></label>
|
|
<div class="controls">
|
|
<%= f.fields_for :item_from_translations do |f| %>
|
|
<%= f.text_field locale, class: "input-block-level",placeholder: t("digital_archive.item_from"),value: (@digital_archive.item_from_translations[locale] rescue nil) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Item Status -->
|
|
<div class="control-group input-title">
|
|
<label class="control-label muted"><%= t("digital_archive.item_status") %></label>
|
|
<div class="controls">
|
|
<%= f.fields_for :item_status_translations do |f| %>
|
|
<%= f.text_field locale, class: "input-block-level",placeholder: t("digital_archive.item_status"),value: (@digital_archive.item_status_translations[locale] rescue nil) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Album Content -->
|
|
<div class="control-group input-title">
|
|
<label class="control-label muted"><%= t("digital_archive.album_content") %></label>
|
|
<div class="controls">
|
|
<%= f.fields_for :album_content_translations do |f| %>
|
|
<%= f.text_field locale, class: "input-block-level",placeholder: t("digital_archive.album_content"),value: (@digital_archive.album_content_translations[locale] rescue nil) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<!-- File -->
|
|
<div class="control-group">
|
|
<label class="control-label muted"><%= t(:file_) %></label>
|
|
<div class="controls">
|
|
|
|
<!-- Exist -->
|
|
<% if @digital_archive && !@digital_archive.digital_content_archive_files.blank? %>
|
|
<div class="exist">
|
|
<% @digital_archive.digital_content_archive_files.each_with_index do |digital_content_archive_file, i| %>
|
|
<%= f.fields_for :digital_content_archive_files, digital_content_archive_file do |f| %>
|
|
<%= render :partial => 'form_file', :object => digital_content_archive_file, :locals => {:f => f, :i => i} %>
|
|
<% end %>
|
|
<% end %>
|
|
<hr>
|
|
</div>
|
|
<% end %>
|
|
|
|
<!-- Add -->
|
|
<div class="add-target">
|
|
</div>
|
|
<p class="add-btn">
|
|
<%= hidden_field_tag 'digital_content_archive_file_field_count', (@digital_archive.digital_content_archive_files.count rescue 0)%>
|
|
<a id="add_file" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
|
|
</p>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Form Actions -->
|
|
<div class="form-actions">
|
|
<%= f.submit t('submit'), class: 'btn btn-primary' %>
|
|
<a href="/<%= I18n.locale.to_s %>/admin/digital_archives/" class="btn" >Cancel</a>
|
|
</div>
|
|
|
|
<% content_for :page_specific_javascript do %>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('.main-forms .add-on').tooltip();
|
|
$(document).on('click', '#add_file', function(){
|
|
var new_id = $(this).prev().attr('value');
|
|
var old_id = new RegExp("new_digital_content_archive_files", "g");
|
|
var on = $('.language-nav li.active').index();
|
|
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
|
|
$(this).prev().attr('value', parseInt(new_id) + 1);
|
|
$(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'form_file', f, :digital_content_archive_files) %>").replace(old_id, new_id));
|
|
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() {
|
|
$(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
|
|
});
|
|
formTip();
|
|
});
|
|
$(document).on('click', '.delete_file', function(){
|
|
$(this).parents('.input-prepend').remove();
|
|
});
|
|
$(document).on('click', '.remove_existing_record', function(){
|
|
if(confirm("<%= I18n.t(:sure?)%>")){
|
|
$(this).children('.should_destroy').attr('value', 1);
|
|
$(this).parents('.start-line').hide();
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<% end %> |