Fix bug.
This commit is contained in:
parent
919bb6eca3
commit
5f24254ae3
|
@ -611,21 +611,53 @@ class Admin::PersonalPluginFieldsController < OrbitMemberController
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
new_text = new_text.gsub(/parse_again_start((?:(?!parse_again_start).)+)parse_again_end/m) do |ff|
|
new_text = new_text.gsub(/[ \t]*parse_again_start((?:(?!parse_again_start).)+)parse_again_end[ \t]*(\r\n|\n)/m) do |ff|
|
||||||
parse_content = $1 #last match
|
@parse_again_mode = true
|
||||||
|
parse_content = $1 #parse_again block contents
|
||||||
result = ff
|
result = ff
|
||||||
if include_key($1,k)
|
match_count = parse_content.match(/^ *\* *\d+/m)
|
||||||
start_index = 0
|
match_count = match_count ? match_count[0] : nil
|
||||||
end_index = parse_content.length
|
exist_condition = parse_content.split("\n")[0].match(/if[ ]+#{::Regexp.escape(k)}(?=\.| |$)/)
|
||||||
start_index = 2 if parse_content[0..1] == "\r\n"
|
extra_cond = nil
|
||||||
end_index = end_index - 2 if parse_content[(end_index - 2)..(end_index - 1)] == "\r\n"
|
if exist_condition
|
||||||
parse_content = parse_content.slice(start_index,end_index)
|
exist_condition = exist_condition[0]
|
||||||
|
parse_content = parse_content[ parse_content.index(exist_condition) + exist_condition.length..-1]
|
||||||
|
extra_cond = parse_content.match(/^\.count *(\!|\<|\>|\=)(\=|) *\d+/)
|
||||||
|
if extra_cond
|
||||||
|
extra_cond = extra_cond[0]
|
||||||
|
exist_condition += extra_cond
|
||||||
|
parse_content = parse_content[extra_cond.length..-1]
|
||||||
|
exist_condition = eval("vv"+extra_cond) ? exist_condition : nil
|
||||||
|
elsif vv.count == 0
|
||||||
|
exist_condition = nil
|
||||||
|
end
|
||||||
|
if exist_condition.nil?
|
||||||
|
match_count = nil
|
||||||
|
parse_content = ""
|
||||||
|
result = ""
|
||||||
|
end
|
||||||
|
elsif match_count
|
||||||
|
parse_content = parse_content[match_count.length..-1]
|
||||||
|
end
|
||||||
|
parse_content = parse_content.sub(/[ \t]+\z/m, '').sub(/\A(\r\n|\n)/, '')
|
||||||
|
if include_key(parse_content,k)
|
||||||
|
vv_count = vv.count
|
||||||
|
if match_count
|
||||||
|
vv_count = [vv_count, match_count.strip[1..-1].to_i].min
|
||||||
|
end
|
||||||
if inner
|
if inner
|
||||||
result = (0...vv.count).map {|ii| replace_text_with_pattern(parse_content,false,i,ii,true) }.join("")
|
result = (0...vv_count).map {|ii| replace_text_with_pattern(parse_content,false,i,ii,true) }.join("")
|
||||||
else
|
else
|
||||||
result = (0...vv.count).map {|ii| replace_text_with_pattern(parse_content,false,ii) }.join("")
|
result = (0...vv_count).map {|ii| replace_text_with_pattern(parse_content,false,ii) }.join("")
|
||||||
end
|
end
|
||||||
|
elsif match_count || exist_condition
|
||||||
|
count = 1
|
||||||
|
if match_count
|
||||||
|
count = match_count.strip[1..-1].to_i
|
||||||
end
|
end
|
||||||
|
result = (0...count).map {|ii| parse_content }.join("")
|
||||||
|
end
|
||||||
|
@parse_again_mode = false
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -637,7 +669,9 @@ class Admin::PersonalPluginFieldsController < OrbitMemberController
|
||||||
end
|
end
|
||||||
def gsub_text_by_key_value(text,k,v)
|
def gsub_text_by_key_value(text,k,v)
|
||||||
@blank_texts = []
|
@blank_texts = []
|
||||||
text.gsub(/\n(\s*)[^\n]*(#{k}|#{k.classify})/m) {|ff| @blank_texts << $1.gsub(/(\r\n|\n)/,'')}
|
if !@parse_again_mode
|
||||||
|
text.gsub(/\n(\s+)[^\n]*(#{k}|#{k.classify})/m) {|ff| @blank_texts << $1.gsub(/(\r\n|\n)/,'')}
|
||||||
|
end
|
||||||
i = 0
|
i = 0
|
||||||
text = text.gsub(k + "s"){|ff| v.pluralize.gsub("\n","\n#{@blank_texts[i]}")}
|
text = text.gsub(k + "s"){|ff| v.pluralize.gsub("\n","\n#{@blank_texts[i]}")}
|
||||||
text = text.gsub(k ){|ff| v.gsub("\n","\n#{@blank_texts[i]}")}
|
text = text.gsub(k ){|ff| v.gsub("\n","\n#{@blank_texts[i]}")}
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<% f.object.related_modal_name.each_with_index do |related_modal_name,i| %>
|
<% f.object.related_modal_name.each_with_index do |related_modal_name,i| %>
|
||||||
<div>
|
<div>
|
||||||
<%= text_field_tag "#{f.object_name}[related_modal_name][]", related_modal_name,placeholder: thead_field("related_modal_name"), class: "related_modal_name" %>
|
<%= text_field_tag "#{f.object_name}[related_modal_name][]", related_modal_name,placeholder: thead_field("related_modal_name"), class: "related_modal_name", title: thead_field("related_modal_name") %>
|
||||||
<button type="button" class="remove_related_modal" index="<%=i%>"><%=t(:remove)%></button>
|
<button type="button" class="remove_related_modal" index="<%=i%>"><%=t(:remove)%></button>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -162,7 +162,7 @@
|
||||||
$(this).parents('.start-line').hide();
|
$(this).parents('.start-line').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var related_modal_name_html = '<%= text_field_tag "#{f.object_name}[related_modal_name][]", '',placeholder: thead_field("related_modal_name"), class: "related_modal_name" %>';
|
var related_modal_name_html = '<%= text_field_tag "#{f.object_name}[related_modal_name][]", '',placeholder: thead_field("related_modal_name"), class: "related_modal_name", title: thead_field("related_modal_name") %>';
|
||||||
related_modal_name_html = $("<div></div>").append(related_modal_name_html);
|
related_modal_name_html = $("<div></div>").append(related_modal_name_html);
|
||||||
related_modal_name_html.append("<button type=\"button\" class=\"remove_related_modal\"><%=t(:remove) %></button>")
|
related_modal_name_html.append("<button type=\"button\" class=\"remove_related_modal\"><%=t(:remove) %></button>")
|
||||||
$(".remove_btn").off("click").on("click",function(){
|
$(".remove_btn").off("click").on("click",function(){
|
||||||
|
@ -276,7 +276,11 @@
|
||||||
$('tr >:last-child').css( 'border','');
|
$('tr >:last-child').css( 'border','');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
$(document).on('blur', 'input.related_modal_name', function(){
|
||||||
|
var _this = $(this);
|
||||||
|
var idx = _this.index('input.related_modal_name');
|
||||||
|
$('span.related_modal_name').eq(idx).text(_this.val());
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.module-area .control-group {
|
.module-area .control-group {
|
||||||
|
|
|
@ -11,20 +11,20 @@
|
||||||
<% ii = -1 %>
|
<% ii = -1 %>
|
||||||
<% object.primary_modal_fields.each do |field_value| %>
|
<% object.primary_modal_fields.each do |field_value| %>
|
||||||
<% next if (!access_field_types.include?(field_value[:field_type]) rescue false) %>
|
<% next if (!access_field_types.include?(field_value[:field_type]) rescue false) %>
|
||||||
<% content = check_box_tag("#{f.object_name}[]", field_value[:field_name] , (object.send(root_name)[page_name].include?(field_value[:field_name]) rescue false),:id=>nil,:class=>"#{page_name}_fields") %>
|
<% content = check_box_tag("#{f.object_name}[#{root_name}][#{page_name}][]", field_value[:field_name] , (object.send(root_name)[page_name].include?(field_value[:field_name]) rescue false),:id=>nil,:class=>"#{page_name}_fields") %>
|
||||||
<% tds << "<td data-index=\"#{ii+=1}\">#{field_value[:translation_name][I18n.locale] rescue ""}-#{field_value[:field_name]}<hr class=\"border-hr\">#{content}</td>" %>
|
<% tds << "<td data-index=\"#{ii+=1}\">#{field_value[:translation_name][I18n.locale] rescue ""}-#{field_value[:field_name]}<hr class=\"border-hr\">#{content}</td>" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if !defined?(access_field_types) %>
|
<% if !defined?(access_field_types) %>
|
||||||
<% f.object.related_modal_name.each_with_index do |related_modal_name,i| %>
|
<% f.object.related_modal_name.each_with_index do |related_modal_name,i| %>
|
||||||
<% field_values = f.object.related_modal_fields[i].to_a %>
|
<% field_values = f.object.related_modal_fields[i].to_a %>
|
||||||
<% field_values.each do |field_value| %>
|
<% field_values.each do |field_value| %>
|
||||||
<% content = check_box_tag("#{f.object_name}[]", "#{related_modal_name+'.'+field_value[:field_name]}" , (object.send(root_name)[page_name].include?(related_modal_name+'.'+field_value[:field_name]) rescue false),:id=>nil,:class=>"#{page_name}_fields") %>
|
<% content = check_box_tag("#{f.object_name}[#{root_name}][#{page_name}][]", "#{related_modal_name+'.'+field_value[:field_name]}" , (object.send(root_name)[page_name].include?(related_modal_name+'.'+field_value[:field_name]) rescue false),:id=>nil,:class=>"#{page_name}_fields") %>
|
||||||
<% tds << "<td data-index=\"#{ii+=1}\">#{related_modal_name}-#{field_value[:translation_name][I18n.locale] rescue ""}-#{field_value[:field_name]}<hr class=\"border-hr\">#{content}</td>" %>
|
<% tds << "<td data-index=\"#{ii+=1}\">#{related_modal_name}-#{field_value[:translation_name][I18n.locale] rescue ""}-#{field_value[:field_name]}<hr class=\"border-hr\">#{content}</td>" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% author_name_translation = @personal_plugin_field.author_name_translations[locale] rescue ""
|
<% author_name_translation = @personal_plugin_field.author_name_translations[locale] rescue ""
|
||||||
author_name_translation = I18n.t("personal_plugins.author") if author_name_translation.blank? %>
|
author_name_translation = I18n.t("personal_plugins.author") if author_name_translation.blank? %>
|
||||||
<% content = check_box_tag("#{f.object_name}[]", "member_profile" , (object.send(root_name)[page_name].include?("member_profile") rescue false),:id=>nil) %>
|
<% content = check_box_tag("#{f.object_name}[#{root_name}][#{page_name}][]", "member_profile" , (object.send(root_name)[page_name].include?("member_profile") rescue false),:id=>nil) %>
|
||||||
<% tds << "<td data-index=\"#{ii+=1}\">#{author_name_translation}<hr class=\"border-hr\">#{content}</td>" %>
|
<% tds << "<td data-index=\"#{ii+=1}\">#{author_name_translation}<hr class=\"border-hr\">#{content}</td>" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% fields_order = (0...tds.count).to_a
|
<% fields_order = (0...tds.count).to_a
|
||||||
|
|
|
@ -60,11 +60,11 @@ module Admin::PluginTemplatesHelper
|
||||||
case type
|
case type
|
||||||
when "default"
|
when "default"
|
||||||
jls = []
|
jls = []
|
||||||
parse_again_start
|
parse_again_start
|
||||||
when "plugin_template_related"
|
when "plugin_template_related"
|
||||||
jls = PluginTemplateRelated.all
|
jls = PluginTemplateRelated.all
|
||||||
main_field_name = "plugin_template_related_main_field"
|
main_field_name = "plugin_template_related_main_field"
|
||||||
parse_again_end
|
parse_again_end
|
||||||
else
|
else
|
||||||
jls = []
|
jls = []
|
||||||
end
|
end
|
||||||
|
@ -102,10 +102,10 @@ parse_again_end
|
||||||
case type
|
case type
|
||||||
when "default"
|
when "default"
|
||||||
t = filter_data(PluginTemplate, current_analysis_field_name, next_analysis_field_name, mps).count rescue 0
|
t = filter_data(PluginTemplate, current_analysis_field_name, next_analysis_field_name, mps).count rescue 0
|
||||||
parse_again_start
|
parse_again_start
|
||||||
when "plugin_template_related"
|
when "plugin_template_related"
|
||||||
t = filter_data(PluginTemplate, current_analysis_field_name, next_analysis_field_name, mps).where(:plugin_template_related_id => nil).count rescue 0
|
t = filter_data(PluginTemplate, current_analysis_field_name, next_analysis_field_name, mps).where(:plugin_template_related_id => nil).count rescue 0
|
||||||
parse_again_end
|
parse_again_end
|
||||||
else
|
else
|
||||||
t = filter_data(PluginTemplate, current_analysis_field_name, next_analysis_field_name, mps).count rescue 0
|
t = filter_data(PluginTemplate, current_analysis_field_name, next_analysis_field_name, mps).count rescue 0
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,27 +5,26 @@ class PluginTemplate
|
||||||
include MemberHelper
|
include MemberHelper
|
||||||
include Slug
|
include Slug
|
||||||
|
|
||||||
|
|
||||||
col_fields
|
col_fields
|
||||||
|
|
||||||
plugin_template_related_files_fields
|
plugin_template_related_files_fields
|
||||||
|
|
||||||
parse_again_start
|
parse_again_start
|
||||||
belongs_to :plugin_template_related
|
belongs_to :plugin_template_related
|
||||||
parse_again_end
|
parse_again_end
|
||||||
|
|
||||||
field :rss2_id
|
field :rss2_id
|
||||||
belongs_to :member_profile
|
belongs_to :member_profile
|
||||||
|
index(plugin_template_sort_hash, { unique: false, background: false })
|
||||||
scope :sort_hash, ->{ order_by(plugin_template_sort_hash) }
|
scope :sort_hash, ->{ order_by(plugin_template_sort_hash) }
|
||||||
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(plugin_template_sort_hash) }
|
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(plugin_template_sort_hash) }
|
||||||
|
|
||||||
parse_again_start
|
parse_again_start
|
||||||
member_methods_define
|
member_methods_define
|
||||||
parse_again_end
|
parse_again_end
|
||||||
parse_again_start
|
parse_again_start
|
||||||
periodic_methods_define
|
periodic_methods_define
|
||||||
parse_again_end
|
parse_again_end
|
||||||
before_save do
|
before_save do
|
||||||
before_save_codes
|
before_save_codes
|
||||||
end
|
end
|
||||||
|
@ -57,23 +56,29 @@ parse_again_end
|
||||||
|
|
||||||
fields_to_show = fields_to_show - fields_to_remove
|
fields_to_show = fields_to_show - fields_to_remove
|
||||||
|
|
||||||
plugin_datas = datas.sort_for_frontend.collect.with_index do |p,index|
|
plugin_datas = datas.sort_for_frontend.collect.with_index do |p,idx|
|
||||||
|
|
||||||
pd_data = []
|
pd_data = []
|
||||||
fields_to_show.collect do |t|
|
fields_to_show.collect do |t|
|
||||||
pd_data << { "data_title" => p.display_field(t) }
|
pd_data << { "data_title" => p.display_field(t) }
|
||||||
end
|
end
|
||||||
|
parse_again_start * 1 if plugin_template_related.count > 0
|
||||||
{
|
{
|
||||||
"pd_datas" => pd_data,
|
"pd_datas" => pd_data,
|
||||||
"type-sort" => (p.course_category.sort_position.to_i rescue 1000),
|
"type-sort" => (p.plugin_template_related.sort_position.to_i rescue 1000),
|
||||||
"sort-index" => index
|
"sort-index" => idx
|
||||||
}
|
}
|
||||||
|
parse_again_end
|
||||||
|
parse_again_start * 1 if plugin_template_related.count == 0
|
||||||
|
{
|
||||||
|
"pd_datas" => pd_data
|
||||||
|
}
|
||||||
|
parse_again_end
|
||||||
end
|
end
|
||||||
|
parse_again_start * 1 if plugin_template_related.count > 0
|
||||||
plugin_datas = plugin_datas.sort_by{|pd| [pd["type-sort"], pd["sort-index"]]}
|
plugin_datas = plugin_datas.sort_by{|pd| [pd["type-sort"], pd["sort-index"]]}
|
||||||
|
parse_again_end
|
||||||
return [pd_title,plugin_datas]
|
return [pd_title,plugin_datas]
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_plugin_data(fields_to_show)
|
def get_plugin_data(fields_to_show)
|
||||||
|
@ -105,5 +110,4 @@ parse_again_end
|
||||||
plugin_template = self
|
plugin_template = self
|
||||||
display_field_code
|
display_field_code
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -1,4 +1,3 @@
|
||||||
class PluginTemplateIntro < PersonalPluginIntro
|
class PluginTemplateIntro < PersonalPluginIntro
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
|
@ -21,5 +21,4 @@ class PluginTemplateLink
|
||||||
self.url = 'http://' + self.url
|
self.url = 'http://' + self.url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -3,9 +3,10 @@ class PluginTemplateRelated
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
|
|
||||||
col_related_fields
|
col_related_fields
|
||||||
|
field :sort_position, type: Integer, default: 0
|
||||||
|
|
||||||
has_many :plugin_templates
|
has_many :plugin_templates
|
||||||
parse_again_start
|
parse_again_start
|
||||||
related_periodic_methods_define
|
related_periodic_methods_define
|
||||||
parse_again_end
|
parse_again_end
|
||||||
end
|
end
|
|
@ -40,7 +40,7 @@
|
||||||
<% @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_start
|
parse_again_start
|
||||||
<!-- locale_fields -->
|
<!-- locale_fields -->
|
||||||
<div class="control-group input-title">
|
<div class="control-group input-title">
|
||||||
<label class="control-label muted"><%= t("personal_plugin_template.locale_fields") %></label>
|
<label class="control-label muted"><%= t("personal_plugin_template.locale_fields") %></label>
|
||||||
|
@ -48,7 +48,7 @@ parse_again_start
|
||||||
locale_fields_input_fields
|
locale_fields_input_fields
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
parse_again_end
|
parse_again_end
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- Link -->
|
<!-- Link -->
|
||||||
|
@ -164,7 +164,7 @@ parse_again_end
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
parse_again_start
|
parse_again_start
|
||||||
<!-- none_locale_fields -->
|
<!-- none_locale_fields -->
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t("personal_plugin_template.none_locale_fields") %></label>
|
<label class="control-label muted"><%= t("personal_plugin_template.none_locale_fields") %></label>
|
||||||
|
@ -172,8 +172,8 @@ parse_again_start
|
||||||
none_locale_fields_input_fields
|
none_locale_fields_input_fields
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
parse_again_end
|
parse_again_end
|
||||||
parse_again_start
|
parse_again_start
|
||||||
<!-- plugin_template_related -->
|
<!-- plugin_template_related -->
|
||||||
<div class="control-group big-group">
|
<div class="control-group big-group">
|
||||||
<label class="control-label muted"><%= t("personal_plugin_template.plugin_template_related.plugin_template_related_main_field") %></label>
|
<label class="control-label muted"><%= t("personal_plugin_template.plugin_template_related.plugin_template_related_main_field") %></label>
|
||||||
|
@ -181,7 +181,7 @@ parse_again_start
|
||||||
<%= f.select :plugin_template_related_id, PluginTemplateRelated.all.collect {|t| [ t.plugin_template_related_main_field, t.id ]}, { include_blank: true } %>
|
<%= f.select :plugin_template_related_id, PluginTemplateRelated.all.collect {|t| [ t.plugin_template_related_main_field, t.id ]}, { include_blank: true } %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
parse_again_end
|
parse_again_end
|
||||||
</div>
|
</div>
|
||||||
<!-- Status Module -->
|
<!-- Status Module -->
|
||||||
<div class="tab-pane fade" id="status">
|
<div class="tab-pane fade" id="status">
|
||||||
|
|
|
@ -1,19 +1,21 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
parse_again_start
|
parse_again_start
|
||||||
<th><%= t("personal_plugin_template.plugin_template_related.related_backend_index_fields") %></th>
|
<th><%= t("personal_plugin_template.plugin_template_related.related_backend_index_fields") %></th>
|
||||||
parse_again_end
|
parse_again_end
|
||||||
<th><%= t(:action) %></th>
|
<th><%= t(:action) %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @plugin_template_relateds.each do |plugin_template_related| %>
|
<% @plugin_template_relateds.each do |plugin_template_related| %>
|
||||||
<tr id="<%= dom_id plugin_template_related %>">
|
<tr id="<%= dom_id plugin_template_related %>">
|
||||||
parse_again_start
|
parse_again_start
|
||||||
<td>related_backend_index_fields_contents</td>
|
<td>related_backend_index_fields_contents</td>
|
||||||
parse_again_end
|
parse_again_end
|
||||||
<td class="span2">
|
<td class="span2">
|
||||||
<a href="<%= edit_admin_plugin_template_related_path(plugin_template_related) %>#plugin_template_related_modal" data-toggle="modal" data-remote="true" class="action"><%= t(:edit) %></a>
|
<a href="<%= edit_admin_plugin_template_related_path(plugin_template_related) %>#plugin_template_related_modal" data-toggle="modal" data-remote="true" class="action">
|
||||||
|
<%= t(:edit) %>
|
||||||
|
</a>
|
||||||
<%= link_to t(:delete_), admin_plugin_template_related_path(plugin_template_related), "data-confirm" => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
|
<%= link_to t(:delete_), admin_plugin_template_related_path(plugin_template_related), "data-confirm" => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<% @plugin_templates.each do |plugin_template| %>
|
<% @plugin_templates.each do |plugin_template| %>
|
||||||
<tr id="<%= dom_id plugin_template %>" class="with_action">
|
<tr id="<%= dom_id plugin_template %>" class="with_action">
|
||||||
parse_again_start
|
parse_again_start
|
||||||
<td> backend_index_fields_contents </td>
|
<td> backend_index_fields_contents </td>
|
||||||
parse_again_end
|
parse_again_end
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
|
@ -48,10 +48,10 @@
|
||||||
<div class="control-group input-title">
|
<div class="control-group input-title">
|
||||||
<label class="control-label muted"><%= t("personal_plugin_template.graph_by") %> : </label>
|
<label class="control-label muted"><%= t("personal_plugin_template.graph_by") %> : </label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
parse_again_start
|
parse_again_start
|
||||||
<%= t("personal_plugin_template.plugin_template_related.plugin_template_related_main_field") %>
|
<%= t("personal_plugin_template.plugin_template_related.plugin_template_related_main_field") %>
|
||||||
<input type="radio" name="graph_by" class="graph-type" value="plugin_template_related">
|
<input type="radio" name="graph_by" class="graph-type" value="plugin_template_related">
|
||||||
parse_again_end
|
parse_again_end
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -84,8 +84,7 @@ parse_again_end
|
||||||
form.form.on("submit",function(){return false;})
|
form.form.on("submit",function(){return false;})
|
||||||
|
|
||||||
$("#generate_excel").on("click",function(){
|
$("#generate_excel").on("click",function(){
|
||||||
window.location.href = "/admin/plugin_templates/download_excel.xlsx?" + "analysis_field_name_start=" + form.form.find("[name=analysis_field_name_start]").val() + "&analysis_field_name_end=" + form.form.find("[name=analysis_field_name_end]").val() + "&time_zone=" +
|
window.location.href = "/admin/plugin_templates/download_excel.xlsx?" + "analysis_field_name_start=" + form.form.find("[name=analysis_field_name_start]").val() + "&analysis_field_name_end=" + form.form.find("[name=analysis_field_name_end]").val() + "&time_zone=" + time_zone_string;
|
||||||
time_zone_string;
|
|
||||||
return false;
|
return false;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -117,7 +116,3 @@ parse_again_end
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,18 +8,18 @@ wb = xlsx_package.workbook
|
||||||
heading = sheet.styles.add_style(:b => true, :locked => true)
|
heading = sheet.styles.add_style(:b => true, :locked => true)
|
||||||
|
|
||||||
row = [t("personal_plugin_template.member_profile")]
|
row = [t("personal_plugin_template.member_profile")]
|
||||||
parse_again_start
|
parse_again_start
|
||||||
@site_in_use_locales.each do |locale|
|
@site_in_use_locales.each do |locale|
|
||||||
row << t("personal_plugin_template.locale_fields") + " - " + t(locale.to_s)
|
row << t("personal_plugin_template.locale_fields") + " - " + t(locale.to_s)
|
||||||
end
|
end
|
||||||
parse_again_end
|
parse_again_end
|
||||||
parse_again_start
|
parse_again_start
|
||||||
row << t("personal_plugin_template.none_locale_fields")
|
row << t("personal_plugin_template.none_locale_fields")
|
||||||
parse_again_end
|
parse_again_end
|
||||||
parse_again_start
|
parse_again_start
|
||||||
row << t("personal_plugin_template.plugin_template_related.plugin_template_related_main_field")
|
row << t("personal_plugin_template.plugin_template_related.plugin_template_related_main_field")
|
||||||
parse_again_end
|
parse_again_end
|
||||||
parse_again_start
|
parse_again_start
|
||||||
row << t("personal_plugin_template.plugin_template_file")
|
row << t("personal_plugin_template.plugin_template_file")
|
||||||
@site_in_use_locales.each do |locale|
|
@site_in_use_locales.each do |locale|
|
||||||
row << t("personal_plugin_template.plugin_template_file") + " " + t("description") + " - " + t(locale.to_s)
|
row << t("personal_plugin_template.plugin_template_file") + " " + t("description") + " - " + t(locale.to_s)
|
||||||
|
@ -27,29 +27,29 @@ parse_again_start
|
||||||
@site_in_use_locales.each do |locale|
|
@site_in_use_locales.each do |locale|
|
||||||
row << t("personal_plugin_template.plugin_template_file") + " " + t("alternative") + " - " + t(locale.to_s)
|
row << t("personal_plugin_template.plugin_template_file") + " " + t("alternative") + " - " + t(locale.to_s)
|
||||||
end
|
end
|
||||||
parse_again_end
|
parse_again_end
|
||||||
parse_again_start
|
parse_again_start
|
||||||
row << t("personal_plugin_template.plugin_template_link")
|
row << t("personal_plugin_template.plugin_template_link")
|
||||||
@site_in_use_locales.each do |locale|
|
@site_in_use_locales.each do |locale|
|
||||||
row << t("personal_plugin_template.plugin_template_link") + " " + t("url_alt") + " - " + t(locale.to_s)
|
row << t("personal_plugin_template.plugin_template_link") + " " + t("url_alt") + " - " + t(locale.to_s)
|
||||||
end
|
end
|
||||||
parse_again_end
|
parse_again_end
|
||||||
sheet.add_row row, :style => heading
|
sheet.add_row row, :style => heading
|
||||||
|
|
||||||
data.each do |plugin_template|
|
data.each do |plugin_template|
|
||||||
row = [(plugin_template.member_profile.name rescue "")]
|
row = [(plugin_template.member_profile.name rescue "")]
|
||||||
parse_again_start
|
parse_again_start
|
||||||
@site_in_use_locales.each do |locale|
|
@site_in_use_locales.each do |locale|
|
||||||
row << plugin_template.locale_fields_translations[locale.to_s]
|
row << plugin_template.locale_fields_translations[locale.to_s]
|
||||||
end
|
end
|
||||||
parse_again_end
|
parse_again_end
|
||||||
parse_again_start
|
parse_again_start
|
||||||
row << plugin_template.display_field("none_locale_fields",true)
|
row << plugin_template.display_field("none_locale_fields",true)
|
||||||
parse_again_end
|
parse_again_end
|
||||||
parse_again_start
|
parse_again_start
|
||||||
row << (plugin_template.plugin_template_related.plugin_template_related_main_field rescue "")
|
row << (plugin_template.plugin_template_related.plugin_template_related_main_field rescue "")
|
||||||
parse_again_end
|
parse_again_end
|
||||||
parse_again_start
|
parse_again_start
|
||||||
plugin_template_files = plugin_template.plugin_template_files.asc(:created_at)
|
plugin_template_files = plugin_template.plugin_template_files.asc(:created_at)
|
||||||
row << plugin_template_files.collect{|f| (@host_url + f.file.url rescue nil)}.join(";")
|
row << plugin_template_files.collect{|f| (@host_url + f.file.url rescue nil)}.join(";")
|
||||||
@site_in_use_locales.each do |locale|
|
@site_in_use_locales.each do |locale|
|
||||||
|
@ -58,14 +58,14 @@ parse_again_start
|
||||||
@site_in_use_locales.each do |locale|
|
@site_in_use_locales.each do |locale|
|
||||||
row << plugin_template_files.collect{|l| l.title_translations[locale]}.join(";")
|
row << plugin_template_files.collect{|l| l.title_translations[locale]}.join(";")
|
||||||
end
|
end
|
||||||
parse_again_end
|
parse_again_end
|
||||||
parse_again_start
|
parse_again_start
|
||||||
plugin_template_links = plugin_template.plugin_template_links.asc(:created_at)
|
plugin_template_links = plugin_template.plugin_template_links.asc(:created_at)
|
||||||
row << plugin_template_links.collect{|l| l.url}.join(";")
|
row << plugin_template_links.collect{|l| l.url}.join(";")
|
||||||
@site_in_use_locales.each do |locale|
|
@site_in_use_locales.each do |locale|
|
||||||
row << plugin_template_links.collect{|l| l.title_translations[locale]}.join(";")
|
row << plugin_template_links.collect{|l| l.title_translations[locale]}.join(";")
|
||||||
end
|
end
|
||||||
parse_again_end
|
parse_again_end
|
||||||
sheet.add_row row
|
sheet.add_row row
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -53,11 +53,8 @@
|
||||||
|
|
||||||
<!-- 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" : '' %>">
|
||||||
|
|
||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
<div class="control-group input-content">
|
<div class="control-group input-content">
|
||||||
<label class="control-label muted"><%= t(:content) %></label>
|
<label class="control-label muted"><%= t(:content) %></label>
|
||||||
|
@ -69,18 +66,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Form Actions -->
|
<!-- Form Actions -->
|
||||||
|
|
|
@ -14,7 +14,9 @@
|
||||||
<div class="bottomnav clearfix">
|
<div class="bottomnav clearfix">
|
||||||
<div class="action pull-right">
|
<div class="action pull-right">
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:new_), new_admin_plugin_template_path, :class => 'btn btn-primary' %>
|
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:new_), new_admin_plugin_template_path, :class => 'btn btn-primary' %>
|
||||||
|
parse_again_start * 1 if plugin_template_related.count == 0
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), admin_plugin_template_setting_path, :class => 'btn btn-primary pull-right' %>
|
<%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), admin_plugin_template_setting_path, :class => 'btn btn-primary pull-right' %>
|
||||||
|
parse_again_end
|
||||||
</div>
|
</div>
|
||||||
<div class="pagination pagination-centered">
|
<div class="pagination pagination-centered">
|
||||||
<%= content_tag :div, paginate(@plugin_templates), class: "pagination pagination-centered" %>
|
<%= content_tag :div, paginate(@plugin_templates), class: "pagination pagination-centered" %>
|
||||||
|
|
|
@ -24,9 +24,9 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
parse_again_start
|
parse_again_start
|
||||||
resources :plugin_template_relateds
|
resources :plugin_template_relateds
|
||||||
parse_again_end
|
parse_again_end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue