diff --git a/README.rdoc b/README.rdoc index 1ec78f8..12404e2 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,3 +1,3 @@ -= PersonalCourse += PersonalPluginGenerator This project rocks and uses MIT-LICENSE. \ No newline at end of file diff --git a/app/controllers/admin/personal_plugin_fields_controller.rb b/app/controllers/admin/personal_plugin_fields_controller.rb index 4d6201b..f0ad69a 100644 --- a/app/controllers/admin/personal_plugin_fields_controller.rb +++ b/app/controllers/admin/personal_plugin_fields_controller.rb @@ -39,7 +39,7 @@ class Admin::PersonalPluginFieldsController < OrbitAdminController redirect_to params[:referer_url] end def generate_plugin - template_dir_path = File.expand_path("../../../views/admin/personal_plugin_fields/template_generator/", __FILE__) + "/" + template_dir_path = File.expand_path("../../../../template_generator/", __FILE__) + "/" cp_template_dir_path = "#{Rails.root}/tmp/#{@personal_plugin_field.module_name}/" FileUtils.rm_rf(cp_template_dir_path) FileUtils.cp_r(template_dir_path,cp_template_dir_path) @@ -78,51 +78,159 @@ class Admin::PersonalPluginFieldsController < OrbitAdminController blank_text = yml_text.split(/(\r\n|\n)/).select{|t| t.include?"col_name_translate_yaml"}.first.split('col_name_translate_yaml').first rescue "" col_name_translate_yaml = col_name_translate_yaml.gsub("\n","\n#{blank_text}") yml_text = yml_text.gsub("col_name_translate_yaml",col_name_translate_yaml) + yml_text = yml_text.gsub("personal_plugin_template_translate",@personal_plugin_field.title_translations[locale]) File.open(yml_file,'w+') do |f| f.write(yml_text) end end - plugin_template_related_files_fields = @personal_plugin_field.primary_modal_fields.select{|field_value| field_value[:field_type] == "file" rescue false}.map{|v| v[:field_name]} - plugin_template_related_files_fields = plugin_template_related_files_fields.map{|field_name| - "has_many :#{field_name.pluralize}, :dependent => :destroy, :autosave => true\n" + - "accepts_nested_attributes_for :#{field_name.pluralize}, :allow_destroy => true\n" - }.join("\n") + @blank_text = " " + slug_title = @personal_plugin_field.primary_modal_fields.select{|field_value| field_value[:slug_title] == "1" rescue false}.first[:field_name].to_s rescue "" + plugin_template_related_files = @personal_plugin_field.primary_modal_fields.select{|field_value| field_value[:field_type] == "file" rescue false}.map{|v| v[:field_name]} + plugin_template_related_files_text = plugin_template_related_files.to_s + plugin_template_related_files_fields = plugin_template_related_files.map{|field_name| + "has_many :#{field_name.pluralize}, :dependent => :destroy, :autosave => true\r\n" + + "#{@blank_text}accepts_nested_attributes_for :#{field_name.pluralize}, :allow_destroy => true" + }.join("\r\n#{@blank_text}") + plugin_template = @personal_plugin_field.primary_modal_name + backend_index_fields = @personal_plugin_field.backend_fields["index"] rescue [] + backend_index_fields_contents = backend_index_fields.map do |field_name| + if field_name == slug_title + "<%= link_to #{plugin_template}.#{field_name}, page_for_#{plugin_template}(#{plugin_template}), target: \"blank\" %>\r\n " + + "
+ +
\r\n " + else + "<%= #{plugin_template}.#{field_name} %>" + end + end col_name_to_show = @personal_plugin_field.frontend_fields["member_show"] rescue [] col_name_to_show_in_show_page = @personal_plugin_field.frontend_fields["show"] rescue [] col_name_to_show_in_index_page = @personal_plugin_field.frontend_fields["index"] rescue [] extra_translate_title = col_name_to_show_in_index_page.map{|field_name| #在個人外掛前台index頁面的欄位翻譯名稱hash ["th-#{field_name}","I18n.locale(\"#{@personal_plugin_field.module_name}.#{field_name}\")"] - }.to_h - col_fields = "" - col_fields = @personal_plugin_field.primary_modal_fields.map do |field_value| - type = "String" if field_value[:field_type] - field_text = "field :#{field_value[:field_name]}, :type => #{type}, :default => {}" - field_text += ", :localize => true" if field_value[:localize] + } + col_fields = get_fields_text(@personal_plugin_field.primary_modal_fields) + col_related_fields = @personal_plugin_field.related_modal_fields.map{|field_values| get_fields_text(field_values)} + locale_fields = [] + none_locale_fields = [] + locale_fields_input_fields = [] + none_locale_fields_input_fields = [] + plugin_template_related = @personal_plugin_field.related_modal_name.select{|n| n.present?} + plugin_template_related_main_field = @personal_plugin_field.related_modal_fields.map{|field_values| field_values.map{|field_value| field_value[:field_name]}.select{|t| t.present?}.first } + @personal_plugin_field.primary_modal_fields.each do |field_value| + field_name = field_value[:field_name] + field_type = field_value[:field_type] + next if field_name.blank? + next if field_type == "file" + if (field_value[:localize] == "1" rescue false) + locale_fields << field_name + input_field = generate_input_field(field_type,field_name,true) + locale_fields_input_fields << input_field + else + none_locale_fields << field_name + input_field = generate_input_field(field_type,field_name) + none_locale_fields_input_fields << input_field + end end - col_fields = col_fields.join("\r\n ") - col_related_fields = "" @match_pattern = {"personal_plugin_template" => @personal_plugin_field.module_name, - "plugin_template" => @personal_plugin_field.primary_modal_name, - "plugin_template_related" => @personal_plugin_field.related_modal_name.select{|n| n.present?}, + "plugin_template" => plugin_template, + "plugin_template_related" => plugin_template_related, "plugin_template_related_files_fields" => plugin_template_related_files_fields, "col_name_to_show" => col_name_to_show.to_s, #在會員前台頁面的顯示欄位 "col_name_to_show_in_show_page" => col_name_to_show_in_show_page.to_s, #在個人外掛前台show頁面的顯示欄位 "col_name_to_show_in_index_page" => col_name_to_show_in_index_page.to_s, #在個人外掛前台index頁面的顯示欄位 - "extra_translate_title" => extra_translate_title.to_s, - "col_fields" => col_fields + "extra_translate_title" => extra_translate_title.map{|k,v| "\"#{k}\" => #{v}"}.join(", ").prepend("{").concat("}"), + "col_fields" => col_fields, + "col_related_fields" => col_related_fields, + "plugin_template_file" => plugin_template_related_files, + "plugin_template_sort_hash" => "nil", + "col_name_to_show_in_index_page_arr" => col_name_to_show_in_index_page, + "backend_index_fields" => backend_index_fields, + "slug_title" => slug_title, + "backend_index_fields_contents" => backend_index_fields_contents, + "plugin_template_related_files_text" => plugin_template_related_files_text, + "locale_fields" => locale_fields, + "none_locale_fields" => none_locale_fields, + "none_locale_fields_input_fields" => none_locale_fields_input_fields, + "locale_fields_input_fields" => locale_fields_input_fields, + "plugin_template_related_main_field" => plugin_template_related_main_field } - @match_pattern = @match_pattern.sort_by{|k,v| -k.length}.sort_by{|k,v| (v.class != Array) ? 1 : 0} + max_length = @match_pattern.keys.map{|k| k.length}.max + @match_pattern = @match_pattern.sort_by{|k,v| (v.class != Array) ? (max_length - k.length) : -k.length} + @logs = [] replace_files(files) #Thread.new do dirs.each do |dir| replace_dir(dir) end #end - render :html => @match_pattern + render :html => @logs.join("
").html_safe#@match_pattern + end + def generate_input_field(field_type,field_name,localize = false) + personal_plugin_template = @personal_plugin_field.module_name + plugin_template = @personal_plugin_field.primary_modal_name + input_field = "" + field_value_text = "@#{plugin_template}.#{field_name}" + field_name_text = ":#{field_name}" + field_name_text = "locale" if localize + if localize + field_value_text = "@#{plugin_template}.#{field_name}_translations[locale]" + end + case field_type + when "year" + input_field = "<%= select_year((#{field_value_text} ? #{field_value_text}.to_i : DateTime.now.year), {:start_year => DateTime.now.year + 5, :end_year => 1930}, {:name => '#{plugin_template}[#{field_name}]',:class => 'span1'} ) %>" + when "date" + when "time" + when "date_time" + input_field = "<%= f.text_area #{field_name_text}, class: \"input-block-level ckeditor\", placeholder: t(\"#{personal_plugin_template}.#{field_name}\"), value: (#{field_value_text} rescue nil) %>" + when "text_editor" + else #text_field + input_field = "<%= f.text_field #{field_name_text}, class: \"input-block-level\", placeholder: t(\"#{personal_plugin_template}.#{field_name}\"), value: (#{field_value_text} rescue nil) %>" + end + if localize + input_field.prepend("<%= f.fields_for :#{field_name}_translations do |f| %>\r\n ").concat("<% end %>\r\n ") + end + input_field + end + def get_fields_text(field_values) + fields_text = field_values.map do |field_value| + next if field_value[:field_type] == "file" || field_value[:field_name].blank? + type = "String" + default = "\"\"" + case field_value[:field_type] + when "date" + type = "Date" + default = "Date.parse(DateTime.now.to_s)" + when "time" + type = "Time" + default = "Time.now" + when "date_time" + type = "DateTime" + default = "DateTime.now" + end + no_localize_types = ["date","time","date_time"] + field_text = "field :#{field_value[:field_name]}, :type => #{type}, :default => #{default}" + field_text += ", :localize => true" if field_value[:localize] && !no_localize_types.include?(field_value[:field_type]) + field_text += ", as: :slug_title" if field_value[:slug_title] + end + fields_text.join("\r\n#{@blank_text}") + end + def replace_dirs(dirs) + dirs.each do |dir| + replace_dir(dir) + end end def replace_dir(dir) dir = replace_file(dir) - return true if dir.blank? + return true if dir.select{|d| d.present?}.blank? + if dir.count > 1 + replace_dirs(dir) + else + dir = dir[0] + end sub_dirs = Dir.glob("#{dir}/*/") files = Dir.glob("#{dir}/*").select { |fn| File.file?(fn) } replace_files(files) @@ -147,49 +255,81 @@ class Admin::PersonalPluginFieldsController < OrbitAdminController if new_filename.blank? FileUtils.rm_rf("#{path}/#{file_name}") elsif file_name != new_filename - FileUtils.mv("#{path}/#{file_name}", "#{path}/#{new_filename}") + if new_filename.class == Array + new_filename.each do |f| + FileUtils.cp_r("#{path}/#{file_name}", "#{path}/#{f}") + end + FileUtils.rm_rf("#{path}/#{file_name}") + else + FileUtils.mv("#{path}/#{file_name}", "#{path}/#{new_filename}") + end end if new_filename.blank? - return "" + return [""] else + is_array = new_filename.class == Array + new_filename = Array(new_filename) if isfile - file_text = File.read("#{path}/#{new_filename}") - file_text = replace_text_with_pattern(file_text) - File.open("#{path}/#{new_filename}",'w+'){|f| f.write(file_text)} + new_filename.each_with_index do |sub_file,i| + next if File.extname(sub_file).match(/(png|jpg)/i) + file_text = File.read("#{path}/#{sub_file}") + if is_array + file_text = replace_text_with_pattern(file_text,false,i) + else + file_text = replace_text_with_pattern(file_text) + end + File.open("#{path}/#{sub_file}",'w+'){|f| f.write(file_text)} + end end - return "#{path}/#{new_filename}" + return new_filename.map{|sub_file| "#{path}/#{sub_file}" if sub_file.present?} end end def replace_text_with_pattern(text,is_file=false,i = nil) new_text = text @match_pattern.each do |k,v| + next if !include_key(new_text,k) vv = v - vv = vv[i] if i + vv = vv[i] if i && vv.class == Array if vv.class == String - if i && vv == "" + if i && vv == "" && is_file new_text = "" - puts k else new_text = gsub_text_by_key_value(new_text,k,vv) end elsif vv.class == Array - if is_file && v.count == 0 && (new_text.include?(k) || new_text.include?(k.classify)) - new_text = "" - break + if is_file + if v.count == 0 + new_text = "" + break + else + new_text = vv.map{|sub_v| gsub_text_by_key_value(new_text,k,sub_v)} + break + end end - new_text = new_text.gsub(/<%[ ]*parse_again_start[ ]*%>((?:(?!<%[ ]*parse_again_start[ ]*%>).)+)<%[ ]*parse_again_end[ ]*%>/m) do |ff| - puts ff - ff = ff.strip - result = (0...vv.count).map {|i| replace_text_with_pattern(ff,false,i) }.join("\r\n") + new_text = new_text.gsub(/<% parse_again_start %>((?:(?!<% parse_again_start %>).)+)<% parse_again_end %>/m) do |ff| + parse_content = $1 #last match + result = ff + if include_key($1,k) + start_index = 0 + end_index = parse_content.length + start_index = 2 if parse_content[0..1] == "\r\n" + end_index = end_index - 2 if parse_content[(end_index - 2)..(end_index - 1)] == "\r\n" + parse_content = parse_content.slice(start_index,end_index) + result = (0...vv.count).map {|i| replace_text_with_pattern(parse_content,false,i) }.join("") + end + result end end end return new_text end + def include_key(text,key) + return text.include?(key) || text.include?(key.classify) + end def gsub_text_by_key_value(text,k,v) text = text.gsub(k + "s",v.pluralize) text = text.gsub(k ,v ) - text = text.gsub(k.classify + "s",v.pluralize.classify) + text = text.gsub(k.classify + "s",v.classify.pluralize) text = text.gsub(k.classify,v.classify) end private diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/_course_category.html.erb b/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/_course_category.html.erb deleted file mode 100644 index 7e4bd83..0000000 --- a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/_course_category.html.erb +++ /dev/null @@ -1,8 +0,0 @@ - - <%= course_category.title %> - - - <%= t(:edit) %> - <%= link_to t(:delete_), admin_course_category_path(course_category), "data-confirm" => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %> - - \ No newline at end of file diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/_plugin_templates.html.erb b/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/_plugin_templates.html.erb deleted file mode 100644 index 772c7c4..0000000 --- a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/_plugin_templates.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<% @courses.each do |course| %> - - <%= course.year %> - - <%= link_to course.title, page_for_course(course), target: "blank"%> -
- -
- - <%= link_to course.course_assignments.count,course_assignments_admin_courses_path(:id=> course.id) %> - <%= course.member_profile.name rescue "" %> - <%= course.display_students rescue "" %> - -<% end %> \ No newline at end of file diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/course_assignments.html.erb b/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/course_assignments.html.erb deleted file mode 100644 index fe349d6..0000000 --- a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/course_assignments.html.erb +++ /dev/null @@ -1,82 +0,0 @@ -

