2014-05-05 06:07:18 +00:00
|
|
|
<% content_for :page_specific_css do %>
|
|
|
|
<%= stylesheet_link_tag "lib/main-forms" %>
|
|
|
|
<%= stylesheet_link_tag "lib/fileupload" %>
|
|
|
|
<%= stylesheet_link_tag "lib/main-list" %>
|
2019-09-25 06:53:46 +00:00
|
|
|
<%= stylesheet_link_tag "jquery.minicolors" %>
|
2014-05-05 06:07:18 +00:00
|
|
|
<% end %>
|
|
|
|
<% content_for :page_specific_javascript do %>
|
|
|
|
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
|
|
|
|
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
|
|
|
|
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
|
|
|
|
<%= javascript_include_tag "lib/modal-preview" %>
|
|
|
|
<%= javascript_include_tag "lib/file-type" %>
|
2019-09-25 06:53:46 +00:00
|
|
|
<%= javascript_include_tag "jquery.minicolors" %>
|
2014-05-05 06:07:18 +00:00
|
|
|
<% end %>
|
2019-09-25 06:53:46 +00:00
|
|
|
<style>
|
|
|
|
.main-forms fieldset .input-area .module-area {
|
|
|
|
padding: 20px;
|
|
|
|
overflow: visible;
|
|
|
|
}
|
|
|
|
input.minicolors-input{
|
|
|
|
height: 2.5em;
|
|
|
|
max-width: 90%;
|
|
|
|
}
|
|
|
|
</style>
|
2021-04-04 05:03:24 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
function set_transparent(trigger) {
|
|
|
|
var color_input_box = $(trigger).parents('.control-group').eq(0).find('.minicolors-input')
|
|
|
|
if (trigger.checked){
|
|
|
|
color_input_box.attr('data-color',color_input_box.val())
|
|
|
|
color_input_box.minicolors('value','transparent')
|
|
|
|
color_input_box.prop('disabled',true)
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
color_input_box.minicolors('value',color_input_box.attr('data-color'))
|
|
|
|
color_input_box.prop('disabled',false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$(document).ready( function() {
|
|
|
|
$('.minicolors-input').minicolors({
|
|
|
|
defaultValue: '',
|
|
|
|
format: 'hex',
|
|
|
|
letterCase: 'lowercase',
|
|
|
|
position: 'bottom left',
|
|
|
|
change: function(value, opacity) {
|
|
|
|
if( !value ) return;
|
|
|
|
if( opacity ) value += ', ' + opacity;
|
|
|
|
},
|
|
|
|
theme: 'bootstrap'
|
|
|
|
});
|
|
|
|
$('.minicolors-input').attr('autocomplete','off')
|
|
|
|
$('.minicolors').css('margin','0 10px')
|
|
|
|
$('.minicolors').css('height','34px')
|
|
|
|
$('*').submit(function () {
|
|
|
|
$.each($(this).find('input.minicolors-input'),function(){
|
|
|
|
var value = $(this).val();
|
|
|
|
if (value == ''){
|
|
|
|
$(this).find('input.minicolors-input').val('transparent');
|
|
|
|
$(this).find('input.minicolors-input').prop('disabled',false);
|
|
|
|
}
|
2019-09-25 06:53:46 +00:00
|
|
|
})
|
2021-04-04 05:03:24 +00:00
|
|
|
return true
|
|
|
|
})
|
|
|
|
});
|
2019-09-25 06:53:46 +00:00
|
|
|
</script>
|
2014-05-05 06:07:18 +00:00
|
|
|
<fieldset>
|
|
|
|
<!-- Input Area -->
|
|
|
|
<div class="input-area">
|
|
|
|
|
|
|
|
<!-- Module Tabs -->
|
2014-05-13 07:40:35 +00:00
|
|
|
<div class="nav-name"><strong><%= t(:module) %></strong></div>
|
2014-05-05 06:07:18 +00:00
|
|
|
<ul class="nav nav-pills module-nav">
|
|
|
|
<li class="active">
|
2014-05-13 07:40:35 +00:00
|
|
|
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
|
2014-05-05 06:07:18 +00:00
|
|
|
</li>
|
|
|
|
<li>
|
2014-05-13 07:40:35 +00:00
|
|
|
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
|
2014-05-05 06:07:18 +00:00
|
|
|
</li>
|
2019-09-25 06:53:46 +00:00
|
|
|
<li>
|
|
|
|
<a href="#frame_color" data-toggle="tab"><%= t('gallery.recreate_thumb') %></a>
|
|
|
|
</li>
|
2014-05-05 06:07:18 +00:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<!-- Module -->
|
|
|
|
<div class="tab-content module-area">
|
|
|
|
|
|
|
|
<!-- Basic Module -->
|
|
|
|
<div class="tab-pane fade in active" id="basic">
|
|
|
|
|
|
|
|
<!-- Category -->
|
|
|
|
<div class="control-group">
|
2014-05-13 07:40:35 +00:00
|
|
|
<label class="control-label muted"><%= t(:category) %></label>
|
2014-05-05 06:07:18 +00:00
|
|
|
<div class="controls">
|
2014-05-13 07:40:35 +00:00
|
|
|
<%= select_category(f, @module_app) %>
|
2014-05-05 06:07:18 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
2019-09-25 06:53:46 +00:00
|
|
|
<!-- Tag Module -->
|
2014-05-05 06:07:18 +00:00
|
|
|
<div class="tab-pane fade" id="tag">
|
|
|
|
|
|
|
|
<!-- Tag -->
|
|
|
|
<div class="control-group">
|
2014-05-13 07:40:35 +00:00
|
|
|
<label class="control-label muted"><%= t(:tags) %></label>
|
2014-05-16 11:25:37 +00:00
|
|
|
<%= select_tags(f, @module_app) %>
|
2014-05-05 06:07:18 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-09-25 06:53:46 +00:00
|
|
|
<!-- Frame Color Module -->
|
|
|
|
<% if @album.album_colors.first.nil? %>
|
2020-01-09 16:14:41 +00:00
|
|
|
<% @album.album_colors.new('color' => 'transparent') %>
|
2019-09-25 06:53:46 +00:00
|
|
|
<% end %>
|
|
|
|
<%= f.fields_for :album_colors do |album_color_form| %>
|
|
|
|
<div class="tab-pane fade" id="frame_color">
|
|
|
|
<!-- Frame Color -->
|
|
|
|
<div class="control-group" style='display: flex;'>
|
|
|
|
<label class="control-label muted"><%= t('gallery.recreate_thumb') %></label>
|
|
|
|
<%= album_color_form.text_field :color , :class => 'input-block-level minicolors-input' %>
|
|
|
|
<span style='font-size: 20px;display: flex;align-items: center;'>
|
|
|
|
<input type='checkbox' onchange='set_transparent(this)' style='width: 18px;height: 18px;margin: 0;'>
|
|
|
|
<%= t('gallery.transparent') %>
|
|
|
|
</span>
|
|
|
|
</div>
|
2021-04-04 05:03:24 +00:00
|
|
|
<div class="control-group" style='display: flex;'>
|
|
|
|
<label class="control-label muted"><%= t('gallery.album_card_background_color') %></label>
|
|
|
|
<%= album_color_form.text_field :album_card_background_color, :class => 'input-block-level minicolors-input' %>
|
|
|
|
<span style='font-size: 20px;display: flex;align-items: center;'>
|
|
|
|
<input type='checkbox' onchange='set_transparent(this)' style='width: 18px;height: 18px;margin: 0;'>
|
|
|
|
<%= t('gallery.transparent') %>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="control-group" style='display: flex;'>
|
|
|
|
<label class="control-label muted"><%= t('gallery.album_card_text_color') %></label>
|
|
|
|
<%= album_color_form.text_field :album_card_text_color, :class => 'input-block-level minicolors-input' %>
|
|
|
|
<span style='font-size: 20px;display: flex;align-items: center;'>
|
|
|
|
<input type='checkbox' onchange='set_transparent(this)' style='width: 18px;height: 18px;margin: 0;'>
|
|
|
|
<%= t('gallery.transparent') %>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label muted">
|
|
|
|
<%= t('gallery.thumb_resize_reference') %>
|
|
|
|
</label>
|
|
|
|
<div class="controls">
|
|
|
|
<%= f.select :resize_gravity, [["---#{t("default")}: #{t("gallery.gravity.#{AlbumSetting::ResizeGravities[0]}")}---",nil]]+AlbumSetting::ResizeGravities.collect{|v| [t("gallery.gravity.#{v}"),v]} %>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-09-25 06:53:46 +00:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2014-05-05 06:07:18 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-09-25 06:53:46 +00:00
|
|
|
<div class='input-area'>
|
|
|
|
<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 <%= (i == 0 ? 'class=active' : '') %>>
|
|
|
|
<a href=".<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %></a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
<div class="tab-content language-area">
|
|
|
|
<!-- Language Tabs -->
|
|
|
|
|
|
|
|
|
|
|
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
|
|
|
|
|
|
|
<div class="tab-pane fade in <%= (i == 0 ? 'active' : '') %> <%= locale %>">
|
|
|
|
<div class="control-group input-title">
|
|
|
|
<%= f.fields_for :name_translations do |name| %>
|
|
|
|
<%= label_tag(locale, t("gallery.album_name"),:class=>"control-label muted") %>
|
|
|
|
<div class="controls">
|
|
|
|
<%= name.text_field locale, :class => "input-block-level", :placeholder=>"Title",:value => (@album.name_translations[locale] rescue nil) %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<div class="control-group input-content">
|
|
|
|
<%= f.fields_for :description_translations do |desc| %>
|
|
|
|
<%= label_tag(locale, t("gallery.album_desc"), :class=>"control-label muted") %>
|
|
|
|
<div class="controls">
|
|
|
|
<div class="textarea">
|
|
|
|
<%= desc.text_area locale, :class => "ckeditor input-block-level", :value => (@album.description_translations[locale] rescue nil)%>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!-- Form Actions -->
|
|
|
|
<div class="form-actions">
|
|
|
|
<%= f.submit t("gallery.save"), :class=> "btn btn-primary bt-form-save" %>
|
|
|
|
</div>
|
2014-05-05 06:07:18 +00:00
|
|
|
</div>
|
|
|
|
</fieldset>
|