217 lines
7.0 KiB
Plaintext
217 lines
7.0 KiB
Plaintext
<% content_for :page_specific_css do %>
|
|
<%= stylesheet_link_tag "lib/main-forms" %>
|
|
<%= stylesheet_link_tag "lib/fileupload" %>
|
|
<% 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/module-area" %>
|
|
<% end %>
|
|
|
|
<%#= f.error_messages %>
|
|
|
|
<!-- 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 class="active">
|
|
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
|
|
</li>
|
|
<li>
|
|
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
|
|
</li>
|
|
<li>
|
|
<a href="#type" data-toggle="tab"><%= t('ad_banner.type') %></a>
|
|
</li>
|
|
<li>
|
|
<a href="#frequency" data-toggle="tab"><%= t(:frequency) %></a>
|
|
</li>
|
|
<li>
|
|
<a href="#link" data-toggle="tab"><%= t(:link) %></a>
|
|
</li>
|
|
<li>
|
|
<a href="#imageupload" data-toggle="tab"><%= t(:image) %></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('ad_banner.banner') %></label>
|
|
<div class="controls">
|
|
<%= f.select :banner_id, @ad_banners.collect{|t| [ t.title, t.id ]} %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Date Time Picker -->
|
|
<div class="control-group">
|
|
<label class="control-label muted"><%= t(:start_date) %></label>
|
|
<div class="controls">
|
|
<%= f.datetime_picker :postdate, :no_label => true %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Date Time Picker -->
|
|
<div class="control-group">
|
|
<label class="control-label muted"><%= t(:end_date) %></label>
|
|
<div class="controls">
|
|
<%= f.datetime_picker :deadline, :no_label => true %>
|
|
</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>
|
|
<div class="controls" data-toggle="buttons-checkbox">
|
|
<% @tags.each do |tag| %>
|
|
<label class="checkbox inline btn <%= 'active' if @ad_image.tag_ids.include?(tag.id) %>">
|
|
<%= check_box_tag 'ad_image[tag_ids][]', tag.id, @ad_image.tag_ids.include?(tag.id) %> <%= tag.name %>
|
|
<%= hidden_field_tag 'ad_image[tag_ids][]', '' %>
|
|
</label>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Type Module -->
|
|
<div class="tab-pane fade" id="type">
|
|
|
|
<!-- Type -->
|
|
<div class="control-group">
|
|
<label class="control-label muted"><%= t('ad_banner.type') %></label>
|
|
<div class="controls">
|
|
<%= f.select :link_open, AdImage::LINK_OPEN_TYPES.map{|a| [t("ad_banner.#{a}"), a]} %>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Frequency Module -->
|
|
<div class="tab-pane fade" id="frequency">
|
|
|
|
<!-- Frequency -->
|
|
<div class="control-group">
|
|
<label class="control-label muted"><%= t(:frequency) %></label>
|
|
<div class="controls">
|
|
<%= f.number_field :weight, placeholder: t(:frequency), in: 1..99, maxlength: 2, onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;" %>
|
|
<span class="help-block"><%= t('ad_banner.enter_number') %></span>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Link Module -->
|
|
<div class="tab-pane fade" id="link">
|
|
|
|
<!-- Link -->
|
|
<div class="control-group">
|
|
<label class="control-label muted"><%= t(:link) %></label>
|
|
<div class="controls">
|
|
<%= f.text_field :out_link, placeholder: t(:url) %>
|
|
<span class="help-block"><%= t('ad_banner.enter_url') %></span>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Images Module -->
|
|
<div class="tab-pane fade" id="imageupload">
|
|
|
|
<!-- Images Upload -->
|
|
<div class="control-group">
|
|
<label class="control-label muted"><%= t(:image) %></label>
|
|
<div class="controls">
|
|
<div class="fileupload fileupload-new clearfix <%= 'fileupload-edit' if @ad_image.file.file %>" data-provides="fileupload">
|
|
<div class="fileupload-new thumbnail pull-left">
|
|
<% if @ad_image.file.file %>
|
|
<%= image_tag @ad_image.file %>
|
|
<% else %>
|
|
<img src="http://www.placehold.it/50x50/EFEFEF/AAAAAA" />
|
|
<% end %>
|
|
</div>
|
|
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
|
|
<span class="btn btn-file">
|
|
<span class="fileupload-new"><%= t(:select_image) %></span>
|
|
<span class="fileupload-exists"><%= t(:change) %></span>
|
|
<%= f.file_field :file %>
|
|
</span>
|
|
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><%= t(:cancel) %></a>
|
|
<div class="controls" data-toggle="buttons-checkbox">
|
|
<label class="checkbox inline btn btn-danger fileupload-remove">
|
|
<%= f.check_box :remove_file %><%= t(:remove) %>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</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: (@ad_image.title_translations[locale] rescue nil) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Content -->
|
|
<div class="control-group input-content">
|
|
<label class="control-label muted"><%= t(:content) %></label>
|
|
<div class="controls">
|
|
<div class="textarea">
|
|
<%= f.fields_for :context_translations do |f| %>
|
|
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@ad_image.context_translations[locale] rescue nil) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Form Actions -->
|
|
<div class="form-actions">
|
|
<%= f.submit t('submit'), class: 'btn btn-primary' %>
|
|
</div>
|