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]
|
||||||
if inner
|
parse_content = parse_content[ parse_content.index(exist_condition) + exist_condition.length..-1]
|
||||||
result = (0...vv.count).map {|ii| replace_text_with_pattern(parse_content,false,i,ii,true) }.join("")
|
extra_cond = parse_content.match(/^\.count *(\!|\<|\>|\=)(\=|) *\d+/)
|
||||||
else
|
if extra_cond
|
||||||
result = (0...vv.count).map {|ii| replace_text_with_pattern(parse_content,false,ii) }.join("")
|
extra_cond = extra_cond[0]
|
||||||
end
|
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
|
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
|
||||||
|
result = (0...vv_count).map {|ii| replace_text_with_pattern(parse_content,false,i,ii,true) }.join("")
|
||||||
|
else
|
||||||
|
result = (0...vv_count).map {|ii| replace_text_with_pattern(parse_content,false,ii) }.join("")
|
||||||
|
end
|
||||||
|
elsif match_count || exist_condition
|
||||||
|
count = 1
|
||||||
|
if match_count
|
||||||
|
count = match_count.strip[1..-1].to_i
|
||||||
|
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
|
||||||
|
|
|
@ -39,5 +39,5 @@ class Admin::PluginTemplateRelatedsController < OrbitMemberController
|
||||||
def plugin_template_related_params
|
def plugin_template_related_params
|
||||||
params.require(:plugin_template_related).permit!
|
params.require(:plugin_template_related).permit!
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -1,5 +1,5 @@
|
||||||
class Admin::PluginTemplatesController < OrbitMemberController
|
class Admin::PluginTemplatesController < OrbitMemberController
|
||||||
include Admin::PluginTemplatesHelper
|
include Admin::PluginTemplatesHelper
|
||||||
layout "member_plugin"
|
layout "member_plugin"
|
||||||
before_action :set_plugin_template, only: [:show, :edit , :update, :destroy]
|
before_action :set_plugin_template, only: [:show, :edit , :update, :destroy]
|
||||||
before_action :set_plugin
|
before_action :set_plugin
|
||||||
|
@ -36,7 +36,7 @@ class Admin::PluginTemplatesController < OrbitMemberController
|
||||||
end
|
end
|
||||||
def new
|
def new
|
||||||
@member = MemberProfile.find_by(:uid=>params['uid']) rescue nil
|
@member = MemberProfile.find_by(:uid=>params['uid']) rescue nil
|
||||||
@plugin_template = PluginTemplate.new
|
@plugin_template = PluginTemplate.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
@ -49,28 +49,28 @@ class Admin::PluginTemplatesController < OrbitMemberController
|
||||||
def analysis
|
def analysis
|
||||||
end
|
end
|
||||||
def analysis_report
|
def analysis_report
|
||||||
role = params[:role_id]
|
role = params[:role_id]
|
||||||
analysis_field_name_start = params[:analysis_field_name_start]
|
analysis_field_name_start = params[:analysis_field_name_start]
|
||||||
analysis_field_name_end = params[:analysis_field_name_end]
|
analysis_field_name_end = params[:analysis_field_name_end]
|
||||||
graph_by = params[:graph_by]
|
graph_by = params[:graph_by]
|
||||||
|
|
||||||
@data = get_chart_data(analysis_field_name_start,analysis_field_name_end,role,params[:graph_by],params[:time_zone])
|
@data = get_chart_data(analysis_field_name_start,analysis_field_name_end,role,params[:graph_by],params[:time_zone])
|
||||||
|
|
||||||
render :layout => false
|
render :layout => false
|
||||||
end
|
end
|
||||||
|
|
||||||
def download_excel
|
def download_excel
|
||||||
analysis_field_name_start = params[:analysis_field_name_start]
|
analysis_field_name_start = params[:analysis_field_name_start]
|
||||||
analysis_field_name_end = params[:analysis_field_name_end]
|
analysis_field_name_end = params[:analysis_field_name_end]
|
||||||
@data = get_data_for_excel(analysis_field_name_start,analysis_field_name_end,params[:time_zone])
|
@data = get_data_for_excel(analysis_field_name_start,analysis_field_name_end,params[:time_zone])
|
||||||
@protocol = (request.referer.blank? ? "http" : URI(request.referer).scheme)
|
@protocol = (request.referer.blank? ? "http" : URI(request.referer).scheme)
|
||||||
@host_url = "#{@protocol}://#{request.host_with_port}"
|
@host_url = "#{@protocol}://#{request.host_with_port}"
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.xlsx {
|
format.xlsx {
|
||||||
response.headers['Content-Disposition'] = 'attachment; filename="plugin_templates.xlsx"'
|
response.headers['Content-Disposition'] = 'attachment; filename="plugin_templates.xlsx"'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
end
|
end
|
||||||
|
@ -88,35 +88,35 @@ class Admin::PluginTemplatesController < OrbitMemberController
|
||||||
|
|
||||||
|
|
||||||
def setting
|
def setting
|
||||||
end
|
end
|
||||||
|
|
||||||
def frontend_setting
|
def frontend_setting
|
||||||
@member = MemberProfile.find_by(:uid=>params['uid']) rescue nil
|
@member = MemberProfile.find_by(:uid=>params['uid']) rescue nil
|
||||||
@intro = PluginTemplateIntro.find_by(:member_profile_id=>@member.id) rescue nil
|
@intro = PluginTemplateIntro.find_by(:member_profile_id=>@member.id) rescue nil
|
||||||
@intro = @intro.nil? ? PluginTemplateIntro.new({:member_profile_id=>@member.id}) : @intro
|
@intro = @intro.nil? ? PluginTemplateIntro.new({:member_profile_id=>@member.id}) : @intro
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_frontend_setting
|
def update_frontend_setting
|
||||||
@member = MemberProfile.find(intro_params['member_profile_id']) rescue nil
|
@member = MemberProfile.find(intro_params['member_profile_id']) rescue nil
|
||||||
@intro = PluginTemplateIntro.find_by(:member_profile_id=>@member.id) rescue nil
|
@intro = PluginTemplateIntro.find_by(:member_profile_id=>@member.id) rescue nil
|
||||||
@intro = @intro.nil? ? PluginTemplateIntro.new({:member_profile_id=>@member.id}) : @intro
|
@intro = @intro.nil? ? PluginTemplateIntro.new({:member_profile_id=>@member.id}) : @intro
|
||||||
@intro.update_attributes(intro_params)
|
@intro.update_attributes(intro_params)
|
||||||
@intro.save
|
@intro.save
|
||||||
redirect_to URI.encode('/admin/members/'+@member.to_param+'/PluginTemplate')
|
redirect_to URI.encode('/admin/members/'+@member.to_param+'/PluginTemplate')
|
||||||
end
|
end
|
||||||
|
|
||||||
def toggle_hide
|
def toggle_hide
|
||||||
if params[:ids]
|
if params[:ids]
|
||||||
@projects = PluginTemplate.any_in(_id: params[:ids])
|
@projects = PluginTemplate.any_in(_id: params[:ids])
|
||||||
|
|
||||||
@projects.each do |project|
|
@projects.each do |project|
|
||||||
project.is_hidden = params[:disable]
|
project.is_hidden = params[:disable]
|
||||||
project.save
|
project.save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
render json: {"success"=>true}
|
render json: {"success"=>true}
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
@ -125,28 +125,28 @@ class Admin::PluginTemplatesController < OrbitMemberController
|
||||||
end
|
end
|
||||||
|
|
||||||
def intro_params
|
def intro_params
|
||||||
params.require(:plugin_template_intro).permit! rescue nil
|
params.require(:plugin_template_intro).permit! rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_settings
|
def get_settings
|
||||||
parse_again_start
|
parse_again_start
|
||||||
@plugin_template_relateds = PluginTemplateRelated.all
|
@plugin_template_relateds = PluginTemplateRelated.all
|
||||||
parse_again_end
|
parse_again_end
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_plugin
|
def set_plugin
|
||||||
@plugin = OrbitApp::Plugin::Registration.all.select{|plugin| plugin.app_name.eql? 'PluginTemplate'}.first
|
@plugin = OrbitApp::Plugin::Registration.all.select{|plugin| plugin.app_name.eql? 'PluginTemplate'}.first
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_plugin_template
|
def set_plugin_template
|
||||||
path = request.path.split('/')
|
path = request.path.split('/')
|
||||||
if path.last.include? '-'
|
if path.last.include? '-'
|
||||||
uid = path[-1].split("-").last
|
uid = path[-1].split("-").last
|
||||||
uid = uid.split("?").first
|
uid = uid.split("?").first
|
||||||
else
|
else
|
||||||
uid = path[-2].split("-").last
|
uid = path[-2].split("-").last
|
||||||
uid = uid.split("?").first
|
uid = uid.split("?").first
|
||||||
end
|
end
|
||||||
@plugin_template = PluginTemplate.find_by(:uid => uid) rescue PluginTemplate.find(params[:id])
|
@plugin_template = PluginTemplate.find_by(:uid => uid) rescue PluginTemplate.find(params[:id])
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1,60 +1,60 @@
|
||||||
class PersonalPluginTemplatesController < ApplicationController
|
class PersonalPluginTemplatesController < ApplicationController
|
||||||
def index
|
def index
|
||||||
params = OrbitHelper.params
|
params = OrbitHelper.params
|
||||||
plugin_templates = PluginTemplate.sort_for_frontend
|
plugin_templates = PluginTemplate.sort_for_frontend
|
||||||
fields_to_show = col_name_to_show_in_index_page
|
fields_to_show = col_name_to_show_in_index_page
|
||||||
if params[:keywords].present?
|
if params[:keywords].present?
|
||||||
plugin_templates = filter_keywords(plugin_templates,params[:selectbox],params[:keywords])
|
plugin_templates = filter_keywords(plugin_templates,params[:selectbox],params[:keywords])
|
||||||
end
|
end
|
||||||
plugin_templates = plugin_templates.page(params[:page_no]).per(OrbitHelper.page_data_count)
|
plugin_templates = plugin_templates.page(params[:page_no]).per(OrbitHelper.page_data_count)
|
||||||
plugin_templates_list = plugin_templates.collect do |plugin_template|
|
plugin_templates_list = plugin_templates.collect do |plugin_template|
|
||||||
member = plugin_template.member_profile
|
member = plugin_template.member_profile
|
||||||
|
|
||||||
fields_hash = fields_to_show.map{|field| [field, get_display_field(plugin_template,field)]}.to_h
|
fields_hash = fields_to_show.map{|field| [field, get_display_field(plugin_template,field)]}.to_h
|
||||||
|
|
||||||
path = OrbitHelper.url_to_plugin_show(member.to_param, 'member') rescue '#'
|
path = OrbitHelper.url_to_plugin_show(member.to_param, 'member') rescue '#'
|
||||||
fields_hash["authors"] = "<a href='#{path}'>#{member.name}</a>" rescue ""
|
fields_hash["authors"] = "<a href='#{path}'>#{member.name}</a>" rescue ""
|
||||||
fields_hash["link_to_show"] = OrbitHelper.url_to_show(plugin_template.to_param)
|
fields_hash["link_to_show"] = OrbitHelper.url_to_show(plugin_template.to_param)
|
||||||
fields_hash
|
fields_hash
|
||||||
end
|
end
|
||||||
|
|
||||||
extras = extra_translate_title
|
extras = extra_translate_title
|
||||||
choice_show = []
|
choice_show = []
|
||||||
fields_to_show.each do |fs|
|
fields_to_show.each do |fs|
|
||||||
choice_show << t("personal_plugin_template.#{fs}")
|
choice_show << t("personal_plugin_template.#{fs}")
|
||||||
end
|
end
|
||||||
choice_value = fields_to_show
|
choice_value = fields_to_show
|
||||||
choice_value.unshift('default')
|
choice_value.unshift('default')
|
||||||
choice_select = choice_value.map { |iter| iter == params[:selectbox] ? 'selected' : '' }
|
choice_select = choice_value.map { |iter| iter == params[:selectbox] ? 'selected' : '' }
|
||||||
choice_select = choice_select.map { |value| { 'choice_select' => value } }
|
choice_select = choice_select.map { |value| { 'choice_select' => value } }
|
||||||
choice_value = choice_value.map { |value| { 'choice_value' => value } }
|
choice_value = choice_value.map { |value| { 'choice_value' => value } }
|
||||||
choice_default = t('personal_plugin_template.extend_translate.select_class')
|
choice_default = t('personal_plugin_template.extend_translate.select_class')
|
||||||
choice_show.unshift(choice_default)
|
choice_show.unshift(choice_default)
|
||||||
choice_show = choice_show.map { |value| { 'choice_show' => value } }
|
choice_show = choice_show.map { |value| { 'choice_show' => value } }
|
||||||
choice = choice_value.zip(choice_show, choice_select)
|
choice = choice_value.zip(choice_show, choice_select)
|
||||||
choice = choice.map { |value| value.inject :merge }
|
choice = choice.map { |value| value.inject :merge }
|
||||||
select_text = t('personal_plugin_template.extend_translate.search_class')
|
select_text = t('personal_plugin_template.extend_translate.search_class')
|
||||||
search_text = t('personal_plugin_template.extend_translate.word_to_search')
|
search_text = t('personal_plugin_template.extend_translate.word_to_search')
|
||||||
|
|
||||||
extras = extras.merge({ 'url' => '/' + I18n.locale.to_s + params[:url],
|
extras = extras.merge({ 'url' => '/' + I18n.locale.to_s + params[:url],
|
||||||
'select_text' => select_text,
|
'select_text' => select_text,
|
||||||
'search_text' => search_text,
|
'search_text' => search_text,
|
||||||
'search_value' => params[:keywords].to_s.gsub(/\"/,'')
|
'search_value' => params[:keywords].to_s.gsub(/\"/,'')
|
||||||
})
|
})
|
||||||
extras["widget-title"] = I18n.t("module_name.personal_plugin_template")
|
extras["widget-title"] = I18n.t("module_name.personal_plugin_template")
|
||||||
{
|
{
|
||||||
"plugin_templates" => plugin_templates_list,
|
"plugin_templates" => plugin_templates_list,
|
||||||
"extras" => extras,
|
"extras" => extras,
|
||||||
"total_pages" => plugin_templates.total_pages,
|
"total_pages" => plugin_templates.total_pages,
|
||||||
'choice' => choice
|
'choice' => choice
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
params = OrbitHelper.params
|
params = OrbitHelper.params
|
||||||
plugin = PluginTemplate.where(:is_hidden=>false).find_by(uid: params[:uid])
|
plugin = PluginTemplate.where(:is_hidden=>false).find_by(uid: params[:uid])
|
||||||
fields_to_show = col_name_to_show_in_show_page
|
fields_to_show = col_name_to_show_in_show_page
|
||||||
{"plugin_datas"=>plugin.get_plugin_data(fields_to_show)}
|
{"plugin_datas"=>plugin.get_plugin_data(fields_to_show)}
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_display_field(plugin_template,field)
|
def get_display_field(plugin_template,field)
|
||||||
|
|
|
@ -1,151 +1,151 @@
|
||||||
module Admin::PluginTemplatesHelper
|
module Admin::PluginTemplatesHelper
|
||||||
include OrbitBackendHelper
|
include OrbitBackendHelper
|
||||||
include OrbitFormHelper
|
include OrbitFormHelper
|
||||||
alias :org_datetime_picker :datetime_picker
|
alias :org_datetime_picker :datetime_picker
|
||||||
def datetime_picker(*arg,**args)
|
def datetime_picker(*arg,**args)
|
||||||
org_datetime_picker(arg,args)
|
org_datetime_picker(arg,args)
|
||||||
end
|
end
|
||||||
def time_iterate(start_time, end_time, step, &block)
|
def time_iterate(start_time, end_time, step, &block)
|
||||||
begin
|
begin
|
||||||
start_time = start_time.to_date if end_time.class == Date
|
start_time = start_time.to_date if end_time.class == Date
|
||||||
yield(start_time)
|
yield(start_time)
|
||||||
end while (start_time += step) <= end_time
|
end while (start_time += step) <= end_time
|
||||||
end
|
end
|
||||||
def parse_time(time_str,timezone="+08:00")
|
def parse_time(time_str,timezone="+08:00")
|
||||||
DateTime.parse("0000-01-01 " + time_str + timezone)
|
DateTime.parse("0000-01-01 " + time_str + timezone)
|
||||||
end
|
end
|
||||||
def page_for_plugin_template(plugin_template_object)
|
def page_for_plugin_template(plugin_template_object)
|
||||||
page = Page.where(:module=>"personal_plugin_template").first
|
page = Page.where(:module=>"personal_plugin_template").first
|
||||||
("/#{I18n.locale}"+page.url+'/'+plugin_template_object.to_param).gsub('//','/') rescue "#"
|
("/#{I18n.locale}"+page.url+'/'+plugin_template_object.to_param).gsub('//','/') rescue "#"
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_data_for_excel(analysis_field_name_start,analysis_field_name_end,timezone)
|
def get_data_for_excel(analysis_field_name_start,analysis_field_name_end,timezone)
|
||||||
analysis_field_name_start = parse_date_time_field("analysis_field_name",analysis_field_name_start,timezone)
|
analysis_field_name_start = parse_date_time_field("analysis_field_name",analysis_field_name_start,timezone)
|
||||||
analysis_field_name_end = parse_date_time_field("analysis_field_name",analysis_field_name_end,timezone)
|
analysis_field_name_end = parse_date_time_field("analysis_field_name",analysis_field_name_end,timezone)
|
||||||
data = []
|
data = []
|
||||||
roles = Role.where(:disabled => false, :title.ne => "", :title.ne => nil).asc(:key)
|
roles = Role.where(:disabled => false, :title.ne => "", :title.ne => nil).asc(:key)
|
||||||
roles.each do |role|
|
roles.each do |role|
|
||||||
d = {}
|
d = {}
|
||||||
d["name"] = role.title
|
d["name"] = role.title
|
||||||
mps = role.member_profile_ids
|
mps = role.member_profile_ids
|
||||||
d["data"] = filter_data(PluginTemplate, analysis_field_name_start, analysis_field_name_end, mps)
|
d["data"] = filter_data(PluginTemplate, analysis_field_name_start, analysis_field_name_end, mps)
|
||||||
data << d
|
data << d
|
||||||
end
|
end
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
def filter_data(data,analysis_field_name_start,analysis_field_name_end,mps = nil)
|
def filter_data(data,analysis_field_name_start,analysis_field_name_end,mps = nil)
|
||||||
result = []
|
result = []
|
||||||
if @periodic
|
if @periodic
|
||||||
all_ids = data.all.pluck(:id) rescue []
|
all_ids = data.all.pluck(:id) rescue []
|
||||||
out_of_range_ids1 = data.where(:analysis_field_name_start.gt => analysis_field_name_end).pluck(:id) rescue []
|
out_of_range_ids1 = data.where(:analysis_field_name_start.gt => analysis_field_name_end).pluck(:id) rescue []
|
||||||
out_of_range_ids2 = data.where(:analysis_field_name_end.lt => analysis_field_name_start).pluck(:id) rescue []
|
out_of_range_ids2 = data.where(:analysis_field_name_end.lt => analysis_field_name_start).pluck(:id) rescue []
|
||||||
result = data.where(:id.in=>(all_ids - out_of_range_ids1 - out_of_range_ids2)) rescue []
|
result = data.where(:id.in=>(all_ids - out_of_range_ids1 - out_of_range_ids2)) rescue []
|
||||||
else
|
else
|
||||||
result = data.where(:analysis_field_name.gte => analysis_field_name_start, :analysis_field_name.lte => analysis_field_name_end) rescue []
|
result = data.where(:analysis_field_name.gte => analysis_field_name_start, :analysis_field_name.lte => analysis_field_name_end) rescue []
|
||||||
end
|
end
|
||||||
result = result.where(:member_profile_id.in => mps) rescue [] unless mps.nil?
|
result = result.where(:member_profile_id.in => mps) rescue [] unless mps.nil?
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
def get_chart_data(analysis_field_name_start,analysis_field_name_end,role,type,timezone)
|
def get_chart_data(analysis_field_name_start,analysis_field_name_end,role,type,timezone)
|
||||||
analysis_field_name_start = parse_date_time_field("analysis_field_name",analysis_field_name_start,timezone)
|
analysis_field_name_start = parse_date_time_field("analysis_field_name",analysis_field_name_start,timezone)
|
||||||
analysis_field_name_end = parse_date_time_field("analysis_field_name",analysis_field_name_end,timezone)
|
analysis_field_name_end = parse_date_time_field("analysis_field_name",analysis_field_name_end,timezone)
|
||||||
main_field_name = ""
|
main_field_name = ""
|
||||||
time_fields = time_fields_text
|
time_fields = time_fields_text
|
||||||
max_iterate = 20
|
max_iterate = 20
|
||||||
iterate_step = iterate_step_text
|
iterate_step = iterate_step_text
|
||||||
iterate_count = ((analysis_field_name_end - analysis_field_name_start) / iterate_step * 1.day.second).ceil
|
iterate_count = ((analysis_field_name_end - analysis_field_name_start) / iterate_step * 1.day.second).ceil
|
||||||
if iterate_count > max_iterate
|
if iterate_count > max_iterate
|
||||||
iterate_step = (iterate_step * (iterate_count / max_iterate.to_f).ceil).second
|
iterate_step = (iterate_step * (iterate_count / max_iterate.to_f).ceil).second
|
||||||
end
|
end
|
||||||
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
|
||||||
|
|
||||||
finaldata = []
|
finaldata = []
|
||||||
role = Role.find(role) rescue nil
|
role = Role.find(role) rescue nil
|
||||||
mps = []
|
mps = []
|
||||||
if !role.nil?
|
if !role.nil?
|
||||||
mps = role.member_profile_ids
|
mps = role.member_profile_ids
|
||||||
end
|
end
|
||||||
jls.each do |jl|
|
jls.each do |jl|
|
||||||
data = {}
|
data = {}
|
||||||
data["name"] = jl.send(main_field_name) rescue "N/A"
|
data["name"] = jl.send(main_field_name) rescue "N/A"
|
||||||
data["data"] = {}
|
data["data"] = {}
|
||||||
time_iterate(analysis_field_name_start,analysis_field_name_end,iterate_step) do |analysis_field_name|
|
time_iterate(analysis_field_name_start,analysis_field_name_end,iterate_step) do |analysis_field_name|
|
||||||
next_analysis_field_name = analysis_field_name + iterate_step
|
next_analysis_field_name = analysis_field_name + iterate_step
|
||||||
current_analysis_field_name = analysis_field_name
|
current_analysis_field_name = analysis_field_name
|
||||||
current_analysis_field_name = analysis_field_name.strftime("%H:%M") if time_fields.include?("analysis_field_name")
|
current_analysis_field_name = analysis_field_name.strftime("%H:%M") if time_fields.include?("analysis_field_name")
|
||||||
next_analysis_field_name = next_analysis_field_name.strftime("%H:%M") if time_fields.include?("analysis_field_name")
|
next_analysis_field_name = next_analysis_field_name.strftime("%H:%M") if time_fields.include?("analysis_field_name")
|
||||||
t = filter_data(jl.plugin_templates, current_analysis_field_name, next_analysis_field_name, mps)
|
t = filter_data(jl.plugin_templates, current_analysis_field_name, next_analysis_field_name, mps)
|
||||||
|
|
||||||
if current_analysis_field_name.class == DateTime
|
if current_analysis_field_name.class == DateTime
|
||||||
current_analysis_field_name = display_date_time(current_analysis_field_name,timezone,iterate_step)
|
current_analysis_field_name = display_date_time(current_analysis_field_name,timezone,iterate_step)
|
||||||
end
|
end
|
||||||
data["data"][current_analysis_field_name.to_s] = t
|
data["data"][current_analysis_field_name.to_s] = t
|
||||||
end
|
end
|
||||||
finaldata << data
|
finaldata << data
|
||||||
end
|
end
|
||||||
data = {"name" => "N/A", "data" => {}}
|
data = {"name" => "N/A", "data" => {}}
|
||||||
time_iterate(analysis_field_name_start,analysis_field_name_end,iterate_step) do |analysis_field_name|
|
time_iterate(analysis_field_name_start,analysis_field_name_end,iterate_step) do |analysis_field_name|
|
||||||
next_analysis_field_name = analysis_field_name + iterate_step
|
next_analysis_field_name = analysis_field_name + iterate_step
|
||||||
current_analysis_field_name = analysis_field_name
|
current_analysis_field_name = analysis_field_name
|
||||||
current_analysis_field_name = analysis_field_name.strftime("%H:%M") if time_fields.include?("analysis_field_name")
|
current_analysis_field_name = analysis_field_name.strftime("%H:%M") if time_fields.include?("analysis_field_name")
|
||||||
next_analysis_field_name = next_analysis_field_name.strftime("%H:%M") if time_fields.include?("analysis_field_name")
|
next_analysis_field_name = next_analysis_field_name.strftime("%H:%M") if time_fields.include?("analysis_field_name")
|
||||||
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
|
||||||
current_analysis_field_name = current_analysis_field_name.new_offset(timezone) if current_analysis_field_name.class == DateTime
|
current_analysis_field_name = current_analysis_field_name.new_offset(timezone) if current_analysis_field_name.class == DateTime
|
||||||
if current_analysis_field_name.class == DateTime
|
if current_analysis_field_name.class == DateTime
|
||||||
current_analysis_field_name = display_date_time(current_analysis_field_name,timezone,iterate_step)
|
current_analysis_field_name = display_date_time(current_analysis_field_name,timezone,iterate_step)
|
||||||
end
|
end
|
||||||
data["data"][current_analysis_field_name.to_s] = t
|
data["data"][current_analysis_field_name.to_s] = t
|
||||||
end
|
end
|
||||||
finaldata << data
|
finaldata << data
|
||||||
finaldata
|
finaldata
|
||||||
end
|
end
|
||||||
def parse_date_time_field(field,value,timezone="+08:00")
|
def parse_date_time_field(field,value,timezone="+08:00")
|
||||||
time_fields = time_fields_text
|
time_fields = time_fields_text
|
||||||
type = PluginTemplate.fields[field].type rescue nil
|
type = PluginTemplate.fields[field].type rescue nil
|
||||||
if type.nil?
|
if type.nil?
|
||||||
@periodic = true
|
@periodic = true
|
||||||
type = PluginTemplate.fields[field + "_start"].type
|
type = PluginTemplate.fields[field + "_start"].type
|
||||||
end
|
end
|
||||||
if time_fields.include?(field)
|
if time_fields.include?(field)
|
||||||
parse_time(value,timezone)
|
parse_time(value,timezone)
|
||||||
elsif type == Integer
|
elsif type == Integer
|
||||||
value.to_i
|
value.to_i
|
||||||
elsif type == Date
|
elsif type == Date
|
||||||
Date.parse(value)
|
Date.parse(value)
|
||||||
else
|
else
|
||||||
DateTime.parse(value+timezone).utc
|
DateTime.parse(value+timezone).utc
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def display_date_time(date_time,timezone,iterate_step)
|
def display_date_time(date_time,timezone,iterate_step)
|
||||||
date_time = date_time.new_offset(timezone)
|
date_time = date_time.new_offset(timezone)
|
||||||
if iterate_step > 1.year
|
if iterate_step > 1.year
|
||||||
date_time = date_time.strftime("%Y")
|
date_time = date_time.strftime("%Y")
|
||||||
elsif iterate_step > 1.month
|
elsif iterate_step > 1.month
|
||||||
date_time = date_time.strftime("%Y/%m")
|
date_time = date_time.strftime("%Y/%m")
|
||||||
elsif iterate_step > 1.day
|
elsif iterate_step > 1.day
|
||||||
date_time = date_time.strftime("%Y/%m/%d")
|
date_time = date_time.strftime("%Y/%m/%d")
|
||||||
else
|
else
|
||||||
date_time = date_time.strftime("%Y/%m/%d %H:%M")
|
date_time = date_time.strftime("%Y/%m/%d %H:%M")
|
||||||
end
|
end
|
||||||
return date_time
|
return date_time
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1,109 +1,113 @@
|
||||||
class PluginTemplate
|
class PluginTemplate
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
include OrbitModel::Status
|
include OrbitModel::Status
|
||||||
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
|
||||||
|
belongs_to :plugin_template_related
|
||||||
|
parse_again_end
|
||||||
|
|
||||||
parse_again_start
|
field :rss2_id
|
||||||
belongs_to :plugin_template_related
|
belongs_to :member_profile
|
||||||
parse_again_end
|
index(plugin_template_sort_hash, { unique: false, background: false })
|
||||||
|
scope :sort_hash, ->{ order_by(plugin_template_sort_hash) }
|
||||||
field :rss2_id
|
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(plugin_template_sort_hash) }
|
||||||
belongs_to :member_profile
|
|
||||||
|
|
||||||
scope :sort_hash, ->{ order_by(plugin_template_sort_hash) }
|
parse_again_start
|
||||||
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(plugin_template_sort_hash) }
|
member_methods_define
|
||||||
|
parse_again_end
|
||||||
|
parse_again_start
|
||||||
|
periodic_methods_define
|
||||||
|
parse_again_end
|
||||||
|
before_save do
|
||||||
|
before_save_codes
|
||||||
|
end
|
||||||
|
def parse_time(time_str)
|
||||||
|
DateTime.parse("0000-01-01 " + time_str)
|
||||||
|
end
|
||||||
|
def self.get_plugin_datas_to_member(datas)
|
||||||
|
|
||||||
parse_again_start
|
fields_to_show = col_name_to_show
|
||||||
member_methods_define
|
|
||||||
parse_again_end
|
|
||||||
parse_again_start
|
|
||||||
periodic_methods_define
|
|
||||||
parse_again_end
|
|
||||||
before_save do
|
|
||||||
before_save_codes
|
|
||||||
end
|
|
||||||
def parse_time(time_str)
|
|
||||||
DateTime.parse("0000-01-01 " + time_str)
|
|
||||||
end
|
|
||||||
def self.get_plugin_datas_to_member(datas)
|
|
||||||
|
|
||||||
fields_to_show = col_name_to_show
|
fields_to_remove = []
|
||||||
|
|
||||||
fields_to_remove = []
|
pd_title = []
|
||||||
|
|
||||||
pd_title = []
|
fields_to_show.each do |t|
|
||||||
|
if (self.fields[t].type.to_s == "String" || self.fields[t].type.to_s == "Object" rescue false)
|
||||||
|
fields_to_remove << t if (datas.where(t.to_sym.ne => nil, t.to_sym.ne => "").count == 0 rescue false)
|
||||||
|
elsif (self.relations.include?(t.pluralize) rescue false)
|
||||||
|
fields_to_remove << t if (datas.where(t.pluralize.to_sym.ne=>[]).count == 0 rescue false)
|
||||||
|
elsif period_fields_text.include?(t)
|
||||||
|
fields_to_remove << t if (datas.select{|d| d.send(t) != " ~ " }.count == 0 rescue false)
|
||||||
|
else
|
||||||
|
fields_to_remove << t if (datas.where(t.to_sym.ne => nil).count == 0 rescue false)
|
||||||
|
end
|
||||||
|
pd_title << {
|
||||||
|
"plugin_data_title" => I18n.t("personal_plugin_template.#{t}")
|
||||||
|
} if !fields_to_remove.include?(t)
|
||||||
|
end
|
||||||
|
|
||||||
fields_to_show.each do |t|
|
fields_to_show = fields_to_show - fields_to_remove
|
||||||
if (self.fields[t].type.to_s == "String" || self.fields[t].type.to_s == "Object" rescue false)
|
|
||||||
fields_to_remove << t if (datas.where(t.to_sym.ne => nil, t.to_sym.ne => "").count == 0 rescue false)
|
|
||||||
elsif (self.relations.include?(t.pluralize) rescue false)
|
|
||||||
fields_to_remove << t if (datas.where(t.pluralize.to_sym.ne=>[]).count == 0 rescue false)
|
|
||||||
elsif period_fields_text.include?(t)
|
|
||||||
fields_to_remove << t if (datas.select{|d| d.send(t) != " ~ " }.count == 0 rescue false)
|
|
||||||
else
|
|
||||||
fields_to_remove << t if (datas.where(t.to_sym.ne => nil).count == 0 rescue false)
|
|
||||||
end
|
|
||||||
pd_title << {
|
|
||||||
"plugin_data_title" => I18n.t("personal_plugin_template.#{t}")
|
|
||||||
} if !fields_to_remove.include?(t)
|
|
||||||
end
|
|
||||||
|
|
||||||
fields_to_show = fields_to_show - fields_to_remove
|
plugin_datas = datas.sort_for_frontend.collect.with_index do |p,idx|
|
||||||
|
|
||||||
plugin_datas = datas.sort_for_frontend.collect.with_index do |p,index|
|
pd_data = []
|
||||||
|
fields_to_show.collect do |t|
|
||||||
pd_data = []
|
pd_data << { "data_title" => p.display_field(t) }
|
||||||
fields_to_show.collect do |t|
|
end
|
||||||
pd_data << { "data_title" => p.display_field(t) }
|
parse_again_start * 1 if plugin_template_related.count > 0
|
||||||
end
|
{
|
||||||
|
"pd_datas" => pd_data,
|
||||||
{
|
"type-sort" => (p.plugin_template_related.sort_position.to_i rescue 1000),
|
||||||
"pd_datas" => pd_data,
|
"sort-index" => idx
|
||||||
"type-sort" => (p.course_category.sort_position.to_i rescue 1000),
|
}
|
||||||
"sort-index" => index
|
parse_again_end
|
||||||
}
|
parse_again_start * 1 if plugin_template_related.count == 0
|
||||||
|
{
|
||||||
end
|
"pd_datas" => pd_data
|
||||||
plugin_datas = plugin_datas.sort_by{|pd| [pd["type-sort"], pd["sort-index"]]}
|
}
|
||||||
return [pd_title,plugin_datas]
|
parse_again_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"]]}
|
||||||
|
parse_again_end
|
||||||
|
return [pd_title,plugin_datas]
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_plugin_data(fields_to_show)
|
def get_plugin_data(fields_to_show)
|
||||||
plugin_datas = []
|
plugin_datas = []
|
||||||
fields_to_show.each do |field|
|
fields_to_show.each do |field|
|
||||||
plugin_data = self.get_plugin_field_data(field) rescue nil
|
plugin_data = self.get_plugin_field_data(field) rescue nil
|
||||||
next if plugin_data.blank? or plugin_data['value'].blank?
|
next if plugin_data.blank? or plugin_data['value'].blank?
|
||||||
plugin_datas << plugin_data
|
plugin_datas << plugin_data
|
||||||
end
|
end
|
||||||
plugin_datas
|
plugin_datas
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_plugin_field_data(field)
|
def get_plugin_field_data(field)
|
||||||
plugin_template = self
|
plugin_template = self
|
||||||
value_case_codes
|
value_case_codes
|
||||||
|
|
||||||
value = (value =~ /\A#{URI::regexp(['http', 'https'])}\z/) ? "<a href='#{value}' target='blank'>#{value}</a>" : value
|
value = (value =~ /\A#{URI::regexp(['http', 'https'])}\z/) ? "<a href='#{value}' target='blank'>#{value}</a>" : value
|
||||||
|
|
||||||
{
|
|
||||||
"key"=>field,
|
|
||||||
"title_class"=>"plugin_template-#{field.gsub('_','-')}-field",
|
|
||||||
"value_class"=>"plugin_template-#{field.gsub('_','-')}-value",
|
|
||||||
"title"=>I18n.t('personal_plugin_template.'+field),
|
|
||||||
"value"=>value
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
def display_field(field,text_only=false)
|
{
|
||||||
plugin_template = self
|
"key"=>field,
|
||||||
display_field_code
|
"title_class"=>"plugin_template-#{field.gsub('_','-')}-field",
|
||||||
end
|
"value_class"=>"plugin_template-#{field.gsub('_','-')}-value",
|
||||||
|
"title"=>I18n.t('personal_plugin_template.'+field),
|
||||||
|
"value"=>value
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
end
|
def display_field(field,text_only=false)
|
||||||
|
plugin_template = self
|
||||||
|
display_field_code
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,4 +1,3 @@
|
||||||
class PluginTemplateIntro < PersonalPluginIntro
|
class PluginTemplateIntro < PersonalPluginIntro
|
||||||
|
|
||||||
|
end
|
||||||
end
|
|
|
@ -2,24 +2,23 @@
|
||||||
require 'uri'
|
require 'uri'
|
||||||
|
|
||||||
class PluginTemplateLink
|
class PluginTemplateLink
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
|
|
||||||
field :url
|
|
||||||
field :title, localize: true
|
|
||||||
|
|
||||||
belongs_to :plugin_template
|
|
||||||
|
|
||||||
before_validation :add_http
|
field :url
|
||||||
|
field :title, localize: true
|
||||||
#validates :url, :presence => true, :format => /\A(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?\Z/i
|
|
||||||
|
|
||||||
protected
|
belongs_to :plugin_template
|
||||||
|
|
||||||
def add_http
|
before_validation :add_http
|
||||||
unless self.url[/^http:\/\//] || self.url[/^https:\/\//]
|
|
||||||
self.url = 'http://' + self.url
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
#validates :url, :presence => true, :format => /\A(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?\Z/i
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def add_http
|
||||||
|
unless self.url[/^http:\/\//] || self.url[/^https:\/\//]
|
||||||
|
self.url = 'http://' + self.url
|
||||||
|
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
|
|
@ -1,242 +1,242 @@
|
||||||
<% # encoding: utf-8 %>
|
<% # encoding: utf-8 %>
|
||||||
<% content_for :page_specific_css do %>
|
<% content_for :page_specific_css do %>
|
||||||
<%= stylesheet_link_tag "lib/main-forms" %>
|
<%= stylesheet_link_tag "lib/main-forms" %>
|
||||||
<%= stylesheet_link_tag "lib/fileupload" %>
|
<%= stylesheet_link_tag "lib/fileupload" %>
|
||||||
<%= stylesheet_link_tag "lib/main-list" %>
|
<%= stylesheet_link_tag "lib/main-list" %>
|
||||||
<%= stylesheet_link_tag "lib/main-form-col2" %>
|
<%= stylesheet_link_tag "lib/main-form-col2" %>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.ui-helper-hidden-accessible{
|
.ui-helper-hidden-accessible{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% content_for :page_specific_javascript do %>
|
<% content_for :page_specific_javascript do %>
|
||||||
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
|
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
|
||||||
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
|
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
|
||||||
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
|
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
|
||||||
<%= javascript_include_tag "lib/file-type" %>
|
<%= javascript_include_tag "lib/file-type" %>
|
||||||
<%= javascript_include_tag "lib/module-area" %>
|
<%= javascript_include_tag "lib/module-area" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<!-- Input Area -->
|
<!-- Input Area -->
|
||||||
<div class="input-area">
|
<div class="input-area">
|
||||||
|
|
||||||
<!-- 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">
|
||||||
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||||
<li class="<%= 'active' if i == 0 %>">
|
<li class="<%= 'active' if i == 0 %>">
|
||||||
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
|
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li class="pull-right">
|
<li class="pull-right">
|
||||||
<%= copy_to_all_language_button(".language-nav", ".language-area") %>
|
<%= copy_to_all_language_button(".language-nav", ".language-area") %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- 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_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>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
locale_fields_input_fields
|
locale_fields_input_fields
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
parse_again_end
|
parse_again_end
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- Link -->
|
<!-- Link -->
|
||||||
<%
|
<%
|
||||||
links_hash = {}
|
links_hash = {}
|
||||||
plugin_template_related_links_text.each do |link|
|
plugin_template_related_links_text.each do |link|
|
||||||
hash = {}
|
hash = {}
|
||||||
hash["html"] = add_attribute("form_link", f, link.pluralize.to_sym)
|
hash["html"] = add_attribute("form_link", f, link.pluralize.to_sym)
|
||||||
hash["count"] = @plugin_template.send(link.pluralize).count rescue 0
|
hash["count"] = @plugin_template.send(link.pluralize).count rescue 0
|
||||||
links_hash[link] = hash
|
links_hash[link] = hash
|
||||||
%>
|
%>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t("personal_plugin_template.#{link}") %></label>
|
<label class="control-label muted"><%= t("personal_plugin_template.#{link}") %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
||||||
<!-- Exist -->
|
<!-- Exist -->
|
||||||
<% if !@plugin_template.new_record? && hash["count"] > 0 %>
|
<% if !@plugin_template.new_record? && hash["count"] > 0 %>
|
||||||
<div class="exist">
|
<div class="exist">
|
||||||
<% @plugin_template.send(link.pluralize).each_with_index do |obj, i| %>
|
<% @plugin_template.send(link.pluralize).each_with_index do |obj, i| %>
|
||||||
<% if !obj.new_record? %>
|
<% if !obj.new_record? %>
|
||||||
<%= f.fields_for link.pluralize.to_sym, obj do |f| %>
|
<%= f.fields_for link.pluralize.to_sym, obj do |f| %>
|
||||||
<%= render :partial => "form_link", :object => obj, :locals => {:f => f, :i => i} %>
|
<%= render :partial => "form_link", :object => obj, :locals => {:f => f, :i => i} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<!-- Add -->
|
<!-- Add -->
|
||||||
<div class="add-target" for="<%= link %>">
|
<div class="add-target" for="<%= link %>">
|
||||||
</div>
|
</div>
|
||||||
<p class="add-btn">
|
<p class="add-btn">
|
||||||
<a class="add_link trigger btn btn-small btn-primary" for="<%= link %>"><i class="icons-plus"></i> <%= t(:add) %></a>
|
<a class="add_link trigger btn btn-small btn-primary" for="<%= link %>"><i class="icons-plus"></i> <%= t(:add) %></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- File -->
|
<!-- File -->
|
||||||
<%
|
<%
|
||||||
files_hash = {}
|
files_hash = {}
|
||||||
plugin_template_related_files_text.each do |file|
|
plugin_template_related_files_text.each do |file|
|
||||||
hash = {}
|
hash = {}
|
||||||
hash["html"] = add_attribute("form_file", f, file.pluralize.to_sym)
|
hash["html"] = add_attribute("form_file", f, file.pluralize.to_sym)
|
||||||
hash["count"] = @plugin_template.send(file.pluralize).count rescue 0
|
hash["count"] = @plugin_template.send(file.pluralize).count rescue 0
|
||||||
files_hash[file] = hash
|
files_hash[file] = hash
|
||||||
%>
|
%>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t("personal_plugin_template.#{file}") %></label>
|
<label class="control-label muted"><%= t("personal_plugin_template.#{file}") %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
||||||
<!-- Exist -->
|
<!-- Exist -->
|
||||||
<% if !@plugin_template.new_record? && hash["count"] > 0 %>
|
<% if !@plugin_template.new_record? && hash["count"] > 0 %>
|
||||||
<div class="exist">
|
<div class="exist">
|
||||||
<% @plugin_template.send(file.pluralize).each_with_index do |obj, i| %>
|
<% @plugin_template.send(file.pluralize).each_with_index do |obj, i| %>
|
||||||
<% if !obj.new_record? %>
|
<% if !obj.new_record? %>
|
||||||
<%= f.fields_for file.pluralize.to_sym, obj do |f| %>
|
<%= f.fields_for file.pluralize.to_sym, obj do |f| %>
|
||||||
<%= render :partial => "form_file", :object => obj, :locals => {:f => f, :i => i} %>
|
<%= render :partial => "form_file", :object => obj, :locals => {:f => f, :i => i} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<!-- Add -->
|
<!-- Add -->
|
||||||
<div class="add-target" for="<%= file %>">
|
<div class="add-target" for="<%= file %>">
|
||||||
</div>
|
</div>
|
||||||
<p class="add-btn">
|
<p class="add-btn">
|
||||||
<a class="add_file trigger btn btn-small btn-primary" for="<%= file %>"><i class="icons-plus"></i> <%= t(:add) %></a>
|
<a class="add_file trigger btn btn-small btn-primary" for="<%= file %>"><i class="icons-plus"></i> <%= t(:add) %></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<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>
|
||||||
<li class="active">
|
<li class="active">
|
||||||
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
|
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#status" data-toggle="tab"><%= t(:status) %></a>
|
<a href="#status" data-toggle="tab"><%= t(:status) %></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- Module -->
|
<!-- Module -->
|
||||||
<div class="tab-content module-area">
|
<div class="tab-content module-area">
|
||||||
|
|
||||||
<!-- Basic Module -->
|
<!-- Basic Module -->
|
||||||
<div class="tab-pane fade in active" id="basic">
|
<div class="tab-pane fade in active" id="basic">
|
||||||
|
|
||||||
<% if !@member.nil? %>
|
<% if !@member.nil? %>
|
||||||
|
|
||||||
<div class="control-group big-group">
|
<div class="control-group big-group">
|
||||||
<label class="control-label muted"><%= t("personal_plugin_template.author_name_translation") %></label>
|
<label class="control-label muted"><%= t("personal_plugin_template.author_name_translation") %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= @member.name rescue ''%>
|
<%= @member.name rescue ''%>
|
||||||
<%= f.hidden_field :member_profile_id, :value => @member.id %>
|
<%= f.hidden_field :member_profile_id, :value => @member.id %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
||||||
<div class="control-group big-group">
|
<div class="control-group big-group">
|
||||||
<label class="control-label muted"><%= t("personal_plugin_template.member_profile") %></label>
|
<label class="control-label muted"><%= t("personal_plugin_template.member_profile") %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<% members = !@plugin_template.member_profile.nil? ? @plugin_template.member_profile.to_a : [] %>
|
<% members = !@plugin_template.member_profile.nil? ? @plugin_template.member_profile.to_a : [] %>
|
||||||
<%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'plugin_template[member_profile_id]', email_members: members,index:'0',select_name:'member_profile_id'} %>
|
<%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'plugin_template[member_profile_id]', email_members: members,index:'0',select_name:'member_profile_id'} %>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
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>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= 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">
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t(:status) %></label>
|
<label class="control-label muted"><%= t(:status) %></label>
|
||||||
<div class="controls" data-toggle="buttons-checkbox">
|
<div class="controls" data-toggle="buttons-checkbox">
|
||||||
<label class="checkbox inline btn <%= 'active' if @plugin_template.is_hidden? %>">
|
<label class="checkbox inline btn <%= 'active' if @plugin_template.is_hidden? %>">
|
||||||
<%= f.check_box :is_hidden %> <%= t(:hide) %>
|
<%= f.check_box :is_hidden %> <%= t(:hide) %>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Form Actions -->
|
<!-- Form Actions -->
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
|
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
|
||||||
<input type="hidden" name="referer_url" value="<%= request.referer %>">
|
<input type="hidden" name="referer_url" value="<%= request.referer %>">
|
||||||
<%= f.submit t('submit'), class: 'btn btn-primary' %>
|
<%= f.submit t('submit'), class: 'btn btn-primary' %>
|
||||||
<%= 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">
|
||||||
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"),
|
||||||
html = files[type].html,
|
html = files[type].html,
|
||||||
count = parseInt(files[type].count),
|
count = parseInt(files[type].count),
|
||||||
replaceReg = new RegExp("new_" + type + "s","g");
|
replaceReg = new RegExp("new_" + type + "s","g");
|
||||||
html = html.replace(replaceReg,count);
|
html = html.replace(replaceReg,count);
|
||||||
$(".add-target[for=" + type + "]").append(html);
|
$(".add-target[for=" + type + "]").append(html);
|
||||||
count++;
|
count++;
|
||||||
files[type].count = count;
|
files[type].count = count;
|
||||||
return false;
|
return false;
|
||||||
})
|
})
|
||||||
|
|
||||||
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"),
|
||||||
html = links[type].html,
|
html = links[type].html,
|
||||||
count = parseInt(links[type].count),
|
count = parseInt(links[type].count),
|
||||||
replaceReg = new RegExp("new_" + type + "s","g");
|
replaceReg = new RegExp("new_" + type + "s","g");
|
||||||
html = html.replace(replaceReg,count);
|
html = html.replace(replaceReg,count);
|
||||||
$(".add-target[for=" + type + "]").append(html);
|
$(".add-target[for=" + type + "]").append(html);
|
||||||
count++;
|
count++;
|
||||||
links[type].count = count;
|
links[type].count = count;
|
||||||
return false;
|
return false;
|
||||||
})
|
})
|
||||||
$(document).on('click', '.delete_file', function(){
|
$(document).on('click', '.delete_file', function(){
|
||||||
$(this).parents('.input-prepend').remove();
|
$(this).parents('.input-prepend').remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(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);
|
||||||
$(this).parents('.start-line').hide();
|
$(this).parents('.start-line').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
|
@ -1,55 +1,55 @@
|
||||||
<% if form_file.new_record? %>
|
<% if form_file.new_record? %>
|
||||||
<div class="fileupload fileupload-new start-line" data-provides="fileupload">
|
<div class="fileupload fileupload-new start-line" data-provides="fileupload">
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="fileupload fileupload-exist start-line" data-provides="fileupload">
|
<div class="fileupload fileupload-exist start-line" data-provides="fileupload">
|
||||||
<% if form_file.file.blank? %>
|
<% if form_file.file.blank? %>
|
||||||
<%= t(:no_file) %>
|
<%= t(:no_file) %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to content_tag(:i) + form_file.file_identifier, form_file.file.url, {:class => 'file-link file-type', :target => '_blank', :title => form_file.file_identifier} %>
|
<%= link_to content_tag(:i) + form_file.file_identifier, form_file.file.url, {:class => 'file-link file-type', :target => '_blank', :title => form_file.file_identifier} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="input-prepend input-append">
|
<div class="input-prepend input-append">
|
||||||
<label>
|
<label>
|
||||||
<span class="add-on btn btn-file" title='<%= t(:file_) %>'>
|
<span class="add-on btn btn-file" title='<%= t(:file_) %>'>
|
||||||
<i class="icons-paperclip"></i>
|
<i class="icons-paperclip"></i>
|
||||||
<%= f.file_field :file %>
|
<%= f.file_field :file %>
|
||||||
</span>
|
</span>
|
||||||
<div class="uneditable-input input-medium">
|
<div class="uneditable-input input-medium">
|
||||||
<i class="icon-file fileupload-exists"></i>
|
<i class="icon-file fileupload-exists"></i>
|
||||||
<span class="fileupload-preview"><%= (form_file.new_record? || form_file.file.blank?) ? t(:select_file) : t(:change_file) %></span>
|
<span class="fileupload-preview"><%= (form_file.new_record? || form_file.file.blank?) ? t(:select_file) : t(:change_file) %></span>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
<span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span>
|
<span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span>
|
||||||
<span class="tab-content">
|
<span class="tab-content">
|
||||||
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||||
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
|
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
|
||||||
<%= f.fields_for :title_translations do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %>
|
<%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
<span class="add-on icons-pencil" title='<%= t(:description) %>'></span>
|
<span class="add-on icons-pencil" title='<%= t(:description) %>'></span>
|
||||||
<span class="tab-content">
|
<span class="tab-content">
|
||||||
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||||
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
|
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
|
||||||
<%= f.fields_for :description_translations do |f| %>
|
<%= f.fields_for :description_translations do |f| %>
|
||||||
<%= f.text_field locale, :class => "input-medium", placeholder: t(:description), :value => (form_file.description_translations[locale] rescue nil) %>
|
<%= f.text_field locale, :class => "input-medium", placeholder: t(:description), :value => (form_file.description_translations[locale] rescue nil) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<% if form_file.new_record? %>
|
<% if form_file.new_record? %>
|
||||||
<span class="delete_file add-on btn" title="<%= t(:delete_) %>">
|
<span class="delete_file add-on btn" title="<%= t(:delete_) %>">
|
||||||
<a class="icon-trash"></a>
|
<a class="icon-trash"></a>
|
||||||
</span>
|
</span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
|
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
|
||||||
<%= f.hidden_field :id %>
|
<%= f.hidden_field :id %>
|
||||||
<a class="icon-remove"></a>
|
<a class="icon-remove"></a>
|
||||||
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
|
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -1,26 +1,26 @@
|
||||||
<div class="input-prepend input-append start-line">
|
<div class="input-prepend input-append start-line">
|
||||||
<span class="add-on icons-link" title="<%= t(:url) %>"></span>
|
<span class="add-on icons-link" title="<%= t(:url) %>"></span>
|
||||||
<%= f.text_field :url, class: "input-large", placeholder: t(:url) %>
|
<%= f.text_field :url, class: "input-large", placeholder: t(:url) %>
|
||||||
<span class="add-on icons-pencil" title="<%= t(:url_alt) %>"></span>
|
<span class="add-on icons-pencil" title="<%= t(:url_alt) %>"></span>
|
||||||
<span class="tab-content">
|
<span class="tab-content">
|
||||||
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||||
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
|
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
|
||||||
<%= f.fields_for :title_translations do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<%= f.text_field locale, :class => "input-large", placeholder: t(:url_alt), :value => (form_link.title_translations[locale] rescue nil) %>
|
<%= f.text_field locale, :class => "input-large", placeholder: t(:url_alt), :value => (form_link.title_translations[locale] rescue nil) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<% if form_link.new_record? %>
|
<% if form_link.new_record? %>
|
||||||
<span class="delete_link add-on btn" title="<%= t(:delete_) %>">
|
<span class="delete_link add-on btn" title="<%= t(:delete_) %>">
|
||||||
<a class="icon-trash"></a>
|
<a class="icon-trash"></a>
|
||||||
</span>
|
</span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
|
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
|
||||||
<%= f.hidden_field :id %>
|
<%= f.hidden_field :id %>
|
||||||
<a class="icon-remove"></a>
|
<a class="icon-remove"></a>
|
||||||
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
|
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,21 +1,23 @@
|
||||||
<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">
|
||||||
<%= link_to t(:delete_), admin_plugin_template_related_path(plugin_template_related), "data-confirm" => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
|
<%= t(:edit) %>
|
||||||
</td>
|
</a>
|
||||||
</tr>
|
<%= link_to t(:delete_), admin_plugin_template_related_path(plugin_template_related), "data-confirm" => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
|
||||||
<% end %>
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
|
@ -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 %>
|
|
@ -1,59 +1,59 @@
|
||||||
<% # encoding: utf-8 %>
|
<% # encoding: utf-8 %>
|
||||||
<% content_for :page_specific_css do %>
|
<% content_for :page_specific_css do %>
|
||||||
<%= stylesheet_link_tag "lib/main-forms" %>
|
<%= stylesheet_link_tag "lib/main-forms" %>
|
||||||
<%= stylesheet_link_tag "lib/fileupload" %>
|
<%= stylesheet_link_tag "lib/fileupload" %>
|
||||||
<%= stylesheet_link_tag "lib/main-list" %>
|
<%= stylesheet_link_tag "lib/main-list" %>
|
||||||
<%= stylesheet_link_tag "lib/main-form-col2" %>
|
<%= stylesheet_link_tag "lib/main-form-col2" %>
|
||||||
<style>
|
<style>
|
||||||
.graph-type {
|
.graph-type {
|
||||||
margin-right: 10px !important;
|
margin-right: 10px !important;
|
||||||
}
|
}
|
||||||
.analysis-show-area{
|
.analysis-show-area{
|
||||||
margin-top: 25px;
|
margin-top: 25px;
|
||||||
}
|
}
|
||||||
.role {
|
.role {
|
||||||
margin: 15px auto;
|
margin: 15px auto;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
height: 400px;
|
height: 400px;
|
||||||
}
|
}
|
||||||
.role h3{
|
.role h3{
|
||||||
border-bottom: 1px solid #000;
|
border-bottom: 1px solid #000;
|
||||||
}
|
}
|
||||||
.role .graph-area{
|
.role .graph-area{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.role .graph-area .loader {
|
.role .graph-area .loader {
|
||||||
margin-top: 170px;
|
margin-top: 170px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% content_for :page_specific_javascript do %>
|
<% content_for :page_specific_javascript do %>
|
||||||
<%= javascript_include_tag "//www.google.com/jsapi", "chartkick"%>
|
<%= javascript_include_tag "//www.google.com/jsapi", "chartkick"%>
|
||||||
<%= javascript_include_tag "justgage.1.0.1.min" %>
|
<%= javascript_include_tag "justgage.1.0.1.min" %>
|
||||||
<%= javascript_include_tag "raphael.2.1.0.min" %>
|
<%= javascript_include_tag "raphael.2.1.0.min" %>
|
||||||
<%= javascript_include_tag "validator" %>
|
<%= javascript_include_tag "validator" %>
|
||||||
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
|
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
|
||||||
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
|
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div id="analysis-area">
|
<div id="analysis-area">
|
||||||
<div class="analysis-form">
|
<div class="analysis-form">
|
||||||
<form id="analysis-form" action="" class="form-horizontal main-forms">
|
<form id="analysis-form" action="" class="form-horizontal main-forms">
|
||||||
<div class="input-area">
|
<div class="input-area">
|
||||||
<div class="control-group input-title">
|
<div class="control-group input-title">
|
||||||
<label class="control-label muted"><%= t("personal_plugin_template.analysis_field_name") %> : </label>
|
<label class="control-label muted"><%= t("personal_plugin_template.analysis_field_name") %> : </label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
analysis_field_input_fields
|
analysis_field_input_fields
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<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>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button id="generate_graph" class="btn btn-info">Graphs</button>
|
<button id="generate_graph" class="btn btn-info">Graphs</button>
|
||||||
|
@ -73,19 +73,18 @@ parse_again_end
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
var late_hour = -(Math.floor(now.getTimezoneOffset() / 60));
|
var late_hour = -(Math.floor(now.getTimezoneOffset() / 60));
|
||||||
var minute = -(now.getTimezoneOffset() % 60);
|
var minute = -(now.getTimezoneOffset() % 60);
|
||||||
var sign = (late_hour < 0) ? "-" : "+";
|
var sign = (late_hour < 0) ? "-" : "+";
|
||||||
var time_zone_string = sign + ("00" + Math.abs(late_hour)).slice(-2) + ":"+ ("00" + Math.abs(minute)).slice(-2);
|
var time_zone_string = sign + ("00" + Math.abs(late_hour)).slice(-2) + ":"+ ("00" + Math.abs(minute)).slice(-2);
|
||||||
var form = new FormValidator($("#analysis-form")),
|
var form = new FormValidator($("#analysis-form")),
|
||||||
roleArea = $("#analysis-area .analysis-show-area"),
|
roleArea = $("#analysis-area .analysis-show-area"),
|
||||||
totalRoles = roleArea.find(".role").length;
|
totalRoles = roleArea.find(".role").length;
|
||||||
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;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -116,8 +115,4 @@ parse_again_end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,66 +7,66 @@ 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)
|
||||||
end
|
end
|
||||||
@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|
|
||||||
row << plugin_template_files.collect{|l| l.description_translations[locale]}.join(";")
|
row << plugin_template_files.collect{|l| l.description_translations[locale]}.join(";")
|
||||||
end
|
end
|
||||||
@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
|
||||||
end
|
end
|
|
@ -1,5 +1,5 @@
|
||||||
<%= form_for @plugin_template, url: admin_plugin_template_path(@plugin_template), html: {class: "form-horizontal main-forms previewable"} do |f| %>
|
<%= form_for @plugin_template, url: admin_plugin_template_path(@plugin_template), html: {class: "form-horizontal main-forms previewable"} do |f| %>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<%= render partial: 'form', locals: {f: f} %>
|
<%= render partial: 'form', locals: {f: f} %>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<% end %>
|
<% end %>
|
|
@ -1,94 +1,82 @@
|
||||||
<% content_for :page_specific_css do %>
|
<% content_for :page_specific_css do %>
|
||||||
<%= stylesheet_link_tag "lib/main-forms" %>
|
<%= stylesheet_link_tag "lib/main-forms" %>
|
||||||
<%= stylesheet_link_tag "lib/main-list" %>
|
<%= stylesheet_link_tag "lib/main-list" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= form_for(:plugin_template_intro, :url => update_frontend_setting_admin_plugin_templates_path, :method => "post", html: {class: "form-horizontal main-forms previewable"} ) do |f| %>
|
<%= form_for(:plugin_template_intro, :url => update_frontend_setting_admin_plugin_templates_path, :method => "post", html: {class: "form-horizontal main-forms previewable"} ) do |f| %>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<!-- Input Area -->
|
<!-- Input Area -->
|
||||||
<div class="input-area">
|
<div class="input-area">
|
||||||
|
|
||||||
<!-- Module Tabs -->
|
<!-- Module Tabs -->
|
||||||
<div class="nav-name"><strong><%= t("module_name.personal_plugin_template") %></strong></div>
|
<div class="nav-name"><strong><%= t("module_name.personal_plugin_template") %></strong></div>
|
||||||
<ul class="nav nav-pills module-nav">
|
<ul class="nav nav-pills module-nav">
|
||||||
<li></li>
|
<li></li>
|
||||||
<li class="active">
|
<li class="active">
|
||||||
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
|
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- Module -->
|
<!-- Module -->
|
||||||
<div class="tab-content module-area">
|
<div class="tab-content module-area">
|
||||||
<!-- Basic Module -->
|
<!-- Basic Module -->
|
||||||
<div class="tab-pane fade in active" id="basic">
|
<div class="tab-pane fade in active" id="basic">
|
||||||
<% if !@member.blank? %>
|
<% if !@member.blank? %>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t("personal_plugins.author") %></label>
|
<label class="control-label muted"><%= t("personal_plugins.author") %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= @member.name rescue ''%>
|
<%= @member.name rescue ''%>
|
||||||
<%= f.hidden_field :member_profile_id, :value => @member.id %>
|
<%= f.hidden_field :member_profile_id, :value => @member.id %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- frontend_page -->
|
<!-- frontend_page -->
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t("personal_plugins.frontend_page") %></label>
|
<label class="control-label muted"><%= t("personal_plugins.frontend_page") %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.check_box :brief_intro, :checked => @intro.brief_intro %> <%= t("personal_plugins.brief_intro") %>
|
<%= f.check_box :brief_intro, :checked => @intro.brief_intro %> <%= t("personal_plugins.brief_intro") %>
|
||||||
<%= f.check_box :complete_list, :checked => @intro.complete_list %> <%= t("personal_plugins.complete_list") %>
|
<%= f.check_box :complete_list, :checked => @intro.complete_list %> <%= t("personal_plugins.complete_list") %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 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">
|
||||||
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||||
<li class="<%= 'active' if i == 0 %>">
|
<li class="<%= 'active' if i == 0 %>">
|
||||||
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
|
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- Language -->
|
<!-- Language -->
|
||||||
<div class="tab-content language-area">
|
<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" : '' %>">
|
||||||
|
<!-- Content -->
|
||||||
|
<div class="control-group input-content">
|
||||||
|
<label class="control-label muted"><%= t(:content) %></label>
|
||||||
|
<div class="controls">
|
||||||
|
<div class="textarea">
|
||||||
|
<%= f.fields_for :text_translations do |f| %>
|
||||||
|
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@intro.text_translations[locale] rescue nil) %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
<!-- Form Actions -->
|
||||||
|
<div class="form-actions">
|
||||||
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
|
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
|
||||||
|
<%= hidden_field_tag :member_profile_id, @member.id.to_s %>
|
||||||
<!-- Content -->
|
<%= f.submit t('submit'), class: 'btn btn-primary' %>
|
||||||
<div class="control-group input-content">
|
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||||
<label class="control-label muted"><%= t(:content) %></label>
|
</div>
|
||||||
<div class="controls">
|
</fieldset>
|
||||||
<div class="textarea">
|
|
||||||
<%= f.fields_for :text_translations do |f| %>
|
|
||||||
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@intro.text_translations[locale] rescue nil) %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Form Actions -->
|
|
||||||
<div class="form-actions">
|
|
||||||
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
|
|
||||||
<%= hidden_field_tag :member_profile_id, @member.id.to_s %>
|
|
||||||
<%= f.submit t('submit'), class: 'btn btn-primary' %>
|
|
||||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
<% end %>
|
<% end %>
|
|
@ -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" %>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<%= form_for @plugin_template, url: admin_plugin_templates_path, html: {class: "form-horizontal main-forms previewable"} do |f| %>
|
<%= form_for @plugin_template, url: admin_plugin_templates_path, html: {class: "form-horizontal main-forms previewable"} do |f| %>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<%= render partial: 'form', locals: {f: f} %>
|
<%= render partial: 'form', locals: {f: f} %>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<% end %>
|
<% end %>
|
|
@ -1,72 +1,72 @@
|
||||||
<% content_for :page_specific_javascript do %>
|
<% content_for :page_specific_javascript do %>
|
||||||
<%= javascript_include_tag "lib/jquery-ui-sortable.min" %>
|
<%= javascript_include_tag "lib/jquery-ui-sortable.min" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.element{
|
.element{
|
||||||
background: #FFF;
|
background: #FFF;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
border: 1px solid #DDD;
|
border: 1px solid #DDD;
|
||||||
}
|
}
|
||||||
.detail{
|
.detail{
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
min-height: 250px;
|
min-height: 250px;
|
||||||
}
|
}
|
||||||
.totle{
|
.totle{
|
||||||
margin-bottom: 25px;
|
margin-bottom: 25px;
|
||||||
}
|
}
|
||||||
.totle span{
|
.totle span{
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
parse_again_start
|
parse_again_start
|
||||||
<div class="element span4">
|
<div class="element span4">
|
||||||
<div class="detail w-a h-a">
|
<div class="detail w-a h-a">
|
||||||
<p class="totle">
|
<p class="totle">
|
||||||
<a class="btn btn-small btn-primary pull-right" href="<%= new_admin_plugin_template_related_path %>#plugin_template_related_modal" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
|
<a class="btn btn-small btn-primary pull-right" href="<%= new_admin_plugin_template_related_path %>#plugin_template_related_modal" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
|
||||||
<span><%= t("personal_plugin_template.plugin_template_related.plugin_template_related_main_field") %></span>
|
<span><%= t("personal_plugin_template.plugin_template_related.plugin_template_related_main_field") %></span>
|
||||||
</p>
|
</p>
|
||||||
<div class="detal-list my_scroll">
|
<div class="detal-list my_scroll">
|
||||||
<div class="scrollbar">
|
<div class="scrollbar">
|
||||||
<div class="track">
|
<div class="track">
|
||||||
<div class="thumb">
|
<div class="thumb">
|
||||||
<div class="end"></div>
|
<div class="end"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="viewport">
|
<div class="viewport">
|
||||||
<div class="overview">
|
<div class="overview">
|
||||||
<table id="plugin_template_relateds" class="table table-striped">
|
<table id="plugin_template_relateds" class="table table-striped">
|
||||||
<%= render :partial => 'plugin_template_related', :locals => {:@plugin_template_relateds => @plugin_template_relateds} %>
|
<%= render :partial => 'plugin_template_related', :locals => {:@plugin_template_relateds => @plugin_template_relateds} %>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
parse_again_end
|
parse_again_end
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
parse_again_start
|
parse_again_start
|
||||||
<div>
|
<div>
|
||||||
<div style="display:none;" class="modal" id="plugin_template_related_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
<div style="display:none;" class="modal" id="plugin_template_related_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$("#plugin_template_relateds tbody").sortable({
|
$("#plugin_template_relateds tbody").sortable({
|
||||||
update : function(){
|
update : function(){
|
||||||
var data = {};
|
var data = {};
|
||||||
$("#plugin_template_relateds tbody tr").each(function(i){
|
$("#plugin_template_relateds tbody tr").each(function(i){
|
||||||
data[$(this).data("type-id")] = i;
|
data[$(this).data("type-id")] = i;
|
||||||
})
|
})
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : "/admin/plugin_template_relateds/update_order",
|
url : "/admin/plugin_template_relateds/update_order",
|
||||||
type : "post",
|
type : "post",
|
||||||
data : {"order" : data}
|
data : {"order" : data}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
parse_again_end
|
parse_again_end
|
|
@ -1,75 +1,75 @@
|
||||||
<% content_for :page_specific_css do %>
|
<% content_for :page_specific_css do %>
|
||||||
<%= stylesheet_link_tag "lib/list-check" %>
|
<%= stylesheet_link_tag "lib/list-check" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% content_for :page_specific_javascript do %>
|
<% content_for :page_specific_javascript do %>
|
||||||
<%= javascript_include_tag "lib/list-check" %>
|
<%= javascript_include_tag "lib/list-check" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%
|
<%
|
||||||
if has_access?
|
if has_access?
|
||||||
@plugin_templates = PluginTemplate.where(member_profile_id: @member.id).sort_hash.page(params[:page]).per(10)
|
@plugin_templates = PluginTemplate.where(member_profile_id: @member.id).sort_hash.page(params[:page]).per(10)
|
||||||
else
|
else
|
||||||
@plugin_templates = PluginTemplate.where(is_hidden: false, member_profile_id: @member.id).sort_hash.page(params[:page]).per(10)
|
@plugin_templates = PluginTemplate.where(is_hidden: false, member_profile_id: @member.id).sort_hash.page(params[:page]).per(10)
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<% if has_access? %>
|
<% if has_access? %>
|
||||||
<div class="list-active">
|
<div class="list-active">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<%= link_to('Hide', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-hide", :rel => toggle_hide_admin_plugin_templates_path(member_profile_id: @member.id.to_s, disable: 'true') ) %>
|
<%= link_to('Hide', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-hide", :rel => toggle_hide_admin_plugin_templates_path(member_profile_id: @member.id.to_s, disable: 'true') ) %>
|
||||||
<%= link_to('Show', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-show", :rel => toggle_hide_admin_plugin_templates_path(member_profile_id: @member.id.to_s, disable: 'false') ) %>
|
<%= link_to('Show', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-show", :rel => toggle_hide_admin_plugin_templates_path(member_profile_id: @member.id.to_s, disable: 'false') ) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
<table class="table table-condensed table-striped main-list">
|
<table class="table table-condensed table-striped main-list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if has_access? %>
|
<% if has_access? %>
|
||||||
<th><input type="checkbox" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
parse_again_start
|
parse_again_start
|
||||||
<th><%= t('personal_plugin_template.backend_profile_fields') %></th>
|
<th><%= t('personal_plugin_template.backend_profile_fields') %></th>
|
||||||
parse_again_end
|
parse_again_end
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @plugin_templates.each do |plugin_template| %>
|
<% @plugin_templates.each do |plugin_template| %>
|
||||||
<tr id="<%= dom_id plugin_template %>" class="<%= plugin_template.is_hidden ? "checkHide" : "" %>">
|
<tr id="<%= dom_id plugin_template %>" class="<%= plugin_template.is_hidden ? "checkHide" : "" %>">
|
||||||
<% if has_access? %>
|
<% if has_access? %>
|
||||||
<td>
|
<td>
|
||||||
<%= check_box_tag 'to_change[]', plugin_template.id.to_s, false, :class => "list-check" %>
|
<%= check_box_tag 'to_change[]', plugin_template.id.to_s, false, :class => "list-check" %>
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
parse_again_start
|
parse_again_start
|
||||||
<td>backend_profile_fields_contents</td>
|
<td>backend_profile_fields_contents</td>
|
||||||
parse_again_end
|
parse_again_end
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
<div class="bottomnav clearfix">
|
<div class="bottomnav clearfix">
|
||||||
<% if has_access? %>
|
<% if has_access? %>
|
||||||
<div class="action pull-right">
|
<div class="action pull-right">
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-edit') +' '+ t('setting'),'/admin/members/'+@member.to_param+'/plugin_templates/frontend_setting', :class => 'btn btn-primary' %>
|
<%= link_to content_tag(:i, nil, :class => 'icon-edit') +' '+ t('setting'),'/admin/members/'+@member.to_param+'/plugin_templates/frontend_setting', :class => 'btn btn-primary' %>
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') +' '+ t('new_'),
|
<%= link_to content_tag(:i, nil, :class => 'icon-plus') +' '+ t('new_'),
|
||||||
'/admin/members/'+@member.to_param+'/plugin_templates/new', :class => 'btn btn-primary' %>
|
'/admin/members/'+@member.to_param+'/plugin_templates/new', :class => 'btn btn-primary' %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="pagination pagination-centered">
|
<div class="pagination pagination-centered">
|
||||||
<%= paginate @plugin_templates, :params => {:direction => params[:direction], :sort => params[:sort] } %>
|
<%= paginate @plugin_templates, :params => {:direction => params[:direction], :sort => params[:sort] } %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
|
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
<h3><%= t(:sure?) %></h3>
|
<h3><%= t(:sure?) %></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= t(:close) %></button>
|
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= t(:close) %></button>
|
||||||
<button class="delete-item btn btn-danger"><%= t(:submit) %></button>
|
<button class="delete-item btn btn-danger"><%= t(:submit) %></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -2,31 +2,31 @@ Rails.application.routes.draw do
|
||||||
locales = Site.find_by(site_active: true).in_use_locales rescue I18n.available_locales
|
locales = Site.find_by(site_active: true).in_use_locales rescue I18n.available_locales
|
||||||
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
get 'plugin_template_setting' => "plugin_templates#setting"
|
get 'plugin_template_setting' => "plugin_templates#setting"
|
||||||
resources :plugin_templates do
|
resources :plugin_templates do
|
||||||
collection do
|
collection do
|
||||||
get 'toggle_hide' => 'plugin_templates#toggle_hide'
|
get 'toggle_hide' => 'plugin_templates#toggle_hide'
|
||||||
get 'analysis'
|
get 'analysis'
|
||||||
get 'analysis_report'
|
get 'analysis_report'
|
||||||
get "download_excel"
|
get "download_excel"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :members do
|
resources :members do
|
||||||
collection do
|
collection do
|
||||||
scope '(:name-:uid)' do
|
scope '(:name-:uid)' do
|
||||||
resources :plugin_templates do
|
resources :plugin_templates do
|
||||||
collection do
|
collection do
|
||||||
get 'frontend_setting' => 'plugin_templates#frontend_setting'
|
get 'frontend_setting' => 'plugin_templates#frontend_setting'
|
||||||
post 'update_frontend_setting' => 'plugin_templates#update_frontend_setting'
|
post 'update_frontend_setting' => 'plugin_templates#update_frontend_setting'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
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