forked from saurabh/orbit4-5
83 lines
4.6 KiB
Plaintext
83 lines
4.6 KiB
Plaintext
<div class="btn-group" data-toggle="buttons-radio">
|
|
<label href="#none" class="btn btn-large <%= @subpart.kind == "none" ? 'active' : '' rescue nil %>" data-toggle="tab">
|
|
<%= t("page_part_kinds.none") %>
|
|
<input type="radio" <%= @subpart.kind == "none" ? "checked" : "" rescue nil %> class="hide" value="none" name="page_part[sub_parts_attributes][<%= @select_number %>][kind]" />
|
|
</label>
|
|
<label href="#text" class="btn btn-large <%= @subpart.kind == "text" ? 'active' : '' rescue nil %>" data-toggle="tab">
|
|
<%= t("page_part_kinds.text") %>
|
|
<input type="radio" class="hide" <%= @subpart.kind == "text" ? "checked" : "" rescue nil %> value="text" name="page_part[sub_parts_attributes][<%= @select_number %>][kind]" />
|
|
</label>
|
|
<!-- <label href="#public_r_tag" class="btn btn-large" data-toggle="tab"> -->
|
|
<%#= t("page_part_kinds.public_r_tag") %>
|
|
<%#= sub.radio_button :kind, "public_r_tag", class: "hide" %>
|
|
<!-- </label> -->
|
|
<label href="#module_widget" class="btn btn-large <%= @subpart.kind == "module_widget" ? 'active' : '' rescue nil %>" data-toggle="tab">
|
|
<%= t("page_part_kinds.module_widget") %>
|
|
<input type="radio" class="hide" value="module_widget" <%= @subpart.kind == "module_widget" ? "checked" : "" rescue nil %> name="page_part[sub_parts_attributes][<%= @select_number %>][kind]" />
|
|
|
|
</label>
|
|
</div>
|
|
<fieldset>
|
|
<div class="input-area tab-content">
|
|
<div id="none" class="parts-none tab-pane fade in <%= @subpart.kind == "none" ? 'active' : '' rescue nil %>"><%= t(:select_one_function) %></div>
|
|
<div id="text" class="tab-pane fade in <%= @subpart.kind == "text" ? 'active' : '' rescue nil %>">
|
|
<div class="nav-name">
|
|
<strong><%= t(:language) %></strong>
|
|
</div>
|
|
<ul class="nav nav-pills language-nav">
|
|
<% I18n.available_locales.each_with_index do |locale, i| %>
|
|
<li class="<%= 'active' if i == 0 %>">
|
|
<a href=".<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %></a>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
<div class="tab-content language-area">
|
|
<% I18n.available_locales.each_with_index do |locale, i| %>
|
|
<div class="tab-pane fade <%= locale %> <%= 'active in' if i == 0 %>">
|
|
<div class="control-group input-content">
|
|
<label class="control-label muted"><%= t(:content) %></label>
|
|
<div class="controls">
|
|
<div class="textarea">
|
|
<textarea name="page_part[sub_parts_attributes][<%= @select_number %>][content_translations][<%= locale.to_s %>]" class="ckeditor input-block-level"><%= @subpart.content_translations[locale] rescue nil %></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="module_widget" class="tab-pane fade in <%= @subpart.kind == "module_widget" ? 'active' : '' rescue nil %>">
|
|
<% I18n.available_locales.each do |locale| %>
|
|
<div class="control-group input-content">
|
|
<label class="control-label muted">Widget name (<%= t(locale.to_s) %>) :</label>
|
|
<div class="controls">
|
|
<input name="page_part[sub_parts_attributes][<%= @select_number %>][title_translations][<%= locale.to_s %>]" value="<%= @subpart.title_translations[locale.to_s] rescue nil %>" />
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<div class="control-group input-content">
|
|
<%= f.label :module_app_id, t(:module) + " :", class: "control-label muted" %>
|
|
<div class="controls">
|
|
<%= select_tag("page_part[sub_parts_attributes][#{@select_number}][module]", options_for_select(@modules.map{|m| [m.title,m.key]}, (@subpart.module rescue nil)),{:include_blank => true,"class" => "input-xlarge change module_name"}) %>
|
|
</div>
|
|
</div>
|
|
<div id="widgets_selection_area">
|
|
<% if params[:action] == "edit_sub_part" && @kind == "module_widget"%>
|
|
<%= render :partial => "widget_form" %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="form-actions">
|
|
<%= f.submit t(:update_), class: "btn btn-primary" %>
|
|
<button type="button" class="btn" onclick="window.history.back()"><%= t(:cancel) %></button>
|
|
</div>
|
|
</fieldset>
|
|
|
|
<script type="text/javascript">
|
|
$('*[data-toggle=buttons-radio] label').click(function(){
|
|
$('*[data-toggle=buttons-radio] input[type=radio]').removeAttr("checked");
|
|
$(this).find("input[type=radio]").prop("checked","checked");
|
|
})
|
|
</script> |