This commit is contained in:
BoHung Chiu 2023-08-05 20:59:32 +08:00
parent e16fc6a9b7
commit b6e0913fab
1 changed files with 51 additions and 36 deletions

View File

@ -20,7 +20,7 @@
<!-- Input Area -->
<div class="input-area">
parse_again_start * 1 if locale_fields_input_fields
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
@ -33,13 +33,15 @@
<%= copy_to_all_language_button(".language-nav", ".language-area") %>
</li>
</ul>
parse_again_end
parse_again_start * 1 if locale_fields_input_fields
<!-- 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" : '' %>">
parse_again_end
parse_again_start
<!-- locale_fields -->
<div class="control-group input-title">
@ -49,8 +51,11 @@
</div>
</div>
parse_again_end
parse_again_start * 1 if locale_fields_input_fields
</div>
<% end %>
parse_again_end
parse_again_start * 1 if module_modal_template_link
<!-- Link -->
<%
links_hash = {}
@ -88,6 +93,8 @@
</div>
</div>
<% end %>
parse_again_end
parse_again_start * 1 if module_modal_template_file
<!-- File -->
<%
files_hash = {}
@ -125,7 +132,10 @@
</div>
</div>
<% end %>
parse_again_end
parse_again_start * 1 if locale_fields_input_fields
</div>
parse_again_end
<div class="nav-name"><strong><%= t(:module) %></strong></div>
<ul class="nav nav-pills module-nav">
<li></li>
@ -204,6 +214,7 @@
<%= link_to t('cancel'), request.referer, :class=>"btn" %>
</div>
<script type="text/javascript">
parse_again_start * 1 if module_modal_template_file
var files = <%= files_hash.to_json.html_safe %>;
$("a.add_file").on("click",function(){
var type = $(this).attr("for"),
@ -216,7 +227,11 @@
files[type].count = count;
return false;
})
$(document).on('click', '.delete_file', function(){
$(this).parents('.input-prepend').remove();
});
parse_again_end
parse_again_start * 1 if module_modal_template_link
var links = <%= links_hash.to_json.html_safe %>;
$("a.add_link").on("click",function(){
var type = $(this).attr("for"),
@ -229,10 +244,10 @@
links[type].count = count;
return false;
})
$(document).on('click', '.delete_file', function(){
$(document).on('click', '.delete_link', function(){
$(this).parents('.input-prepend').remove();
});
parse_again_end
$(document).on('click', '.remove_existing_record', function(){
if(confirm("<%= I18n.t(:sure?)%>")){
$(this).children('.should_destroy').attr('value', 1);