<%=t("personal_course.assignment_management")%>-<%=@course.title rescue "" %>

-<% student_assignment = (StudentAssignment rescue nil) %> - - - - - - - - - <% if !student_assignment.nil? %> - - <% end %> - - - - <% @course_assignments.each do |course_assignment| %> - - - - - - - <% if !student_assignment.nil? %> - - <% end %> - - <% end %> - -
<%= t("personal_course.name") %><%= t("personal_course.detail") %><%= t("personal_course.course_attachment") %> - <%= t("personal_course.assign_date") %> - - - - <%= t("personal_course.deadline") %> - - - <%=t("personal_course.already_deliver")%>
- <%= course_assignment.name %> -
- -
-
<%= course_assignment.detail.html_safe %><%= course_assignment.display_attachments %><%= course_assignment.display_assign_date %><%= course_assignment.display_deadline %><%= link_to course_assignment.deliver_count, show_assignments_admin_courses_path(:name=>course_assignment.name, :uid => course_assignment.uid ) %>
- -
-
- <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:new_), new_assignment_admin_courses_path(:id=>params[:id]), :class => 'btn btn-primary' %> -
- -
- \ No newline at end of file diff --git a/app/views/admin/personal_plugin_fields/template_generator/lib/personal_plugin_template/version.rb b/app/views/admin/personal_plugin_fields/template_generator/lib/personal_plugin_template/version.rb deleted file mode 100644 index c446c96..0000000 --- a/app/views/admin/personal_plugin_fields/template_generator/lib/personal_plugin_template/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -module PersonalCourse - VERSION = "0.0.1" -end diff --git a/app/views/admin/personal_plugin_fields/template_generator/.gitignore b/template_generator/.gitignore similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/.gitignore rename to template_generator/.gitignore diff --git a/app/views/admin/personal_plugin_fields/template_generator/Gemfile b/template_generator/Gemfile similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/Gemfile rename to template_generator/Gemfile diff --git a/app/views/admin/personal_plugin_fields/template_generator/MIT-LICENSE b/template_generator/MIT-LICENSE similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/MIT-LICENSE rename to template_generator/MIT-LICENSE diff --git a/app/views/admin/personal_plugin_fields/template_generator/README.rdoc b/template_generator/README.rdoc similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/README.rdoc rename to template_generator/README.rdoc diff --git a/app/views/admin/personal_plugin_fields/template_generator/Rakefile b/template_generator/Rakefile similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/Rakefile rename to template_generator/Rakefile diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/assets/images/personal_course/.keep b/template_generator/app/assets/images/personal_course/.keep similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/assets/images/personal_course/.keep rename to template_generator/app/assets/images/personal_course/.keep diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/assets/javascripts/personal_course/application.js b/template_generator/app/assets/javascripts/personal_course/application.js similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/assets/javascripts/personal_course/application.js rename to template_generator/app/assets/javascripts/personal_course/application.js diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/assets/stylesheets/personal_course/application.css b/template_generator/app/assets/stylesheets/personal_course/application.css similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/assets/stylesheets/personal_course/application.css rename to template_generator/app/assets/stylesheets/personal_course/application.css diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/controllers/admin/plugin_template_relateds_controller.rb b/template_generator/app/controllers/admin/plugin_template_relateds_controller.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/controllers/admin/plugin_template_relateds_controller.rb rename to template_generator/app/controllers/admin/plugin_template_relateds_controller.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/controllers/admin/plugin_templates_controller.rb b/template_generator/app/controllers/admin/plugin_templates_controller.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/controllers/admin/plugin_templates_controller.rb rename to template_generator/app/controllers/admin/plugin_templates_controller.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/controllers/personal_plugin_templates_controller.rb b/template_generator/app/controllers/personal_plugin_templates_controller.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/controllers/personal_plugin_templates_controller.rb rename to template_generator/app/controllers/personal_plugin_templates_controller.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/helpers/admin/plugin_templates_helper.rb b/template_generator/app/helpers/admin/plugin_templates_helper.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/helpers/admin/plugin_templates_helper.rb rename to template_generator/app/helpers/admin/plugin_templates_helper.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/models/plugin_template.rb b/template_generator/app/models/plugin_template.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/models/plugin_template.rb rename to template_generator/app/models/plugin_template.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/models/plugin_template_file.rb b/template_generator/app/models/plugin_template_file.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/models/plugin_template_file.rb rename to template_generator/app/models/plugin_template_file.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/models/plugin_template_intro.rb b/template_generator/app/models/plugin_template_intro.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/models/plugin_template_intro.rb rename to template_generator/app/models/plugin_template_intro.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/models/plugin_template_related.rb b/template_generator/app/models/plugin_template_related.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/models/plugin_template_related.rb rename to template_generator/app/models/plugin_template_related.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_template_relateds/_form.html.erb b/template_generator/app/views/admin/plugin_template_relateds/_form.html.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_template_relateds/_form.html.erb rename to template_generator/app/views/admin/plugin_template_relateds/_form.html.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_template_relateds/create.js.erb b/template_generator/app/views/admin/plugin_template_relateds/create.js.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_template_relateds/create.js.erb rename to template_generator/app/views/admin/plugin_template_relateds/create.js.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_template_relateds/destroy.js.erb b/template_generator/app/views/admin/plugin_template_relateds/destroy.js.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_template_relateds/destroy.js.erb rename to template_generator/app/views/admin/plugin_template_relateds/destroy.js.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_template_relateds/edit.js.erb b/template_generator/app/views/admin/plugin_template_relateds/edit.js.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_template_relateds/edit.js.erb rename to template_generator/app/views/admin/plugin_template_relateds/edit.js.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_template_relateds/new.js.erb b/template_generator/app/views/admin/plugin_template_relateds/new.js.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_template_relateds/new.js.erb rename to template_generator/app/views/admin/plugin_template_relateds/new.js.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_template_relateds/update.js.erb b/template_generator/app/views/admin/plugin_template_relateds/update.js.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_template_relateds/update.js.erb rename to template_generator/app/views/admin/plugin_template_relateds/update.js.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/_form.html.erb b/template_generator/app/views/admin/plugin_templates/_form.html.erb similarity index 60% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/_form.html.erb rename to template_generator/app/views/admin/plugin_templates/_form.html.erb index 3b3bc5b..0b68dbf 100644 --- a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/_form.html.erb +++ b/template_generator/app/views/admin/plugin_templates/_form.html.erb @@ -40,51 +40,34 @@ <% @site_in_use_locales.each_with_index do |locale, i| %>
"> - +<% parse_again_start %> +
- +
- <%= f.text_field :course_code, class: "input-block-level", placeholder: t("personal_course.course_code"), value: (@course.course_code rescue nil) %> -
-
- -
- -
- <%= f.fields_for :title_translations do |f| %> - <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_course.title"), value: (@course.title_translations[locale] rescue nil) %> - <% end %> -
-
- - -
- -
- <%= f.fields_for :objective_translations do |f| %> - <%= f.text_area locale, class: "input-block-level ckeditor", placeholder: t("personal_course.objective"), value: (@course.objective_translations[locale] rescue nil) %> - <% end %> + locale_fields_input_fields
+<% parse_again_end %>
<% end %> <% files_hash = {} - ["course_syllabus_file", "course_progress_file", "course_activity_file", "course_multimedia_file", "course_material_file", "course_supplement_file", "course_evaluation_file"].each do |file| + plugin_template_related_files_text.each do |file| hash = {} hash["html"] = add_attribute("form_file", f, file.pluralize.to_sym) - hash["count"] = @course.send(file.pluralize).count rescue 0 + hash["count"] = @plugin_template.send(file.pluralize).count rescue 0 files_hash[file] = hash %>
- +
- <% if !@course.new_record? && hash["count"] > 0 %> + <% if !@plugin_template.new_record? && hash["count"] > 0 %>
- <% @course.send(file.pluralize).each_with_index do |obj, i| %> + <% @plugin_template.send(file.pluralize).each_with_index do |obj, i| %> <% if !obj.new_record? %> <%= f.fields_for file.pluralize.to_sym, obj do |f| %> <%= render :partial => "form_file", :object => obj, :locals => {:f => f, :i => i} %> @@ -115,9 +98,6 @@
  • <%= t(:status) %>
  • -
  • - <%= t("personal_course.students") %> -
  • @@ -141,58 +121,42 @@
    - <% members = !@course.member_profile.nil? ? @course.member_profile.to_a : [] %> - <%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'course[member_profile_id]', email_members: members,index:'0',select_name:'member_profile_id'} %> + <% 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'} %>
    <% end %> - - +<% parse_again_start %> +
    - +
    - <%= select_year((@course.year ? @course.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year + 5, :end_year => 1930}, {:name => 'course[year]',:class => 'span1'} ) %> + none_locale_fields_input_fields
    - - +<% parse_again_end %> +<% parse_again_start %> +
    - +
    - <%= f.select :course_category_id, CourseCategory.all.collect {|t| [ t.title, t.id ]} %> + <%= f.select :plugin_template_related_id, plugin_template_related.all.collect {|t| [ t.plugin_template_related_main_field, t.id ]} %>
    - - -
    - -
    - <%= f.select :course_semester_id, CourseSemester.all.collect {|t| [ t.title, t.id ]} %> -
    -
    - +<% parse_again_end %>
    -
    -
    -
    -
    - -
    - <%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'course[student_ids][]', email_members: @course.students,index:'1',select_name:'student_ids'} %> -
    -
    -
    diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/_form_file.html.erb b/template_generator/app/views/admin/plugin_templates/_form_file.html.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/_form_file.html.erb rename to template_generator/app/views/admin/plugin_templates/_form_file.html.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/_plugin_template_related.html.erb b/template_generator/app/views/admin/plugin_templates/_plugin_template_related.html.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/_plugin_template_related.html.erb rename to template_generator/app/views/admin/plugin_templates/_plugin_template_related.html.erb diff --git a/template_generator/app/views/admin/plugin_templates/_plugin_templates.html.erb b/template_generator/app/views/admin/plugin_templates/_plugin_templates.html.erb new file mode 100644 index 0000000..312a64a --- /dev/null +++ b/template_generator/app/views/admin/plugin_templates/_plugin_templates.html.erb @@ -0,0 +1,7 @@ +<% @plugin_templates.each do |plugin_template| %> + +<% parse_again_start %> + backend_index_fields_contents +<% parse_again_end %> + +<% end %> \ No newline at end of file diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/analysis.html.erb b/template_generator/app/views/admin/plugin_templates/analysis.html.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/analysis.html.erb rename to template_generator/app/views/admin/plugin_templates/analysis.html.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/analysis_report.html.erb b/template_generator/app/views/admin/plugin_templates/analysis_report.html.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/analysis_report.html.erb rename to template_generator/app/views/admin/plugin_templates/analysis_report.html.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/download_excel.xlsx.axlsx b/template_generator/app/views/admin/plugin_templates/download_excel.xlsx.axlsx similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/download_excel.xlsx.axlsx rename to template_generator/app/views/admin/plugin_templates/download_excel.xlsx.axlsx diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/edit.html.erb b/template_generator/app/views/admin/plugin_templates/edit.html.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/edit.html.erb rename to template_generator/app/views/admin/plugin_templates/edit.html.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/frontend_setting.html.erb b/template_generator/app/views/admin/plugin_templates/frontend_setting.html.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/frontend_setting.html.erb rename to template_generator/app/views/admin/plugin_templates/frontend_setting.html.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/index.html.erb b/template_generator/app/views/admin/plugin_templates/index.html.erb similarity index 80% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/index.html.erb rename to template_generator/app/views/admin/plugin_templates/index.html.erb index 46fece1..4d10a89 100644 --- a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/index.html.erb +++ b/template_generator/app/views/admin/plugin_templates/index.html.erb @@ -1,11 +1,13 @@ - + <% parse_again_start %> + + <% parse_again_end %> - <%= render 'personal_plugin_templates' %> + <%= render 'plugin_templates' %>
    <%= t('personal_plugin_template.year') %><%= t('personal_plugin_template.backend_index_fields') %>
    diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/new.html.erb b/template_generator/app/views/admin/plugin_templates/new.html.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/new.html.erb rename to template_generator/app/views/admin/plugin_templates/new.html.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/setting.html.erb b/template_generator/app/views/admin/plugin_templates/setting.html.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/admin/plugin_templates/setting.html.erb rename to template_generator/app/views/admin/plugin_templates/setting.html.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/personal_plugin_templates/index.html.erb b/template_generator/app/views/personal_plugin_templates/index.html.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/personal_plugin_templates/index.html.erb rename to template_generator/app/views/personal_plugin_templates/index.html.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/personal_plugin_templates/show.html.erb b/template_generator/app/views/personal_plugin_templates/show.html.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/personal_plugin_templates/show.html.erb rename to template_generator/app/views/personal_plugin_templates/show.html.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/app/views/plugin/personal_plugin_template/_profile.html.erb b/template_generator/app/views/plugin/personal_plugin_template/_profile.html.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/app/views/plugin/personal_plugin_template/_profile.html.erb rename to template_generator/app/views/plugin/personal_plugin_template/_profile.html.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/bin/rails b/template_generator/bin/rails similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/bin/rails rename to template_generator/bin/rails diff --git a/app/views/admin/personal_plugin_fields/template_generator/config/locales/en.yml b/template_generator/config/locales/en.yml similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/config/locales/en.yml rename to template_generator/config/locales/en.yml diff --git a/app/views/admin/personal_plugin_fields/template_generator/config/locales/zh_tw.yml b/template_generator/config/locales/zh_tw.yml similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/config/locales/zh_tw.yml rename to template_generator/config/locales/zh_tw.yml diff --git a/app/views/admin/personal_plugin_fields/template_generator/config/routes.rb b/template_generator/config/routes.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/config/routes.rb rename to template_generator/config/routes.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/lib/personal_plugin_template.rb b/template_generator/lib/personal_plugin_template.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/lib/personal_plugin_template.rb rename to template_generator/lib/personal_plugin_template.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/lib/personal_plugin_template/engine.rb b/template_generator/lib/personal_plugin_template/engine.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/lib/personal_plugin_template/engine.rb rename to template_generator/lib/personal_plugin_template/engine.rb diff --git a/template_generator/lib/personal_plugin_template/version.rb b/template_generator/lib/personal_plugin_template/version.rb new file mode 100644 index 0000000..9054351 --- /dev/null +++ b/template_generator/lib/personal_plugin_template/version.rb @@ -0,0 +1,3 @@ +module PersonalPluginTemplate + VERSION = "0.0.1" +end diff --git a/app/views/admin/personal_plugin_fields/template_generator/lib/tasks/personal_plugin_template_tasks.rake b/template_generator/lib/tasks/personal_plugin_template_tasks.rake similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/lib/tasks/personal_plugin_template_tasks.rake rename to template_generator/lib/tasks/personal_plugin_template_tasks.rake diff --git a/template_generator/modules/personal_plugin_template/index.html.erb b/template_generator/modules/personal_plugin_template/index.html.erb new file mode 100644 index 0000000..f777f69 --- /dev/null +++ b/template_generator/modules/personal_plugin_template/index.html.erb @@ -0,0 +1,27 @@ + + + + + <% parse_again_start %> + + <% parse_again_end %> + + + + + <% parse_again_start %> + + <% parse_again_end %> + + +

    {{widget-title}}

    {{th_col_name_to_show_in_index_page_arr}}
    {{col_name_to_show_in_index_page_arr}}
    +{{pagination_goes_here}} + + \ No newline at end of file diff --git a/template_generator/modules/personal_plugin_template/info.json b/template_generator/modules/personal_plugin_template/info.json new file mode 100644 index 0000000..cda3d13 --- /dev/null +++ b/template_generator/modules/personal_plugin_template/info.json @@ -0,0 +1,12 @@ +{ + "frontend": [ + { + "filename" : "index", + "name" : { + "zh_tw" : "1. 列表", + "en" : "1. List" + }, + "thumbnail" : "thumb.png" + } + ] +} \ No newline at end of file diff --git a/template_generator/modules/personal_plugin_template/show.html.erb b/template_generator/modules/personal_plugin_template/show.html.erb new file mode 100644 index 0000000..58a66d2 --- /dev/null +++ b/template_generator/modules/personal_plugin_template/show.html.erb @@ -0,0 +1,8 @@ + + + + + + + +
    {{title}}{{value}}
    \ No newline at end of file diff --git a/template_generator/modules/personal_plugin_template/thumbs/thumb.png b/template_generator/modules/personal_plugin_template/thumbs/thumb.png new file mode 100644 index 0000000..266af56 Binary files /dev/null and b/template_generator/modules/personal_plugin_template/thumbs/thumb.png differ diff --git a/app/views/admin/personal_plugin_fields/template_generator/personal_plugin_template.gemspec b/template_generator/personal_plugin_template.gemspec similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/personal_plugin_template.gemspec rename to template_generator/personal_plugin_template.gemspec diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/README.rdoc b/template_generator/test/dummy/README.rdoc similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/README.rdoc rename to template_generator/test/dummy/README.rdoc diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/Rakefile b/template_generator/test/dummy/Rakefile similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/Rakefile rename to template_generator/test/dummy/Rakefile diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/assets/images/.keep b/template_generator/test/dummy/app/assets/images/.keep similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/assets/images/.keep rename to template_generator/test/dummy/app/assets/images/.keep diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/assets/javascripts/application.js b/template_generator/test/dummy/app/assets/javascripts/application.js similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/assets/javascripts/application.js rename to template_generator/test/dummy/app/assets/javascripts/application.js diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/assets/stylesheets/application.css b/template_generator/test/dummy/app/assets/stylesheets/application.css similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/assets/stylesheets/application.css rename to template_generator/test/dummy/app/assets/stylesheets/application.css diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/controllers/application_controller.rb b/template_generator/test/dummy/app/controllers/application_controller.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/controllers/application_controller.rb rename to template_generator/test/dummy/app/controllers/application_controller.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/controllers/concerns/.keep b/template_generator/test/dummy/app/controllers/concerns/.keep similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/controllers/concerns/.keep rename to template_generator/test/dummy/app/controllers/concerns/.keep diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/helpers/application_helper.rb b/template_generator/test/dummy/app/helpers/application_helper.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/helpers/application_helper.rb rename to template_generator/test/dummy/app/helpers/application_helper.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/mailers/.keep b/template_generator/test/dummy/app/mailers/.keep similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/mailers/.keep rename to template_generator/test/dummy/app/mailers/.keep diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/models/.keep b/template_generator/test/dummy/app/models/.keep similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/models/.keep rename to template_generator/test/dummy/app/models/.keep diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/models/concerns/.keep b/template_generator/test/dummy/app/models/concerns/.keep similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/models/concerns/.keep rename to template_generator/test/dummy/app/models/concerns/.keep diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/views/layouts/application.html.erb b/template_generator/test/dummy/app/views/layouts/application.html.erb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/app/views/layouts/application.html.erb rename to template_generator/test/dummy/app/views/layouts/application.html.erb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/bin/bundle b/template_generator/test/dummy/bin/bundle similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/bin/bundle rename to template_generator/test/dummy/bin/bundle diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/bin/rails b/template_generator/test/dummy/bin/rails similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/bin/rails rename to template_generator/test/dummy/bin/rails diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/bin/rake b/template_generator/test/dummy/bin/rake similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/bin/rake rename to template_generator/test/dummy/bin/rake diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config.ru b/template_generator/test/dummy/config.ru similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config.ru rename to template_generator/test/dummy/config.ru diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/application.rb b/template_generator/test/dummy/config/application.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/application.rb rename to template_generator/test/dummy/config/application.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/boot.rb b/template_generator/test/dummy/config/boot.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/boot.rb rename to template_generator/test/dummy/config/boot.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/database.yml b/template_generator/test/dummy/config/database.yml similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/database.yml rename to template_generator/test/dummy/config/database.yml diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/environment.rb b/template_generator/test/dummy/config/environment.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/environment.rb rename to template_generator/test/dummy/config/environment.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/environments/development.rb b/template_generator/test/dummy/config/environments/development.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/environments/development.rb rename to template_generator/test/dummy/config/environments/development.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/environments/production.rb b/template_generator/test/dummy/config/environments/production.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/environments/production.rb rename to template_generator/test/dummy/config/environments/production.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/environments/test.rb b/template_generator/test/dummy/config/environments/test.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/environments/test.rb rename to template_generator/test/dummy/config/environments/test.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/assets.rb b/template_generator/test/dummy/config/initializers/assets.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/assets.rb rename to template_generator/test/dummy/config/initializers/assets.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/backtrace_silencers.rb b/template_generator/test/dummy/config/initializers/backtrace_silencers.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/backtrace_silencers.rb rename to template_generator/test/dummy/config/initializers/backtrace_silencers.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/cookies_serializer.rb b/template_generator/test/dummy/config/initializers/cookies_serializer.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/cookies_serializer.rb rename to template_generator/test/dummy/config/initializers/cookies_serializer.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/filter_parameter_logging.rb b/template_generator/test/dummy/config/initializers/filter_parameter_logging.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/filter_parameter_logging.rb rename to template_generator/test/dummy/config/initializers/filter_parameter_logging.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/inflections.rb b/template_generator/test/dummy/config/initializers/inflections.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/inflections.rb rename to template_generator/test/dummy/config/initializers/inflections.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/mime_types.rb b/template_generator/test/dummy/config/initializers/mime_types.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/mime_types.rb rename to template_generator/test/dummy/config/initializers/mime_types.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/session_store.rb b/template_generator/test/dummy/config/initializers/session_store.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/session_store.rb rename to template_generator/test/dummy/config/initializers/session_store.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/wrap_parameters.rb b/template_generator/test/dummy/config/initializers/wrap_parameters.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/initializers/wrap_parameters.rb rename to template_generator/test/dummy/config/initializers/wrap_parameters.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/locales/en.yml b/template_generator/test/dummy/config/locales/en.yml similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/locales/en.yml rename to template_generator/test/dummy/config/locales/en.yml diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/routes.rb b/template_generator/test/dummy/config/routes.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/routes.rb rename to template_generator/test/dummy/config/routes.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/secrets.yml b/template_generator/test/dummy/config/secrets.yml similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/config/secrets.yml rename to template_generator/test/dummy/config/secrets.yml diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/lib/assets/.keep b/template_generator/test/dummy/lib/assets/.keep similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/lib/assets/.keep rename to template_generator/test/dummy/lib/assets/.keep diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/log/.keep b/template_generator/test/dummy/log/.keep similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/log/.keep rename to template_generator/test/dummy/log/.keep diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/public/404.html b/template_generator/test/dummy/public/404.html similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/public/404.html rename to template_generator/test/dummy/public/404.html diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/public/422.html b/template_generator/test/dummy/public/422.html similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/public/422.html rename to template_generator/test/dummy/public/422.html diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/public/500.html b/template_generator/test/dummy/public/500.html similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/public/500.html rename to template_generator/test/dummy/public/500.html diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/dummy/public/favicon.ico b/template_generator/test/dummy/public/favicon.ico similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/dummy/public/favicon.ico rename to template_generator/test/dummy/public/favicon.ico diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/integration/navigation_test.rb b/template_generator/test/integration/navigation_test.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/integration/navigation_test.rb rename to template_generator/test/integration/navigation_test.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/personal_plugin_template_test.rb b/template_generator/test/personal_plugin_template_test.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/personal_plugin_template_test.rb rename to template_generator/test/personal_plugin_template_test.rb diff --git a/app/views/admin/personal_plugin_fields/template_generator/test/test_helper.rb b/template_generator/test/test_helper.rb similarity index 100% rename from app/views/admin/personal_plugin_fields/template_generator/test/test_helper.rb rename to template_generator/test/test_helper.rb