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