From b772845e4a8f3d6e542ca7821155f5b5f78c8753 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 7 May 2020 23:22:02 +0800 Subject: [PATCH] change from seminar with no conflict --- Gemfile | 14 - Gemfile.lock | 87 --- MIT-LICENSE | 20 - README.rdoc | 3 - Rakefile | 32 -- .../check_seminar_set_items.js.erb | 78 --- .../javascripts/field-forms-submission.js | 494 ---------------- app/assets/javascripts/field-forms.js | 494 ---------------- app/assets/javascripts/seminar.js.coffee | 3 - app/assets/javascripts/seminar_sets.js | 29 - app/assets/stylesheets/seminar.css | 18 - app/assets/stylesheets/seminar_sets.css | 3 - .../admin/seminar_agreements_controller.rb | 20 - .../admin/seminar_item_contents_controller.rb | 70 --- .../admin/seminar_items_controller.rb | 52 -- .../admin/seminar_signups_controller.rb | 53 -- app/controllers/admin/seminars_controller.rb | 340 ----------- app/controllers/seminars_controller.rb | 401 ------------- app/helpers/admin/seminars_field_helper.rb | 530 ------------------ app/helpers/admin/seminars_helper.rb | 33 -- app/helpers/admin/seminars_values_helper.rb | 109 ---- app/models/seminar_agreement.rb | 7 - app/models/seminar_email_set.rb | 10 - app/models/seminar_file.rb | 14 - app/models/seminar_item.rb | 12 - app/models/seminar_item_content.rb | 15 - app/models/seminar_link.rb | 25 - app/models/seminar_main.rb | 87 --- app/models/seminar_review.rb | 12 - app/models/seminar_signup.rb | 27 - app/models/seminar_signup_contribute.rb | 13 - app/models/seminar_signup_field.rb | 161 ------ app/models/seminar_signup_field_custom.rb | 8 - app/models/seminar_signup_field_set.rb | 11 - app/models/seminar_signup_value.rb | 215 ------- app/models/seminar_submission_field.rb | 186 ------ app/models/seminar_submission_field_set.rb | 11 - app/models/seminar_submission_value.rb | 212 ------- .../admin/seminar_agreements/index.html.erb | 63 --- .../seminar_item_contents/_form.html.erb | 91 --- .../admin/seminar_item_contents/edit.html.erb | 5 - .../seminar_item_contents/index.html.erb | 43 -- .../admin/seminar_item_contents/new.html.erb | 5 - .../seminar_items/_delete_modal.html.erb | 16 - app/views/admin/seminar_items/_form.html.erb | 11 - app/views/admin/seminar_items/_index.html.erb | 27 - app/views/admin/seminar_items/_item.html.erb | 8 - app/views/admin/seminar_items/index.html.erb | 81 --- app/views/admin/seminar_items/index.js.erb | 8 - app/views/admin/seminar_signups/edit.html.erb | 204 ------- .../admin/seminars/_attribute_field.html.erb | 132 ----- .../_attribute_submission_field.html.erb | 132 ----- app/views/admin/seminars/_form.html.erb | 487 ---------------- app/views/admin/seminars/_form_file.html.erb | 55 -- app/views/admin/seminars/_form_link.html.erb | 26 - app/views/admin/seminars/_index.html.erb | 48 -- .../seminars/_support_member_form_js.erb | 268 --------- app/views/admin/seminars/edit.html.erb | 5 - app/views/admin/seminars/export.xlsx.axlsx | 66 --- app/views/admin/seminars/index.html.erb | 6 - app/views/admin/seminars/new.html.erb | 5 - .../seminars/seminar_item_content.html.erb | 44 -- .../admin/seminars/seminar_signup.html.erb | 215 ------- .../seminars/seminar_signup_field.html.erb | 37 -- .../seminar_submission_field.html.erb | 36 -- app/views/email/add_file_email.html.erb | 8 - app/views/email/edit_file_email.html.erb | 8 - app/views/email/signup_email.html.erb | 8 - app/views/email/submission_email.html.erb | 8 - app/views/seminars/add_file.html.erb | 110 ---- .../seminars/check_availability.html.erb | 4 - app/views/seminars/check_email.html.erb | 10 - app/views/seminars/con_login.html.erb | 53 -- app/views/seminars/con_logout.html.erb | 13 - app/views/seminars/con_upload.html.erb | 72 --- app/views/seminars/edit_file.html.erb | 99 ---- app/views/seminars/index.html.erb | 63 --- app/views/seminars/show.html.erb | 332 ----------- app/views/seminars/show_data.html.erb | 92 --- app/views/seminars/show_privacy.html.erb | 28 - app/views/seminars/signup_ok.html.erb | 12 - app/views/simple_captcha/_simple_captcha.erb | 33 -- bin/rails | 18 - config/locales/en.yml | 131 ----- config/locales/zh_tw.yml | 131 ----- config/routes.rb | 40 -- lib/seminar.rb | 4 - lib/seminar/engine.rb | 50 -- lib/seminar/version.rb | 3 - lib/tasks/seminar_tasks.rake | 4 - seminar.gemspec | 22 - test/controllers/seminar_controller_test.rb | 7 - test/dummy/README.rdoc | 28 - test/dummy/Rakefile | 6 - test/dummy/app/assets/images/.keep | 0 .../app/assets/javascripts/application.js | 13 - .../app/assets/stylesheets/application.css | 15 - .../app/controllers/application_controller.rb | 5 - test/dummy/app/controllers/concerns/.keep | 0 test/dummy/app/helpers/application_helper.rb | 2 - test/dummy/app/mailers/.keep | 0 test/dummy/app/models/.keep | 0 test/dummy/app/models/concerns/.keep | 0 .../app/views/layouts/application.html.erb | 14 - test/dummy/bin/bundle | 3 - test/dummy/bin/rails | 4 - test/dummy/bin/rake | 4 - test/dummy/config.ru | 4 - test/dummy/config/application.rb | 23 - test/dummy/config/boot.rb | 5 - test/dummy/config/database.yml | 25 - test/dummy/config/environment.rb | 5 - test/dummy/config/environments/development.rb | 37 -- test/dummy/config/environments/production.rb | 78 --- test/dummy/config/environments/test.rb | 39 -- test/dummy/config/initializers/assets.rb | 8 - .../initializers/backtrace_silencers.rb | 7 - .../config/initializers/cookies_serializer.rb | 3 - .../initializers/filter_parameter_logging.rb | 4 - test/dummy/config/initializers/inflections.rb | 16 - test/dummy/config/initializers/mime_types.rb | 4 - .../config/initializers/session_store.rb | 3 - .../config/initializers/wrap_parameters.rb | 14 - test/dummy/config/locales/en.yml | 23 - test/dummy/config/routes.rb | 56 -- test/dummy/config/secrets.yml | 22 - test/dummy/lib/assets/.keep | 0 test/dummy/log/.keep | 0 test/dummy/public/404.html | 67 --- test/dummy/public/422.html | 67 --- test/dummy/public/500.html | 66 --- test/dummy/public/favicon.ico | 0 test/helpers/seminar_helper_test.rb | 4 - test/seminar_test.rb | 7 - test/test_helper.rb | 18 - 135 files changed, 8095 deletions(-) delete mode 100644 Gemfile delete mode 100644 Gemfile.lock delete mode 100644 MIT-LICENSE delete mode 100644 README.rdoc delete mode 100644 Rakefile delete mode 100755 app/assets/javascripts/check_seminar_set_items.js.erb delete mode 100644 app/assets/javascripts/field-forms-submission.js delete mode 100644 app/assets/javascripts/field-forms.js delete mode 100644 app/assets/javascripts/seminar.js.coffee delete mode 100644 app/assets/javascripts/seminar_sets.js delete mode 100644 app/assets/stylesheets/seminar.css delete mode 100644 app/assets/stylesheets/seminar_sets.css delete mode 100644 app/controllers/admin/seminar_agreements_controller.rb delete mode 100644 app/controllers/admin/seminar_item_contents_controller.rb delete mode 100644 app/controllers/admin/seminar_items_controller.rb delete mode 100644 app/controllers/admin/seminar_signups_controller.rb delete mode 100644 app/controllers/admin/seminars_controller.rb delete mode 100644 app/controllers/seminars_controller.rb delete mode 100644 app/helpers/admin/seminars_field_helper.rb delete mode 100644 app/helpers/admin/seminars_helper.rb delete mode 100644 app/helpers/admin/seminars_values_helper.rb delete mode 100644 app/models/seminar_agreement.rb delete mode 100644 app/models/seminar_email_set.rb delete mode 100644 app/models/seminar_file.rb delete mode 100644 app/models/seminar_item.rb delete mode 100644 app/models/seminar_item_content.rb delete mode 100644 app/models/seminar_link.rb delete mode 100644 app/models/seminar_main.rb delete mode 100644 app/models/seminar_review.rb delete mode 100644 app/models/seminar_signup.rb delete mode 100644 app/models/seminar_signup_contribute.rb delete mode 100644 app/models/seminar_signup_field.rb delete mode 100644 app/models/seminar_signup_field_custom.rb delete mode 100644 app/models/seminar_signup_field_set.rb delete mode 100644 app/models/seminar_signup_value.rb delete mode 100644 app/models/seminar_submission_field.rb delete mode 100644 app/models/seminar_submission_field_set.rb delete mode 100644 app/models/seminar_submission_value.rb delete mode 100644 app/views/admin/seminar_agreements/index.html.erb delete mode 100644 app/views/admin/seminar_item_contents/_form.html.erb delete mode 100644 app/views/admin/seminar_item_contents/edit.html.erb delete mode 100644 app/views/admin/seminar_item_contents/index.html.erb delete mode 100644 app/views/admin/seminar_item_contents/new.html.erb delete mode 100644 app/views/admin/seminar_items/_delete_modal.html.erb delete mode 100644 app/views/admin/seminar_items/_form.html.erb delete mode 100644 app/views/admin/seminar_items/_index.html.erb delete mode 100644 app/views/admin/seminar_items/_item.html.erb delete mode 100644 app/views/admin/seminar_items/index.html.erb delete mode 100644 app/views/admin/seminar_items/index.js.erb delete mode 100644 app/views/admin/seminar_signups/edit.html.erb delete mode 100644 app/views/admin/seminars/_attribute_field.html.erb delete mode 100644 app/views/admin/seminars/_attribute_submission_field.html.erb delete mode 100644 app/views/admin/seminars/_form.html.erb delete mode 100644 app/views/admin/seminars/_form_file.html.erb delete mode 100644 app/views/admin/seminars/_form_link.html.erb delete mode 100644 app/views/admin/seminars/_index.html.erb delete mode 100644 app/views/admin/seminars/_support_member_form_js.erb delete mode 100644 app/views/admin/seminars/edit.html.erb delete mode 100644 app/views/admin/seminars/export.xlsx.axlsx delete mode 100644 app/views/admin/seminars/index.html.erb delete mode 100644 app/views/admin/seminars/new.html.erb delete mode 100644 app/views/admin/seminars/seminar_item_content.html.erb delete mode 100644 app/views/admin/seminars/seminar_signup.html.erb delete mode 100644 app/views/admin/seminars/seminar_signup_field.html.erb delete mode 100644 app/views/admin/seminars/seminar_submission_field.html.erb delete mode 100644 app/views/email/add_file_email.html.erb delete mode 100644 app/views/email/edit_file_email.html.erb delete mode 100644 app/views/email/signup_email.html.erb delete mode 100644 app/views/email/submission_email.html.erb delete mode 100644 app/views/seminars/add_file.html.erb delete mode 100644 app/views/seminars/check_availability.html.erb delete mode 100644 app/views/seminars/check_email.html.erb delete mode 100644 app/views/seminars/con_login.html.erb delete mode 100644 app/views/seminars/con_logout.html.erb delete mode 100644 app/views/seminars/con_upload.html.erb delete mode 100644 app/views/seminars/edit_file.html.erb delete mode 100644 app/views/seminars/index.html.erb delete mode 100644 app/views/seminars/show.html.erb delete mode 100644 app/views/seminars/show_data.html.erb delete mode 100644 app/views/seminars/show_privacy.html.erb delete mode 100644 app/views/seminars/signup_ok.html.erb delete mode 100644 app/views/simple_captcha/_simple_captcha.erb delete mode 100755 bin/rails delete mode 100644 config/locales/en.yml delete mode 100644 config/locales/zh_tw.yml delete mode 100644 config/routes.rb delete mode 100644 lib/seminar.rb delete mode 100644 lib/seminar/engine.rb delete mode 100644 lib/seminar/version.rb delete mode 100644 lib/tasks/seminar_tasks.rake delete mode 100644 seminar.gemspec delete mode 100644 test/controllers/seminar_controller_test.rb delete mode 100644 test/dummy/README.rdoc delete mode 100644 test/dummy/Rakefile delete mode 100644 test/dummy/app/assets/images/.keep delete mode 100644 test/dummy/app/assets/javascripts/application.js delete mode 100644 test/dummy/app/assets/stylesheets/application.css delete mode 100644 test/dummy/app/controllers/application_controller.rb delete mode 100644 test/dummy/app/controllers/concerns/.keep delete mode 100644 test/dummy/app/helpers/application_helper.rb delete mode 100644 test/dummy/app/mailers/.keep delete mode 100644 test/dummy/app/models/.keep delete mode 100644 test/dummy/app/models/concerns/.keep delete mode 100644 test/dummy/app/views/layouts/application.html.erb delete mode 100755 test/dummy/bin/bundle delete mode 100755 test/dummy/bin/rails delete mode 100755 test/dummy/bin/rake delete mode 100644 test/dummy/config.ru delete mode 100644 test/dummy/config/application.rb delete mode 100644 test/dummy/config/boot.rb delete mode 100644 test/dummy/config/database.yml delete mode 100644 test/dummy/config/environment.rb delete mode 100644 test/dummy/config/environments/development.rb delete mode 100644 test/dummy/config/environments/production.rb delete mode 100644 test/dummy/config/environments/test.rb delete mode 100644 test/dummy/config/initializers/assets.rb delete mode 100644 test/dummy/config/initializers/backtrace_silencers.rb delete mode 100644 test/dummy/config/initializers/cookies_serializer.rb delete mode 100644 test/dummy/config/initializers/filter_parameter_logging.rb delete mode 100644 test/dummy/config/initializers/inflections.rb delete mode 100644 test/dummy/config/initializers/mime_types.rb delete mode 100644 test/dummy/config/initializers/session_store.rb delete mode 100644 test/dummy/config/initializers/wrap_parameters.rb delete mode 100644 test/dummy/config/locales/en.yml delete mode 100644 test/dummy/config/routes.rb delete mode 100644 test/dummy/config/secrets.yml delete mode 100644 test/dummy/lib/assets/.keep delete mode 100644 test/dummy/log/.keep delete mode 100644 test/dummy/public/404.html delete mode 100644 test/dummy/public/422.html delete mode 100644 test/dummy/public/500.html delete mode 100644 test/dummy/public/favicon.ico delete mode 100644 test/helpers/seminar_helper_test.rb delete mode 100644 test/seminar_test.rb delete mode 100644 test/test_helper.rb diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 1950993..0000000 --- a/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -# Declare your gem's dependencies in seminar.gemspec. -# Bundler will treat runtime dependencies like base dependencies, and -# development dependencies will be added by default to the :development group. -gemspec - -# Declare any dependencies that are still in development here instead of in -# your gemspec. These might include edge Rails or gems from your path or -# Git. Remember to move these dependencies to your gemspec before releasing -# your gem to rubygems.org. - -# To use debugger -# gem 'debugger' diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 305eb37..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,87 +0,0 @@ -PATH - remote: . - specs: - seminar (0.0.1) - rails (~> 4.1.9) - -GEM - remote: https://rubygems.org/ - specs: - actionmailer (4.1.9) - actionpack (= 4.1.9) - actionview (= 4.1.9) - mail (~> 2.5, >= 2.5.4) - actionpack (4.1.9) - actionview (= 4.1.9) - activesupport (= 4.1.9) - rack (~> 1.5.2) - rack-test (~> 0.6.2) - actionview (4.1.9) - activesupport (= 4.1.9) - builder (~> 3.1) - erubis (~> 2.7.0) - activemodel (4.1.9) - activesupport (= 4.1.9) - builder (~> 3.1) - activerecord (4.1.9) - activemodel (= 4.1.9) - activesupport (= 4.1.9) - arel (~> 5.0.0) - activesupport (4.1.9) - i18n (~> 0.6, >= 0.6.9) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.1) - tzinfo (~> 1.1) - arel (5.0.1.20140414130214) - builder (3.2.2) - erubis (2.7.0) - hike (1.2.3) - i18n (0.7.0) - json (1.8.2) - mail (2.6.3) - mime-types (>= 1.16, < 3) - mime-types (2.4.3) - minitest (5.5.1) - multi_json (1.10.1) - rack (1.5.2) - rack-test (0.6.3) - rack (>= 1.0) - rails (4.1.9) - actionmailer (= 4.1.9) - actionpack (= 4.1.9) - actionview (= 4.1.9) - activemodel (= 4.1.9) - activerecord (= 4.1.9) - activesupport (= 4.1.9) - bundler (>= 1.3.0, < 2.0) - railties (= 4.1.9) - sprockets-rails (~> 2.0) - railties (4.1.9) - actionpack (= 4.1.9) - activesupport (= 4.1.9) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.4.2) - sprockets (2.12.3) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.2.4) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (>= 2.8, < 4.0) - sqlite3 (1.3.10) - thor (0.19.1) - thread_safe (0.3.4) - tilt (1.4.1) - tzinfo (1.2.2) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - seminar! - sqlite3 diff --git a/MIT-LICENSE b/MIT-LICENSE deleted file mode 100644 index 1e4beb8..0000000 --- a/MIT-LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2015 YOURNAME - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.rdoc b/README.rdoc deleted file mode 100644 index 53399c4..0000000 --- a/README.rdoc +++ /dev/null @@ -1,3 +0,0 @@ -= Seminar - -This project rocks and uses MIT-LICENSE. \ No newline at end of file diff --git a/Rakefile b/Rakefile deleted file mode 100644 index d4cf079..0000000 --- a/Rakefile +++ /dev/null @@ -1,32 +0,0 @@ -begin - require 'bundler/setup' -rescue LoadError - puts 'You must `gem install bundler` and `bundle install` to run rake tasks' -end - -require 'rdoc/task' - -RDoc::Task.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'Seminar' - rdoc.options << '--line-numbers' - rdoc.rdoc_files.include('README.rdoc') - rdoc.rdoc_files.include('lib/**/*.rb') -end - - - - -Bundler::GemHelper.install_tasks - -require 'rake/testtask' - -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.libs << 'test' - t.pattern = 'test/**/*_test.rb' - t.verbose = false -end - - -task default: :test diff --git a/app/assets/javascripts/check_seminar_set_items.js.erb b/app/assets/javascripts/check_seminar_set_items.js.erb deleted file mode 100755 index bc793f5..0000000 --- a/app/assets/javascripts/check_seminar_set_items.js.erb +++ /dev/null @@ -1,78 +0,0 @@ -function checkTagsQuantity() { - var $tagLead = $('.tag-lead'), - $tagsGroups = $('.tags-groups'); - - $tagsGroups.each(function(i) { - var $children = $(this).children().length; - $tagLead.eq(i).children('.badge').text($children); - }) -} - -function checkedLength() { - var $tagsList = $('#tags-list'), - $defaultTags, - ids; - function reload_links() { - var _checked = 0; - ids = []; - $defaultTags = $('li.default input[type="checkbox"]'); - $defaultTags.each(function(index, el) { - if($(el).prop('checked')) { - _checked ++; - ids.push($(el).val()) - } - }); - console.log(_checked,ids) - if(_checked > 0) { - $('#deselect').removeClass('hide'); - $('#deselect').on('click', deselect); - $('#deleteItems').attr('rel', "<%= Rails.application.routes.url_helpers.delete_items_admin_seminar_items_path %>" + "?ids=" + ids); - $('#deleteItems').removeClass('hide'); - - } else { - $('#deselect').addClass('hide'); - $('#deleteItems').attr('rel', ""); - $('#deleteItems').addClass('hide'); - $('#deselect').off('click', deselect); - }; - } - $tagsList.on('click', '.card', function(event) { - reload_links(); - }); - $('#selectAllTags').on('click', function() { - $('.filter-item:not(".mark") input[type="checkbox"]').prop('checked', true); - $('.filter-item:not(".mark") .card').addClass('active'); - reload_links(); - }); - $('#deleteItems').on('click', function() { - $('#delete_seminar_items .tags-groups').empty(); - $('#delete_seminar_items a.delete-tags').attr("href", $(this).attr("rel")); - if(ids.length) { - $('.filter-item').children('.card.active').each(function(i, e) { - console.log($(e)) - $(e).parents('.filter-item').clone().appendTo('#delete_seminar_items .tags-groups'); - $('#delete_seminar_items .tags-groups .filter-item').addClass('def'); - }); - } - - $('#delete_seminar_items').modal('show', cleanTagInputs()); - function cleanTagInputs(){ - var $tagsDelete = $('#delete_seminar_items'), - $filterItem = $tagsDelete.find('.filter-item'); - $filterItem.find('.card, .amount').remove(); - $filterItem.find('a').removeAttr('class'); - $filterItem.find('a').removeAttr('href'); - } - }); - - function deselect() { - $('.tags input[type="checkbox"]').prop('checked', false); - $('.card').removeClass('active'); - $('.bottomnav .toggable').not('.open-slide').addClass('hide'); - $('#deleteItems').attr('rel', ""); - } -} - -$(function() { - checkedLength(); -}); diff --git a/app/assets/javascripts/field-forms-submission.js b/app/assets/javascripts/field-forms-submission.js deleted file mode 100644 index c64b9fc..0000000 --- a/app/assets/javascripts/field-forms-submission.js +++ /dev/null @@ -1,494 +0,0 @@ -// Retrieve the initial data -function temporary() { - attributesArray.length = 0; - $('.attributes').each(function() { - var attributesData = {}, - $selectType = $('.dataType').data().type; - - // Capture "attributes-body" within the input[type = "text"] val - $(this).find('.attributes-body').find('input[type="text"]').each(function(i) { - var $type = $(this).data().type; - attributesData[$type] = $(this).val(); - }); - - // Capture "attributes-body" within the input[type = "radio"] checked - $(this).find('.attributes-body').find('input[type="radio"]').each(function(i) { - var $type = $(this).data().type; - attributesData[$type] = $(this).prop("checked"); - }); - - // Capture "attributes-body" within the dataType selected - $(this).find('.attributes-body').find('.dataType').children("option:selected").each(function () { - attributesData[$selectType] = {}; - attributesData[$selectType].index = $(this).index(); - attributesData[$selectType].name = $(this).attr('ref'); - if($(this).attr('ref') == 'typeB' || $(this).attr('ref') == 'typeE' || $(this).attr('ref') == 'typeF') { - attributesData[$selectType].option = []; - } - }); - - // Capture "field-type" within the input[type = "text"] val - $(this).find('.field-type').find('input[type="text"]').each(function(i) { - var $type = $(this).data().type; - if(!$type.match('option_lang')) { - attributesData[$selectType][$type] = $(this).val(); - } - }); - - $(this).find('.field-type .add-target').find('.input-append').each(function() { - var append = [] - $(this).children('input[type="text"]').each(function() { - var val = $(this).val(); - append.push(val); - }); - attributesData[$selectType].option.push(append); - }) - - // Capture "field-type" within the input[type = "checkbox"] checked - $(this).find('.field-type').find('input[type="checkbox"]').each(function() { - var $type = $(this).data().type; - attributesData[$selectType][$type] = $(this).prop("checked"); - }); - - // Capture "field-type" within the input[type = "radio"] checked - $(this).find('.field-type').find('input[type="radio"]').each(function() { - var $type = $(this).data().type; - attributesData[$selectType][$type] = $(this).prop("checked"); - }); - - // Capture "field-type" within the dataType selected - $(this).find('.field-type').find('select').children("option:selected").each(function () { - attributesData[$selectType].dateFormat = $(this).index(); - }); - - attributesArray.push(attributesData); - }); -}; - -// Determine the Append input length -function inputAppendLength() { - $('.add-target').each(function(i) { - if($(this).children('.input-append:not(:hidden)').length == 1 || $(this).children('.input-append').length == 1) { - $(this).children('.input-append').each(function() { - if($(this).children('div').hasClass('tab-content')) { - var btnLength = $(this).children('.btn').length; - $(this).find('.btn').eq(btnLength-2).addClass('last'); - $(this).find('.remove-input').addClass('hide'); - } else { - var mediumLength = $(this).children('.input-medium').length; - $(this).children('.input-medium').eq(mediumLength-1).addClass('last'); - $(this).children('.remove-input').addClass('hide'); - } - }); - } else { - $(this).children('.input-append').each(function() { - if($(this).children('div').hasClass('tab-content')) { - $(this).find('.btn').removeClass('last'); - $(this).find('.remove-input').removeClass('hide'); - } else { - $(this).children('.input-medium').removeClass('last'); - $(this).children('.remove-input').removeClass('hide'); - } - }); - } - }); -}; - -// Role Attribute Template Data -function setData(l, type, ol) { - var fields = $('#info').length ? "info[seminar_submission_fields]" : $('#sub_seminar_main').length ? "sub_seminar_main[seminar_submission_fields]" : "seminar_main[seminar_submission_fields]", - data = { - _add_more: ["add_more_" +l, fields+"["+l+"]["+type+"][add_more]"], - _calendar: ["calendar_" +l, fields+"["+l+"]["+type+"][calendar]"], - _cross_lang: ["cross_lang_" +l, fields+"["+l+"]["+type+"][cross_lang]"], - _disabled: ["disabled_" +l, fields+"["+l+"][disabled]"], - _format: ["format_" +l, fields+"["+l+"]["+type+"][format]"], - _initial: ["initial_" +l, fields+"["+l+"]["+type+"][initial]"], - _is_range: ["is_range_" +l, fields+"["+l+"]["+type+"][is_range]"], - _key: ["key_" +l, fields+"["+l+"][key]"], - _markup: fields+"["+l+"][markup]", - _option_list: ["option_list_"+l+"_"+ol, fields+"["+l+"]["+type+"][option_list]["+ol+"]", "option_list_"+ol], - _placeholder: ["placeholder_" +l, fields+"["+l+"]["+type+"][placeholder]"], - _title_translations: ["title_translations_" +l, fields+"["+l+"][title_translations]"], - _to_delete: ["to_delete_" +l, fields+"["+l+"][to_delete]"], - _to_require: ["to_require_" +l, fields+"["+l+"][to_require]"], - }; - return data; -} - -// Get Default Address Form -function getAddressForm(trigger, element, decide) { - if(decide) { - addressVal.length = addressArray.length = 0; - var addressAllVal = []; - var inputNameArray = []; - trigger.closest('.input-append').find('.tab-pane').each(function() { - var adderssText = $(this).children('input[type="text"]').val(), - addersshidden = '', - addressData = {}, - inputName = []; - $(this).children('input:not(:first)').each(function(j) { - var name = $(this).attr('name'), - val = $(this).val(); - addersshidden += val; - addressData[name] = val; - inputName.push(name); - }); - addressArray.push(addressData); - addressAllVal.push(adderssText); - inputNameArray.push(inputName); - if(adderssText != addersshidden) { - addressVal.push(false); - } else { - addressVal.push(true); - } - }); - element.find('.tab-pane').each(function(i) { - $(this).find('textarea, input[type="text"]').each(function(j) { - $(this).attr('name',inputNameArray[i][j]); - }); - if(addressVal[i]) { - $(this).find('textarea, input[type="text"]').each(function(j) { - $(this).val(addressArray[i][$(this).attr('name')]); - }); - } else { - $(this).find('textarea').val(addressAllVal[i]); - $(this).find('input[type="text"]').each(function(j) { - $(this).val(''); - }); - } - }); - }; - element.off('show'); -}; - -// Return Address Form -function returnAddressForm(element, decide) { - if(decide) { - addressArray.length = 0; - element.find('.tab-pane').each(function(i) { - var addressData = {}; - $(this).find('textarea, input[type="text"]').each(function(j) { - var name = $(this).attr('name'), - val = $(this).val(); - addressData[name] = val; - }); - addressArray.push(addressData); - }); - $.map(addressInputId, function(n, i) { - var v = ''; - $('#'+n).find('input[type="hidden"]').each(function() { - $(this).val(addressArray[i][$(this).attr('name')]); - v += addressArray[i][$(this).attr('name')] - }); - $('#'+n).find('input[type="text"]').each(function() { - $(this).val(v); - }); - }); - }; - returnDecide = false; -}; - -$(function() { - appendIndex = null; - if($('#user-forms').length) { - addressVal = []; - addressArray = []; - addressInputId = []; - seminar_mainType = null; - returnDecide = false; - $('.attributes').each(function() { - if($(this).find('.toggle-check').attr('value') == "true") { - $(this).addClass('disabled').children('.attributes-body').hide(); - } - }); - $('.returnDecide').on(clickEvent, function() { - returnDecide = true; - }) - $('#address-field').on('hidden', function () { - $('.btn[data-toggle="modal"]').removeClass('active').blur(); - $(this).find('.nav-tabs > li').removeClass('active').eq(0).addClass('active'); - $(this).find('.tab-content > .tab-pane').removeClass('active in').eq(0).addClass('active in'); - $(this).on('show', getAddressForm(null, $(this), false)); - returnAddressForm($(this), returnDecide) - }); - $('.control-group').delegate('.btn[data-toggle="modal"]', 'click', function() { - var $trigger = $(this); - addressInputId.length = 0; - $(this).closest('.input-append').find('.tab-pane').each(function() { - addressInputId.push($(this).attr('id')); - }); - $('#address-field').on('show', getAddressForm($trigger, $('#address-field'), true)); - }); - $('#user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) { - if($(this).hasClass('togglebox')) { - var seminar_main_staus = []; - if($(this).hasClass('disable')) { - $(this).find('.toggle-check') - .attr('value', 'false') - .closest('.attributes') - .removeClass('disabled') - .children('.attributes-body') - .fadeIn(300); - } else { - $(this).find('.toggle-check') - .attr('value', 'true') - .closest('.attributes') - .addClass('disabled') - .children('.attributes-body') - .fadeOut(300) - .find('.check') - .attr("checked",false) - .attr("value",seminar_main_staus); - } - $(this).toggleClass('disable'); - }; - if($(this).hasClass('remove-input')) { - $(this).closest('.input-append').fadeOut(300, function() { - $(this).remove(); - inputAppendLength(); - }); - }; - if($(this).hasClass('trigger')) { - appendIndex = $(this).closest('.controls').find('.input-append').length; - nameNumber = $(this).closest('.controls').find('.input-append:eq(0)').find('input').eq(0).attr('name'); - nameNumber = nameNumber.match(/[^[\D\]]+(?=])/g)[0]; - seminar_mainType = $(this).data('seminar_mains') - if($(this).hasClass('textInput')) { - $("#template-text").tmpl().appendTo($(this).closest('.controls').find('.add-target')); - } else if ($(this).hasClass('textLengInput')) { - $("#template-text-language").tmpl().appendTo($(this).closest('.controls').find('.add-target')); - } else if ($(this).hasClass('address')) { - $("#template-address").tmpl().appendTo($(this).closest('.controls').find('.add-target')); - } - inputAppendLength(); - }; - event.preventDefault(); - }); - inputAppendLength(); - } else { - attributesArray = []; - attributesHeaderLength = null; - templateType = null; - attributeIndex = null; - if($('.add-target').length) { - inputAppendLength(); - } - if(!$('.attributes').length) { - $('#attributes-area').addClass('clickHere'); - } else { - temporary(); - }; - - $('.add-attributes').on(clickEvent, function() { - if($('#attributes-area').hasClass('clickHere')) { - $('#attributes-area').removeClass('clickHere'); - }; - attributesHeaderLength = $('.attributes:not(:hidden)').length+1; - attributesLength = $('#attributes-area .attributes').length; - $("#template-attributes").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo( "#attributes-area" ); - $('.toggle-check').togglebox(); - }); - - - - $('.attributes.default').each(function(i) { - $(this).children('.field-type').not('.default').hide(); - $(this).find('input[type="text"]').on('keyup', function() { - $(this).trigger("checking"); - }); - $(this).find('input[type="radio"], input[type="checkbox"], select').change(function() { - $(this).trigger("checking"); - }); - $(this).delegate('input[type="text"], input[type="radio"], input[type="checkbox"], select', 'checking', function(e) { - var e = e.target.type, - $data = $(this).data().type; - switch(e) { - case 'text': - var val = $(this).val(); - if(!$(this).closest('.field-type').length) { - $data = attributesArray[i][$data]; - } else if(!$(this).closest('.add-target').length) { - $data = attributesArray[i].select[$data]; - } else { - appendIndex = $(this).parent('.input-append').index() - optionIndex = $(this).index() - $data = attributesArray[i].select.option[appendIndex][optionIndex]; - } - if(val != $data) { - $(this).closest('.attributes').find('.reply').removeClass('hide'); - } - break; - case 'radio': - var checked = $(this).prop("checked"); - $data = attributesArray[i][$data]; - if(checked != $data) { - $(this).closest('.attributes').find('.reply').removeClass('hide'); - } - break; - case 'checkbox': - var checked = $(this).prop("checked"); - $data = attributesArray[i].select[$data]; - if(checked != $data) { - $(this).closest('.attributes').find('.reply').removeClass('hide'); - } - break; - case 'select-one': - var ref, - $data = attributesArray[i].select.name; - $(this).children("option:selected").each(function() { - ref = $(this).attr('ref'); - }); - if(ref != $data) { - $(this).closest('.attributes').find('.reply').removeClass('hide'); - } - break; - }; - }); - $(this).delegate('.reply', clickEvent, function() { - var $bodyText = $(this).parent('.attributes-header').siblings('.attributes-body').find('input[type="text"]'), - $bodyRadio = $(this).parent('.attributes-header').siblings('.attributes-body').find('input[type="radio"]'), - $bodySelected = $(this).parent('.attributes-header').siblings('.attributes-body').find('.dataType').children("option"), - $fieldTypeO = $(this).parent('.attributes-header').siblings('.field-type.default'), - $fieldTypeN = $(this).parent('.attributes-header').siblings('.field-type').not('.default'); - $bodyText.each(function() { - var $type = $(this).data().type; - $(this).val(attributesArray[i][$type]); - }); - $bodyRadio.each(function() { - var $type = $(this).data().type; - $(this).prop("checked", attributesArray[i][$type]) - }); - $fieldTypeO.find('input[type="text"]').each(function() { - var $type = $(this).data().type; - if(!$type.match('option_lang')) { - $(this).val(attributesArray[i].select[$type]); - } - }); - $fieldTypeO.find('.add-target').find('.input-append').each(function(k) { - $(this).children('input[type="text"]').each(function(j) { - $(this).val(attributesArray[i].select.option[k][j]); - // var val = $(this).val(); - // append.push(val); - }); - }) - $fieldTypeO.find('input[type="checkbox"], input[type="radio"]').each(function() { - var $type = $(this).data().type; - $(this).prop("checked", attributesArray[i].select[$type]); - }); - $fieldTypeO.find('select').children("option").eq(attributesArray[i].select.dateFormat).prop('selected',true); - $bodySelected.eq(attributesArray[i].select.index).prop('selected',true); - $fieldTypeO.show(); - $fieldTypeN.empty().hide(); - $(this).addClass('hide') - return false - }) - }); - $('#attributes-area').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) { - if($(this).hasClass('togglebox')) { - if($(this).hasClass('disable')) { - $(this).find('.toggle-check') - .attr('value', 'false') - .closest('.attributes') - .removeClass('disabled') - .find('input, select') - .removeAttr('disabled') - .end('.attributes') - .find('.btn-group .btn') - .removeClass('disabled') - .end().find('.attribute_field_disabled').attr('value', 'false'); - if($(this).closest('.attributes').find('.dataType').children("option:selected").attr('ref')) { - $(this).closest('.attributes').find('.field-type').addClass('in').find('.control-group').delay(150).fadeIn(300); - } - } else { - $(this).find('.toggle-check') - .attr('value', 'true') - .closest('.attributes') - .addClass('disabled') - .find('.attributes-body input, .attributes-body select') - .attr({'disabled': 'disabled'}) - .end('.attributes') - .find('.btn-group .btn') - .addClass('disabled') - .end().find('.attribute_field_disabled').attr('value', 'true') - .end().find('.field-type .control-group').fadeOut(300, function() { - $(this).parent('.field-type').removeClass('in'); - }); - } - $(this).toggleClass('disable'); - }; - if($(this).hasClass('delete')) { - $(this).closest('.attributes').fadeOut(300, function() { - $('.attributes:not(:hidden)').each(function(i) { - $(this).find('.attributes-header h4 span').text(i+1); - }); - attributesHeaderLength = $('.attributes:not(:hidden)').length+1; - if(!$('.attributes:not(:hidden)').length) { - $('#attributes-area').addClass('clickHere'); - }; - }).find('.attribute_field_to_delete').attr('value', 'true');; - }; - if($(this).hasClass('trigger')) { - // appendIndex = $(this).closest('.controls').find('.input-append').length; - appendIndex = $(this).closest('.controls').find('.input-append:last-child').children('input:first-child').attr('name'); - // appendIndex = appendIndex.split("]["); - // appendIndex = parseInt(appendIndex[appendIndex.length-2])+1; - appendIndex = parseInt(appendIndex.match(/[^[\D\]]+(?=])/g)[1])+1; - console.log(appendIndex) - attributeIndex = $(this).closest('.attributes').index(); - templateType = $(this).closest('.attributes').find('.dataType').children("option:selected").attr('ref'); - $("#template-input-append").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo($(this).closest('.controls').find('.add-target')); - inputAppendLength(); - }; - if($(this).hasClass('remove-input')) { - $(this).parent('.input-append').fadeOut(300, function() { - $(this).remove() - inputAppendLength(); - }); - - } - event.preventDefault(); - }); - $('#attributes-area').delegate('.dataType', 'change', function() { - $(this).children("option:selected").each(function () { - var target = $(this).closest('.attributes').find('.field-type').not('.default'); - attributeIndex = $(this).closest('.attributes').index(); - appendIndex = 0 - // $(this).closest('.attributes').find('.add-target').find('.input-append').length; - if($(this).closest('.attributes').hasClass('default')){ - var i = $(this).closest('.attributes').index() - if($(this).attr('ref') == attributesArray[i].select.name) { - $(this).closest('.attributes').find('.field-type.default').show() - target.empty().hide(); - } else { - $(this).closest('.attributes').find('.field-type.default').hide() - if($(this).attr('ref')) { - templateType = $(this).attr('ref'); - target.removeAttr('class').addClass('field-type fade in ' + templateType).empty(); - $("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target); - if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') { - inputAppendLength(); - } - } else { - target.removeAttr('class').addClass('field-type fade') - target.empty(); - }; - target.show(); - } - } else { - if($(this).attr('ref')) { - templateType = $(this).attr('ref'); - target.removeAttr('class').addClass('field-type fade in ' + templateType).empty(); - $("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target); - if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') { - inputAppendLength(); - } - } else { - target.removeAttr('class').addClass('field-type fade') - target.empty(); - }; - } - }); - }); - } -}); \ No newline at end of file diff --git a/app/assets/javascripts/field-forms.js b/app/assets/javascripts/field-forms.js deleted file mode 100644 index 1c62186..0000000 --- a/app/assets/javascripts/field-forms.js +++ /dev/null @@ -1,494 +0,0 @@ -// Retrieve the initial data -function temporary() { - attributesArray.length = 0; - $('.attributes').each(function() { - var attributesData = {}, - $selectType = $('.dataType').data().type; - - // Capture "attributes-body" within the input[type = "text"] val - $(this).find('.attributes-body').find('input[type="text"]').each(function(i) { - var $type = $(this).data().type; - attributesData[$type] = $(this).val(); - }); - - // Capture "attributes-body" within the input[type = "radio"] checked - $(this).find('.attributes-body').find('input[type="radio"]').each(function(i) { - var $type = $(this).data().type; - attributesData[$type] = $(this).prop("checked"); - }); - - // Capture "attributes-body" within the dataType selected - $(this).find('.attributes-body').find('.dataType').children("option:selected").each(function () { - attributesData[$selectType] = {}; - attributesData[$selectType].index = $(this).index(); - attributesData[$selectType].name = $(this).attr('ref'); - if($(this).attr('ref') == 'typeB' || $(this).attr('ref') == 'typeE' || $(this).attr('ref') == 'typeF') { - attributesData[$selectType].option = []; - } - }); - - // Capture "field-type" within the input[type = "text"] val - $(this).find('.field-type').find('input[type="text"]').each(function(i) { - var $type = $(this).data().type; - if(!$type.match('option_lang')) { - attributesData[$selectType][$type] = $(this).val(); - } - }); - - $(this).find('.field-type .add-target').find('.input-append').each(function() { - var append = [] - $(this).children('input[type="text"]').each(function() { - var val = $(this).val(); - append.push(val); - }); - attributesData[$selectType].option.push(append); - }) - - // Capture "field-type" within the input[type = "checkbox"] checked - $(this).find('.field-type').find('input[type="checkbox"]').each(function() { - var $type = $(this).data().type; - attributesData[$selectType][$type] = $(this).prop("checked"); - }); - - // Capture "field-type" within the input[type = "radio"] checked - $(this).find('.field-type').find('input[type="radio"]').each(function() { - var $type = $(this).data().type; - attributesData[$selectType][$type] = $(this).prop("checked"); - }); - - // Capture "field-type" within the dataType selected - $(this).find('.field-type').find('select').children("option:selected").each(function () { - attributesData[$selectType].dateFormat = $(this).index(); - }); - - attributesArray.push(attributesData); - }); -}; - -// Determine the Append input length -function inputAppendLength() { - $('.add-target').each(function(i) { - if($(this).children('.input-append:not(:hidden)').length == 1 || $(this).children('.input-append').length == 1) { - $(this).children('.input-append').each(function() { - if($(this).children('div').hasClass('tab-content')) { - var btnLength = $(this).children('.btn').length; - $(this).find('.btn').eq(btnLength-2).addClass('last'); - $(this).find('.remove-input').addClass('hide'); - } else { - var mediumLength = $(this).children('.input-medium').length; - $(this).children('.input-medium').eq(mediumLength-1).addClass('last'); - $(this).children('.remove-input').addClass('hide'); - } - }); - } else { - $(this).children('.input-append').each(function() { - if($(this).children('div').hasClass('tab-content')) { - $(this).find('.btn').removeClass('last'); - $(this).find('.remove-input').removeClass('hide'); - } else { - $(this).children('.input-medium').removeClass('last'); - $(this).children('.remove-input').removeClass('hide'); - } - }); - } - }); -}; - -// Role Attribute Template Data -function setData(l, type, ol) { - var fields = $('#info').length ? "info[seminar_signup_fields]" : $('#sub_seminar_main').length ? "sub_seminar_main[seminar_signup_fields]" : "seminar_main[seminar_signup_fields]", - data = { - _add_more: ["add_more_" +l, fields+"["+l+"]["+type+"][add_more]"], - _calendar: ["calendar_" +l, fields+"["+l+"]["+type+"][calendar]"], - _cross_lang: ["cross_lang_" +l, fields+"["+l+"]["+type+"][cross_lang]"], - _disabled: ["disabled_" +l, fields+"["+l+"][disabled]"], - _format: ["format_" +l, fields+"["+l+"]["+type+"][format]"], - _initial: ["initial_" +l, fields+"["+l+"]["+type+"][initial]"], - _is_range: ["is_range_" +l, fields+"["+l+"]["+type+"][is_range]"], - _key: ["key_" +l, fields+"["+l+"][key]"], - _markup: fields+"["+l+"][markup]", - _option_list: ["option_list_"+l+"_"+ol, fields+"["+l+"]["+type+"][option_list]["+ol+"]", "option_list_"+ol], - _placeholder: ["placeholder_" +l, fields+"["+l+"]["+type+"][placeholder]"], - _title_translations: ["title_translations_" +l, fields+"["+l+"][title_translations]"], - _to_delete: ["to_delete_" +l, fields+"["+l+"][to_delete]"], - _to_require: ["to_require_" +l, fields+"["+l+"][to_require]"], - }; - return data; -} - -// Get Default Address Form -function getAddressForm(trigger, element, decide) { - if(decide) { - addressVal.length = addressArray.length = 0; - var addressAllVal = []; - var inputNameArray = []; - trigger.closest('.input-append').find('.tab-pane').each(function() { - var adderssText = $(this).children('input[type="text"]').val(), - addersshidden = '', - addressData = {}, - inputName = []; - $(this).children('input:not(:first)').each(function(j) { - var name = $(this).attr('name'), - val = $(this).val(); - addersshidden += val; - addressData[name] = val; - inputName.push(name); - }); - addressArray.push(addressData); - addressAllVal.push(adderssText); - inputNameArray.push(inputName); - if(adderssText != addersshidden) { - addressVal.push(false); - } else { - addressVal.push(true); - } - }); - element.find('.tab-pane').each(function(i) { - $(this).find('textarea, input[type="text"]').each(function(j) { - $(this).attr('name',inputNameArray[i][j]); - }); - if(addressVal[i]) { - $(this).find('textarea, input[type="text"]').each(function(j) { - $(this).val(addressArray[i][$(this).attr('name')]); - }); - } else { - $(this).find('textarea').val(addressAllVal[i]); - $(this).find('input[type="text"]').each(function(j) { - $(this).val(''); - }); - } - }); - }; - element.off('show'); -}; - -// Return Address Form -function returnAddressForm(element, decide) { - if(decide) { - addressArray.length = 0; - element.find('.tab-pane').each(function(i) { - var addressData = {}; - $(this).find('textarea, input[type="text"]').each(function(j) { - var name = $(this).attr('name'), - val = $(this).val(); - addressData[name] = val; - }); - addressArray.push(addressData); - }); - $.map(addressInputId, function(n, i) { - var v = ''; - $('#'+n).find('input[type="hidden"]').each(function() { - $(this).val(addressArray[i][$(this).attr('name')]); - v += addressArray[i][$(this).attr('name')] - }); - $('#'+n).find('input[type="text"]').each(function() { - $(this).val(v); - }); - }); - }; - returnDecide = false; -}; - -$(function() { - appendIndex = null; - if($('#user-forms').length) { - addressVal = []; - addressArray = []; - addressInputId = []; - seminar_mainType = null; - returnDecide = false; - $('.attributes').each(function() { - if($(this).find('.toggle-check').attr('value') == "true") { - $(this).addClass('disabled').children('.attributes-body').hide(); - } - }); - $('.returnDecide').on(clickEvent, function() { - returnDecide = true; - }) - $('#address-field').on('hidden', function () { - $('.btn[data-toggle="modal"]').removeClass('active').blur(); - $(this).find('.nav-tabs > li').removeClass('active').eq(0).addClass('active'); - $(this).find('.tab-content > .tab-pane').removeClass('active in').eq(0).addClass('active in'); - $(this).on('show', getAddressForm(null, $(this), false)); - returnAddressForm($(this), returnDecide) - }); - $('.control-group').delegate('.btn[data-toggle="modal"]', 'click', function() { - var $trigger = $(this); - addressInputId.length = 0; - $(this).closest('.input-append').find('.tab-pane').each(function() { - addressInputId.push($(this).attr('id')); - }); - $('#address-field').on('show', getAddressForm($trigger, $('#address-field'), true)); - }); - $('#user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) { - if($(this).hasClass('togglebox')) { - var seminar_main_staus = []; - if($(this).hasClass('disable')) { - $(this).find('.toggle-check') - .attr('value', 'false') - .closest('.attributes') - .removeClass('disabled') - .children('.attributes-body') - .fadeIn(300); - } else { - $(this).find('.toggle-check') - .attr('value', 'true') - .closest('.attributes') - .addClass('disabled') - .children('.attributes-body') - .fadeOut(300) - .find('.check') - .attr("checked",false) - .attr("value",seminar_main_staus); - } - $(this).toggleClass('disable'); - }; - if($(this).hasClass('remove-input')) { - $(this).closest('.input-append').fadeOut(300, function() { - $(this).remove(); - inputAppendLength(); - }); - }; - if($(this).hasClass('trigger')) { - appendIndex = $(this).closest('.controls').find('.input-append').length; - nameNumber = $(this).closest('.controls').find('.input-append:eq(0)').find('input').eq(0).attr('name'); - nameNumber = nameNumber.match(/[^[\D\]]+(?=])/g)[0]; - seminar_mainType = $(this).data('seminar_mains') - if($(this).hasClass('textInput')) { - $("#template-text").tmpl().appendTo($(this).closest('.controls').find('.add-target')); - } else if ($(this).hasClass('textLengInput')) { - $("#template-text-language").tmpl().appendTo($(this).closest('.controls').find('.add-target')); - } else if ($(this).hasClass('address')) { - $("#template-address").tmpl().appendTo($(this).closest('.controls').find('.add-target')); - } - inputAppendLength(); - }; - event.preventDefault(); - }); - inputAppendLength(); - } else { - attributesArray = []; - attributesHeaderLength = null; - templateType = null; - attributeIndex = null; - if($('.add-target').length) { - inputAppendLength(); - } - if(!$('.attributes').length) { - $('#attributes-area').addClass('clickHere'); - } else { - temporary(); - }; - - $('.add-attributes').on(clickEvent, function() { - if($('#attributes-area').hasClass('clickHere')) { - $('#attributes-area').removeClass('clickHere'); - }; - attributesHeaderLength = $('.attributes:not(:hidden)').length+1; - attributesLength = $('#attributes-area .attributes').length; - $("#template-attributes").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo( "#attributes-area" ); - $('.toggle-check').togglebox(); - }); - - - - $('.attributes.default').each(function(i) { - $(this).children('.field-type').not('.default').hide(); - $(this).find('input[type="text"]').on('keyup', function() { - $(this).trigger("checking"); - }); - $(this).find('input[type="radio"], input[type="checkbox"], select').change(function() { - $(this).trigger("checking"); - }); - $(this).delegate('input[type="text"], input[type="radio"], input[type="checkbox"], select', 'checking', function(e) { - var e = e.target.type, - $data = $(this).data().type; - switch(e) { - case 'text': - var val = $(this).val(); - if(!$(this).closest('.field-type').length) { - $data = attributesArray[i][$data]; - } else if(!$(this).closest('.add-target').length) { - $data = attributesArray[i].select[$data]; - } else { - appendIndex = $(this).parent('.input-append').index() - optionIndex = $(this).index() - $data = attributesArray[i].select.option[appendIndex][optionIndex]; - } - if(val != $data) { - $(this).closest('.attributes').find('.reply').removeClass('hide'); - } - break; - case 'radio': - var checked = $(this).prop("checked"); - $data = attributesArray[i][$data]; - if(checked != $data) { - $(this).closest('.attributes').find('.reply').removeClass('hide'); - } - break; - case 'checkbox': - var checked = $(this).prop("checked"); - $data = attributesArray[i].select[$data]; - if(checked != $data) { - $(this).closest('.attributes').find('.reply').removeClass('hide'); - } - break; - case 'select-one': - var ref, - $data = attributesArray[i].select.name; - $(this).children("option:selected").each(function() { - ref = $(this).attr('ref'); - }); - if(ref != $data) { - $(this).closest('.attributes').find('.reply').removeClass('hide'); - } - break; - }; - }); - $(this).delegate('.reply', clickEvent, function() { - var $bodyText = $(this).parent('.attributes-header').siblings('.attributes-body').find('input[type="text"]'), - $bodyRadio = $(this).parent('.attributes-header').siblings('.attributes-body').find('input[type="radio"]'), - $bodySelected = $(this).parent('.attributes-header').siblings('.attributes-body').find('.dataType').children("option"), - $fieldTypeO = $(this).parent('.attributes-header').siblings('.field-type.default'), - $fieldTypeN = $(this).parent('.attributes-header').siblings('.field-type').not('.default'); - $bodyText.each(function() { - var $type = $(this).data().type; - $(this).val(attributesArray[i][$type]); - }); - $bodyRadio.each(function() { - var $type = $(this).data().type; - $(this).prop("checked", attributesArray[i][$type]) - }); - $fieldTypeO.find('input[type="text"]').each(function() { - var $type = $(this).data().type; - if(!$type.match('option_lang')) { - $(this).val(attributesArray[i].select[$type]); - } - }); - $fieldTypeO.find('.add-target').find('.input-append').each(function(k) { - $(this).children('input[type="text"]').each(function(j) { - $(this).val(attributesArray[i].select.option[k][j]); - // var val = $(this).val(); - // append.push(val); - }); - }) - $fieldTypeO.find('input[type="checkbox"], input[type="radio"]').each(function() { - var $type = $(this).data().type; - $(this).prop("checked", attributesArray[i].select[$type]); - }); - $fieldTypeO.find('select').children("option").eq(attributesArray[i].select.dateFormat).prop('selected',true); - $bodySelected.eq(attributesArray[i].select.index).prop('selected',true); - $fieldTypeO.show(); - $fieldTypeN.empty().hide(); - $(this).addClass('hide') - return false - }) - }); - $('#attributes-area').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) { - if($(this).hasClass('togglebox')) { - if($(this).hasClass('disable')) { - $(this).find('.toggle-check') - .attr('value', 'false') - .closest('.attributes') - .removeClass('disabled') - .find('input, select') - .removeAttr('disabled') - .end('.attributes') - .find('.btn-group .btn') - .removeClass('disabled') - .end().find('.attribute_field_disabled').attr('value', 'false'); - if($(this).closest('.attributes').find('.dataType').children("option:selected").attr('ref')) { - $(this).closest('.attributes').find('.field-type').addClass('in').find('.control-group').delay(150).fadeIn(300); - } - } else { - $(this).find('.toggle-check') - .attr('value', 'true') - .closest('.attributes') - .addClass('disabled') - .find('.attributes-body input, .attributes-body select') - .attr({'disabled': 'disabled'}) - .end('.attributes') - .find('.btn-group .btn') - .addClass('disabled') - .end().find('.attribute_field_disabled').attr('value', 'true') - .end().find('.field-type .control-group').fadeOut(300, function() { - $(this).parent('.field-type').removeClass('in'); - }); - } - $(this).toggleClass('disable'); - }; - if($(this).hasClass('delete')) { - $(this).closest('.attributes').fadeOut(300, function() { - $('.attributes:not(:hidden)').each(function(i) { - $(this).find('.attributes-header h4 span').text(i+1); - }); - attributesHeaderLength = $('.attributes:not(:hidden)').length+1; - if(!$('.attributes:not(:hidden)').length) { - $('#attributes-area').addClass('clickHere'); - }; - }).find('.attribute_field_to_delete').attr('value', 'true');; - }; - if($(this).hasClass('trigger')) { - // appendIndex = $(this).closest('.controls').find('.input-append').length; - appendIndex = $(this).closest('.controls').find('.input-append:last-child').children('input:first-child').attr('name'); - // appendIndex = appendIndex.split("]["); - // appendIndex = parseInt(appendIndex[appendIndex.length-2])+1; - appendIndex = parseInt(appendIndex.match(/[^[\D\]]+(?=])/g)[1])+1; - console.log(appendIndex) - attributeIndex = $(this).closest('.attributes').index(); - templateType = $(this).closest('.attributes').find('.dataType').children("option:selected").attr('ref'); - $("#template-input-append").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo($(this).closest('.controls').find('.add-target')); - inputAppendLength(); - }; - if($(this).hasClass('remove-input')) { - $(this).parent('.input-append').fadeOut(300, function() { - $(this).remove() - inputAppendLength(); - }); - - } - event.preventDefault(); - }); - $('#attributes-area').delegate('.dataType', 'change', function() { - $(this).children("option:selected").each(function () { - var target = $(this).closest('.attributes').find('.field-type').not('.default'); - attributeIndex = $(this).closest('.attributes').index(); - appendIndex = 0 - // $(this).closest('.attributes').find('.add-target').find('.input-append').length; - if($(this).closest('.attributes').hasClass('default')){ - var i = $(this).closest('.attributes').index() - if($(this).attr('ref') == attributesArray[i].select.name) { - $(this).closest('.attributes').find('.field-type.default').show() - target.empty().hide(); - } else { - $(this).closest('.attributes').find('.field-type.default').hide() - if($(this).attr('ref')) { - templateType = $(this).attr('ref'); - target.removeAttr('class').addClass('field-type fade in ' + templateType).empty(); - $("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target); - if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') { - inputAppendLength(); - } - } else { - target.removeAttr('class').addClass('field-type fade') - target.empty(); - }; - target.show(); - } - } else { - if($(this).attr('ref')) { - templateType = $(this).attr('ref'); - target.removeAttr('class').addClass('field-type fade in ' + templateType).empty(); - $("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target); - if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') { - inputAppendLength(); - } - } else { - target.removeAttr('class').addClass('field-type fade') - target.empty(); - }; - } - }); - }); - } -}); \ No newline at end of file diff --git a/app/assets/javascripts/seminar.js.coffee b/app/assets/javascripts/seminar.js.coffee deleted file mode 100644 index 24f83d1..0000000 --- a/app/assets/javascripts/seminar.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/seminar_sets.js b/app/assets/javascripts/seminar_sets.js deleted file mode 100644 index 92be5b3..0000000 --- a/app/assets/javascripts/seminar_sets.js +++ /dev/null @@ -1,29 +0,0 @@ -$(function() { - - $('a[data-toggle="tab"]').click(function (e) { - e.preventDefault(); - $(this).tab('show'); - }); - - $.pageslide.closeCallback(function(pageslide, item) { - $('.filter-item').removeClass("active"); - }); - - $.pageslide.loadComplete(function(pageslide, item) { - - $('.filter-item').removeClass("active"); - - item.closest('li').addClass('active'); - - if(item.data('id') == 'new') { - resetForm(); - pageslide.find('form:eq(0)').attr('action', window.location.pathname); - pageslide.find('form:eq(0)').attr('method', 'post'); - }else { - setForm(item.data('form')); - pageslide.find('form:eq(0)').attr('action', window.location.pathname + '/' + item.data('id')); - pageslide.find('form:eq(0)').attr('method', 'put'); - } - - }); -}) \ No newline at end of file diff --git a/app/assets/stylesheets/seminar.css b/app/assets/stylesheets/seminar.css deleted file mode 100644 index cb2b874..0000000 --- a/app/assets/stylesheets/seminar.css +++ /dev/null @@ -1,18 +0,0 @@ -@media (max-width:767px){ - .form-group{ - justify-content:flex-start !important; - flex-wrap: wrap; - &>span{ - padding-left: 0.7em; - &>br{ - display:none; - } - } - &>.col-sm-10.controls{ - width:100%; - textarea{ - min-height: 8em; - } - } - } -} \ No newline at end of file diff --git a/app/assets/stylesheets/seminar_sets.css b/app/assets/stylesheets/seminar_sets.css deleted file mode 100644 index 16aacf9..0000000 --- a/app/assets/stylesheets/seminar_sets.css +++ /dev/null @@ -1,3 +0,0 @@ -/* - *= require lib/tags-groups -*/ \ No newline at end of file diff --git a/app/controllers/admin/seminar_agreements_controller.rb b/app/controllers/admin/seminar_agreements_controller.rb deleted file mode 100644 index fdca660..0000000 --- a/app/controllers/admin/seminar_agreements_controller.rb +++ /dev/null @@ -1,20 +0,0 @@ -class Admin::SeminarAgreementsController < OrbitAdminController - - def initialize - super - @app_title = 'seminar' - end - - def index - @seminar_agreement = SeminarAgreement.first || SeminarAgreement.create - @url = admin_seminar_agreement_path(@seminar_agreement) - end - - def update - @seminar_agreement = SeminarAgreement.first - @seminar_agreement.update_attributes(params.require(:seminar_agreement).permit!) - - redirect_to admin_seminar_agreements_path, notice: t('seminar.save_success') - end - -end diff --git a/app/controllers/admin/seminar_item_contents_controller.rb b/app/controllers/admin/seminar_item_contents_controller.rb deleted file mode 100644 index a445fb4..0000000 --- a/app/controllers/admin/seminar_item_contents_controller.rb +++ /dev/null @@ -1,70 +0,0 @@ -# encoding: utf-8 -class Admin::SeminarItemContentsController < OrbitAdminController - - before_action ->(module_app = @app_title) { set_variables module_app } - - def initialize - super - @app_title = "seminar" - end - - def index - - @seminar_item_contents = SeminarItemContent.where(:seminar_main_id => params[:seminar_main_id]).page(params[:page]).per(10) - @seminar = SeminarMain.find(params[:seminar_main_id]) - - @seminar_items = SeminarItem.where(:_id.nin=> SeminarItemContent.where(:seminar_main_id => params[:seminar_main_id]).collect{|t| t.seminar_item_id} ).collect{|a| [a.title,a.id]} - end - - def new - - @contents = SeminarItemContent.where(:seminar_main_id => params[:seminar_main_id]).collect{|t| t.seminar_item_id} - @seminar_item_content = SeminarItemContent.new - - @seminar_items = SeminarItem.where(:_id.nin=> @contents).collect{|a| [a.title,a.id]} - - end - - def create - - seminar_item_content = SeminarItemContent.new(seminar_item_content_params) - - seminar_item_content.create_user_id = current_user.id - seminar_item_content.update_user_id = current_user.id - - seminar_item_content.save - - redirect_to params['referer_url']+"?seminar_main_id="+seminar_item_content.seminar_main_id - - end - - def edit - - @seminar_item_content = SeminarItemContent.find(params[:id]) - @seminar = SeminarMain.find(@seminar_item_content.seminar_main_id) - - end - - def update - - @seminar_item_content = SeminarItemContent.find(params[:id]) - @seminar_item_content.update_attributes(seminar_item_content_params) - - redirect_to "/admin/seminar_item_contents?seminar_main_id="+@seminar_item_content.seminar_main_id - - end - - def destroy - @seminar_item_content = SeminarItemContent.find(params[:id]) - - @seminar_item_content.destroy - - redirect_to "/admin/seminar_item_contents?seminar_main_id="+@seminar_item_content.seminar_main_id - end - - private - - def seminar_item_content_params - params.require(:seminar_item_content).permit! - end -end diff --git a/app/controllers/admin/seminar_items_controller.rb b/app/controllers/admin/seminar_items_controller.rb deleted file mode 100644 index d376fcf..0000000 --- a/app/controllers/admin/seminar_items_controller.rb +++ /dev/null @@ -1,52 +0,0 @@ -class Admin::SeminarItemsController < OrbitAdminController - - def initialize - super - @app_title = 'seminar' - end - - def index - @seminar_items = SeminarItem.all - @url = admin_seminar_item_path(@seminar_items) - end - - def create - @seminar_item = SeminarItem.new(seminar_item_params) - @seminar_item.save - redirect_to request.referer, :status => 303 - end - - def create_in_form - @seminar_item = SeminarItem.new(seminar_item_params) - @seminar_item.saveseminar_item - render :json => {:id=>@seminar_item.id.to_s, :title=>@seminar_item.title}.to_json ,:layout => false - end - - def update - @seminar_item = SeminarItem.find(params[:id]) - @seminar_item.update_attributes(seminar_item_params) - redirect_to request.referer, :status => 303 - end - - def toggle - @seminar_item = SeminarItem.find(params[:id]) - @seminar_item.save! - redirect_to request.referer, :status => 303 - end - - def delete_items - items = SeminarItem.find(params[:ids].split(',')) rescue nil - if items - items.each(&:destroy) - end - redirect_to request.referer, :status => 303 - end - - - private - - def seminar_item_params - params.require(:seminar_item).permit! - end - -end diff --git a/app/controllers/admin/seminar_signups_controller.rb b/app/controllers/admin/seminar_signups_controller.rb deleted file mode 100644 index 5f1e989..0000000 --- a/app/controllers/admin/seminar_signups_controller.rb +++ /dev/null @@ -1,53 +0,0 @@ -# encoding: utf-8 -class Admin::SeminarSignupsController < OrbitAdminController - include Admin::SeminarsHelper - before_action ->(module_app = @app_title) { set_variables module_app } - - def initialize - super - @app_title = "seminar" - end - - def edit - OrbitHelper.set_params(params,current_user) - params[:controller] = "admin/seminars" - - @seminar_signup = SeminarSignup.find(params[:id]) - @seminar = SeminarMain.find(@seminar_signup.seminar_main_id) - - @form_index = 0 - - end - - def update - - @seminar_signup = SeminarSignup.find(params[:id]) - @seminar_signup.update_attributes(seminar_signup_params) - - if !params[:seminar_signup_values].nil? - params[:seminar_signup_values].each_with_index do |r,i| - field_value = r.last[:id].present? - @custom_field_value = SeminarSignupValue.put_field_values(@seminar_signup, r.last, r.last[:id], field_value) - end - end - - redirect_to "/admin/seminars/#{@seminar_signup.seminar_main_id}/seminar_signup" - - end - - def destroy - @seminar_signup = SeminarSignup.find(params[:id]) - - @seminar_main_id = @seminar_signup.seminar_main_id - - @seminar_signup.destroy - - redirect_to "/admin/seminars/#{@seminar_main_id}/seminar_signup" - end - - private - - def seminar_signup_params - params.require(:seminar_signup).permit! - end -end diff --git a/app/controllers/admin/seminars_controller.rb b/app/controllers/admin/seminars_controller.rb deleted file mode 100644 index ad7f4c9..0000000 --- a/app/controllers/admin/seminars_controller.rb +++ /dev/null @@ -1,340 +0,0 @@ -# encoding: utf-8 -class Admin::SeminarsController < OrbitAdminController - - require 'axlsx' - helper Admin::SeminarsFieldHelper - before_action ->(module_app = @app_title) { set_variables module_app } - before_action :set_seminar, only: [:edit, :set_write_off, :seminar_signup, :destroy] - - def initialize - super - @app_title = "seminar" - end - - def filter_fields(categories) - { - :category=>categories.map{|c| {:title=>(c.title.blank? ? " " : c.title), :id=>c.id}} - } - end - - def index - @categories = @module_app.categories.enabled - @filter_fields = filter_fields(@categories) - @table_fields = [:category, 'seminar.title', 'seminar.event_during', 'seminar.signup_during', 'seminar.signup_count', 'seminar.export'] - - if !params[:sort].blank? - if params[:sort] == 'event_during' - sort = {:seminar_start_date.to_sym=>params[:order]} - elsif params[:sort] == 'signup_during' - sort = {:signup_start_date.to_sym=>params[:order]} - else - sort = {params[:sort].to_sym=>params[:order]} - end - else - sort = {:signup_start_date=>"desc"} - end - - @seminars = SeminarMain.all.order_by(sort).with_categories(filters("category")) - - @seminars = search_data(@seminars,[:title]).page(params[:page]).per(10) - - if request.xhr? - render :partial => "index" - end - - end - - def export - - @seminar = SeminarMain.find(params[:id]) - @seminar_signups = SeminarSignup.where(:seminar_main_id => params[:id]) - filename = @seminar.title.parameterize.underscore + "_export.xlsx" - respond_to do |format| - format.xlsx { - response.headers['Content-Disposition'] = 'attachment; filename="' + filename + '"' - } - end - - end - - def new - @member = nil - @seminar = SeminarMain.new - create_set (false) - @signup_sets = @seminar.seminar_signup_field_sets - @submission_set = @seminar.seminar_submission_field_sets - @custom_set = @seminar.seminar_signup_field_customs - @seminar_items = SeminarItem.all - @review = @seminar.seminar_reviews.new() - end - - def create - - if !seminar_params['seminar_links_attributes'].nil? - seminar_params['seminar_links_attributes'].each do |idx,link| - seminar_params['seminar_links_attributes'].delete(idx.to_s) if link['url'].blank? - end - end - seminar_main_params = seminar_params - seminar_signup_set_params = seminar_main_params['seminar_signup_field_sets'] - seminar_submission_set_params = seminar_main_params['seminar_submission_field_sets'] - seminar_email_sets_params = seminar_main_params['seminar_email_sets'] - seminar_main_params.delete(:seminar_signup_field_sets) - seminar_main_params.delete(:seminar_submission_field_sets) - seminar_main_params.delete(:seminar_email_sets) - seminar = SeminarMain.new(seminar_main_params) - seminar.create_user_id = current_user.id - seminar.update_user_id = current_user.id - seminar.save - seminar_signup_set_params.each do |key,value| - seminar.seminar_signup_field_sets.create(value) - end - seminar_submission_set_params.each do |key,value| - seminar.seminar_submission_field_sets.create(value) - end - seminar_email_sets_params.each do |key,value| - seminar.seminar_email_sets.create(value) - end - redirect_to params['referer_url'] - - end - - def edit - @seminar_items = SeminarItem.all - @seminar = SeminarMain.where(id: params[:id]).first - @seminar.seminar_signup_field_sets.each do |signup_field_set| - if !(SeminarSignup.attribute_names.include? signup_field_set.field_name) && signup_field_set.field_name != 'recaptcha' - signup_field_set.delete - end - end - @seminar.seminar_submission_field_sets.each do |submission_field_set| - if !(SeminarSignupContribute.attribute_names.include? submission_field_set.field_name) - submission_field_set.delete - end - end - @seminar.seminar_signup_field_customs.each do |custom_set| - if !(@seminar.seminar_signup_fields.collect(&:id).include? custom_set.seminar_signup_field_id) - custom_set.delete - end - end - create_set (true) - @signup_sets = @seminar.seminar_signup_field_sets - @submission_set = @seminar.seminar_submission_field_sets - @custom_set = @seminar.seminar_signup_field_customs - if @seminar.seminar_reviews.first.nil? - @review = @seminar.seminar_reviews.new() - else - @review = @seminar.seminar_reviews.first - end - @member = MemberProfile.find(@review.reviewer_id) rescue nil - end - - def update - - - params[:seminar_main][:registration_status] = (params[:seminar_main][:registration_status] ? params[:seminar_main][:registration_status] : []) - - uid = params[:id].split('-').last - @seminar = SeminarMain.find_by(:uid=>uid) - - if params[:seminar_main][:seminar_signup_fields] - seminar_params[:seminar_signup_fields].each do |a| - @field_name = 'seminar_main' - field_status = a.last[:id].present? - @attribute_field = SeminarSignupField.add_seminar_signup_field(@seminar, a.last, a.last[:id], field_status) - @attribute = @seminar - end - flash.now[:notice] = "Updated Fields" - @seminar.seminar_signup_fields.each{|t| t.destroy if t["to_delete"] == true} - - redirect_to admin_seminars_path - elsif params[:seminar_main][:seminar_submission_fields] - params[:seminar_main][:seminar_submission_fields].each do |a| - @field_name = 'seminar_main' - field_status = a.last[:id].present? - @attribute_field = SeminarSubmissionField.add_seminar_signup_field(@seminar, a.last, a.last[:id], field_status) - @attribute = @seminar - end - flash.now[:notice] = "Updated Fields" - @seminar.seminar_submission_fields.each{|t| t.destroy if t["to_delete"] == true} - redirect_to admin_seminars_path - else - - if !seminar_params['seminar_links_attributes'].nil? - seminar_params['seminar_links_attributes'].each do |idx,link| - seminar_params['seminar_links_attributes'].delete(idx.to_s) if link['url'].blank? - end - end - - @seminar.update_user_id = current_user.id - if @seminar.update_attributes(seminar_params) - @seminar.seminar_signup_fields.each{|t| t.destroy if t["to_delete"] == true} - redirect_to params['referer_url'] - else - flash.now[:error] = t('update.error.category') - render action: :edit - end - end - - end - - def set_write_off - - @seminar.donation_write_off_status = true - @seminar.save - - redirect_to "/admin/seminars?page=#{params['page']}" - - end - - def destroy - - @seminar.destroy - redirect_to "/admin/seminars" - - end - - def seminar_signup_field - @field_name = 'seminar_main' - @attribute = SeminarMain.find(params[:id]) - @attribute_type = 'seminar' - @class = 'seminars' - end - - def seminar_submission_field - @field_name = 'seminar_main' - @attribute = SeminarMain.find(params[:id]) - @attribute_type = 'seminar' - @class = 'seminars' - end - - def seminar_signup - - if !params[:search].blank? - @seminar_signups = SeminarSignup.where(:seminar_main_id => @seminar.id, :name=>params[:search]).page(params[:page]).per(10) - else - @seminar_signups = SeminarSignup.where(:seminar_main_id => @seminar.id).page(params[:page]).per(10) - end - - end - - def edit_seminar_signup - @seminar_signup = SeminarSignup.find(params[:id]) - @seminar = SeminarMain.find(@seminar_signup.seminar_main_id) - end - - def delete_seminar_signup - - @seminar_signup = SeminarSignup.find(params[:id]) - - @seminar_id = @seminar_signup.seminar_main_id - - @seminar_signup.destroy - - redirect_to "/admin/seminars/@seminar_id.to_s/seminar_signup" - end - - private - - def set_seminar - @seminar = SeminarMain.find(params[:id]) - end - - def seminar_params - params.require(:seminar_main).permit! - end - def create_set (save_flag) - SeminarSignup.attribute_names.each do |attr_signup| - if !(['_id', 'created_at', 'updated_at','seminar_main_id'].include? attr_signup) - signup_set = @seminar.seminar_signup_field_sets.select{|v| v.field_name==attr_signup } - if signup_set.length==0 - if ['status','name','tel','phone','email','password'].include? attr_signup - disabled = false - else - disabled = true - end - if ['status','name','tel'].include? attr_signup - hidden = false - else - hidden = true - end - name1 = Hash.new - now_locale = I18n.locale - I18n.available_locales.each do |locale| - I18n.locale = locale - name1[locale] = t("seminar_signup.#{attr_signup}") - end - I18n.locale = now_locale - if save_flag - @seminar.seminar_signup_field_sets.create(field_name:attr_signup,disabled:disabled,hidden:hidden,name:name1,placeholder:name1) - else - @seminar.seminar_signup_field_sets.new(field_name:attr_signup,disabled:disabled,hidden:hidden,name:name1,placeholder:name1) - end - end - end - end - signup_set = @seminar.seminar_signup_field_sets.select{|v| v.field_name== 'recaptcha' } - if signup_set.length==0 - name1 = Hash.new - now_locale = I18n.locale - I18n.available_locales.each do |locale| - I18n.locale = locale - name1[locale] = t("seminar_signup.recaptcha") - end - I18n.locale = now_locale - if save_flag - @seminar.seminar_signup_field_sets.create(field_name:'recaptcha',name:name1,placeholder:name1,hidden:true) - else - @seminar.seminar_signup_field_sets.new(field_name:'recaptcha',name:name1,placeholder:name1,hidden:true) - end - end - SeminarSignupContribute.attribute_names.each do |attr_submission| - if !(['_id', 'created_at', 'updated_at','seminar_signup_id'].include? attr_submission) - signup_set = @seminar.seminar_submission_field_sets.select{|v| v.field_name==attr_submission } - if signup_set.length==0 - name1 = Hash.new - now_locale = I18n.locale - I18n.available_locales.each do |locale| - I18n.locale = locale - name1[locale] = t("seminar_signup.#{attr_submission}") - end - I18n.locale = now_locale - if save_flag - @seminar.seminar_submission_field_sets.create(field_name:attr_submission,name:name1,placeholder:name1) - else - @seminar.seminar_submission_field_sets.new(field_name:attr_submission,name:name1,placeholder:name1) - end - end - end - end - @seminar.seminar_signup_fields.all.map{|v| v}.each do |field| - set = @seminar.seminar_signup_field_customs.select{|v| v.seminar_signup_field_id==field.id} - if set.length == 0 - @seminar.seminar_signup_field_customs.create(seminar_signup_field_id:field.id) - end - end - @email_set = [] - ['signup','submission','add_file','edit_file'].each do |field_name| - email_set = @seminar.seminar_email_sets.select{|v| v.field_name==field_name} - if email_set.length==0 - title = Hash.new - content = Hash.new - now_locale = I18n.locale - I18n.available_locales.each do |locale| - I18n.locale = locale - title[locale] = t("seminar.email_#{field_name}_success") - content[locale] = t("seminar.email_#{field_name}_content") - end - I18n.locale = now_locale - if save_flag - email_set = @seminar.seminar_email_sets.create(field_name:field_name,title:title,content:content) - else - email_set = @seminar.seminar_email_sets.new(field_name:field_name,title:title,content:content) - end - else - email_set = email_set[0] - end - @email_set << email_set - end - end -end diff --git a/app/controllers/seminars_controller.rb b/app/controllers/seminars_controller.rb deleted file mode 100644 index 968a28d..0000000 --- a/app/controllers/seminars_controller.rb +++ /dev/null @@ -1,401 +0,0 @@ -class SeminarsController < ApplicationController - - helper MemberHelper - include ActionView::Context #vary important (only add this can access @@session from view) - include Admin::SeminarsHelper - # include SimpleCaptcha::ControllerHelpers - def index - - time_now = Time.now - - seminars = SeminarMain.all.desc(:seminar_start_date).filter_by_categories - { - "seminars" => seminars, - 'time_now' => time_now, - "total_pages" => seminars.total_pages - } - - end - - def show_privacy - - params = OrbitHelper.params - - seminar = SeminarMain.where(uid: params[:uid]).first - - seminar_agreement = SeminarAgreement.first - - { - 'seminar' => seminar, - "seminar_agreement" => seminar_agreement - } - - end - - def show_data - - time_now = Time.now - - params = OrbitHelper.params - - seminar = SeminarMain.find_by(uid: params[:uid]) - - if !seminar.registration_status.blank? && seminar.signup_start_date <= time_now && ( seminar.signup_end_date.nil? || seminar.signup_end_date+1 >= time_now ) - sign_up = ('' + t('seminar.signup') + '').html_safe - elsif seminar.registration_status.blank? - sign_up = t('seminar.sign_up_not_open') - elsif seminar.signup_start_date > time_now - sign_up = t('seminar.sign_up_not_yet') - else - sign_up = t('seminar.sign_up_overdue') - end - - if !seminar.registration_status.blank? && seminar.registration_status.include?('C') && seminar.contribute_start_date <= time_now && ( seminar.contribute_end_date.nil? || seminar.contribute_end_date+1 >= time_now ) - if !@@session[:seminar_signup_id].blank? - if @@session[:seminar_main_id] == seminar.id - contribute_action = ('' + t('seminar_signup.uploads') + '').html_safe - else - contribute_action = ('' + t('seminar_signup.con_login') + '').html_safe - end - else - contribute_action = ('' + t('seminar_signup.con_login') + '').html_safe - end - end - - - - { - 'seminar' => seminar, - 'sign_up' => sign_up, - 'contribute_action' => contribute_action, - 'time_now' => time_now, - 'contribute_time_range' => SeminarMain.time_range(seminar.contribute_start_date, seminar.contribute_end_date), - 'sign_up_time_range' => SeminarMain.time_range(seminar.signup_start_date, seminar.signup_end_date), - 'seminar_time_range' => SeminarMain.time_range(seminar.seminar_start_date, seminar.seminar_end_date) - } - - end - - def show - - params = OrbitHelper.params - - module_app = ModuleApp.where(:key => "seminar").first - - categories = module_app.categories - - seminar = SeminarMain.where(uid: params[:uid]).first - - seminar_signup = SeminarSignup.new - - time_now = Time.now - { - "seminar" => seminar, - "seminar_signup" => seminar_signup, - "time_now" => time_now - } - - end - - def check_email - - params = OrbitHelper.params - - if !params[:email].blank? - count = SeminarSignup.where(:email => params[:email], :seminar_main_id => params[:no]).count - - result = count > 0 ? t('seminar.already_used') : t('seminar.available') - else - result = t('seminar.please_enter_email') - end - - { - "result" => result - } - - end - - def check_availability - - params = OrbitHelper.params - - response = {} - case params[:type] - when "seminar_signup_email" - - response["success"] = SeminarSignup.where(:email => params[:value], :seminar_main_id => params[:no]).count > 0 ? false : true - end - render :json => response.to_json - end - - def create - - @signup = SeminarSignup.where(email: params[:seminar_signup][:email], seminar_main_id: params[:seminar_signup][:seminar_main_id] ).first - - @seminar_signup = SeminarSignup.new(seminar_signup_params) - @seminar = SeminarMain.where(id:params[:seminar_signup][:seminar_main_id]).first - if @seminar.seminar_signup_field_sets.count!=0 - flag = @seminar.seminar_signup_field_sets.select{|v| v.field_name=='recaptcha'}[0].disabled - else - flag = false - end - if gotcha_valid? || flag - if @signup.blank? && @seminar_signup.save - # if gotcha_valid? && @seminar_signup.save - - if !params[:seminar_signup_values].nil? - seminar_signup_values_params.each_with_index do |r,i| - field_value = r.last[:id].present? - @custom_field_value = SeminarSignupValue.put_field_values(@seminar_signup, r.last, r.last[:seminar_signup_field_id], field_value) - end - end - if params['seminar_signup']['status']=='C' - status_param = '&status=' - send_mail('submission',params[:seminar_signup][:email],params[:seminar_signup][:seminar_main_id]) - else - status_param = '' - send_mail('signup',params[:seminar_signup][:email],params[:seminar_signup][:seminar_main_id]) - end - redirect_to "#{params[:referer_url]}/?method=signup_ok#{status_param}" - else - if !@signup.blank? - redirect_to "#{params[:referer_url]}", :notice => 'mail已存在' - else - redirect_to "#{params[:referer_url]}", :notice => t('recaptcha.errors.verification_failed') - end - end - else - redirect_to "#{params[:referer_url]}", :notice => t('recaptcha.errors.verification_failed') - end - - end - - def signup_ok - end - - def add_file_proc - - update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values']) - flag = true - update_params.permit! - if !update_params['seminar_submission_values'].nil? - if update_params['seminar_submission_values']['0']['value'].class==String - value = update_params['seminar_submission_values']['0']['value'] - if !value.to_s.blank? - flag = false - end - else - update_params['seminar_submission_values']['0']['value'].each do |key,value| - if !value.to_s.blank? - flag = false - end - end - end - else - flag = false - end - if flag - update_params['seminar_submission_values']['0']['value']['en'] = ' ' - end - @con = SeminarSignupContribute.new(update_params) - if @con.save - signup = SeminarSignup.where(id:update_params['seminar_signup_id']).first - seminar_id = signup.seminar_main_id - @seminar = SeminarMain.where(id:seminar_id).first - send_mail('add_file',signup.email,seminar_id) - redirect_to "#{params[:referer_url]}/?method=con_upload" - else - redirect_to "#{params[:referer_url]}", :notice => t('recaptcha.errors.verification_failed') - end - - end - - def update - @con = SeminarSignupContribute.find(params[:seminar_signup_contribute][:id]) - update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values']) - flag = true - update_params.permit! - if update_params['seminar_submission_values']['0']['value'].class==String - value = update_params['seminar_submission_values']['0']['value'] - if !value.to_s.blank? - flag = false - end - else - update_params['seminar_submission_values']['0']['value'].each do |key,value| - if !value.to_s.blank? - flag = false - end - end - end - - if flag - update_params['seminar_submission_values']['0']['value']['en'] = ' ' - end - @con.update_attributes(update_params) - if @con.save - signup = SeminarSignup.where(id:update_params['seminar_signup_id']).first - seminar_id = signup.seminar_main_id - @seminar = SeminarMain.where(id:seminar_id).first - send_mail('edit_file',signup.email,seminar_id) - redirect_to "#{params[:referer_url]}/?method=con_upload" - else - redirect_to "#{params[:referer_url]}", :notice => t('recaptcha.errors.verification_failed') - end - - end - - def del_file - - con = SeminarSignupContribute.find(params[:con_no]) - - # seminar_signup = SeminarSignup.find_by(_id: con.seminar_signup_id ) - # seminar = SeminarMain.find_by(_id: seminar_signup.seminar_main_id ) - - con.destroy - - redirect_to "#{params[:referer_url]}/?method=con_upload" - - end - - def add_file - - if !@@session[:seminar_main_id].blank? - - seminar = SeminarMain.find_by(id: @@session[:seminar_main_id]) - seminar_signup = SeminarSignup.find_by(_id: @@session[:seminar_signup_id], seminar_main_id: @@session[:seminar_main_id] ) - - else - - seminar = {} - seminar_signup = {} - - end - - con = SeminarSignupContribute.new - - { - 'con' => con, - 'seminar' => seminar, - 'seminar_signup' => seminar_signup - } - - end - - def edit_file - - params = OrbitHelper.params - if !@@session[:seminar_main_id].blank? - seminar = SeminarMain.find_by(id: @@session[:seminar_main_id]) - seminar_signup = SeminarSignup.find_by(_id: @@session[:seminar_signup_id], seminar_main_id: @@session[:seminar_main_id] ) - else - seminar = {} - seminar_signup = {} - end - con = SeminarSignupContribute.find(params[:con_no]) - { - 'con' => con, - 'seminar' => seminar, - 'seminar_signup' => seminar_signup - } - - end - - def con_upload - - time_now = Time.now - - if !@@session[:seminar_main_id].blank? - - seminar = SeminarMain.find_by(id: @@session[:seminar_main_id]) - - seminar_signup = SeminarSignup.find_by(_id: @@session[:seminar_signup_id], seminar_main_id: @@session[:seminar_main_id] ) - - else - - seminar = {} - seminar_signup = {} - - end - - { - 'time_now' => time_now, - 'seminar' => seminar, - 'seminar_signup' => seminar_signup - } - - end - - def con_logout - - # redirect_to page_for_seminar_url - - end - - def con_login - - time_now = Time.now - - params = OrbitHelper.params - - seminar = SeminarMain.find_by(uid: params[:uid]) - - { - 'seminar' => seminar, - 'time_now' => time_now - } - - end - - def con_login_proc - - seminar = SeminarMain.find_by(id: params[:seminar_signup][:seminar_main_id]) - - @seminar_signup = SeminarSignup.where(:status=>'C', :email=> params[:user_name], :password => params[:password], :seminar_main_id => params[:seminar_signup][:seminar_main_id]).first - - if !@seminar_signup.blank? - - session[:seminar_signup_id] = @seminar_signup.id - session[:seminar_main_id] = @seminar_signup.seminar_main_id - - redirect_to "#{params[:referer_url]}/?method=con_upload" - else - redirect_to "#{params[:referer_url]}/?method=con_login", :notice => '登入失敗' - end - - end - - def seminar_signup_params - params.require(:seminar_signup).permit! - end - - def seminar_signup_contribute_params - params.require(:seminar_signup_contribute).permit! - end - - def seminar_signup_values_params - params.require(:seminar_signup_values).permit! - end - def send_mail(field_name,email,seminar_id) - email_set = @seminar.seminar_email_sets.select{|v| v.field_name == field_name} - if email_set.length==0 - mail = Email.create(mail_to:[email], - module_app_key:"seminar", - template:"email/#{field_name}_email.html.erb", - mail_sentdate:Time.current, - mail_subject: t("seminar.email_#{field_name}_success"), - template_data:{'seminar_id'=>seminar_id,'locale'=>I18n.locale}) - elsif !(email_set[0].disabled) - mail = Email.create(mail_to:[email], - module_app_key:"seminar", - template:"email/#{field_name}_email.html.erb", - mail_sentdate:Time.current, - mail_subject: email_set[0].title[I18n.locale], - template_data:{'seminar_id'=>seminar_id,'locale'=>I18n.locale}) - end - begin - mail.deliver - rescue => e - puts ["email can't deliver",e] - end - end -end diff --git a/app/helpers/admin/seminars_field_helper.rb b/app/helpers/admin/seminars_field_helper.rb deleted file mode 100644 index f3d385c..0000000 --- a/app/helpers/admin/seminars_field_helper.rb +++ /dev/null @@ -1,530 +0,0 @@ -module Admin::SeminarsFieldHelper - - include ActionView::Helpers::FormTagHelper - include ActionView::Helpers::FormOptionsHelper - include ActionView::Helpers::DateHelper - include ActionView::Helpers::TagHelper - include ActionView::Helpers::RenderingHelper - include ActionView::Context - include OrbitBasis::RenderAnywhere - - include OrbitFormHelper - - def block_helper(member,index,disable = false,attribute_type=nil,signup=nil, to_require=true) - unless self.disabled - @index = index - @require = to_require - @markup_options = markup_options.merge(:disabled=>disable, :required => to_require) - @member = member - @attribute_value = @member.get_value_from_field_id(id,signup) - @attribute_type = attribute_type - @new_attribute = @attribute_value.nil? - @attribute_value = @attribute_value || signup.seminar_signup_values.build(seminar_signup_field_id: id) - @prefiled_value = @attribute_value.value rescue nil - return instance_eval("render_#{markup}") rescue "" - end - end - - def lang_tab(str,lang) - content_tag(:div,str,:class=>"tab-pane fade",:id=>(get_field_name_base+"tab_#{lang}")) - end - - def render_address - control_group_wrapper do |key,value| - value = (can_muti_lang_input? ? @prefiled_value[key] : @prefiled_value) rescue nil - key_field = can_muti_lang_input? ? "[#{key}]" : "" - place_holder= @panel_setting["placeholder"][key] rescue '' - # result = text_area_tag(get_field_name_base + key_field, value,@markup_options.merge({:placeholder=>place_holder,:for=>key})) - result = text_field_tag(get_field_name_base + key_field, value,@markup_options.merge({:placeholder=>place_holder,:for=>key})) - - add_ext= @attribute_value.address_key[key] rescue {} - - result << hidden_field_tag(get_basic_field_name_base+"[address_key][#{key}][county]",add_ext["county"],:class=>"county_#{key}") - result << hidden_field_tag(get_basic_field_name_base+"[address_key][#{key}][street_address]",add_ext["street_address"],:class=>"street_address_#{key}") - result << hidden_field_tag(get_basic_field_name_base+"[address_key][#{key}][city]",add_ext["city"],:class=>"city_#{key}") - result << hidden_field_tag(get_basic_field_name_base+"[address_key][#{key}][zip]",add_ext["zip"],:class=>"zip_#{key}") - result << hidden_field_tag(get_basic_field_name_base+"[address_key][#{key}][country]",add_ext["country"],:class=>"country_#{key}") - result << hidden_field_tag(get_basic_field_name_base+"[address_key][#{key}][indicator]",add_ext["indicator"],:class=>"indicator_#{key}") - end - end - - def render_checkbox - @prefiled_value ||=[] - control_group_wrapper do - a = self.typeE[:option_list].collect do |key,value| - label_tag(key,check_box_tag(get_field_name_base+"[#{key}]", true , (@prefiled_value.include?(key) ? true : false), { :id=>"#{get_basic_field_name_org}_#{self.id}"})+value[I18n.locale.to_s],@markup_options.merge(:class=>"checkbox inline")) - end.join.html_safe rescue "" - end - end - - def render_date - d = DateTime.now() - - if date_is_range? - # fill_from = @attribute_value.get_date(:from) rescue nil - # fill_to = @attribute_value.get_date(:to) rescue nil - control_group_wrapper do - - case self.typeC['format'] - when 'format1' - fill_from = (@prefiled_value && @prefiled_value["from"] ) ? @prefiled_value["from"] : d.strftime("%Y/%m/%d %H:%M") - fill_to = (@prefiled_value && @prefiled_value["to"] ) ? @prefiled_value["to"] : d.strftime("%Y/%m/%d %H:%M") - buf = datetime_picker(get_field_name_base+'[from]', fill_from, 'yyyy/MM/dd hh:mm', true) - buf << ' ~ ' - buf << datetime_picker(get_field_name_base+'[to]', fill_to, 'yyyy/MM/dd hh:mm', true) - when 'format2' - fill_from = (@prefiled_value && @prefiled_value["from"] ) ? @prefiled_value["from"] : d.strftime("%Y/%m/%d") - fill_to = (@prefiled_value && @prefiled_value["to"] ) ? @prefiled_value["to"] : d.strftime("%Y/%m/%d") - buf = datetime_picker(get_field_name_base+'[from]', fill_from, 'yyyy/MM/dd') - buf << ' ~ ' - buf << datetime_picker(get_field_name_base+'[to]', fill_to, 'yyyy/MM/dd') - when 'format3' - fill_from = (@prefiled_value && @prefiled_value["from"] ) ? @prefiled_value["from"] : d.strftime("%Y/%m") - fill_to = (@prefiled_value && @prefiled_value["to"] ) ? @prefiled_value["to"] : d.strftime("%Y/%m/") - buf = datetime_picker(get_field_name_base+'[from]', fill_from, 'yyyy/MM') - buf << ' ~ ' - buf << datetime_picker(get_field_name_base+'[to]', fill_to, 'yyyy/MM') - when 'format4' - fill_from = (@prefiled_value && @prefiled_value["from"] ) ? @prefiled_value["from"] : d.strftime("%Y") - fill_to = (@prefiled_value && @prefiled_value["to"] ) ? @prefiled_value["to"] : d.strftime("%Y") - buf = datetime_picker(get_field_name_base+'[from]', fill_from, 'yyyy') - buf << ' ~ ' - buf << datetime_picker(get_field_name_base+'[to]', fill_to, 'yyyy') - end - - # buf = date_select(get_field_name_base+'[from]',nil,@markup_options.merge(:default=>fill_from),:class=>"input-small") - # buf << ' ~ ' - # buf << date_select(get_field_name_base+'[to]',nil,@markup_options.merge(:default=>fill_to),:class=>"input-small") - buf - end - else - # @prefiled_value = @attribute_value.get_date - # @prefiled_value = @attribute_value.get_date - - case self.typeC['format'] - when 'format1' - tmp = datetime_picker(get_field_name_base, (@prefiled_value ? @prefiled_value : d.strftime("%Y/%m/%d %H:%M")), 'yyyy/MM/dd hh:mm', true) - when 'format2' - tmp = datetime_picker(get_field_name_base, (@prefiled_value ? @prefiled_value : d.strftime("%Y/%m/%d")), 'yyyy/MM/dd') - when 'format3' - tmp = datetime_picker(get_field_name_base, (@prefiled_value ? @prefiled_value : d.strftime("%Y/%m")), 'yyyy/MM') - when 'format4' - tmp = datetime_picker(get_field_name_base, (@prefiled_value ? @prefiled_value : d.strftime("%Y")), 'yyyy') - end - - control_group_wrapper{tmp} - # control_group_wrapper{date_select(get_field_name_base,nil,@markup_options.merge(:default=>@prefiled_value),:class=>"input-small")} - - end - end - - def seminar_datetime_picker(object_name, value, format, time=false) - content_tag :div, :class => "input-append datetimepick", "data-date-format"=>format, "data-picktime"=>"#{time}" do - concat text_field_tag(object_name, value, :placeholder=>format) - concat (content_tag :span, :class => 'add-on clearDate' do - content_tag :i, nil, :class => 'icons-cross-3' - end) - concat (content_tag :span, :class => 'add-on iconbtn' do - content_tag :i, nil, 'data-time-icon' => 'icons-clock', 'data-date-icon' => 'icons-calendar', :class=>"icons-calendar" - end) - end - end - - def render_date_durnation #Need re-write low priority - - end - - def render_radio_button - @prefiled_value ||=[] - control_group_wrapper do - self.typeE[:option_list].collect do |key,value| - label_tag(key,radio_button_tag(get_field_name_base, key , (@prefiled_value.include?(key) ? true : false), {:required=>@require})+value[I18n.locale.to_s],@markup_options.merge(:class=>"radio inline")) - end.join.html_safe - end - end - - def render_select - prompt = @panel_setting["initial"][I18n.locale.to_s] rescue nil - @markup_options.merge!(:prompt => prompt) unless prompt.nil? - control_group_wrapper{select_tag( get_field_name_base,options_for_select(self.typeB["option_list"].collect{|p| [p[1][I18n.locale.to_s],p[0]]},@prefiled_value),@markup_options)} rescue "" - end - - def render_text_area - control_group_wrapper do |key,value| - if !@prefiled_value.nil? - value = can_muti_lang_input? ? @prefiled_value[key] : @prefiled_value - else - value = nil - end - key = can_muti_lang_input? ? "#{key}" : I18n.locale - place_holder= typeD["placeholder"][key] rescue '' - name1 = can_muti_lang_input? ? (get_field_name_base + "[#{key}]") : get_field_name_base - text_area_tag(name1, value,@markup_options.merge(:placeholder=>place_holder,:class=>'ckeditor input-medium form-control')) - end - end - - def render_text_field - a = control_group_wrapper do |key,value| - add_more_blank = can_add_more ? "[]" : "" - key_field = can_muti_lang_input? ? "#{key}" : I18n.locale - place_holder= typeA["placeholder"][key_field] rescue '' - name1 = can_muti_lang_input? ? ([get_field_name_base,add_more_blank,"[#{key_field}]"].join) : ([get_field_name_base,add_more_blank].join) - text_field_tag(name1, value,@markup_options.merge(:placeholder=>place_holder,:class=>'input-medium form-control')) - end - end - - def date_is_range? - is_range = "false" - data = get_data - if !data.nil? - is_range = data['is_range'] if data.has_key? "is_range" - end - is_range == "true" - end - -protected - - def valid_locales - site = Site.first - [I18n.locale]+(site.valid_locales-[I18n.locale]) - end - - def lang_panel_tabbable_wrapper(add_more_params,&block) - add_more_counter = '' - - if self.markup=='text_area' #or self.markup=='address' - tmp1 = valid_locales.collect do |key| - if !@prefiled_value.nil? - value = @prefiled_value[key] rescue nil - else - value = nil - end - # div_class_ary = ["tab-pane" ,"fade","#{get_pairing_tab_class({})}_#{key}"] - div_class_ary = ["tab-pane" ,"fade"] - if @show_set_field && @markup=='text_area' - div_id = "ckeditor_#{get_pairing_tab_class({})}_#{key}" - puts 'ckeditor_' - else - div_id = "#{get_pairing_tab_class({})}_#{key}" - end - if can_add_more - add_more_value = add_more_params[0][:value] - add_more_counter = add_more_params[0][:counter] - value = add_more_value[key] rescue nil - div_class_ary << "add_more_item_#{add_more_counter}" - end - - div_class = div_class_ary.join(" ") - div_class << (key == I18n.locale ? " active in" : '') - content_tag(:div,yield(key,value), :id=>div_id,:class=>div_class) - end# of VALID_LOCALES.collect for tabed input - tmp2 = content_tag(:div,:class => 'btn-group', :data=>{:toggle=>"buttons-radio"}) do - buff2 = valid_locales.each.collect do |key| - # link_entry = self.add_more ? "#{add_more_tab(:tab_btn,loop_counter,key)}" : "#tab"+id.to_s+"_#{key}" - if @show_set_field && @markup=='text_area' - link_entry_ary = ["#ckeditor_#{get_pairing_tab_class({})}","_#{key}"] - else - link_entry_ary = ["##{get_pairing_tab_class({})}","_#{key}"] - end - link_entry_ary << ".add_more_item_#{add_more_counter}" if can_add_more - link_entry = link_entry_ary.join - link_to(I18n.t(key),link_entry,:data=>{:toggle=>"tab"},:class=>"btn #{(key == I18n.locale ? "active" : nil)}",:for=>key) - end # of VALID_LOCALES.collect for tabs - - buff2 << link_to((content_tag :i,'',:class=>'icon-edit'),"##{get_pairing_tab_class({})}_m_window", :role=>"button",:class=>'btn',:data=>{:toggle=>"modal"}) if self.markup == 'address' - buff2 << link_to((content_tag :i,'',:class=>'icon-trash'),"#",:class=>"btn remove-input") if self.add_more - buff2.join.html_safe - end # of content ul - tmp = content_tag :div,:class=> "tab-content textarea-lang" do - tmp2 << tmp1.join('').html_safe - end - else - - # tmp = content_tag :div,:class=> (add_more || self.markup=='address') ? "input-append" : "tab-content" do - tmp1 = - content_tag :div,:class=> "tab-content" do - - buff = valid_locales.collect do |key| - value = @prefiled_value[key] rescue nil - # div_class_ary = ["tab-pane" ,"fade","#{get_pairing_tab_class({})}_#{key}"] - div_class_ary = ["tab-pane" ,"fade"] - - div_id = "#{get_pairing_tab_class({})}_#{key}" - - - if can_add_more - add_more_value = add_more_params[0][:value] - add_more_counter = add_more_params[0][:counter] - value = add_more_value[key] rescue nil - div_class_ary << "add_more_item_#{add_more_counter}" - end - - div_class = div_class_ary.join(" ") - div_class << (key == I18n.locale ? " active in" : '') - content_tag(:div,yield(key,value), :id=>div_id,:class=>div_class) - end# of VALID_LOCALES.collect for tabed input - - buff.join('').html_safe - - end - - tmp2 = content_tag(:div,:class => 'btn-group', :data=>{:toggle=>"buttons-radio"}) do - buff2 = valid_locales.each.collect do |key| - # link_entry = self.add_more ? "#{add_more_tab(:tab_btn,loop_counter,key)}" : "#tab"+id.to_s+"_#{key}" - link_entry_ary = ["##{get_pairing_tab_class({})}","_#{key}"] - link_entry_ary << ".add_more_item_#{add_more_counter}" if can_add_more - link_entry = link_entry_ary.join - link_to(I18n.t(key),link_entry,:data=>{:toggle=>"tab"},:class=>"btn #{(key == I18n.locale ? "active" : nil)}",:for=>key) - end # of VALID_LOCALES.collect for tabs - - buff2 << link_to((content_tag :i,'',:class=>'icon-edit'),"#address-field", :role=>"button",:class=>'btn',:data=>{:toggle=>"modal"}) if self.markup == 'address' - buff2 << link_to((content_tag :i,'',:class=>'icon-trash'),"#",:class=>"btn remove-input") if self.add_more - buff2.join.html_safe - end # of content ul - - - - tmp = content_tag :div,:class=> "input-append" do - tmp1 << tmp2 - end - - end - - end - - - def controls_wrapper(*add_more_params,&block) - result = Array.new - add_more_counter = "" - - if can_add_more - add_more_counter = add_more_params[0][:counter] - add_more_value = add_more_params[0][:value] - end - - - - if can_muti_lang_input? - result << lang_panel_tabbable_wrapper(add_more_params,&block) - result << gen_modal_dialog if self.markup == "address" - # result << add_more_unt if can_add_more - else #cross lang field - case can_add_more - when true - value = add_more_params[0][:value] - result << content_tag(:div,:class=>"input-append"){yield(nil,value) + link_to((content_tag :i,'',:class=>'icon-trash'),"#",:class=>"btn remove-input") } - # result << add_more_unt - else - value = @prefiled_value - result << yield(nil,value) - end - - - end - if self.markup == "address" - result - else - result[0] - end - - end # of def controls_wrapper(&block) - - def control_group_wrapper(&block) - div_class = can_muti_lang_input? ? "col-sm-10 controls" : "col-sm-10 controls" - # div_class = can_muti_lang_input? ? "control-group language-swich" : "control-group" - result = "" - - case self.markup - - when "text_field" - - if can_add_more - - multipleInputs = - content_tag(:div,:class=>"add-target") do - @attribute_value.add_more_counter.times.collect do |t| - controls_wrapper(:value=>(@prefiled_value[t] rescue nil),:counter=>t,&block) - end.join('').html_safe # of add_more fields - end - - - temp = content_tag(:div, multipleInputs + add_more_unt, :class=>'add-input') - - result = form_label + content_tag(:div,temp,:class=>div_class) - - # result = label + multipleInputs + add_more_unt - # result = label + 一堆的輸入框(要用 multipleInput editMore 包起來) + add_more btn + hidden_fields - else - result = form_label + content_tag(:div,controls_wrapper(&block),:class=>div_class) - end - - when "address" - - # address = content_tag :div,:class=>"multipleInput editMore" do - address = content_tag :div,:class=>"col-sm-10" do - form_label + content_tag(:div, controls_wrapper(&block), :class=>'add-input') - end # of div multipleInput editMore - - result = address - - else - result = form_label + content_tag(:div,controls_wrapper(&block),:class=>div_class) - end - result = result + end_block - result.html_safe - - end - - - def add_more_unt - temp_field_name = get_basic_field_name_base + '[temp]' - add_more = content_tag :p,:class=> 'add-btn' do - content = link_to (content_tag :i,I18n.t(:add),:class=>"icon-plus"),"#","data-roles"=>"role_a",:class=>"trigger #{can_muti_lang_input? ? 'textLengInput' : 'textInput' } btn btn-small btn-primary" - content << hidden_field_tag("#{temp_field_name}[count]",@attribute_value.add_more_counter ,:class=>"list_count") - content << hidden_field_tag("#{temp_field_name}[count]",get_basic_field_name_base,:class=>"field_name") - content - end # of div - # add_more = content_tag :div,:class=> 'controls' do - # content_tag :span,:class=> 'help-block' do - # content = link_to (content_tag :i,I18n.t(:add),:class=>"icon-plus-sign"),"#",:class=>'addinput' - # content << hidden_field_tag("#{temp_field_name}[count]",@attribute_value.add_more_counter ,:class=>"list_count") - # content << hidden_field_tag("#{temp_field_name}[count]",get_basic_field_name_base,:class=>"field_name") - # content - # end # of span - # end # of div - end - - def end_block - if @new_attribute - hidden_field_tag(get_basic_field_name_base+"[#{get_basic_field_name}_id]",id,:for=>"field_#{@index}") - else - hidden_field_tag(get_basic_field_name_base+"[id]",@attribute_value.id,:for=>"field_#{@index}") - end - end - - def add_more_tab(mode,counter,key) - case mode - when :input_field - get_pairing_tab_class(:suffix=>['','tab'+counter.to_s,key].join('-')) - when :tab_btn - ".#{get_pairing_tab_class(:suffix=>['','tab'+counter.to_s,key].join('-'))}" - end - end - - def get_pairing_tab_class(opts) - prefix = opts[:prefix] - suffix = opts[:suffix] - str = get_basic_field_name_base.gsub("[","_").gsub("]",'') - str = prefix.nil? ? str : prefix+ str - suffix.nil? ? str : str + suffix - end - - def get_basic_field_name_org - "seminar_signup_values" - end - - def get_basic_field_name - "seminar_signup_field" - end - - def get_basic_field_name_base - "#{get_basic_field_name_org}[#{@index}]" - end - - def get_field_name_base - get_basic_field_name_base + "[value]" - end - - def form_label - if self.markup == "text_area" - plc = typeD["placeholder"][I18n.locale].to_s.blank? ? '' : "(#{typeD["placeholder"][I18n.locale]})" - ""+ - label_tag(key,(!@require.blank? ? '*'+title : title),:class=>"col-sm-2 control-label muted",:style =>'display: contents;')+ - tag(:br)+"#{plc}" - else - label_tag(key,(!@require.blank? ? '*'+title : title),:class=>"col-sm-2 control-label muted") - end - end - - def can_muti_lang_input? - if self.markup == "address" - return true - else - LIST[:markups][markup]["muti_lang_input_supprt"] and !(get_data["cross_lang"] == "true") - end - end - - def can_add_more - if self.markup == "address" - return false - else - add_more - end - end - - def gen_modal_dialog - render_anywhere("shared/attribute_field/address_modal_dialog",{ - :field_name=>title, - :html_id=>"address-field", - :btn_class => "#{get_pairing_tab_class({})}", - :field_name_basic => get_basic_field_name_base - } - ) - end - def show_set_field(field_sets,key_field,key_index,field,markup='text_field') - @show_set_field = true - def self.can_muti_lang_input? - true - end - def self.can_add_more - false - end - @markup = markup - def self.markup - @markup - end - def self.add_more - false - end - @new_attribute = false - @key_index = key_index - def self.key - @key_index - end - def self.form_label - '' - end - def self.end_block - hidden_field_tag("seminar_main[#{@key_field}][#{@key_index}]"+"[id]", - @attribute_value.id,:for=>"field_#{@key_index}") - end - @key_field = key_field - @field = field - def self.get_basic_field_name_base - "seminar_main[#{@key_field}][#{@key_index}][#{@field}]" - end - def self.get_field_name_base - "seminar_main[#{@key_field}][#{@key_index}][#{@field}]" - end - @attribute_value = field_sets - @prefiled_value = field_sets[field] - a = control_group_wrapper do |key,value| - add_more_blank = "" - if markup=='text_field' - if key_field == 'seminar_email_sets' - inside = text_field_tag([get_field_name_base,"[#{key}]"].join,value,:class=>'input-medium form-control') - else - inside = text_field_tag([get_field_name_base,"[#{key}]"].join,value) - end - else - inside = cktext_area("seminar_main[#{@key_field}][#{@key_index}][#{@field}]","#{key}",value:value) - end - inside - end - @key_field = nil - @key_index = nil - @field = nil - @show_set_field = nil - return a.html_safe - end -end \ No newline at end of file diff --git a/app/helpers/admin/seminars_helper.rb b/app/helpers/admin/seminars_helper.rb deleted file mode 100644 index 73825f4..0000000 --- a/app/helpers/admin/seminars_helper.rb +++ /dev/null @@ -1,33 +0,0 @@ -module Admin::SeminarsHelper - def page_for_seminar(seminar) - ann_page = nil - pages = Page.where(:module=>'seminar') - - pages.each do |page| - if page.categories.count ==1 - if page.categories.include?(seminar.category.id.to_s) - ann_page = page - end - end - break if !ann_page.nil? - end - - if ann_page.nil? - pages.each do |page| - if page.categories.include?(seminar.category.id.to_s) - ann_page = page - end - break if !ann_page.nil? - end - end - - ann_page = pages.first if ann_page.nil? - request.protocol+(request.host_with_port+ann_page.url+'/'+seminar.to_param).gsub('//','/') rescue "/" - end - - def page_for_seminar_url - page = Page.where(:module => 'seminar').first - return request.protocol+(request.host_with_port+"/#{I18n.locale}#{page.url}").gsub('//','/') rescue "/" - # return "/#{I18n.locale}#{page.url}/#{seminar.to_param}" - end -end \ No newline at end of file diff --git a/app/helpers/admin/seminars_values_helper.rb b/app/helpers/admin/seminars_values_helper.rb deleted file mode 100644 index 7743617..0000000 --- a/app/helpers/admin/seminars_values_helper.rb +++ /dev/null @@ -1,109 +0,0 @@ -module Admin::SeminarsValuesHelper - def show_west_calender(from_to=nil) - case from_to - when :to - date = get_date(:to) - when :from - date = get_date(:from) - when nil - date = get_date - end - - # case self.member_profile_field["typeC"]["format"] - # when 'format1' # Y/M/D h:m - # date.strftime("%Y/%m/%d %H:%M") - # when 'format2' # Y/M/D - # date.strftime("%Y/%m/%d") - # when 'format3' # Y/M - # date.strftime("%Y/%m") - # when 'format4' # Y - # date.strftime("%Y") - # end # of case west cal format - end - - def show_minguo_calendar(from_to=nil) - get_minguo - - case from_to - when :to - date = get_date(:to) - when :from - date = get_date(:from) - when nil - date = get_date - end - - @date = date.split('/') - date_year = @date[0].to_i - - year_str = "" - unless date_year == 1912 - m_year = (date_year - 1912).abs.to_s + I18n.t("date.minguo_calendar.year") - year_str = minguo_format_year(m_year) - end - get_minguo_year(from_to) + minguo_m_y_d_time(from_to) - end - - def get_minguo_year(from_to=nil) - case from_to - when :to - date = get_date(:to) - when :from - date = get_date(:from) - when nil - date = get_date - end - - @date = date.split('/') - date_year = @date[0].to_i - - m_year = (date_year - 1911).abs - year_end = I18n.t("date.minguo_calendar.year") - case - when date_year <1912 - I18n.t("date.minguo_calendar.before") + (m_year+1).to_s + year_end - when date_year ==1912 - I18n.t("date.minguo_calendar.first_year") - when date_year >1912 - I18n.t("date.minguo_calendar.after")+ (m_year).to_s + year_end - end # of case tw_calendar year - end - - def minguo_m_y_d_time(from_to=nil) - case from_to - when :to - date = get_date(:to) - when :from - date = get_date(:from) - when nil - date = get_date - end - @date = date.split('/') - - case self.seminar_signup_field["typeC"]["format"] - when 'format1' # Y/M/D h:m - "/#{@date[1]}/#{@date[2]}" - when 'format2' # Y/M/D - "/#{@date[1]}/#{@date[2]}" - when 'format3' # Y/M - - "/#{@date[1]}#{I18n.t("date.minguo_calendar.month")}"\ - when 'format4' # Y - '' - end # of case - end - - def get_date_by_format(from_to = nil) - case I18n.locale - when :zh_tw - case - when self.seminar_signup_field["typeC"]["calendar"] == "west_calendar" - show_west_calender(from_to) - when self.seminar_signup_field["typeC"]["calendar"] == "tw_calendar" - show_minguo_calendar(from_to) - end #case self.seminar_signup_field["typeC"]["calendar"] - when :en - show_west_calender(from_to) - end - end -end \ No newline at end of file diff --git a/app/models/seminar_agreement.rb b/app/models/seminar_agreement.rb deleted file mode 100644 index f3a21ef..0000000 --- a/app/models/seminar_agreement.rb +++ /dev/null @@ -1,7 +0,0 @@ -class SeminarAgreement - include Mongoid::Document - include Mongoid::Timestamps - - field :content, localize: true - -end \ No newline at end of file diff --git a/app/models/seminar_email_set.rb b/app/models/seminar_email_set.rb deleted file mode 100644 index f22f0c7..0000000 --- a/app/models/seminar_email_set.rb +++ /dev/null @@ -1,10 +0,0 @@ -class SeminarEmailSet - include Mongoid::Document - include Mongoid::Timestamps - - field :field_name, type: String - field :title - field :content - field :disabled, type: Boolean, default: false - belongs_to :seminar_main -end diff --git a/app/models/seminar_file.rb b/app/models/seminar_file.rb deleted file mode 100644 index 143296b..0000000 --- a/app/models/seminar_file.rb +++ /dev/null @@ -1,14 +0,0 @@ -# encoding: utf-8 -class SeminarFile - - include Mongoid::Document - include Mongoid::Timestamps - - mount_uploader :file, AssetUploader - - field :description, localize: true - field :title, localize: true - - belongs_to :seminar_main - -end diff --git a/app/models/seminar_item.rb b/app/models/seminar_item.rb deleted file mode 100644 index cfd1192..0000000 --- a/app/models/seminar_item.rb +++ /dev/null @@ -1,12 +0,0 @@ -class SeminarItem - include Mongoid::Document - include Mongoid::Timestamps - - field :title, localize: true - - belongs_to :seminar_main - - has_many :seminar_item_contents, :autosave => true, :dependent => :destroy - accepts_nested_attributes_for :seminar_item_contents, :allow_destroy => true - -end \ No newline at end of file diff --git a/app/models/seminar_item_content.rb b/app/models/seminar_item_content.rb deleted file mode 100644 index 5eba95a..0000000 --- a/app/models/seminar_item_content.rb +++ /dev/null @@ -1,15 +0,0 @@ -# encoding: utf-8 -class SeminarItemContent - - include Mongoid::Document - include Mongoid::Timestamps - - field :content, localize: true - - field :create_user_id - field :update_user_id - - belongs_to :seminar_item - belongs_to :seminar_main - -end diff --git a/app/models/seminar_link.rb b/app/models/seminar_link.rb deleted file mode 100644 index 2009008..0000000 --- a/app/models/seminar_link.rb +++ /dev/null @@ -1,25 +0,0 @@ -# encoding: utf-8 -require 'uri' - -class SeminarLink - include Mongoid::Document - include Mongoid::Timestamps - - field :url - field :title, localize: true - - belongs_to :seminar_main - - before_validation :add_http - - 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 \ No newline at end of file diff --git a/app/models/seminar_main.rb b/app/models/seminar_main.rb deleted file mode 100644 index 51f7071..0000000 --- a/app/models/seminar_main.rb +++ /dev/null @@ -1,87 +0,0 @@ -class SeminarMain - include Mongoid::Document - include Mongoid::Timestamps - - include OrbitModel::Impression - # encoding: utf-8 - include OrbitCategory::Categorizable - include Slug - - field :title, as: :slug_title, type: String, localize: true - field :speaker, localize: true - field :content, localize: true - field :act_place, localize: true - - field :seminar_start_date, :type => Date, :default => Time.now - field :seminar_end_date, :type => Date, :default => Time.now - - field :signup_start_date, :type => Date, :default => Time.now - field :signup_end_date, :type => Date, :default => Time.now - - field :contribute_start_date, :type => Date - field :contribute_end_date, :type => Date - - field :contribute_file_count, type: String - - field :registration_status , :type => Array #C: 投稿者 G:一般 - - field :create_user_id - field :update_user_id - - belongs_to :seminar_item - - has_many :seminar_links, :autosave => true, :dependent => :destroy - has_many :seminar_files, :autosave => true, :dependent => :destroy - has_many :seminar_item_contents, :autosave => true, :dependent => :destroy - has_many :seminar_signups, :autosave => true, :dependent => :destroy - has_many :seminar_submission_fields, :autosave => true, :dependent => :destroy - has_many :seminar_signup_fields, :autosave => true, :dependent => :destroy - has_many :seminar_reviews, :autosave => true, :dependent => :destroy - has_many :seminar_signup_field_sets, autosave: true, dependent: :destroy - has_many :seminar_submission_field_sets, autosave: true, dependent: :destroy - has_many :seminar_email_sets, autosave: true, dependent: :destroy - has_many :seminar_signup_field_customs, :autosave => true, :dependent => :destroy - accepts_nested_attributes_for :seminar_links, :allow_destroy => true - accepts_nested_attributes_for :seminar_files, :allow_destroy => true - accepts_nested_attributes_for :seminar_item_contents, :allow_destroy => true - accepts_nested_attributes_for :seminar_signups, :allow_destroy => true - accepts_nested_attributes_for :seminar_submission_fields, :allow_destroy => true - accepts_nested_attributes_for :seminar_signup_fields, :allow_destroy => true - accepts_nested_attributes_for :seminar_reviews, :allow_destroy => true - accepts_nested_attributes_for :seminar_signup_field_sets, :allow_destroy => true - accepts_nested_attributes_for :seminar_submission_field_sets, :allow_destroy => true - accepts_nested_attributes_for :seminar_email_sets, :allow_destroy => true - accepts_nested_attributes_for :seminar_signup_field_customs, :allow_destroy => true - def self.time_range(date1 = null, date2 = null) - - if !date1.blank? - - r = "#{date1.strftime('%Y-%m-%d')}" - - if date2 - r += " - #{date2.strftime('%Y-%m-%d')}" - else - r += " - #{I18n.t(:no_deadline)}" - end - - r - - end - - end - - def get_attribute_value(attribute_field, signup_id) - SeminarSignupValue.find_by(seminar_signup_field_id: attribute_field.id, seminar_signup_id: signup_id) - end - - def get_attribute_values(attribute_type=nil) - @attribute_values = attribute_type.seminar_signup_values rescue nil - end - - def get_value_from_field_id(field_id,attribute_type=nil) - values = get_attribute_values(attribute_type) - value = values.detect {|value| value.seminar_signup_field_id == field_id} rescue nil - value ? value : nil - end - -end diff --git a/app/models/seminar_review.rb b/app/models/seminar_review.rb deleted file mode 100644 index 8ed7aee..0000000 --- a/app/models/seminar_review.rb +++ /dev/null @@ -1,12 +0,0 @@ -# encoding: utf-8 -require "orbit_form_helper" -class SeminarReview - - include Mongoid::Document - include Mongoid::Timestamps - - field :review_start_date, :type => Date, :default => Time.now - field :review_end_date, :type => Date, :default => Time.now - field :reviewer_id - belongs_to :seminar_main -end diff --git a/app/models/seminar_signup.rb b/app/models/seminar_signup.rb deleted file mode 100644 index 9f40877..0000000 --- a/app/models/seminar_signup.rb +++ /dev/null @@ -1,27 +0,0 @@ -# encoding: utf-8 -class SeminarSignup - - include Mongoid::Document - include Mongoid::Timestamps - - field :status - field :name # become Last Name for TICC - field :tel, type: String # become First Name for TICC - field :unit, localize: true - field :phone, type: String - field :fax, type: String - field :email, type: String - field :address, localize: true - field :password - field :note, localize: true - - belongs_to :seminar_main - - has_many :seminar_signup_values - has_many :seminar_signup_contributes - - accepts_nested_attributes_for :seminar_signup_values, allow_destroy: true - accepts_nested_attributes_for :seminar_signup_contributes, allow_destroy: true - - -end diff --git a/app/models/seminar_signup_contribute.rb b/app/models/seminar_signup_contribute.rb deleted file mode 100644 index b282142..0000000 --- a/app/models/seminar_signup_contribute.rb +++ /dev/null @@ -1,13 +0,0 @@ -class SeminarSignupContribute - - include Mongoid::Document - include Mongoid::Timestamps - - field :title - mount_uploader :file, AssetUploader - field :description - - belongs_to :seminar_signup - has_many :seminar_submission_values, autosave: true, dependent: :destroy - accepts_nested_attributes_for :seminar_submission_values, :allow_destroy => true -end \ No newline at end of file diff --git a/app/models/seminar_signup_field.rb b/app/models/seminar_signup_field.rb deleted file mode 100644 index ca6c3fb..0000000 --- a/app/models/seminar_signup_field.rb +++ /dev/null @@ -1,161 +0,0 @@ -class SeminarSignupField - include Mongoid::Document - include Mongoid::Timestamps - include Mongoid::Attributes::Dynamic - include ::AttributeFieldsHelper - include ::Admin::SeminarsFieldHelper - - field :key, type: String - field :af_count - field :title, type: String, localize: true - field :markup, default: "text_field" - field :option_list, type: Hash,default: {} - field :markup_options, type: Hash - field :built_in, type: Boolean, default: false - field :disabled, type: Boolean, default: false - field :to_delete, type: Boolean, default: false - - field :to_require,type: Boolean, default: true - - field :typeA, type: Hash, default: {cross_lang: false} - field :typeB, type: Hash, default: {} - field :typeC, type: Hash, default: {calendar: "west_calendar", format: "format3"} - field :typeD, type: Hash, default: {cross_lang: false} - field :typeE, type: Hash, default: {} - - belongs_to :seminar_main - has_many :seminar_signup_values, autosave: true, dependent: :destroy - accepts_nested_attributes_for :seminar_signup_values, :allow_destroy => true - before_save :check_option_list - - def markup_value - get_data["option_list"] - end - - def add_more - (get_data["add_more"] == "true" ? true : false) rescue false - end - - def locale - get_data["cross_lang"] == "true" ? false : true - end - - def self_defined_markup_options? - (self.seminar.method(self[:key].pluralize.to_sym) && self.seminar.method(self[:key].pluralize+"_for_"+markup)) rescue false - end - - def option_list - if self_defined_markup_options? - #Class need to have corresponding field and value agent - # Ex: For "status" the class must have field called "statuses" for the relation and "statuses_for_select" for the select function - method = self.seminar.method(self[:key].pluralize+"_for_"+markup) - return (method.call rescue {}) - elsif self[:option_list].nil? || (self[:option_list].empty?) - return {} - else - return self[:option_list] - end - end - - def markup_options=(var) - self[:markup_options] = (eval(var) rescue {}) - end - - def markup_options - if self[:markup_options].nil? - return {} - else - Hash[self[:markup_options].map{|key,val|[key.to_sym,val]}] rescue {} - end - - end - - def panel - panel = LIST[:markups][self[:markup]]["panel"] - end - - def get_data - self[panel] - end - - def typeA=(var) - check_add_more_convert(var) - check_cross_lang_convert(var,"typeA") - self["typeA"] = var - end - - def typeD=(var) - check_cross_lang_convert(var,"typeD") - self["typeD"] = var - end - - def is_built_in? - self.built_in - end - - def is_disabled? - self.disabled - end - - def self.add_seminar_signup_field(seminar,seminar_param, seminar_signup_field_id=nil,field_status) - @field_name = 'seminar' - if field_status.eql?(true) - @seminar_signup_field_counter = seminar.seminar_signup_fields.count rescue nil - @seminar_signup_field = self.find(seminar_signup_field_id) rescue nil - old_key = @seminar_signup_field.key - @seminar_signup_field.update(seminar_param) - @seminar_signup_field.save - attribute_values = @seminar_signup_field.seminar_signup_values - if attribute_values.count > 0 - attribute_values.each do |av| - av.key = seminar_param["key"] - av.save - end - end - @seminar_signup_field[:af_count] = @seminar_signup_field_counter - else - @seminar_signup_field_counter = seminar.seminar_signup_fields.count rescue nil - @seminar_signup_field = seminar.seminar_signup_fields.build(seminar_param) rescue nil - @seminar_signup_field.save - @seminar_signup_field[:af_count] = @seminar_signup_field_counter - end - return @seminar_signup_field - end - - protected - - def check_cross_lang_convert(var,field) - if self[field]["cross_lang"] != var["cross_lang"] - case var["cross_lang"] - when "true" #from no-add_more to add_more - cross_lang_convert(:to_cross_lang) - else #from add_more to no-add_more - cross_lang_convert(:to_no_cross_lang) - end # of case - end # of if - end - - def check_add_more_convert(var) - if self["typeA"]["add_more"] != var["add_more"] - case var["add_more"] - when "true" #from no-add_more to add_more - add_more_convert(:to_add_more) - else #from add_more to no-add_more - add_more_convert(:to_no_add_more) - end # of case - end # of if - end - - def cross_lang_convert(opt) - - end - - def check_option_list - self[:option_list] = self[panel]["option_list"] rescue nil - end - - def add_more_convert(opt) - - end - -end \ No newline at end of file diff --git a/app/models/seminar_signup_field_custom.rb b/app/models/seminar_signup_field_custom.rb deleted file mode 100644 index ac322db..0000000 --- a/app/models/seminar_signup_field_custom.rb +++ /dev/null @@ -1,8 +0,0 @@ -class SeminarSignupFieldCustom - include Mongoid::Document - include Mongoid::Timestamps - - field :seminar_signup_field_id - field :hidden, type: Boolean, default: true - belongs_to :seminar_main -end diff --git a/app/models/seminar_signup_field_set.rb b/app/models/seminar_signup_field_set.rb deleted file mode 100644 index 0470192..0000000 --- a/app/models/seminar_signup_field_set.rb +++ /dev/null @@ -1,11 +0,0 @@ -class SeminarSignupFieldSet - include Mongoid::Document - include Mongoid::Timestamps - - field :field_name, type: String - field :placeholder - field :name - field :disabled, type: Boolean, default: false - field :hidden, type: Boolean, default: false - belongs_to :seminar_main -end diff --git a/app/models/seminar_signup_value.rb b/app/models/seminar_signup_value.rb deleted file mode 100644 index f477f67..0000000 --- a/app/models/seminar_signup_value.rb +++ /dev/null @@ -1,215 +0,0 @@ -class SeminarSignupValue - include Mongoid::Document - include Mongoid::Timestamps - include Mongoid::Attributes::Dynamic - include ::AttributeValuesHelper - include ::Admin::SeminarsValuesHelper - - field :key, type: String - - belongs_to :seminar_signup_field - belongs_to :seminar_signup - - before_save :check_key - before_save :data_proc - - def add_more_counter - index_max = self["val"].count rescue 0 - index_max == 0 ? 1 : index_max - end - - def value(index = nil) - site = Site.first - result = case self.seminar_signup_field.markup - when 'text_field','text_area' - if self.seminar_signup_field.add_more and (self.seminar_signup_field.markup == "text_field") - index.nil? ? self["val"] : self["val"][index] - else - self.seminar_signup_field.get_data["cross_lang"] =="true" ? self["val"] : Hash[site.valid_locales.collect{|lang| [lang,self[lang.to_sym]]}] - end - when 'select','radio_button','address' - self["val"] - when 'date' - if !self["val"].blank? and !self["val"]['(1i)'].blank? - "#{self["val"]['(1i)']}/#{self["val"]['(2i)']}/#{self["val"]['(3i)']}" - else - self["val"] - end - when 'checkbox' - self["val"] - end #end of case self.seminar_signup_field.markup - end - - def value=(value) - #save everything to temp_data waiting for futher process - self[:temp_data] = value - end - - def get_field_value - if (self.seminar_signup_field.markup.eql?("text_field") || self.seminar_signup_field.markup.eql?("text_area")) - field_value = self.value[I18n.locale] - elsif (self.seminar_signup_field.markup.eql?("select") || self.seminar_signup_field.markup.eql?("radio_button")) - field_value = self.seminar_signup_field.markup_value["#{self.value}"][I18n.locale] rescue nil - elsif self.seminar_signup_field.markup.eql?("address") - field_value = rf[:address_key][I18n.locale].map{|k,v| v}.delete_if(&:blank?).join(', ') - elsif self.seminar_signup_field.markup.eql?("date") - case self.seminar_signup_field.typeC['format'] - when 'format1' - field_value = self.value.to_date.strftime("%Y/%m/%d") - when 'format2' - field_value = self.value.to_date.strftime("%Y/%m/%d") - when 'format3' - field_value = self.value.to_date.strftime("%Y/%m") - when 'format4' - field_value = self.value.to_date.strftime("%Y") - end - elsif self.seminar_signup_field.markup.eql?("checkbox") - field_value = self.value.map {|v| self.seminar_signup_field.markup_value["#{v}"][I18n.locale]}.join(', ') rescue nil - end - - field_value = (field_value =~ /\A#{URI::regexp(['http', 'https'])}\z/) ? "#{field_value}" : field_value - field_value = (field_value =~ /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i) ? "#{field_value}" : field_value - - if !field_value.blank? - { - "key" => self.seminar_signup_field.key, - "title" => self.seminar_signup_field.title, - "value" => field_value, - "val" => field_value = self.value - } - else - { - "key" => self.seminar_signup_field.key, - "title" => self.seminar_signup_field.title, - "value" => "", - "val" => field_value = self.value - } - end - end - - def get_value_by_locale(locale,add_more_index=nil) - case self.seminar_signup_field.markup - when "text_field" - case self.seminar_signup_field.add_more - when true - if self.seminar_signup_field.locale - add_more_index.nil? ? self.value.collect{|t| t[locale.to_s]}.join(",") : self.value(add_more_index)[locale] - else - add_more_index.nil? ? self.value.join(",") : self.value(add_more_index) - end - - when false - self.seminar_signup_field.locale ? self[locale.to_s] : self.value - end - - when "select" - markup_values = self.seminar_signup_field.self_defined_markup_options? ? self.seminar_signup_field.markup_value : self.seminar_signup_field.markup_value - markup_values[self.value][locale.to_s] rescue 'NoData' - - when "text_area" - self.seminar_signup_field.locale ? self[locale.to_s] : self.value - - when "date" - if self.seminar_signup_field.date_is_range? - get_date_by_format(:from) + ' ~ ' + get_date_by_format(:to) - # self.value["from"] + ' ~ ' + self.value["to"] - else - get_date_by_format - # self.value - end - - when "address" - self.value[locale.to_s] - - when "radio_button" - markup_values = self.seminar_signup_field.markup_value - markup_values[self.value][locale.to_s] - - when "checkbox" - markup_values = self.seminar_signup_field.markup_value - self.value.collect{|key| markup_values["#{key}"][I18n.locale]}.join(",") - when "date_durnation" - self.value - - else - self.seminar_signup_field.locale ? self[locale.to_s] : self.value - end - end - - def get_date(item = nil) - case item - when :from - # data = self[:val]["from"] - data = self.value["from"] - when :to - # data = self[:val]["to"] - data = self.value["to"] - when nil - # data = self[:val] - data = self.value - end - - # Date.new(data["(1i)"].to_i,data["(2i)"].to_i,data["(3i)"].to_i) rescue nil - end - - def self.put_field_values(member, field_value_param, field_value_id=nil,field_value_status) - if field_value_status.eql?(true) - @seminar_signup_field_value = member.seminar_signup_values.find(field_value_id) rescue nil - if @seminar_signup_field_value!=nil - @seminar_signup_field_value.update(field_value_param) rescue nil - @seminar_signup_field_value.save rescue nil - end - else - @seminar_signup_field_value = member.seminar_signup_values.build(field_value_param) rescue nil - @seminar_signup_field_value.save - end - return @seminar_signup_field_value - end - - -protected - -def unset_all_lang_values - VALID_LOCALES.each{|t| self.unset t} - end - - def data_proc - unless self[:temp_data].nil? - case self.seminar_signup_field.markup - when "address" - self["val"] = self["temp_data"] - when 'text_field','text_area' - if self.seminar_signup_field.add_more - self["val"] = self["temp_data"] - else # if not add_more - if self.seminar_signup_field.can_muti_lang_input? - self[:temp_data].each do |key,val| - self[key] = val - end if(!self.seminar_signup_field.get_data[:cross_lang]) - else - self["val"] = self[:temp_data] - end - end # of self.seminar_signup_field.add_more - - when 'select','date','radio_button' - self["val"] = self[:temp_data] - when 'checkbox' - self["val"] = self[:temp_data].keys - end #end of case self.seminar_signup_field.markup - end # of self[:temp_data].nil? - self.unset('temp_data') - self.unset('temp') - end #of data_proc - - def check_key - self.key = self.seminar_signup_field.key - end - - def method_missing(*field) - if field.size < 1 - self[field[0]] - else - self[(field[0].to_s.delete "=")] = field[1] - end - end -end diff --git a/app/models/seminar_submission_field.rb b/app/models/seminar_submission_field.rb deleted file mode 100644 index 07e8e5a..0000000 --- a/app/models/seminar_submission_field.rb +++ /dev/null @@ -1,186 +0,0 @@ -class SeminarSubmissionField - include Mongoid::Document - include Mongoid::Timestamps - include Mongoid::Attributes::Dynamic - include ::AttributeFieldsHelper - include ::Admin::SeminarsFieldHelper - - field :key, type: String - field :af_count - field :title, type: String, localize: true - field :markup, default: "text_field" - field :option_list, type: Hash,default: {} - field :markup_options, type: Hash - field :built_in, type: Boolean, default: false - field :disabled, type: Boolean, default: false - field :to_delete, type: Boolean, default: false - - field :to_require,type: Boolean, default: true - - field :typeA, type: Hash, default: {cross_lang: false} - field :typeB, type: Hash, default: {} - field :typeC, type: Hash, default: {calendar: "west_calendar", format: "format3"} - field :typeD, type: Hash, default: {cross_lang: false} - field :typeE, type: Hash, default: {} - - belongs_to :seminar_main - has_many :seminar_submission_values, autosave: true, dependent: :destroy - accepts_nested_attributes_for :seminar_submission_values, :allow_destroy => true - before_save :check_option_list - def get_basic_field_name_org - "seminar_submission_values" - end - - def get_basic_field_name - "seminar_submission_field" - end - def block_helper(member,index,disable = false,attribute_type=nil,con_field=nil, to_require=true,rf) - unless self.disabled - @index = index - @require = to_require - @markup_options = markup_options.merge(:disabled=>disable, :required => to_require) - @member = member - if !(con_field.seminar_submission_values.nil?) && con_field.seminar_submission_values!=[] - @attribute_value = con_field.seminar_submission_values.select{|v| v.seminar_submission_field_id.to_s==rf.id.to_s}[0] - else - @attribute_value = nil - end - @attribute_type = attribute_type - @new_attribute = @attribute_value.nil? - @prefiled_value = @attribute_value.value rescue nil - html = (instance_eval("render_#{markup}") rescue "") - return html - end - end - - def markup_value - get_data["option_list"] - end - - def add_more - (get_data["add_more"] == "true" ? true : false) rescue false - end - - def locale - get_data["cross_lang"] == "true" ? false : true - end - - def self_defined_markup_options? - (self.seminar.method(self[:key].pluralize.to_sym) && self.seminar.method(self[:key].pluralize+"_for_"+markup)) rescue false - end - - def option_list - if self_defined_markup_options? - #Class need to have corresponding field and value agent - # Ex: For "status" the class must have field called "statuses" for the relation and "statuses_for_select" for the select function - method = self.seminar.method(self[:key].pluralize+"_for_"+markup) - return (method.call rescue {}) - elsif self[:option_list].nil? || (self[:option_list].empty?) - return {} - else - return self[:option_list] - end - end - - def markup_options=(var) - self[:markup_options] = (eval(var) rescue {}) - end - - def markup_options - if self[:markup_options].nil? - return {} - else - Hash[self[:markup_options].map{|key,val|[key.to_sym,val]}] rescue {} - end - - end - - def panel - panel = LIST[:markups][self[:markup]]["panel"] - end - - def get_data - self[panel] - end - - def typeA=(var) - check_add_more_convert(var) - check_cross_lang_convert(var,"typeA") - self["typeA"] = var - end - - def typeD=(var) - check_cross_lang_convert(var,"typeD") - self["typeD"] = var - end - - def is_built_in? - self.built_in - end - - def is_disabled? - self.disabled - end - - def self.add_seminar_signup_field(seminar,seminar_param, seminar_submission_field_id=nil,field_status) - @field_name = 'seminar' - if field_status.eql?(true) - @seminar_submission_field_counter = seminar.seminar_submission_fields.count rescue nil - @seminar_submission_field = self.find(seminar_submission_field_id) rescue nil - old_key = @seminar_submission_field.key - @seminar_submission_field.update(seminar_param) - @seminar_submission_field.save - attribute_values = @seminar_submission_field.seminar_submission_values - if attribute_values.count > 0 - attribute_values.each do |av| - av.key = seminar_param["key"] - av.save - end - end - @seminar_submission_field[:af_count] = @seminar_submission_field_counter - else - @seminar_submission_field_counter = seminar.seminar_submission_fields.count rescue nil - @seminar_submission_field = seminar.seminar_submission_fields.build(seminar_param) rescue nil - @seminar_submission_field.save - @seminar_submission_field[:af_count] = @seminar_submission_field_counter - end - return @seminar_submission_field - end - - protected - - def check_cross_lang_convert(var,field) - if self[field]["cross_lang"] != var["cross_lang"] - case var["cross_lang"] - when "true" #from no-add_more to add_more - cross_lang_convert(:to_cross_lang) - else #from add_more to no-add_more - cross_lang_convert(:to_no_cross_lang) - end # of case - end # of if - end - - def check_add_more_convert(var) - if self["typeA"]["add_more"] != var["add_more"] - case var["add_more"] - when "true" #from no-add_more to add_more - add_more_convert(:to_add_more) - else #from add_more to no-add_more - add_more_convert(:to_no_add_more) - end # of case - end # of if - end - - def cross_lang_convert(opt) - - end - - def check_option_list - self[:option_list] = self[panel]["option_list"] rescue nil - end - - def add_more_convert(opt) - - end - -end \ No newline at end of file diff --git a/app/models/seminar_submission_field_set.rb b/app/models/seminar_submission_field_set.rb deleted file mode 100644 index 0f5b0e5..0000000 --- a/app/models/seminar_submission_field_set.rb +++ /dev/null @@ -1,11 +0,0 @@ -class SeminarSubmissionFieldSet - include Mongoid::Document - include Mongoid::Timestamps - - field :field_name, type: String - field :placeholder - field :name - field :disabled, type: Boolean, default: false - field :hidden, type: Boolean, default: false - belongs_to :seminar_main -end \ No newline at end of file diff --git a/app/models/seminar_submission_value.rb b/app/models/seminar_submission_value.rb deleted file mode 100644 index b04aea8..0000000 --- a/app/models/seminar_submission_value.rb +++ /dev/null @@ -1,212 +0,0 @@ -class SeminarSubmissionValue - include Mongoid::Document - include Mongoid::Timestamps - include Mongoid::Attributes::Dynamic - include ::AttributeValuesHelper - include ::Admin::SeminarsValuesHelper - - field :key, type: String - - belongs_to :seminar_submission_field - belongs_to :seminar_signup_contribute - before_save :check_key - before_save :data_proc - - def add_more_counter - index_max = self["val"].count rescue 0 - index_max == 0 ? 1 : index_max - end - - def value(index = nil) - site = Site.first - result = case self.seminar_submission_field.markup - when 'text_field','text_area' - if self.seminar_submission_field.add_more and (self.seminar_submission_field.markup == "text_field") - index.nil? ? self["val"] : self["val"][index] - else - self.seminar_submission_field.get_data["cross_lang"] =="true" ? self["val"] : Hash[site.valid_locales.collect{|lang| [lang,self[lang.to_sym]]}] - end - when 'select','radio_button','address' - self["val"] - when 'date' - if !self["val"].blank? and !self["val"]['(1i)'].blank? - "#{self["val"]['(1i)']}/#{self["val"]['(2i)']}/#{self["val"]['(3i)']}" - else - self["val"] - end - when 'checkbox' - self["val"] - end #end of case self.seminar_submission_field.markup - end - - def value=(value) - #save everything to temp_data waiting for futher process - self[:temp_data] = value - end - - def get_field_value - if (self.seminar_submission_field.markup.eql?("text_field") || self.seminar_submission_field.markup.eql?("text_area")) - field_value = self.value[I18n.locale] - elsif (self.seminar_submission_field.markup.eql?("select") || self.seminar_submission_field.markup.eql?("radio_button")) - field_value = self.seminar_submission_field.markup_value["#{self.value}"][I18n.locale] rescue nil - elsif self.seminar_submission_field.markup.eql?("address") - field_value = rf[:address_key][I18n.locale].map{|k,v| v}.delete_if(&:blank?).join(', ') - elsif self.seminar_submission_field.markup.eql?("date") - case self.seminar_submission_field.typeC['format'] - when 'format1' - field_value = self.value.to_date.strftime("%Y/%m/%d") - when 'format2' - field_value = self.value.to_date.strftime("%Y/%m/%d") - when 'format3' - field_value = self.value.to_date.strftime("%Y/%m") - when 'format4' - field_value = self.value.to_date.strftime("%Y") - end - elsif self.seminar_submission_field.markup.eql?("checkbox") - field_value = self.value.map {|v| self.seminar_submission_field.markup_value["#{v}"][I18n.locale]}.join(', ') rescue nil - end - - field_value = (field_value =~ /\A#{URI::regexp(['http', 'https'])}\z/) ? "#{field_value}" : field_value - field_value = (field_value =~ /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i) ? "#{field_value}" : field_value - - if !field_value.blank? - { - "key" => self.seminar_submission_field.key, - "title" => self.seminar_submission_field.title, - "value" => field_value, - "val" => field_value = self.value - } - else - { - "key" => self.seminar_submission_field.key, - "title" => self.seminar_submission_field.title, - "value" => "", - "val" => field_value = self.value - } - end - end - - def get_value_by_locale(locale,add_more_index=nil) - case self.seminar_submission_field.markup - when "text_field" - case self.seminar_submission_field.add_more - when true - if self.seminar_submission_field.locale - add_more_index.nil? ? self.value.collect{|t| t[locale.to_s]}.join(",") : self.value(add_more_index)[locale] - else - add_more_index.nil? ? self.value.join(",") : self.value(add_more_index) - end - - when false - self.seminar_submission_field.locale ? self[locale.to_s] : self.value - end - - when "select" - markup_values = self.seminar_submission_field.self_defined_markup_options? ? self.seminar_submission_field.markup_value : self.seminar_submission_field.markup_value - markup_values[self.value][locale.to_s] rescue 'NoData' - - when "text_area" - self.seminar_submission_field.locale ? self[locale.to_s] : self.value - - when "date" - if self.seminar_submission_field.date_is_range? - get_date_by_format(:from) + ' ~ ' + get_date_by_format(:to) - # self.value["from"] + ' ~ ' + self.value["to"] - else - get_date_by_format - # self.value - end - - when "address" - self.value[locale.to_s] - - when "radio_button" - markup_values = self.seminar_submission_field.markup_value - markup_values[self.value][locale.to_s] - - when "checkbox" - markup_values = self.seminar_submission_field.markup_value - self.value.collect{|key| markup_values["#{key}"][I18n.locale]}.join(",") - when "date_durnation" - self.value - - else - self.seminar_submission_field.locale ? self[locale.to_s] : self.value - end - end - - def get_date(item = nil) - case item - when :from - # data = self[:val]["from"] - data = self.value["from"] - when :to - # data = self[:val]["to"] - data = self.value["to"] - when nil - # data = self[:val] - data = self.value - end - - # Date.new(data["(1i)"].to_i,data["(2i)"].to_i,data["(3i)"].to_i) rescue nil - end - - def self.put_field_values(member, field_value_param, field_value_id=nil,field_value_status) - if field_value_status.eql?(true) - @seminar_submission_field_value = self.find(field_value_id) rescue nil - @seminar_submission_field_value.update(field_value_param) rescue nil - @seminar_submission_field_value.save rescue nil - else - @seminar_submission_field_value = member.seminar_submission_values.build(field_value_param) rescue nil - @seminar_submission_field_value.save - end - return @seminar_submission_field_value - end - - -protected - -def unset_all_lang_values - VALID_LOCALES.each{|t| self.unset t} - end - - def data_proc - unless self[:temp_data].nil? - case self.seminar_submission_field.markup - when "address" - self["val"] = self["temp_data"] - when 'text_field','text_area' - if self.seminar_submission_field.add_more - self["val"] = self["temp_data"] - else # if not add_more - if self.seminar_submission_field.can_muti_lang_input? - self[:temp_data].each do |key,val| - self[key] = val - end if(!self.seminar_submission_field.get_data[:cross_lang]) - else - self["val"] = self[:temp_data] - end - end # of self.seminar_submission_field.add_more - - when 'select','date','radio_button' - self["val"] = self[:temp_data] - when 'checkbox' - self["val"] = self[:temp_data].keys - end #end of case self.seminar_submission_field.markup - end # of self[:temp_data].nil? - self.unset('temp_data') - self.unset('temp') - end #of data_proc - - def check_key - self.key = self.seminar_submission_field.key - end - - def method_missing(*field) - if field.size < 1 - self[field[0]] - else - self[(field[0].to_s.delete "=")] = field[1] - end - end -end diff --git a/app/views/admin/seminar_agreements/index.html.erb b/app/views/admin/seminar_agreements/index.html.erb deleted file mode 100644 index a2014a9..0000000 --- a/app/views/admin/seminar_agreements/index.html.erb +++ /dev/null @@ -1,63 +0,0 @@ -<% content_for :page_specific_css do %> - <%= stylesheet_link_tag "lib/main-forms" %> - <%= stylesheet_link_tag "lib/main-list" %> -<% end %> -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "lib/module-area" %> -<% end %> - -

<%= t('seminar.seminar') %>

- -<%= form_for @seminar_agreement, url: @url, html: {class: "form-horizontal main-forms"} do |f| %> -
- - -
- - - - - - -
- - <% @site_in_use_locales.each_with_index do |locale, i| %> - -
"> - -
- -
-
- <%= f.fields_for :content_translations do |f| %> - <%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@seminar_agreement.content_translations[locale] rescue nil) %> - <% end %> -
-
-
- -
- - <% end %> - -
- -
- - -
- <%= get_referer_url[:action] rescue "" %> - <%= f.submit t('submit'), class: 'btn btn-primary' %> - - <%= link_to t('cancel'), admin_seminars_path, :class=>"btn" %> -
- -
- -<% end %> diff --git a/app/views/admin/seminar_item_contents/_form.html.erb b/app/views/admin/seminar_item_contents/_form.html.erb deleted file mode 100644 index 4dd4f7b..0000000 --- a/app/views/admin/seminar_item_contents/_form.html.erb +++ /dev/null @@ -1,91 +0,0 @@ - - <% content_for :page_specific_css do %> - <%= stylesheet_link_tag "lib/main-forms" %> - <%= stylesheet_link_tag "lib/fileupload" %> - <%= stylesheet_link_tag "lib/main-list" %> - <% end %> - <% content_for :page_specific_javascript do %> - <%= javascript_include_tag "lib/bootstrap-fileupload" %> - <%= javascript_include_tag "lib/bootstrap-datetimepicker" %> - <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> - <%= javascript_include_tag "lib/file-type" %> - <%= javascript_include_tag "lib/module-area" %> - <% end %> - - -
- - - - - - -
- - -
- - -
- -
- <% if !@seminar_item_content.seminar_item_id.blank? %> - <%= @seminar_item_content.seminar_item.title %> - <% else %> - <%= select_tag "seminar_item_content[seminar_item_id]", options_for_select(@seminar_items) %> - <% end %> -
-
- -
- -
- - - - - - -
- - <% @site_in_use_locales.each_with_index do |locale, i| %> - -
"> - - -
- -
-
- <%= f.fields_for :content_translations do |f| %> - <%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@seminar_item_content.content_translations[locale] rescue nil) %> - <% end %> -
-
-
- - -
- - <% end %> - -
- -
- - -
- <%= f.hidden_field :seminar_main_id, :value => (!params[:seminar_main_id].blank? ? params[:seminar_main_id] : @seminar_item_content.seminar_main_id) %> - <%= get_referer_url[:seminarion] rescue "" %> - <%= f.submit t('submit'), class: 'btn btn-primary' %> - - <%= link_to t('cancel'), admin_seminars_path, :class=>"btn" %> -
\ No newline at end of file diff --git a/app/views/admin/seminar_item_contents/edit.html.erb b/app/views/admin/seminar_item_contents/edit.html.erb deleted file mode 100644 index 721edfa..0000000 --- a/app/views/admin/seminar_item_contents/edit.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<%= form_for @seminar_item_content, url: admin_seminar_item_content_path(@seminar_item_content), html: {class: "form-horizontal main-forms"} do |f| %> -
- <%= render :partial => 'form', locals: {f: f} %> -
-<% end %> \ No newline at end of file diff --git a/app/views/admin/seminar_item_contents/index.html.erb b/app/views/admin/seminar_item_contents/index.html.erb deleted file mode 100644 index e69742f..0000000 --- a/app/views/admin/seminar_item_contents/index.html.erb +++ /dev/null @@ -1,43 +0,0 @@ - - - - -

<%= @seminar.title %>

- - - - - - - - - <% @seminar_item_contents.each do |seminar_item_content| %> - - - - <% end %> - -
<%= t(:item)%>
- <%= seminar_item_content.seminar_item.title %> -
- -
-
- -<%= link_to content_tag(:i, nil, :class => 'icon-plus') +' '+ t('new_'), new_admin_seminar_item_content_path(:seminar_main_id=>params[:seminar_main_id]), :class => 'btn btn-primary' if @seminar_items.count > 0 %> - -<%= - content_tag :div, class: "bottomnav clearfix" do - content_tag :div, paginate(@seminar_item_contents), class: "pagination pagination-centered" - end -%> -
- -<%= render 'layouts/delete_modal', delete_options: @delete_options %> diff --git a/app/views/admin/seminar_item_contents/new.html.erb b/app/views/admin/seminar_item_contents/new.html.erb deleted file mode 100644 index e7100ed..0000000 --- a/app/views/admin/seminar_item_contents/new.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<%= form_for @seminar_item_content, url: admin_seminar_item_contents_path, html: {class: "form-horizontal main-forms"} do |f| %> -
- <%= render :partial => 'form', locals: {f: f} %> -
-<% end %> \ No newline at end of file diff --git a/app/views/admin/seminar_items/_delete_modal.html.erb b/app/views/admin/seminar_items/_delete_modal.html.erb deleted file mode 100644 index 0d68c8e..0000000 --- a/app/views/admin/seminar_items/_delete_modal.html.erb +++ /dev/null @@ -1,16 +0,0 @@ - \ No newline at end of file diff --git a/app/views/admin/seminar_items/_form.html.erb b/app/views/admin/seminar_items/_form.html.erb deleted file mode 100644 index 6335b9d..0000000 --- a/app/views/admin/seminar_items/_form.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<%= f.fields_for :title_translations do |f| %> - <% @site_in_use_locales.each do |locale| %> -
- -
- - <%= t('front_page.name_field_helper') %> -
-
- <% end %> -<% end %> diff --git a/app/views/admin/seminar_items/_index.html.erb b/app/views/admin/seminar_items/_index.html.erb deleted file mode 100644 index 1b6c311..0000000 --- a/app/views/admin/seminar_items/_index.html.erb +++ /dev/null @@ -1,27 +0,0 @@ - -
-
- - - <%= link_to t(:delete_), '#', id: "deleteItems", class: "btn btn-danger toggable hide", rel: '' %> - <%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t('seminar_item.new_item'), id: 'new'} %> -
-
- - - -
-
-

<%= t('seminar_item.set_item') %>

- <% if !@seminar_items.blank? %> -
    - <%= render partial: "item", collection: @seminar_items, locals: {in_module: true} %> -
- <% end %> -
-
- - - -<%= render 'delete_modal' %> - \ No newline at end of file diff --git a/app/views/admin/seminar_items/_item.html.erb b/app/views/admin/seminar_items/_item.html.erb deleted file mode 100644 index f62d177..0000000 --- a/app/views/admin/seminar_items/_item.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -
  • -

    - -

    - <%= link_to '#', class: "open-slide", data: {title: t('seminar_item.edit_item'), id: item.id.to_s, form: item.title_translations} do %> - <%= item.title_translations.values.join(" / ") %> - <% end %> -
  • \ No newline at end of file diff --git a/app/views/admin/seminar_items/index.html.erb b/app/views/admin/seminar_items/index.html.erb deleted file mode 100644 index fee290b..0000000 --- a/app/views/admin/seminar_items/index.html.erb +++ /dev/null @@ -1,81 +0,0 @@ -
    - <%= render 'index' %> -
    - - -
    -
    - - - - -
    -
    -
    -
    -
    - -
    - -
    - <%= form_for :seminar_item, url: nil, remote: true do |f| %> -
    - <%= render :partial => "form", :locals => { :f => f } %> -
    - <%= t(:cancel) %> - <%= f.submit t(:submit), class: 'btn btn-primary btn-small', id: "tag_submit" %> -
    -
    - <% end %> -
    - -
    - -
    -
    -
    -
    -
    - -<% content_for :page_specific_css do %> - <%= stylesheet_link_tag "seminar_sets" %> -<% end %> -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "check_seminar_set_items.js" %> - <%= javascript_include_tag "seminar_sets.js" %> -<% end %> - - - \ No newline at end of file diff --git a/app/views/admin/seminar_items/index.js.erb b/app/views/admin/seminar_items/index.js.erb deleted file mode 100644 index df389d1..0000000 --- a/app/views/admin/seminar_items/index.js.erb +++ /dev/null @@ -1,8 +0,0 @@ -$("#delete_seminar_items").modal('hide'); -$("#seminar_items_index").html("<%= j render 'index' %>") -$.pageslide.close(); -openSlide(); -$('.card').cardCheck({ - item: $('.card input[type="checkbox"]'), -}); -checkedLength(); \ No newline at end of file diff --git a/app/views/admin/seminar_signups/edit.html.erb b/app/views/admin/seminar_signups/edit.html.erb deleted file mode 100644 index 0e50a48..0000000 --- a/app/views/admin/seminar_signups/edit.html.erb +++ /dev/null @@ -1,204 +0,0 @@ -<%= form_for @seminar_signup, url: admin_seminar_signup_path(@seminar_signup), html: {class: "form-horizontal main-forms"} do |f| %> -
    - -<% content_for :page_specific_css do %> - <%= stylesheet_link_tag "lib/main-forms" %> - <%= stylesheet_link_tag "lib/fileupload" %> - <%= stylesheet_link_tag "lib/main-list" %> -<% end %> -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "lib/bootstrap-fileupload" %> - <%= javascript_include_tag "lib/bootstrap-datetimepicker" %> - <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> - <%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %> - <%= javascript_include_tag "lib/file-type" %> - <%= javascript_include_tag "lib/module-area" %> -<% end %> - - -
    - - -
    - - - -
    - -
    - <%= @seminar.title %> -
    -
    - <% if @seminar.seminar_signup_field_sets.count != 0 %> - <% @seminar.seminar_signup_field_sets.each do |signup_field| %> - <% if !(signup_field.disabled) && signup_field.field_name != 'recaptcha' %> - - <% end %> - <% end %> - <% else %> -
    - -
    - <% if @seminar.registration_status.include?('G') %> - - <% end %> - <% if @seminar.registration_status.include?('C') %> - - <% end %> -
    -
    - -
    -
    *(required)
    -
    - - -
    - -
    - <%= f.text_field :name, :class=>"input-block-level", :id=>'name', :placeholder=> t('seminar_signup.name'), :required => true %> -
    -
    - - -
    - -
    - <%= f.text_field :tel, :class=>"input-block-level", :placeholder=> t('seminar_signup.tel'), :required => true %> -
    -
    - - -
    - -
    - <%= f.email_field :email, :class=>"input-block-level", :placeholder=> t(:email), :required => true %> check mail -
    -
    - -
    - -
    - <%= f.text_field :password, :class=>"input-block-level", :placeholder=> t('seminar_signup.password') %> - <%= t('seminar_signup.password_message') %> -
    -
    - - <% end %> - <% @form_index = 0 %> - <% @seminar.seminar_signup_fields.asc(:_id).each do |rf| %> - -
    - - <%= rf.block_helper(@seminar,@form_index,false,"seminar_signup",@seminar_signup, rf.to_require) %> - -
    - - <% @form_index = @form_index +1 %> - - <% end %> - - - -
    - -
    - - -
    - <%#= get_referer_url[:action] rescue "" %> - <%= f.submit t('submit'), class: 'btn btn-primary' %> - <%= link_to t('cancel'), "/admin/seminars/#{@seminar.id}/seminar_signup", :class=>"btn" %> -
    - - -
    -<% end %> \ No newline at end of file diff --git a/app/views/admin/seminars/_attribute_field.html.erb b/app/views/admin/seminars/_attribute_field.html.erb deleted file mode 100644 index bf3ceb7..0000000 --- a/app/views/admin/seminars/_attribute_field.html.erb +++ /dev/null @@ -1,132 +0,0 @@ -
    -<% - attribute_field.af_count ? @af_counter = attribute_field_counter + attribute_field.af_count : @af_counter = attribute_field_counter -%> -
    -
    -
    - <%= hidden_field "#{@field_name}[seminar_signup_fields][#{@af_counter}]","disabled",:value=>attribute_field.disabled,:class=>"toggle-check", :data=>{:deploy=>"right"} %> - -
    -
    - <%= t(:delete_)%> - <%= hidden_field "#{@field_name}[seminar_signup_fields][#{@af_counter}]","to_delete",:value=>false,:class=>"attribute_field_to_delete"%> - Reset -

    Field <%= @af_counter + 1 %>

    -
    -
    -
    - -
    - <%= text_field "#{@field_name}[seminar_signup_fields][#{@af_counter}]","key",:value=>attribute_field.key, :data=>{:type=>"key"} %> -
    -
    - - <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"#{@field_name}[seminar_signup_fields][#{@af_counter}][title_translations]"}%> - -
    - -
    - - -
    -
    -
    - -
    - -
    -
    -
    - -
    - - <%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeA")}" do%> -
    - -
    - - -
    -
    - <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field["typeA"]["placeholder"],:field_name=>"#{@field_name}[seminar_signup_fields][#{@af_counter}][typeA][placeholder]"}%> - <% end if show_type_panel(attribute_field,"typeA") != 'typeA hide' %> - - <%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeB")}" do %> - <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:label_ext=>t(:initial),:values=>attribute_field["typeB"]["initial"],:field_name=>"#{@field_name}[seminar_signup_fields][#{@af_counter}][typeB][initial]"}%> - - <% if attribute_field.self_defined_markup_options?%> - <%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[seminar_signup_fields][#{@af_counter}][attribute][seminar][statuses]"} %> - <%else #normal list%> - <%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[seminar_signup_fields][#{@af_counter}][typeB][option_list]"} %> - <% end #of self_defined_markup_options?%> - - <% end if show_type_panel(attribute_field,"typeB") != 'typeB hide' %> - - <%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeC")}" do %> -
    - -
    - <%= select "#{@field_name}[seminar_signup_fields][#{@af_counter}][typeC]","format",Admin::AttributeValuesViewHelper::OPT,:class=>"dataType",:selected=>attribute_field["typeC"]["format"] %> -
    -
    -
    - -
    - - -
    -
    -
    - -
    - - -
    -
    - <% end if show_type_panel(attribute_field,"typeC") != 'typeC hide' %> - - <%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeD")}" do%> -
    - -
    - -
    -
    - <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:field_name=>"#{@field_name}[seminar_signup_fields][#{@af_counter}][typeD][placeholder]",:values=>attribute_field["typeD"]["placeholder"]} %> - <% end if show_type_panel(attribute_field,"typeD") != 'typeD hide' %> - - <%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeE")}" do%> - <%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"#{@field_name}[seminar_signup_fields][#{@af_counter}][typeE][option_list]",:values=>attribute_field["typeE"]["option_list"]}%> - <% end if show_type_panel(attribute_field,"typeE") != 'typeE hide' %> - - <%= hidden_field "#{@field_name}[seminar_signup_fields][#{@af_counter}]","id",:value=>attribute_field.id%> - -
    \ No newline at end of file diff --git a/app/views/admin/seminars/_attribute_submission_field.html.erb b/app/views/admin/seminars/_attribute_submission_field.html.erb deleted file mode 100644 index c29edc8..0000000 --- a/app/views/admin/seminars/_attribute_submission_field.html.erb +++ /dev/null @@ -1,132 +0,0 @@ -
    -<% - attribute_submission_field.af_count ? @af_counter = attribute_submission_field_counter + attribute_submission_field.af_count : @af_counter = attribute_submission_field_counter -%> -
    -
    -
    - <%= hidden_field "#{@field_name}[seminar_submission_fields][#{@af_counter}]","disabled",:value=>attribute_submission_field.disabled,:class=>"toggle-check", :data=>{:deploy=>"right"} %> - -
    -
    - <%= t(:delete_)%> - <%= hidden_field "#{@field_name}[seminar_submission_fields][#{@af_counter}]","to_delete",:value=>false,:class=>"attribute_submission_field_to_delete"%> - Reset -

    Field <%= @af_counter + 1 %>

    -
    -
    -
    - -
    - <%= text_field "#{@field_name}[seminar_submission_fields][#{@af_counter}]","key",:value=>attribute_submission_field.key, :data=>{:type=>"key"} %> -
    -
    - - <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_submission_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"#{@field_name}[seminar_submission_fields][#{@af_counter}][title_translations]"}%> - -
    - -
    - - -
    -
    -
    - -
    - -
    -
    -
    - -
    - - <%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_submission_field,"typeA")}" do%> -
    - -
    - - -
    -
    - <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_submission_field["typeA"]["placeholder"],:field_name=>"#{@field_name}[seminar_submission_fields][#{@af_counter}][typeA][placeholder]"}%> - <% end if show_type_panel(attribute_submission_field,"typeA") != 'typeA hide' %> - - <%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_submission_field,"typeB")}" do %> - <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:label_ext=>t(:initial),:values=>attribute_submission_field["typeB"]["initial"],:field_name=>"#{@field_name}[seminar_submission_fields][#{@af_counter}][typeB][initial]"}%> - - <% if attribute_submission_field.self_defined_markup_options?%> - <%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_submission_field["option_list"],:field_name=> "#{@field_name}[seminar_submission_fields][#{@af_counter}][attribute][seminar][statuses]"} %> - <%else #normal list%> - <%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_submission_field["option_list"],:field_name=> "#{@field_name}[seminar_submission_fields][#{@af_counter}][typeB][option_list]"} %> - <% end #of self_defined_markup_options?%> - - <% end if show_type_panel(attribute_submission_field,"typeB") != 'typeB hide' %> - - <%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_submission_field,"typeC")}" do %> -
    - -
    - <%= select "#{@field_name}[seminar_submission_fields][#{@af_counter}][typeC]","format",Admin::AttributeValuesViewHelper::OPT,:class=>"dataType",:selected=>attribute_submission_field["typeC"]["format"] %> -
    -
    -
    - -
    - - -
    -
    -
    - -
    - - -
    -
    - <% end if show_type_panel(attribute_submission_field,"typeC") != 'typeC hide' %> - - <%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_submission_field,"typeD")}" do%> -
    - -
    - -
    -
    - <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:field_name=>"#{@field_name}[seminar_submission_fields][#{@af_counter}][typeD][placeholder]",:values=>attribute_submission_field["typeD"]["placeholder"]} %> - <% end if show_type_panel(attribute_submission_field,"typeD") != 'typeD hide' %> - - <%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_submission_field,"typeE")}" do%> - <%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"#{@field_name}[seminar_submission_fields][#{@af_counter}][typeE][option_list]",:values=>attribute_submission_field["typeE"]["option_list"]}%> - <% end if show_type_panel(attribute_submission_field,"typeE") != 'typeE hide' %> - - <%= hidden_field "#{@field_name}[seminar_submission_fields][#{@af_counter}]","id",:value=>attribute_submission_field.id%> - -
    \ No newline at end of file diff --git a/app/views/admin/seminars/_form.html.erb b/app/views/admin/seminars/_form.html.erb deleted file mode 100644 index a5b975e..0000000 --- a/app/views/admin/seminars/_form.html.erb +++ /dev/null @@ -1,487 +0,0 @@ -<% content_for :page_specific_css do %> - <%= stylesheet_link_tag "lib/main-forms" %> - <%= stylesheet_link_tag "lib/fileupload" %> - <%= stylesheet_link_tag "lib/main-list" %> -<% end %> -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "lib/bootstrap-fileupload" %> - <%= javascript_include_tag "lib/bootstrap-datetimepicker" %> - <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> - <%= javascript_include_tag "lib/file-type" %> - <%= javascript_include_tag "lib/module-area" %> -<% end %> - - -
    - - - - - - -
    - - -
    - - -
    - -
    - <%= select_category(f, @module_app) %> -
    -
    - - -
    - -
    - <%= f.datetime_picker :seminar_start_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @seminar.new_record? %> -
    -
    - -
    - -
    - <%= f.datetime_picker :seminar_end_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @seminar.new_record? %> -
    -
    - -
    - - - -
    - - -
    - -
    - <% ['G','C'].each do |t| %> - - <% end %> -
    -
    - - -
    - -
    - <%= f.datetime_picker :signup_start_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @seminar.new_record? %> -
    -
    - -
    - -
    - <%= f.datetime_picker :signup_end_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @seminar.new_record? %> -
    -
    - - -
    - -
    - <%= f.datetime_picker :contribute_start_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @seminar.new_record? %> -
    -
    - -
    - -
    - <%= f.datetime_picker :contribute_end_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @seminar.new_record? %> -
    -
    - -
    - -
    - <%= f.text_field :contribute_file_count %> - (<%= t('seminar.blank_no_limit') %>) -
    -
    - -
    - -
    - <%= f.fields_for :seminar_reviews,@review do |seminar_reviews_form| %> -
    - -
    - <% if !@member.nil? %> - <%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'seminar_main[seminar_reviews_attributes][0][reviewer_id][]', email_members:@member} %> - <% else %> - <%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'seminar_main[seminar_reviews_attributes][0][reviewer_id][]', email_members:[]} %> - <% end %> -
    -
    -
    - -
    - <%= seminar_reviews_form.datetime_picker :review_start_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @seminar.new_record? %> -
    -
    -
    - -
    - <%= seminar_reviews_form.datetime_picker :review_end_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @seminar.new_record? %> -
    -
    - <% end %> -
    - -
    - - - - - - - - - - <% @signup_sets.each_with_index do |attr_signup,signup_index| %> - - - - - - - - <% end %> - -
    <%= t('seminar.field_name') %><%= t('seminar.name') %><%= t('seminar.placeholder') %><%= t('seminar.disable') %><%= t('seminar.hidden') %>
    - <%= t("seminar_signup.#{attr_signup.field_name}") %> - - <%= show_set_field(attr_signup,'seminar_signup_field_sets',signup_index,'name') %> - - <%= show_set_field(attr_signup,'seminar_signup_field_sets',signup_index,'placeholder') %> - - - - <%= check_box_tag("seminar_main[seminar_signup_field_sets][#{signup_index}][disabled]", true ,attr_signup.disabled) %> - - <% if attr_signup.field_name != 'recaptcha' %> - - <%= check_box_tag("seminar_main[seminar_signup_field_sets][#{signup_index}][hidden]", true ,attr_signup.hidden) %> - <% end %> -
    - -
    - -
    - - - - - - - - - - <% @submission_set.each_with_index do |attr_signup,submission_index| %> - - - - - - - - <% end %> - -
    <%= t('seminar.field_name') %><%= t('seminar.name') %><%= t('seminar.placeholder') %><%= t('seminar.disable') %><%= t('seminar.hidden') %>
    - <%= t("seminar_signup.#{attr_signup.field_name}") %> - - <%= show_set_field(attr_signup,'seminar_submission_field_sets',submission_index,'name') %> - - <%= show_set_field(attr_signup,'seminar_submission_field_sets',submission_index,'placeholder') %> - - - - <%= check_box_tag("seminar_main[seminar_submission_field_sets][#{submission_index}][disabled]", true ,attr_signup.disabled) %> - - - <%= check_box_tag("seminar_main[seminar_submission_field_sets][#{submission_index}][hidden]", true ,attr_signup.hidden) %> -
    -
    - -
    - - - - - - - <% @custom_set.each_with_index do |attr_custom,custom_index| %> - - - - - - <% end %> - -
    <%= t('seminar.field_name') %><%= t('seminar.hidden') %>
    - <%= SeminarSignupField.where(id:attr_custom.seminar_signup_field_id).first.title rescue '' %> - - - <%= check_box_tag("seminar_main[seminar_signup_field_customs][#{custom_index}][hidden]", true ,attr_custom.hidden) %> -
    -
    - -
    - -
    - <% (0..3).each do |index1| %> - <% active_email_set = index1==0 ? ' active' : '' %> -
    - - - - - - - - - - - - - - - - -
    - <%= t('seminar.disable') %> - - - <%= check_box_tag("seminar_main[seminar_email_sets][#{index1}][disabled]", true ,@email_set[index1].disabled) %> -
    - <%= t('seminar.email_title') %> - - <%= show_set_field(@email_set[index1],'seminar_email_sets',index1,'title','text_field') %> -
    - <%= t('seminar.email_content') %> - -
    - <%= show_set_field(@email_set[index1],'seminar_email_sets',index1,'content','text_area') %> -
    -
    -
    - <% end %> -
    -
    -
    - - - - - - -
    - - <% @site_in_use_locales.each_with_index do |locale, i| %> - -
    "> - - -
    - -
    - <%= f.fields_for :title_translations do |f| %> - <%= f.text_field locale, class: "input-block-level", placeholder: t(:title), value: (@seminar.title_translations[locale] rescue nil) %> - <% end %> -
    -
    - - -
    - -
    - <%= f.fields_for :speaker_translations do |f| %> - <%= f.text_field locale, class: "input-block-level", placeholder: t('seminar.speaker'), value: (@seminar.speaker_translations[locale] rescue nil) %> - <% end %> -
    -
    - - -
    - -
    -
    - <%= f.fields_for :content_translations do |f| %> - <%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@seminar.content_translations[locale] rescue nil) %> - <% end %> -
    -
    -
    - - -
    - -
    - <%= f.fields_for :act_place_translations do |f| %> - <%= f.text_field locale, class: "input-block-level", placeholder: t('seminar.act_place'), value: (@seminar.act_place_translations[locale] rescue nil) %> - <% end %> -
    -
    - - -
    - - <% end %> - - -
    - -
    - - - <% if @seminar && !@seminar.seminar_links.blank? %> -
    - <% @seminar.seminar_links.each_with_index do |seminar_link, i| %> - <%= f.fields_for :seminar_links, seminar_link do |f| %> - <%= render :partial => 'form_link', :object => seminar_link, :locals => {:f => f, :i => i} %> - <% end %> - <% end %> -
    -
    - <% end %> - - -
    -
    -

    - <%= hidden_field_tag 'seminar_link_field_count', @seminar.seminar_links.count %> - <%= t(:add) %> -

    - -
    -
    - - -
    - -
    - - - <% if @seminar && !@seminar.seminar_files.blank? %> -
    - <% @seminar.seminar_files.each_with_index do |seminar_file, i| %> - <%= f.fields_for :seminar_files, seminar_file do |f| %> - <%= render :partial => 'form_file', :object => seminar_file, :locals => {:f => f, :i => i} %> - <% end %> - <% end %> -
    -
    - <% end %> - - -
    -
    -

    - <%= hidden_field_tag 'seminar_file_field_count', @seminar.seminar_files.count %> - <%= t(:add) %> -

    - -
    -
    - -
    - -
    - - -
    - <%= get_referer_url[:seminarion] rescue "" %> - <%= f.submit t('submit'), class: 'btn btn-primary' %> - - <%= link_to t('cancel'), admin_seminars_path, :class=>"btn" %> -
    - -<% content_for :page_specific_javascript do %> - -<% end %> \ No newline at end of file diff --git a/app/views/admin/seminars/_form_file.html.erb b/app/views/admin/seminars/_form_file.html.erb deleted file mode 100644 index a1ab19a..0000000 --- a/app/views/admin/seminars/_form_file.html.erb +++ /dev/null @@ -1,55 +0,0 @@ -<% if form_file.new_record? %> -
    -<% else %> -
    - <% if form_file.file.blank? %> - <%= t(:no_file) %> - <% 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} %> - <% end %> -<% end %> -
    - - - - <% @site_in_use_locales.each_with_index do |locale, i| %> - <%= locale %>"> - <%= 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) %> - <% end %> - - <% end %> - - - - <% @site_in_use_locales.each_with_index do |locale, i| %> - <%= locale %>"> - <%= 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) %> - <% end %> - - <% end %> - - - <% if form_file.new_record? %> - - - - <% else %> - - <%= f.hidden_field :id %> - - <%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %> - - <% end %> -
    -
    \ No newline at end of file diff --git a/app/views/admin/seminars/_form_link.html.erb b/app/views/admin/seminars/_form_link.html.erb deleted file mode 100644 index d4aa5fd..0000000 --- a/app/views/admin/seminars/_form_link.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -
    - - <%= f.text_field :url, class: "input-large", placeholder: t(:url) %> - - - <% @site_in_use_locales.each_with_index do |locale, i| %> - <%= locale %>"> - <%= 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) %> - <% end %> - - <% end %> - - - <% if form_link.new_record? %> - - - - <% else %> - - <%= f.hidden_field :id %> - - <%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %> - - <% end %> -
    \ No newline at end of file diff --git a/app/views/admin/seminars/_index.html.erb b/app/views/admin/seminars/_index.html.erb deleted file mode 100644 index cb0b6b4..0000000 --- a/app/views/admin/seminars/_index.html.erb +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - <% @table_fields.each do |f| %> - <% if f == 'seminar.title' %> - - <% else %> - <%= thead(f) %> - <% end %> - <% end %> - - - - <% @seminars.each do |seminar| %> - - - - - - - - - <% end %> - -
    <%= t(f)%>
    <%= seminar.category.title %> - <%= seminar.title %> - - <%= SeminarMain.time_range(seminar.seminar_start_date, seminar.seminar_end_date) %><%= SeminarMain.time_range(seminar.signup_start_date, seminar.signup_end_date) %><%= seminar.seminar_signups.count %><%= t('seminar.export') %>
    - -<%= - content_tag :div, class: "bottomnav clearfix" do - content_tag :div, paginate(@seminars), class: "pagination pagination-centered" - end -%> \ No newline at end of file diff --git a/app/views/admin/seminars/_support_member_form_js.erb b/app/views/admin/seminars/_support_member_form_js.erb deleted file mode 100644 index c90efb7..0000000 --- a/app/views/admin/seminars/_support_member_form_js.erb +++ /dev/null @@ -1,268 +0,0 @@ -<%#= encoding: utf-8 %> - - - - - - - - - - \ No newline at end of file diff --git a/app/views/admin/seminars/edit.html.erb b/app/views/admin/seminars/edit.html.erb deleted file mode 100644 index f6a638b..0000000 --- a/app/views/admin/seminars/edit.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<%= form_for @seminar, url: admin_seminar_path(@seminar), html: {class: "form-horizontal main-forms"} do |f| %> -
    - <%= render :partial => 'form', locals: {f: f} %> -
    -<% end %> \ No newline at end of file diff --git a/app/views/admin/seminars/export.xlsx.axlsx b/app/views/admin/seminars/export.xlsx.axlsx deleted file mode 100644 index 340998f..0000000 --- a/app/views/admin/seminars/export.xlsx.axlsx +++ /dev/null @@ -1,66 +0,0 @@ -# encoding: utf-8 - -wb = xlsx_package.workbook - -wb.add_worksheet(name: (@seminar.title.to_s[0..27]+'...')) do |sheet| - - row = [t('seminar_signup.signup_time')] - - row << t('seminar_signup.name') - - row << t('seminar_signup.unit') - - row << t('seminar_signup.tel') - - row << t('seminar_signup.phone') - - row << t('seminar_signup.fax') - - row << t('seminar_signup.address') - - row << t(:email) - - row << t('seminar_signup.note') - - @seminar.seminar_signup_fields.asc(:_id).each do |rf| - if rf.can_muti_lang_input? - @site_in_use_locales.each do |l| - row << rf.title + " (#{t(l.to_s)})" - end - else - row << rf.title - end - end - - sheet.add_row row - - @seminar.seminar_signups.each do |signup| - - row2 = [] - - row2 << "#{signup.created_at} " - row2 << "#{signup[:name]} " - row2 << "#{signup.unit} " - row2 << "#{signup[:tel]} " - row2 << "#{signup[:phone]} " - row2 << "#{signup[:fax]} " - row2 << "#{signup.address} " - row2 << "#{signup[:email]} " - row2 << "#{signup.note} " - - @seminar.seminar_signup_fields.asc(:_id).each do |rf| - if rf.can_muti_lang_input? - @site_in_use_locales.each do |l| - row2 << nl2br(show_attribute_value(@seminar.get_attribute_value(rf,signup.id).get_value_by_locale(l))) rescue ' ' - end - else - row2 << nl2br(show_attribute_value(@seminar.get_attribute_value(rf,signup.id).get_value_by_locale(I18n.locale))) rescue ' ' - end - end - - sheet.add_row row2 - end - - -end - diff --git a/app/views/admin/seminars/index.html.erb b/app/views/admin/seminars/index.html.erb deleted file mode 100644 index 4513c37..0000000 --- a/app/views/admin/seminars/index.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= render_filter @filter_fields, "index_table" %> - - <%= render 'index'%> - - -<%= render 'layouts/delete_modal', delete_options: @delete_options %> diff --git a/app/views/admin/seminars/new.html.erb b/app/views/admin/seminars/new.html.erb deleted file mode 100644 index fe6d4fe..0000000 --- a/app/views/admin/seminars/new.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<%= form_for @seminar, url: admin_seminars_path, html: {class: "form-horizontal main-forms"} do |f| %> -
    - <%= render :partial => 'form', locals: {f: f} %> -
    -<% end %> \ No newline at end of file diff --git a/app/views/admin/seminars/seminar_item_content.html.erb b/app/views/admin/seminars/seminar_item_content.html.erb deleted file mode 100644 index 7268cdd..0000000 --- a/app/views/admin/seminars/seminar_item_content.html.erb +++ /dev/null @@ -1,44 +0,0 @@ - - - - -

    <%= @seminar.title %>

    - - - - - - - - - <% @seminar_item_contents.each do |seminar_item_content| %> - - - - <% end %> - -
    <%= t('seminar_item_content.name')%>
    - <%= seminar_item_content.content %> -
    - -
    -
    - -<%= link_to content_tag(:i, nil, :class => 'icon-plus') +' '+ t('new_'), - '/admin/seminar_item_contents/'+@member.to_param+'/journal_papers/new', :class => 'btn btn-primary' %> - -<%= - content_tag :div, class: "bottomnav clearfix" do - content_tag :div, paginate(@seminar_item_contents), class: "pagination pagination-centered" - end -%> -
    - -<%= render 'layouts/delete_modal', delete_options: @delete_options %> diff --git a/app/views/admin/seminars/seminar_signup.html.erb b/app/views/admin/seminars/seminar_signup.html.erb deleted file mode 100644 index d3bc449..0000000 --- a/app/views/admin/seminars/seminar_signup.html.erb +++ /dev/null @@ -1,215 +0,0 @@ - - - - - -
    -
    - -
    -
    - - -

    <%= @seminar.title %>

    - - - - - <% if @seminar.seminar_signup_field_sets.count != 0 %> - <% @seminar.seminar_signup_field_sets.each do |field_set| %> - <% if !(field_set.hidden) %> - - <% end %> - <% end %> - <% else %> - - - - <% end %> - <% if @seminar.seminar_signup_field_customs.count != 0 %> - <% @seminar.seminar_signup_field_customs.each do |field_set| %> - <% if !(field_set.hidden) %> - - <% end %> - <% end %> - <% end %> - <% if @seminar.seminar_submission_field_sets.count != 0 %> - <% show1 = !(@seminar.seminar_submission_field_sets.select{|v| v.field_name=='title'}[0].hidden) - show2 = !(@seminar.seminar_submission_field_sets.select{|v| v.field_name=='file'}[0].hidden) - show3 = !(@seminar.seminar_submission_field_sets.select{|v| v.field_name=='description'}[0].hidden) - %> - <% else %> - <% show1 = true - show2 = true - show3 = true - %> - <% end %> - <% if show1 %> - - <% end %> - <% if show2 %> - - <% end %> - <% if show3 %> - - <% end %> - <% @seminar.seminar_submission_fields.asc(:_id).each do |submission_field| %> - - <% end %> - - - - <% @seminar_signups.each do |seminar_signup| %> - <% len = seminar_signup.seminar_signup_contributes.count %> - - <% if @seminar.seminar_signup_field_sets.count != 0 %> - <% @seminar.seminar_signup_field_sets.each do |field_set| %> - <% if !(field_set.hidden) %> - - <% end %> - <% end %> - <% else %> - - - - <% end %> - <% if @seminar.seminar_signup_field_customs.count != 0 %> - <% @seminar.seminar_signup_field_customs.each do |field_set| %> - <% if !(field_set.hidden) %> - - <% end %> - <% end %> - <% end %> - <% count_set = 0 %> - <% if @seminar.seminar_submission_field_sets.count != 0 %> - <% show1 = !(@seminar.seminar_submission_field_sets.select{|v| v.field_name=='title'}[0].hidden) - show2 = !(@seminar.seminar_submission_field_sets.select{|v| v.field_name=='file'}[0].hidden) - show3 = !(@seminar.seminar_submission_field_sets.select{|v| v.field_name=='description'}[0].hidden) - %> - <% @seminar.seminar_submission_field_sets.each do |field_set| %> - <% if !(field_set.hidden) %> - <% count_set+=1 %> - <% end %> - <% end %> - <% else %> - <% show1 = true - show2 = true - show3 = true - %> - <% count_set = 2 %> - <% end %> - <% if len==0 %> - <% - count_field = @seminar.seminar_submission_fields.count - %> -
      - <% for i in 1..count_field+count_set %> -
    - <% end %> - - - <% end %> -
      - <% seminar_signup.seminar_signup_contributes.collect do |seminar_signup_contribute| %> - <% if show1 %> -
    - <% end %> - <% if show2 %> - - <% end %> - <% if show3 %> - - <% end %> - <% - count_value = seminar_signup_contribute.seminar_submission_values.count - count_field = @seminar.seminar_submission_fields.count - %> - <% if count_value == count_field %> - <% seminar_signup_contribute.seminar_submission_values.asc(:seminar_submission_field_id).each do |value| %> - - <% end %> - <% else %> - <% for i in 1..(count_field-count_value) %> - - <% end %> - <% end %> - - - <% end %> - - - <% end %> - -
    <%= field_set.name[I18n.locale] %><%= t('seminar_signup.name')%><%= t('seminar_signup.tel')%><%= t('seminar.registration_status')%><%= SeminarSignupField.where(id:field_set.seminar_signup_field_id).first.title rescue '' %><%= t('seminar_signup.title')%><%= t('seminar_signup.file')%><%= t('seminar_signup.description')%><%= submission_field.title %>
    - <% if field_set.field_name== 'name' %> - <%= seminar_signup.name %> -
    - -
    - <% elsif field_set.field_name== 'status' %> - <%= t("seminar.registration_status_#{seminar_signup.status}") if !seminar_signup.status.blank? %> - <% elsif field_set.field_name != 'recaptcha' %> - <%= seminar_signup.send("#{field_set.field_name}") %> - <% end %> -
    - <%= seminar_signup.name %> -
    - -
    -
    <%= seminar_signup.tel %><%= t("seminar.registration_status_#{seminar_signup.status}") if !seminar_signup.status.blank? %> - - <% seminar_signup.seminar_signup_values.each do |seminar_signup_values| %> - <% if seminar_signup_values.seminar_signup_field_id == field_set.seminar_signup_field_id %> - <% if seminar_signup_values.value.class == String || seminar_signup_values.value.nil? %> - <%= seminar_signup_values.get_value_by_locale(I18n.locale,seminar_signup_values) %> - <% else %> - <% seminar_signup_values.value.each do |key,v| %> - <%= "#{I18n.t(key)}:#{seminar_signup_values.get_value_by_locale(key,seminar_signup_values)}" %> -
    - <% end %> - <% end %> - <% end %> - <% end %> -
    -
    -
  • <%= seminar_signup_contribute.title.to_s %>
  • -
    -
  • - <%= link_to (seminar_signup_contribute.title.blank? ? File.basename(seminar_signup_contribute.file.path) : seminar_signup_contribute.title) , seminar_signup_contribute.file.url, {:target => '_blank', :title => Nokogiri::HTML(seminar_signup_contribute.description).text} if seminar_signup_contribute.file.file %> -
  • -
    -
  • <%= seminar_signup_contribute.description.to_s.html_safe %>
  • -
    - - <% if value.value.class == String || value.value.nil? %> - <%= value.get_value_by_locale(I18n.locale,value) %> - <% else %> - <% value.value.each do |key,v| %> - <%= "#{I18n.t(key)}:#{value.get_value_by_locale(key,value)}" %> -
    - <% end %> - <% end %> -
    -
    -
    - -<%= - content_tag :div, class: "bottomnav clearfix" do - content_tag :div, paginate(@seminar_signups), class: "pagination pagination-centered" - end -%> -
    - -<%= render 'layouts/delete_modal', delete_options: @delete_options %> diff --git a/app/views/admin/seminars/seminar_signup_field.html.erb b/app/views/admin/seminars/seminar_signup_field.html.erb deleted file mode 100644 index 330b6f4..0000000 --- a/app/views/admin/seminars/seminar_signup_field.html.erb +++ /dev/null @@ -1,37 +0,0 @@ -<% content_for :page_specific_css do -%> - <%= stylesheet_link_tag "lib/wrap-nav.css" %> - <%= stylesheet_link_tag "lib/pageslide.css" %> - <%= stylesheet_link_tag "lib/main-forms.css" %> - <%= stylesheet_link_tag "lib/togglebox.css" %> -<% end -%> - -<% content_for :page_specific_javascript do -%> - <%= javascript_include_tag "lib/jquery.tmpl.min.js" %> - <%= javascript_include_tag "field-forms.js" %> -<% end -%> - -<%= form_for @attribute,:url => admin_seminar_path(@attribute) , :html => { :class=> "form-horizontal main-forms" } do |f| %> - <% if flash.now[:notice].present? %> - <%= flash.now[:notice]%> - <% end %> - -

    <%= @attribute.title %>

    -
    - -
    - <%= render partial: "attribute_field",collection: @attribute.seminar_signup_fields.asc(:_id)%> -
    - -
    - - <%= hidden_field_tag 'id', params[:id] if !params[:id].blank? %> - <%= f.submit t(:submit),:class=>"btn btn-primary"%> - <%= link_to t('cancel'), get_go_back, :class=>"btn" %> -
    -
    -<% end %> - - -<% content_for :page_specific_javascript do -%> - <%= render 'support_member_form_js' %> -<% end -%> \ No newline at end of file diff --git a/app/views/admin/seminars/seminar_submission_field.html.erb b/app/views/admin/seminars/seminar_submission_field.html.erb deleted file mode 100644 index c4063b1..0000000 --- a/app/views/admin/seminars/seminar_submission_field.html.erb +++ /dev/null @@ -1,36 +0,0 @@ -<% content_for :page_specific_css do -%> - <%= stylesheet_link_tag "lib/wrap-nav.css" %> - <%= stylesheet_link_tag "lib/pageslide.css" %> - <%= stylesheet_link_tag "lib/main-forms.css" %> - <%= stylesheet_link_tag "lib/togglebox.css" %> -<% end -%> - -<% content_for :page_specific_javascript do -%> - <%= javascript_include_tag "lib/jquery.tmpl.min.js" %> - <%= javascript_include_tag "field-forms-submission.js" %> -<% end -%> -<%= form_for @attribute,:url => admin_seminar_path(@attribute) , :html => { :class=> "form-horizontal main-forms" } do |f| %> - <% if flash.now[:notice].present? %> - <%= flash.now[:notice]%> - <% end %> - -

    <%= @attribute.title %>

    -
    - -
    - <%= render partial: "attribute_submission_field",collection: @attribute.seminar_submission_fields.asc(:_id)%> -
    - -
    - - <%= hidden_field_tag 'id', params[:id] if !params[:id].blank? %> - <%= f.submit t(:submit),:class=>"btn btn-primary"%> - <%= link_to t('cancel'), get_go_back, :class=>"btn" %> -
    -
    -<% end %> - - -<% content_for :page_specific_javascript do -%> - <%= render 'support_member_form_js' %> -<% end -%> \ No newline at end of file diff --git a/app/views/email/add_file_email.html.erb b/app/views/email/add_file_email.html.erb deleted file mode 100644 index c4eb60c..0000000 --- a/app/views/email/add_file_email.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<% email_set = SeminarMain.where(id:@data['seminar_id']).first.seminar_email_sets.select{|v| v.field_name == 'add_file'} %> -<% if email_set.length != 0 %> - <% if !(email_set[0].content.nil?) %> - <%= email_set[0].content[@data['locale']].html_safe %> - <% end %> -<% else %> - <%= t('seminar.email_add_file_content') %> -<% end %> \ No newline at end of file diff --git a/app/views/email/edit_file_email.html.erb b/app/views/email/edit_file_email.html.erb deleted file mode 100644 index 5412b0e..0000000 --- a/app/views/email/edit_file_email.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<% email_set = SeminarMain.where(id:@data['seminar_id']).first.seminar_email_sets.select{|v| v.field_name == 'edit_file'} %> -<% if email_set.length != 0 %> - <% if !(email_set[0].content.nil?) %> - <%= email_set[0].content[@data['locale']].html_safe %> - <% end %> -<% else %> - <%= t('seminar.email_edit_file_content') %> -<% end %> \ No newline at end of file diff --git a/app/views/email/signup_email.html.erb b/app/views/email/signup_email.html.erb deleted file mode 100644 index eb6a9a0..0000000 --- a/app/views/email/signup_email.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<% email_set = SeminarMain.where(id:@data['seminar_id']).first.seminar_email_sets.select{|v| v.field_name == 'signup'} %> -<% if email_set.length != 0 %> - <% if !(email_set[0].content.nil?) %> - <%= email_set[0].content[@data['locale']].html_safe %> - <% end %> -<% else %> - <%= t('seminar.email_signup_content') %> -<% end %> \ No newline at end of file diff --git a/app/views/email/submission_email.html.erb b/app/views/email/submission_email.html.erb deleted file mode 100644 index d3b4041..0000000 --- a/app/views/email/submission_email.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<% email_set = SeminarMain.where(id:@data['seminar_id']).first.seminar_email_sets.select{|v| v.field_name == 'submission'} %> -<% if email_set.length != 0 %> - <% if !(email_set[0].content.nil?) %> - <%= email_set[0].content[@data['locale']].html_safe %> - <% end %> -<% else %> - <%= t('seminar.email_submission_content') %> -<% end %> \ No newline at end of file diff --git a/app/views/seminars/add_file.html.erb b/app/views/seminars/add_file.html.erb deleted file mode 100644 index 7b7146d..0000000 --- a/app/views/seminars/add_file.html.erb +++ /dev/null @@ -1,110 +0,0 @@ -<% # encoding: utf-8 %> -<%= stylesheet_link_tag "lib/jquery-ui-1.12.1/jquery-ui.min.css" %> -<%= stylesheet_link_tag "seminar" %> -<%= javascript_include_tag 'basic.js' %> -<% @@session = session %> -<%= yield %> -<% - data = action_data - @con = data["con"] - @seminar = data["seminar"] - @seminar_signup = data["seminar_signup"] - @form_index = 0 -%> -<% if !session[:seminar_signup_id].blank? %> - - <% if ( @seminar.contribute_file_count.blank? or @seminar_signup.seminar_signup_contributes.count < @seminar.contribute_file_count.to_i ) %> - -<%= form_for @con, url: add_file_proc_seminars_path, html: {class: "content form-horizontal" , :id=>"new-seminar-signup-contribute"} do |f| %> -
    - <% if @seminar.seminar_submission_field_sets.count != 0 - data1 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='title'}[0] - data2 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='description'}[0] - data3 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='file'}[0] - show1 = !(data1.disabled) - show2 = !(data2.disabled) - show3 = !(data3.disabled) - name1 = data1['name'][I18n.locale] - name2 = data2['name'][I18n.locale] - name3 = data3['name'][I18n.locale] - plc1 = data1['placeholder'][I18n.locale] - plc2 = data2['placeholder'][I18n.locale]==t('seminar_signup.description') ? '' : data2['placeholder'][I18n.locale] - plc3 = data3['placeholder'][I18n.locale]==t('seminar_signup.file') ? '' : data3['placeholder'][I18n.locale] - else - show1 = true - show2 = true - show3 = true - name1 = t('seminar_signup.title') - name2 = t('seminar_signup.description') - name3 = t('seminar_signup.file') - plc1 = t('seminar_signup.title') - plc2 = '' - plc3 = '' - end - %> - <% if show1 %> -
    - -
    - <%= f.text_field :title, :class=>"input-medium form-control", :id=>'name', :placeholder=> plc1, :required => true %> -
    -
    - <% end %> - <% if show2 %> -
    - - -
    - <%= "(#{plc2})" if !(plc2.to_s.blank?) %> -
    -
    - <%= f.text_area :description, rows: 5, :class=>"ckeditor input-medium form-control", :placeholder=> plc2 %> -
    -
    - <% end %> - <% if show3 %> -
    - - -
    - <%= "(#{plc3})" if !(plc3.to_s.blank?) %> -
    -
    - <%= f.file_field :file, :required => true %> -
    -
    - <% end %> - <% @seminar.seminar_submission_fields.asc(:_id).each do |rf| %> -
    - <%= rf.block_helper(@seminar,@form_index,false,"seminar_signup_contribute",@con, rf.to_require,rf) %> -
    - <% @form_index = @form_index +1 %> - <% end %> -
    -
    - "> - - <%= f.submit t('submit'), class: 'btn btn-primary', :id => 'button-mail' %> - <%= f.button t('cancel'), type: 'reset', class: 'btn' %> -
    -
    -
    -<% end %> - -<% else %> - -上傳檔案數已滿 - -<% end %> - -<% else %> - -請先登入 -
    -回列表頁 - -<% end %> \ No newline at end of file diff --git a/app/views/seminars/check_availability.html.erb b/app/views/seminars/check_availability.html.erb deleted file mode 100644 index 80cbe51..0000000 --- a/app/views/seminars/check_availability.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<% # encoding: utf-8 %> -<% - data = action_data -%> \ No newline at end of file diff --git a/app/views/seminars/check_email.html.erb b/app/views/seminars/check_email.html.erb deleted file mode 100644 index 382cbd4..0000000 --- a/app/views/seminars/check_email.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<% # encoding: utf-8 %> -<% - data = action_data - result = data["result"] -%> - -
    -

    <%= result %>

    -<%= t('seminar.close_window') %> -
    \ No newline at end of file diff --git a/app/views/seminars/con_login.html.erb b/app/views/seminars/con_login.html.erb deleted file mode 100644 index 32f245c..0000000 --- a/app/views/seminars/con_login.html.erb +++ /dev/null @@ -1,53 +0,0 @@ -<% # encoding: utf-8 %> -<% - data = action_data - @seminar = data["seminar"] - @time_now = data["time_now"] -%> - -<% if @seminar.contribute_start_date <= @time_now and (@seminar.contribute_end_date.nil? or @seminar.contribute_end_date+1 >= @time_now ) %> - -
    - -
    - -<% else %> - -已截止 - -<% end %> \ No newline at end of file diff --git a/app/views/seminars/con_logout.html.erb b/app/views/seminars/con_logout.html.erb deleted file mode 100644 index 0e2913a..0000000 --- a/app/views/seminars/con_logout.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<% # encoding: utf-8 %> -<% - # data = action_data - - session[:seminar_signup_id] = nil - session[:seminar_main_id] = nil - - -%> - -<%= t('seminar_signup.logouting') %> - - \ No newline at end of file diff --git a/app/views/seminars/con_upload.html.erb b/app/views/seminars/con_upload.html.erb deleted file mode 100644 index 1abe351..0000000 --- a/app/views/seminars/con_upload.html.erb +++ /dev/null @@ -1,72 +0,0 @@ -<% # encoding: utf-8 %> -<% @@session = session %> -<%= yield %> -<% - data = action_data - @seminar = data["seminar"] - @seminar_signup = data["seminar_signup"] - @time_now = data["time_now"] -%> -<% if @seminar.contribute_start_date <= @time_now and ( @seminar.contribute_end_date.nil? or @seminar.contribute_end_date+1 >= @time_now ) %> - - <% if !session[:seminar_signup_id].blank? %> - - <%= t('seminar_signup.logout') %> - - - - - - - - - - - - - <% - @seminar_signup.seminar_signup_contributes.each do |seminar_signup_contribute| - %> - - - - - - - <% end %> - -
    -

    <%= @seminar.title %>

    -
    <%= t('seminar_signup.file_name') %><%= t('seminar_signup.file_note') %><%= t('seminar_signup.files') %><%= t(:action) %>
    <%= seminar_signup_contribute.title %><%= seminar_signup_contribute.description.to_s.html_safe %><%= link_to File.basename(seminar_signup_contribute.file.path), seminar_signup_contribute.file.url, {:target => '_blank', :title => Nokogiri::HTML(seminar_signup_contribute.description).text} if seminar_signup_contribute.file.file %> - <%= link_to t(:edit), OrbitHelper.url_to_show(@seminar.to_param) + '?method=edit_file&con_no=' + seminar_signup_contribute.id, :class => 'btn btn-primary' %> -
    - <%= submit_tag t(:delete_), class: "btn btn-primary" %> - "> - -
    - -
    - - <% if ( @seminar.contribute_file_count.blank? or @seminar_signup.seminar_signup_contributes.count < @seminar.contribute_file_count.to_i ) %> - - <%= link_to content_tag(:i, nil, :class => 'icon-plus') +' '+ t('new_'), OrbitHelper.url_to_show(@seminar.to_param) + '?method=add_file', :class => 'btn btn-primary' %> - - <% end %> -
    -
    - - - <% else %> - - 請先登入 -
    - 回列表頁 - - <% end %> - -<% else %> - -已截止 - -<% end %> - diff --git a/app/views/seminars/edit_file.html.erb b/app/views/seminars/edit_file.html.erb deleted file mode 100644 index 7a1bdbf..0000000 --- a/app/views/seminars/edit_file.html.erb +++ /dev/null @@ -1,99 +0,0 @@ -<% # encoding: utf-8 %> -<%= stylesheet_link_tag "lib/jquery-ui-1.12.1/jquery-ui.min.css" %> -<%= stylesheet_link_tag "seminar" %> -<%= javascript_include_tag 'basic.js' %> -<% @@session = session %> -<%= yield %> -<% - data = action_data - @con = data["con"] - @seminar = data["seminar"] - @seminar_signup = data["seminar_signup"] - @form_index = 0 -%> -<% if !session[:seminar_signup_id].blank? %> - -<%= form_for @con, url: edit_file_proc_seminars_path, html: {class: "content form-horizontal" , :id=>"new-seminar-signup-contribute"} do |f| %> -
    - <% if @seminar.seminar_submission_field_sets.count != 0 - data1 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='title'}[0] - data2 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='description'}[0] - data3 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='file'}[0] - show1 = !(data1.disabled) - show2 = !(data2.disabled) - show3 = !(data3.disabled) - name1 = data1['name'][I18n.locale] - name2 = data2['name'][I18n.locale] - name3 = data3['name'][I18n.locale] - plc1 = data1['placeholder'][I18n.locale] - plc2 = data2['placeholder'][I18n.locale]==t('seminar_signup.description') ? '' : data2['placeholder'][I18n.locale] - plc3 = data3['placeholder'][I18n.locale]==t('seminar_signup.file') ? '' : data3['placeholder'][I18n.locale] - else - show1 = true - show2 = true - show3 = true - name1 = t('seminar_signup.title') - name2 = t('seminar_signup.description') - name3 = t('seminar_signup.file') - plc1 = t('seminar_signup.title') - plc2 = '' - plc3 = '' - end - %> - <% if show1 %> -
    - -
    - <%= f.text_field :title, :class=>"input-medium form-control", :id=>'name', :placeholder=> plc1, :required => true %> -
    -
    - <% end %> - <% if show2 %> -
    - - -
    - <%= "(#{plc2})" if !(plc2.to_s.blank?) %> -
    -
    - <%= f.text_area :description, rows: 5, :class=>"ckeditor input-medium form-control", :placeholder=> plc2 %> -
    -
    - <% end %> - <% if show3 %> -
    - - -
    - <%= "(#{plc3})" if !(plc3.to_s.blank?) %> -
    -
    - <%= f.file_field :file %> -
    -
    - <% end %> - <% @seminar.seminar_submission_fields.asc(:_id).each do |rf| %> -
    - <%= rf.block_helper(@seminar,@form_index,false,"seminar_signup_contribute",@con, rf.to_require,rf) %> -
    - <% @form_index = @form_index +1 %> - <% end %> -
    -
    - "> - - - <%= f.submit t('submit'), class: 'btn btn-primary', :id => 'button-mail' %> - <%= f.button t('cancel'), type: 'reset', class: 'btn' %> -
    -
    -
    -<% end %> - -<% else %> -請登入 -<% end %> \ No newline at end of file diff --git a/app/views/seminars/index.html.erb b/app/views/seminars/index.html.erb deleted file mode 100644 index eba6e34..0000000 --- a/app/views/seminars/index.html.erb +++ /dev/null @@ -1,63 +0,0 @@ -<% # encoding: utf-8 %> -<% - data = action_data - @seminars = data["seminars"] - @total_pages = data["total_pages"] - @time_now = data["time_now"] -%> - - - - - - - - - - - - - - <% - @seminars.each do |seminar| - - if !seminar.registration_status.blank? and seminar.signup_start_date <= @time_now and ( seminar.signup_end_date.nil? or seminar.signup_end_date+1 >= @time_now ) - sign_up = ('' + t('seminar.signup') + '').html_safe - elsif seminar.registration_status.blank? - sign_up = t('seminar.sign_up_not_open') - elsif seminar.signup_start_date > @time_now - sign_up = t('seminar.sign_up_not_yet') - else - sign_up = t('seminar.sign_up_overdue') - end - %> - - - - - - - - <% end %> - -
    -

    <%= t('seminar.seminar') %>

    -
    <%= t(:category) %><%= t('seminar.title') %><%= t('seminar_signup.time') %><%= t('seminar_signup.place') %><%= t('seminar.signup') %>
    <%= seminar.category.title %><%= ('' + seminar.title + '').html_safe %><%= SeminarMain.time_range(seminar.seminar_start_date, seminar.seminar_end_date) %><%= seminar.act_place %> - <%= sign_up %>
    - - <%= - if !seminar.registration_status.blank? and seminar.registration_status.include?('C') and seminar.contribute_start_date <= @time_now and ( seminar.contribute_end_date.nil? or seminar.contribute_end_date+1 >= @time_now ) - if !session[:seminar_signup_id].blank? - if session[:seminar_main_id] == seminar.id - ('' + t('seminar_signup.uploads') + '').html_safe - else - ('' + t('seminar_signup.con_login') + '').html_safe - end - else - ('' + t('seminar_signup.con_login') + '').html_safe - end - end - %> -
    - -<%= create_pagination(@total_pages).html_safe if @total_pages > 1 %> \ No newline at end of file diff --git a/app/views/seminars/show.html.erb b/app/views/seminars/show.html.erb deleted file mode 100644 index 93009b1..0000000 --- a/app/views/seminars/show.html.erb +++ /dev/null @@ -1,332 +0,0 @@ -<% - data = action_data - @seminar = data["seminar"] - @seminar_signup = data["seminar_signup"] - @time_now = data["time_now"] - @form_index = 0 -%> -<% if !@seminar.registration_status.blank? and @seminar.signup_start_date < @time_now and ( @seminar.signup_end_date.nil? or @seminar.signup_end_date+1 > @time_now ) %> - - <%#= stylesheet_link_tag "lib/main-forms" %> - <%= stylesheet_link_tag "basic/bootstrap-datetimepicker" %> - <%= javascript_include_tag "lib/bootstrap-datetimepicker" %> - <%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %> - <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> - - -<% flash.each do |key, msg| %> - <%= content_tag :p, msg, :class => [key, "alert alert-error in fade"] %> -<% end %> - -<%= form_for @seminar_signup, url: seminars_path, html: {class: "content form-horizontal" , :id=>"new-seminar-signup"} do |f| %> -
    - - -
    - -
    - <%= @seminar.title %> -
    -
    - <% if @seminar.seminar_signup_field_sets.count != 0 %> - <% @seminar.seminar_signup_field_sets.each do |signup_field| %> - <% if signup_field.field_name == 'name' %> -
    -
    *(<%= t('seminar.required') %>)
    -
    - <% end %> - <% if !(signup_field.disabled) && signup_field.field_name != 'recaptcha' %> - - <% end %> - <% end %> - <% else %> -
    - -
    - <% if @seminar.registration_status.include?('G') %> - - <% end %> - <% if @seminar.registration_status.include?('C') %> - - <% end %> -
    -
    - -
    -
    *(<%= t('seminar.required') %>)
    -
    - - -
    - -
    - <%= f.text_field :name, :class=>"input-medium form-control", :id=>'name', :placeholder=> t('seminar_signup.name'), :required => true %> -
    -
    - - -
    - -
    - <%= f.text_field :tel, :class=>"input-medium form-control", :placeholder=> t('seminar_signup.tel'), :required => true %> -
    -
    - - -
    - -
    - <%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> t(:email), :required => true %> check mail -
    -
    - -
    - -
    - <%= f.text_field :password, :class=>"input-medium form-control", :placeholder=> t('seminar_signup.password') %> - <%= t('seminar_signup.password_message') %> -
    -
    - - <% end %> - <% @seminar.seminar_signup_fields.asc(:_id).each do |rf| %> - -
    - - <%= rf.block_helper(@seminar,@form_index,false,"seminar_signup",@seminar_signup, rf.to_require) %> - -
    - - <% @form_index = @form_index +1 %> - - <% end %> - - - - <% if @seminar.seminar_signup_field_sets.count != 0 %> - <% if !(@seminar.seminar_signup_field_sets.select{|v| v.field_name=='recaptcha'}[0].disabled) %> -
    - -
    - <%= gotcha_error %> - <%= gotcha %> -
    -
    - <% end %> - <% end %> - - - - - -
    -
    - "> - - <%= f.submit t('submit'), class: 'btn btn-primary', :id => 'button-mail' %> - <%= f.button t('cancel'), type: 'reset', class: 'btn' %> -
    -
    - -
    -<% end %> - - - - -<% elsif @seminar.registration_status.blank? %> - -<%= t('seminar.sign_up_not_open') %> - -<% elsif @seminar.signup_start_date > @time_now %> - -<%= t('seminar.sign_up_not_yet') %> - -<% else %> - -<%= t('seminar.sign_up_overdue') %> - -<% end %> diff --git a/app/views/seminars/show_data.html.erb b/app/views/seminars/show_data.html.erb deleted file mode 100644 index 182799a..0000000 --- a/app/views/seminars/show_data.html.erb +++ /dev/null @@ -1,92 +0,0 @@ -<% # encoding: utf-8 %> -<% @@session = session %> -<%= yield %> -<% - data = action_data - @seminar = data["seminar"] - @sign_up = data["sign_up"] - @sign_up_time_range = data["sign_up_time_range"] - @seminar_time_range = data["seminar_time_range"] - @contribute_time_range = data["contribute_time_range"] - @contribute_action = data["contribute_action"] -%> - - - - - - - - - - - - - - - - - <% if !@seminar.speaker.blank? %> - - - - - <% end %> - <% if !@seminar.content.blank? %> - - - - - <% end %> - - - - - <% if !@contribute_time_range.blank? %> - - - - - <% end %> - - - - - <% if !@seminar.act_place.blank? %> - - - - - <% end %> - <% if !@seminar.seminar_files.blank? %> - - - - - <% end %> - <% if !@seminar.seminar_links.blank? %> - - - - - <% end %> - <% @seminar.seminar_item_contents.asc(:_id).each do |item_content| %> - - - - - <% end %> - -
    <%= t(:category) %><%= @seminar.category.title %>
    <%= t('seminar.event_during') %><%= @seminar_time_range %>
    <%= t('seminar.title') %><%= @seminar.title %>
    <%= t('seminar.speaker') %><%= @seminar.speaker %>
    <%= t('seminar.content') %><%= nl2br(@seminar.content) %>
    <%= t('seminar.signup_during') %><%= @sign_up_time_range %>
    <%= t('seminar.contribute_during') %><%= @contribute_time_range %>
    <%= t('seminar.signup') %><%= @sign_up %>
    <%= @contribute_action %>
    <%= t('seminar.act_place') %><%= @seminar.act_place %>
    <%= t(:file_) %> - <% @seminar.seminar_files.map do |file| %> - <%= link_to (file.title.blank? ? File.basename(file.file.path) : file.title) , file.file.url, {:target => '_blank', :title => file.description} if file.file.file %> - <% end %> -
    <%= t(:link) %> - <% @seminar.seminar_links.map do |link| %> - <%= link_to (link.title.blank? ? link.url : link.title), link.url, :target => '_blank' %> - <% end %> -
    <%= item_content.seminar_item.title %><%= item_content.content.html_safe %>
    - -
    - -<%= link_to t(:close), 'javascript:window.close();', :class => 'btn btn-primary' %> diff --git a/app/views/seminars/show_privacy.html.erb b/app/views/seminars/show_privacy.html.erb deleted file mode 100644 index e41ef30..0000000 --- a/app/views/seminars/show_privacy.html.erb +++ /dev/null @@ -1,28 +0,0 @@ -<% # encoding: utf-8 %> - -<% - data = action_data - @seminar_agreement = data["seminar_agreement"] -%> - - - -

    <%= t('seminar_signup.privacy_statement') %>

    - -
    - -<%= @seminar_agreement.content.html_safe %> - -
    - -
    - -<%= link_to t(:close), 'javascript:window.close();', :class => 'btn btn-primary' %> diff --git a/app/views/seminars/signup_ok.html.erb b/app/views/seminars/signup_ok.html.erb deleted file mode 100644 index 0dcc17a..0000000 --- a/app/views/seminars/signup_ok.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<% # encoding: utf-8 %> -<% - data = action_data -%> - -<%= t('seminar_signup.success_message') %> -<% if !params['status'].nil? %> -
    - - <%= t('seminar.click_to_contribute') %> - -<% end %> diff --git a/app/views/simple_captcha/_simple_captcha.erb b/app/views/simple_captcha/_simple_captcha.erb deleted file mode 100644 index 748746f..0000000 --- a/app/views/simple_captcha/_simple_captcha.erb +++ /dev/null @@ -1,33 +0,0 @@ - - -
    -
    - <%= simple_captcha_options[:image] %> -
    - -
    - <%= simple_captcha_options[:field] %> -
    -
    diff --git a/bin/rails b/bin/rails deleted file mode 100755 index 426790e..0000000 --- a/bin/rails +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env ruby -# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. - -ENGINE_ROOT = File.expand_path('../..', __FILE__) -ENGINE_PATH = File.expand_path('../../lib/nkuht_donate/engine', __FILE__) - -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) - -# require 'rails/all' -# require 'rails/engine/commands' -require "action_controller/railtie" -require "action_mailer/railtie" -require "sprockets/railtie" -require "rails/test_unit/railtie" -require 'rails/engine/commands' -require "mongoid/railtie" diff --git a/config/locales/en.yml b/config/locales/en.yml deleted file mode 100644 index d5eb7c9..0000000 --- a/config/locales/en.yml +++ /dev/null @@ -1,131 +0,0 @@ -en: - - simple_captcha: - placeholder: "" - label: "" - - restful_actions: - act_signup: Sign Up Info #報名資料 - seminar_submission_field: Seminar Submission Field - seminar_signup_field: Seminar Signup Field - seminar_signup: Signup Analyze - module_name: - seminar: Seminar #研討會 - - recaptcha: - errors: - verification_failed: Verification Failed #驗證碼錯誤 - - seminar: - email_signup_success: Signup success - email_submission_success: Submission registration success - email_add_file_success: Add file success - email_edit_file_success: Edit file success - email_signup_content: Signup success - email_submission_content: Submission registration success - email_add_file_content: Add file success - email_edit_file_content: Edit file success - email_title: Title - email_content: Content - email_signup: Signup - email_submission: Submission - email_edit_file: Edit file - email_add_file: Add file - auto_send_email_set: Auto send email setting - click_to_contribute: Click here to contribute - required: Required - already_used: Already Used - please_enter_email: Please enter email - available: Available - close_window: Close window - custom_set: Custom Set - field_name: Field Name - placeholder: Placeholder - name: Show Name - disable: Disable - hidden: Hidden(admin) - submission_set: Submission Set - signup_set: Signup Set - reviewer: Reviewer #審查委員 - review_end_date: Review End Date #審查結束日期 - review_start_date: Review Start Date #審查開始日期 - review: Reveiw #審稿 - blank_no_limit: Allow Blank Value #空白無限制 - export_csv: Export CSV #匯出CSV - recaptcha: Recaptcha #驗證碼 - yes_: Yes #是 - no_: No #否 - seminar: Seminar #研討會 - title: Conference Name #研討會名稱 - speaker: Speaker #主講者 - content: Content #內容說明 - act_place: Seminar Location #活動地點 - registration_status: Attendee Role #報名身分 - registration_status_C: Contributor #投稿者 - registration_status_G: Attendee #Normal sign up #一般報名 - seminar_start_date: Seminar Start Date #活動開始時間 - seminar_end_date: Seminar End Date #活動結束時間 - signup_start_date: Sign Up Start Date #報名開始時間 - signup_end_date: Sign Up End Date #報名結束時間 - contribute_start_date: Contribute Start Date #投稿開始時間 - contribute_end_date: Contirbute End Date #投稿結束時間 - event_during: Event During #活動期間 - contribute_during: Contribute During #投稿期間 - signup_during: Sign Up During #報名期間 - signup_count: Sign Up Count #報名人數 - signup: Sign Up #報名 - export: Export #匯出 - set_seminar_items: Items #項目 - set_seminar_submission_field: Set Submission Field - set_seminar_signup_field: Set Sign Up Field #圈選設定 - set_seminar_item_content: Set Item Content #項目設定 - set_seminar_agreements: Personal Data Usage Agreements #個資宣告設定 - seminar_agreements_content: Content of Personal Data Usage Agreements #個資宣告內容 - to_require: Should Be Filled? #是否必填 - sign_up_not_yet: Does Not Yet Allow Sign Up #報名時間未開始 - sign_up_not_open: Does Not Open Sign Up #未開放報名 - sign_up_overdue: Sign Up Overdue #報名時間已過 - contribute_file_count: Count of Contribute Files #投稿檔案數 - - frontend: - seminar: Semianr #研討會前台 - - seminar_item: - new_item: New Item #新增項目 - edit_item: Edit Item #編輯項目 - set_item: Set Item #設定項目 - del_item: Delete Item #刪除項目 - - seminar_item_content: - content: Content #內容 - - seminar_signup: - status: Attendee Role - title: File Name - description: Summary - file: Files - signup_time: Sign Up Time #報名時間 - name: Name - unit: Unit #單位 - tel: Tel - phone: Mobile telephone - fax: Fax - address: Address #地址 - email: Email #e-mail信箱 - password: Password #密碼 - password_message: '( This password is for uploading file when contributing. )' - note: Note #註解 - time: 'Start / End Time' #(開始/結束)時間 - place: Place #地點 - agree: "Accept Privacy and Personal Information Protection Policy of the Site" - privacy_statement: 'Privacy and Personal Information Protection Policy of the Site' - recaptcha: Verification code - signup_field: Sign Up Field #圈選項目 - uploads: Uploads #上傳檔案 - con_login: Contributor Login #投稿者登入 - file_name: File Name #稿件名稱 - file_note: Summary #摘要 - files: Files #檔案 - logout: Log Out #登出 - logouting: Logging Out #登出中 - success_message: 'Registration successful, thank you.' diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml deleted file mode 100644 index 9cccecd..0000000 --- a/config/locales/zh_tw.yml +++ /dev/null @@ -1,131 +0,0 @@ -zh_tw: - - simple_captcha: - placeholder: "" - label: "" - - restful_actions: - act_signup: 報名資料 - seminar_submission_field: 上傳介面欄位 - seminar_signup_field: 報名欄位 - seminar_signup: 報名統計 - module_name: - seminar: 研討會 - - recaptcha: - errors: - verification_failed: 驗證碼錯誤 - - seminar: - email_signup_success: 報名成功 - email_submission_success: 投稿註冊成功 - email_add_file_success: 新增上傳成功 - email_edit_file_success: 編輯上傳成功 - email_signup_content: 報名成功 - email_submission_content: 投稿註冊成功 - email_add_file_content: 新增上傳成功 - email_edit_file_content: 編輯上傳成功 - email_title: 主旨 - email_content: 內文 - email_signup: 報名 - email_submission: 投稿 - email_edit_file: 編輯上傳 - email_add_file: 新增上傳 - auto_send_email_set: 自動發信設定 - click_to_contribute: 按此登入投稿 - required: 必填 - already_used: 已存在 - please_enter_email: 請輸入Email - available: 可使用 - close_window: 關閉視窗 - custom_set: 客製化欄位設定 - field_name: 欄位名稱 - placeholder: 提示文字 - name: 顯示名稱 - disable: 關閉 - hidden: 隱藏(後台) - submission_set: 投稿欄位設定 - signup_set: 報名欄位設定 - reviewer: 審查委員 - review_end_date: 審查結束日期 - review_start_date: 審查開始日期 - review: 審稿 - blank_no_limit: 空白無限制 - export_csv: 匯出CSV - recaptcha: 驗證碼 - yes_: 是 - no_: 否 - seminar: 研討會 - title: 研討會名稱 - speaker: 主講者 - content: 內容說明 - act_place: 活動地點 - registration_status: 報名身分 - registration_status_C: 投稿者 - registration_status_G: 一般報名 - seminar_start_date: 活動開始時間 - seminar_end_date: 活動結束時間 - signup_start_date: 報名開始時間 - signup_end_date: 報名結束時間 - contribute_start_date: 投稿開始時間 - contribute_end_date: 投稿結束時間 - event_during: 活動期間 - contribute_during: 投稿期間 - signup_during: 報名期間 - signup_count: 報名人數 - signup: 報名 - export: 匯出 - set_seminar_items: 項目 - set_seminar_submission_field: 上傳介面欄位設定 - set_seminar_signup_field: 圈選設定 - set_seminar_item_content: 項目設定 - set_seminar_agreements: 個資宣告設定 - seminar_agreements_content: 個資宣告內容 - to_require: 是否必填 - sign_up_not_yet: 報名時間未開始 - sign_up_not_open: 未開放報名 - sign_up_overdue: 報名時間已過 - contribute_file_count: 投稿檔案數 - - frontend: - seminar: 研討會前台 - - seminar_item: - new_item: 新增項目 - edit_item: 編輯項目 - set_item: 設定項目 - del_item: 刪除項目 - - seminar_item_content: - content: 內容 - - seminar_signup: - status: 報名身分 - title: 稿件名稱 - description: 摘要 - file: 檔案 - signup_time: 報名時間 - name: 姓名 - unit: 單位 - tel: 聯絡電話 - phone: 行動電話 - fax: 傳真 - address: 地址 - email: e-mail信箱 - password: 密碼 - password_message: '( 此密碼為下次投稿上傳檔案時必須輸入的密碼。 )' - note: 註解 - time: (開始/結束)時間 - place: 地點 - agree: 同意接受本站個資及隱私權保護宣告 - privacy_statement: '個資及隱私權保護宣告' - recaptcha: 驗證碼 - signup_field: 圈選項目 - uploads: 上傳檔案 - con_login: 投稿者登入 - file_name: 稿件名稱 - file_note: 摘要 - files: 檔案 - logout: 登出 - logouting: 登出中 - success_message: '您的報名已成功,感謝您的參與。' diff --git a/config/routes.rb b/config/routes.rb deleted file mode 100644 index 2b5c292..0000000 --- a/config/routes.rb +++ /dev/null @@ -1,40 +0,0 @@ -Rails.application.routes.draw do - - locales = Site.first.in_use_locales rescue I18n.available_locales - - scope "(:locale)", locale: Regexp.new(locales.join("|")) do - namespace :admin do - resources :seminars do - member do - get 'export' - get 'set_write_off' - get 'seminar_signup' - get 'seminar_item_content' - get 'seminar_signup_field' - get 'seminar_submission_field' - end - end - resources :seminar_items do - collection do - post 'delete_items' - end - end - resources :seminar_agreements - resources :seminar_signups - resources :seminar_item_contents - end - - resources :seminars do - collection do - get ':slug_title-:uid', to: 'seminars#show' - post 'con_login_proc', to: 'seminars#con_login_proc' - post 'con_logout_proc', to: 'seminars#con_logout_proc' - post 'add_file_proc', to: 'seminars#add_file_proc' - post 'edit_file_proc', to: 'seminars#edit_file_proc' - post 'del_file', to: 'seminars#del_file' - end - end - - end - -end diff --git a/lib/seminar.rb b/lib/seminar.rb deleted file mode 100644 index 740f4f9..0000000 --- a/lib/seminar.rb +++ /dev/null @@ -1,4 +0,0 @@ -require "seminar/engine" - -module Seminar -end diff --git a/lib/seminar/engine.rb b/lib/seminar/engine.rb deleted file mode 100644 index 6e026e0..0000000 --- a/lib/seminar/engine.rb +++ /dev/null @@ -1,50 +0,0 @@ -module Seminar - class Engine < ::Rails::Engine - initializer "seminar" do - OrbitApp.registration "Seminar", :type => "ModuleApp" do - module_label "seminar.seminar" - base_url File.expand_path File.dirname(__FILE__) - authorizable - categorizable - frontend_enabled - data_count 1..20 - - side_bar do - head_label_i18n 'seminar.seminar', icon_class: "icon-globe" - available_for "managers" - active_for_controllers (['admin/seminars']) - head_link_path "admin_seminars_path" - - context_link 'list_', - :link_path=>"admin_seminars_path" , - :priority=>1, - :active_for_action=>{'admin/seminars'=>'index'}, - :available_for => 'managers' - context_link 'new_', - :link_path=>"new_admin_seminar_path" , - :priority=>2, - :active_for_action=>{'admin/seminars'=>'new'}, - :available_for => 'managers' - context_link 'categories', - :link_path=>"admin_module_app_categories_path" , - :link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'seminar').id}", - :priority=>3, - :active_for_action=>{'admin/seminars'=>'categories'}, - :active_for_category => 'Seminar', - :available_for => 'managers' - context_link 'seminar.set_seminar_items', - :link_path=>"admin_seminar_items_path" , - :priority=>3, - :active_for_action=>{'admin/seminars'=>'seminar_items'}, - :available_for => 'managers' - context_link 'seminar.set_seminar_agreements', - :link_path=>"admin_seminar_agreements_path" , - :priority=>3, - :active_for_action=>{'admin/seminars'=>'seminar_agreements'}, - :available_for => 'managers' - end - - end - end - end -end \ No newline at end of file diff --git a/lib/seminar/version.rb b/lib/seminar/version.rb deleted file mode 100644 index 7e91fe9..0000000 --- a/lib/seminar/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -module Seminar - VERSION = "0.0.1" -end diff --git a/lib/tasks/seminar_tasks.rake b/lib/tasks/seminar_tasks.rake deleted file mode 100644 index ad9c435..0000000 --- a/lib/tasks/seminar_tasks.rake +++ /dev/null @@ -1,4 +0,0 @@ -# desc "Explaining what the task does" -# task :seminar do -# # Task goes here -# end diff --git a/seminar.gemspec b/seminar.gemspec deleted file mode 100644 index ce414e5..0000000 --- a/seminar.gemspec +++ /dev/null @@ -1,22 +0,0 @@ -# -*- encoding: utf-8 -*- -# stub: seminar 0.0.1 ruby lib - -Gem::Specification.new do |s| - s.name = "seminar" - s.version = "0.0.1" - - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.require_paths = ["lib"] - s.authors = ["Rulingcom"] - s.date = "2019-11-19" - s.description = "Seminar plugin." - s.email = ["orbit@rulingcom.com"] - s.files = ["MIT-LICENSE", "README.rdoc", "Rakefile", "app/assets/javascripts/check_seminar_set_items.js.erb", "app/assets/javascripts/field-forms.js", "app/assets/javascripts/seminar.js.coffee", "app/assets/javascripts/seminar_sets.js", "app/assets/stylesheets/seminar.css.scss", "app/assets/stylesheets/seminar_sets.css", "app/controllers/admin/seminar_agreements_controller.rb", "app/controllers/admin/seminar_item_contents_controller.rb", "app/controllers/admin/seminar_items_controller.rb", "app/controllers/admin/seminar_signups_controller.rb", "app/controllers/admin/seminars_controller.rb", "app/controllers/seminars_controller.rb", "app/helpers/admin/seminars_field_helper.rb", "app/helpers/admin/seminars_helper.rb", "app/helpers/admin/seminars_values_helper.rb", "app/models/seminar_agreement.rb", "app/models/seminar_file.rb", "app/models/seminar_item.rb", "app/models/seminar_item_content.rb", "app/models/seminar_link.rb", "app/models/seminar_main.rb", "app/models/seminar_review.rb", "app/models/seminar_signup.rb", "app/models/seminar_signup_contribute.rb", "app/models/seminar_signup_field.rb", "app/models/seminar_signup_value.rb", "app/views/admin/seminar_agreements", "app/views/admin/seminar_agreements/index.html.erb", "app/views/admin/seminar_item_contents", "app/views/admin/seminar_item_contents/_form.html.erb", "app/views/admin/seminar_item_contents/edit.html.erb", "app/views/admin/seminar_item_contents/index.html.erb", "app/views/admin/seminar_item_contents/new.html.erb", "app/views/admin/seminar_items", "app/views/admin/seminar_items/_delete_modal.html.erb", "app/views/admin/seminar_items/_form.html.erb", "app/views/admin/seminar_items/_index.html.erb", "app/views/admin/seminar_items/_item.html.erb", "app/views/admin/seminar_items/index.html.erb", "app/views/admin/seminar_items/index.js.erb", "app/views/admin/seminar_signups", "app/views/admin/seminar_signups/edit.html.erb", "app/views/admin/seminars", "app/views/admin/seminars/_attribute_field.html.erb", "app/views/admin/seminars/_form.html.erb", "app/views/admin/seminars/_form_file.html.erb", "app/views/admin/seminars/_form_link.html.erb", "app/views/admin/seminars/_index.html.erb", "app/views/admin/seminars/_support_member_form_js.erb", "app/views/admin/seminars/edit.html.erb", "app/views/admin/seminars/export.xlsx.axlsx", "app/views/admin/seminars/index.html.erb", "app/views/admin/seminars/new.html.erb", "app/views/admin/seminars/seminar_item_content.html.erb", "app/views/admin/seminars/seminar_signup.html.erb", "app/views/admin/seminars/seminar_signup_field.html.erb", "app/views/seminars", "app/views/seminars/add_file.html.erb", "app/views/seminars/check_availability.html.erb", "app/views/seminars/check_email.html.erb", "app/views/seminars/con_login.html.erb", "app/views/seminars/con_logout.html.erb", "app/views/seminars/con_upload.html.erb", "app/views/seminars/edit_file.html.erb", "app/views/seminars/index.html.erb", "app/views/seminars/show.html.erb", "app/views/seminars/show_data.html.erb", "app/views/seminars/show_privacy.html.erb", "app/views/seminars/signup_ok.html.erb", "app/views/simple_captcha", "app/views/simple_captcha/_simple_captcha.erb", "config/locales/en.yml", "config/locales/zh_tw.yml", "config/routes.rb", "lib/seminar", "lib/seminar.rb", "lib/seminar/engine.rb", "lib/seminar/version.rb", "lib/tasks/seminar_tasks.rake", "test/controllers/seminar_controller_test.rb", "test/dummy", "test/dummy/README.rdoc", "test/dummy/Rakefile", "test/dummy/app", "test/dummy/app/assets", "test/dummy/app/assets/images", "test/dummy/app/assets/javascripts", "test/dummy/app/assets/javascripts/application.js", "test/dummy/app/assets/stylesheets", "test/dummy/app/assets/stylesheets/application.css", "test/dummy/app/controllers", "test/dummy/app/controllers/application_controller.rb", "test/dummy/app/controllers/concerns", "test/dummy/app/helpers", "test/dummy/app/helpers/application_helper.rb", "test/dummy/app/mailers", "test/dummy/app/models", "test/dummy/app/models/concerns", "test/dummy/app/views", "test/dummy/app/views/layouts", "test/dummy/app/views/layouts/application.html.erb", "test/dummy/bin", "test/dummy/bin/bundle", "test/dummy/bin/rails", "test/dummy/bin/rake", "test/dummy/config", "test/dummy/config.ru", "test/dummy/config/application.rb", "test/dummy/config/boot.rb", "test/dummy/config/database.yml", "test/dummy/config/environment.rb", "test/dummy/config/environments", "test/dummy/config/environments/development.rb", "test/dummy/config/environments/production.rb", "test/dummy/config/environments/test.rb", "test/dummy/config/initializers", "test/dummy/config/initializers/assets.rb", "test/dummy/config/initializers/backtrace_silencers.rb", "test/dummy/config/initializers/cookies_serializer.rb", "test/dummy/config/initializers/filter_parameter_logging.rb", "test/dummy/config/initializers/inflections.rb", "test/dummy/config/initializers/mime_types.rb", "test/dummy/config/initializers/session_store.rb", "test/dummy/config/initializers/wrap_parameters.rb", "test/dummy/config/locales", "test/dummy/config/locales/en.yml", "test/dummy/config/routes.rb", "test/dummy/config/secrets.yml", "test/dummy/lib", "test/dummy/lib/assets", "test/dummy/log", "test/dummy/public", "test/dummy/public/404.html", "test/dummy/public/422.html", "test/dummy/public/500.html", "test/dummy/public/favicon.ico", "test/helpers/seminar_helper_test.rb", "test/seminar_test.rb", "test/test_helper.rb"] - s.homepage = "http://www.rulingcom.com" - s.licenses = ["MIT"] - s.rubygems_version = "2.2.2" - s.summary = "Seminar plugin." - s.test_files = ["test/dummy", "test/dummy/app", "test/dummy/app/assets", "test/dummy/app/assets/javascripts", "test/dummy/app/assets/javascripts/application.js", "test/dummy/app/assets/images", "test/dummy/app/assets/stylesheets", "test/dummy/app/assets/stylesheets/application.css", "test/dummy/app/models", "test/dummy/app/models/concerns", "test/dummy/app/helpers", "test/dummy/app/helpers/application_helper.rb", "test/dummy/app/mailers", "test/dummy/app/views", "test/dummy/app/views/layouts", "test/dummy/app/views/layouts/application.html.erb", "test/dummy/app/controllers", "test/dummy/app/controllers/concerns", "test/dummy/app/controllers/application_controller.rb", "test/dummy/config", "test/dummy/config/routes.rb", "test/dummy/config/environments", "test/dummy/config/environments/test.rb", "test/dummy/config/environments/development.rb", "test/dummy/config/environments/production.rb", "test/dummy/config/initializers", "test/dummy/config/initializers/assets.rb", "test/dummy/config/initializers/session_store.rb", "test/dummy/config/initializers/wrap_parameters.rb", "test/dummy/config/initializers/filter_parameter_logging.rb", "test/dummy/config/initializers/inflections.rb", "test/dummy/config/initializers/mime_types.rb", "test/dummy/config/initializers/backtrace_silencers.rb", "test/dummy/config/initializers/cookies_serializer.rb", "test/dummy/config/secrets.yml", "test/dummy/config/boot.rb", "test/dummy/config/environment.rb", "test/dummy/config/database.yml", "test/dummy/config/application.rb", "test/dummy/config/locales", "test/dummy/config/locales/en.yml", "test/dummy/public", "test/dummy/public/500.html", "test/dummy/public/422.html", "test/dummy/public/404.html", "test/dummy/public/favicon.ico", "test/dummy/bin", "test/dummy/bin/rake", "test/dummy/bin/rails", "test/dummy/bin/bundle", "test/dummy/lib", "test/dummy/lib/assets", "test/dummy/config.ru", "test/dummy/Rakefile", "test/dummy/README.rdoc", "test/dummy/log", "test/seminar_test.rb", "test/helpers/seminar_helper_test.rb", "test/test_helper.rb", "test/controllers/seminar_controller_test.rb"] - - s.installed_by_version = "2.2.2" if s.respond_to? :installed_by_version -end diff --git a/test/controllers/seminar_controller_test.rb b/test/controllers/seminar_controller_test.rb deleted file mode 100644 index 0308133..0000000 --- a/test/controllers/seminar_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class SeminarControllerTest < ActionController::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/dummy/README.rdoc b/test/dummy/README.rdoc deleted file mode 100644 index dd4e97e..0000000 --- a/test/dummy/README.rdoc +++ /dev/null @@ -1,28 +0,0 @@ -== README - -This README would normally document whatever steps are necessary to get the -application up and running. - -Things you may want to cover: - -* Ruby version - -* System dependencies - -* Configuration - -* Database creation - -* Database initialization - -* How to run the test suite - -* Services (job queues, cache servers, search engines, etc.) - -* Deployment instructions - -* ... - - -Please feel free to use a different markup language if you do not plan to run -rake doc:app. diff --git a/test/dummy/Rakefile b/test/dummy/Rakefile deleted file mode 100644 index ba6b733..0000000 --- a/test/dummy/Rakefile +++ /dev/null @@ -1,6 +0,0 @@ -# Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. - -require File.expand_path('../config/application', __FILE__) - -Rails.application.load_tasks diff --git a/test/dummy/app/assets/images/.keep b/test/dummy/app/assets/images/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/dummy/app/assets/javascripts/application.js b/test/dummy/app/assets/javascripts/application.js deleted file mode 100644 index 5bc2e1c..0000000 --- a/test/dummy/app/assets/javascripts/application.js +++ /dev/null @@ -1,13 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// compiled file. -// -// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details -// about supported directives. -// -//= require_tree . diff --git a/test/dummy/app/assets/stylesheets/application.css b/test/dummy/app/assets/stylesheets/application.css deleted file mode 100644 index a443db3..0000000 --- a/test/dummy/app/assets/stylesheets/application.css +++ /dev/null @@ -1,15 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the bottom of the - * compiled file so the styles you add here take precedence over styles defined in any styles - * defined in the other CSS/SCSS files in this directory. It is generally better to create a new - * file per style scope. - * - *= require_tree . - *= require_self - */ diff --git a/test/dummy/app/controllers/application_controller.rb b/test/dummy/app/controllers/application_controller.rb deleted file mode 100644 index d83690e..0000000 --- a/test/dummy/app/controllers/application_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -class ApplicationController < ActionController::Base - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception -end diff --git a/test/dummy/app/controllers/concerns/.keep b/test/dummy/app/controllers/concerns/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/dummy/app/helpers/application_helper.rb b/test/dummy/app/helpers/application_helper.rb deleted file mode 100644 index de6be79..0000000 --- a/test/dummy/app/helpers/application_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module ApplicationHelper -end diff --git a/test/dummy/app/mailers/.keep b/test/dummy/app/mailers/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/dummy/app/models/.keep b/test/dummy/app/models/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/dummy/app/models/concerns/.keep b/test/dummy/app/models/concerns/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/dummy/app/views/layouts/application.html.erb b/test/dummy/app/views/layouts/application.html.erb deleted file mode 100644 index 593a778..0000000 --- a/test/dummy/app/views/layouts/application.html.erb +++ /dev/null @@ -1,14 +0,0 @@ - - - - Dummy - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> - <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> - <%= csrf_meta_tags %> - - - -<%= yield %> - - - diff --git a/test/dummy/bin/bundle b/test/dummy/bin/bundle deleted file mode 100755 index 66e9889..0000000 --- a/test/dummy/bin/bundle +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -load Gem.bin_path('bundler', 'bundle') diff --git a/test/dummy/bin/rails b/test/dummy/bin/rails deleted file mode 100755 index 728cd85..0000000 --- a/test/dummy/bin/rails +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -APP_PATH = File.expand_path('../../config/application', __FILE__) -require_relative '../config/boot' -require 'rails/commands' diff --git a/test/dummy/bin/rake b/test/dummy/bin/rake deleted file mode 100755 index 1724048..0000000 --- a/test/dummy/bin/rake +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -require_relative '../config/boot' -require 'rake' -Rake.application.run diff --git a/test/dummy/config.ru b/test/dummy/config.ru deleted file mode 100644 index 5bc2a61..0000000 --- a/test/dummy/config.ru +++ /dev/null @@ -1,4 +0,0 @@ -# This file is used by Rack-based servers to start the application. - -require ::File.expand_path('../config/environment', __FILE__) -run Rails.application diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb deleted file mode 100644 index ad1e5de..0000000 --- a/test/dummy/config/application.rb +++ /dev/null @@ -1,23 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'rails/all' - -Bundler.require(*Rails.groups) -require "seminar" - -module Dummy - class Application < Rails::Application - # Settings in config/environments/* take precedence over those specified here. - # Application configuration should go into files in config/initializers - # -- all .rb files in that directory are automatically loaded. - - # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. - # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - # config.time_zone = 'Central Time (US & Canada)' - - # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] - # config.i18n.default_locale = :de - end -end - diff --git a/test/dummy/config/boot.rb b/test/dummy/config/boot.rb deleted file mode 100644 index 6266cfc..0000000 --- a/test/dummy/config/boot.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) - -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) -$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) diff --git a/test/dummy/config/database.yml b/test/dummy/config/database.yml deleted file mode 100644 index 1c1a37c..0000000 --- a/test/dummy/config/database.yml +++ /dev/null @@ -1,25 +0,0 @@ -# SQLite version 3.x -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' -# -default: &default - adapter: sqlite3 - pool: 5 - timeout: 5000 - -development: - <<: *default - database: db/development.sqlite3 - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - <<: *default - database: db/test.sqlite3 - -production: - <<: *default - database: db/production.sqlite3 diff --git a/test/dummy/config/environment.rb b/test/dummy/config/environment.rb deleted file mode 100644 index ee8d90d..0000000 --- a/test/dummy/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the Rails application. -require File.expand_path('../application', __FILE__) - -# Initialize the Rails application. -Rails.application.initialize! diff --git a/test/dummy/config/environments/development.rb b/test/dummy/config/environments/development.rb deleted file mode 100644 index ddf0e90..0000000 --- a/test/dummy/config/environments/development.rb +++ /dev/null @@ -1,37 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. - config.cache_classes = false - - # Do not eager load code on boot. - config.eager_load = false - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Don't care if the mailer can't send. - config.action_mailer.raise_delivery_errors = false - - # Print deprecation notices to the Rails logger. - config.active_support.deprecation = :log - - # Raise an error on page load if there are pending migrations. - config.active_record.migration_error = :page_load - - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = true - - # Adds additional error checking when serving assets at runtime. - # Checks for improperly declared sprockets dependencies. - # Raises helpful error messages. - config.assets.raise_runtime_errors = true - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true -end diff --git a/test/dummy/config/environments/production.rb b/test/dummy/config/environments/production.rb deleted file mode 100644 index b93a877..0000000 --- a/test/dummy/config/environments/production.rb +++ /dev/null @@ -1,78 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # Code is not reloaded between requests. - config.cache_classes = true - - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both threaded web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. - config.eager_load = true - - # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Enable Rack::Cache to put a simple HTTP cache in front of your application - # Add `rack-cache` to your Gemfile before enabling this. - # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. - # config.action_dispatch.rack_cache = true - - # Disable Rails's static asset server (Apache or nginx will already do this). - config.serve_static_assets = false - - # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier - # config.assets.css_compressor = :sass - - # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false - - # Generate digests for assets URLs. - config.assets.digest = true - - # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb - - # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true - - # Set to :debug to see everything in the log. - config.log_level = :info - - # Prepend all log lines with the following tags. - # config.log_tags = [ :subdomain, :uuid ] - - # Use a different logger for distributed setups. - # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = "http://assets.example.com" - - # Ignore bad email addresses and do not raise email delivery errors. - # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation cannot be found). - config.i18n.fallbacks = true - - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify - - # Disable automatic flushing of the log to improve performance. - # config.autoflush_log = false - - # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = ::Logger::Formatter.new - - # Do not dump schema after migrations. - config.active_record.dump_schema_after_migration = false -end diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb deleted file mode 100644 index 053f5b6..0000000 --- a/test/dummy/config/environments/test.rb +++ /dev/null @@ -1,39 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false - - # Configure static asset server for tests with Cache-Control for performance. - config.serve_static_assets = true - config.static_cache_control = 'public, max-age=3600' - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment. - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Print deprecation notices to the stderr. - config.active_support.deprecation = :stderr - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true -end diff --git a/test/dummy/config/initializers/assets.rb b/test/dummy/config/initializers/assets.rb deleted file mode 100644 index d2f4ec3..0000000 --- a/test/dummy/config/initializers/assets.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = '1.0' - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. -# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/test/dummy/config/initializers/backtrace_silencers.rb b/test/dummy/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 59385cd..0000000 --- a/test/dummy/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/test/dummy/config/initializers/cookies_serializer.rb b/test/dummy/config/initializers/cookies_serializer.rb deleted file mode 100644 index 7a06a89..0000000 --- a/test/dummy/config/initializers/cookies_serializer.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Be sure to restart your server when you modify this file. - -Rails.application.config.action_dispatch.cookies_serializer = :json \ No newline at end of file diff --git a/test/dummy/config/initializers/filter_parameter_logging.rb b/test/dummy/config/initializers/filter_parameter_logging.rb deleted file mode 100644 index 4a994e1..0000000 --- a/test/dummy/config/initializers/filter_parameter_logging.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Configure sensitive parameters which will be filtered from the log file. -Rails.application.config.filter_parameters += [:password] diff --git a/test/dummy/config/initializers/inflections.rb b/test/dummy/config/initializers/inflections.rb deleted file mode 100644 index ac033bf..0000000 --- a/test/dummy/config/initializers/inflections.rb +++ /dev/null @@ -1,16 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format. Inflections -# are locale specific, and you may define rules for as many different -# locales as you wish. All of these examples are active by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end - -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' -# end diff --git a/test/dummy/config/initializers/mime_types.rb b/test/dummy/config/initializers/mime_types.rb deleted file mode 100644 index dc18996..0000000 --- a/test/dummy/config/initializers/mime_types.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf diff --git a/test/dummy/config/initializers/session_store.rb b/test/dummy/config/initializers/session_store.rb deleted file mode 100644 index e766b67..0000000 --- a/test/dummy/config/initializers/session_store.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Be sure to restart your server when you modify this file. - -Rails.application.config.session_store :cookie_store, key: '_dummy_session' diff --git a/test/dummy/config/initializers/wrap_parameters.rb b/test/dummy/config/initializers/wrap_parameters.rb deleted file mode 100644 index 33725e9..0000000 --- a/test/dummy/config/initializers/wrap_parameters.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# This file contains settings for ActionController::ParamsWrapper which -# is enabled by default. - -# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. -ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] if respond_to?(:wrap_parameters) -end - -# To enable root element in JSON for ActiveRecord objects. -# ActiveSupport.on_load(:active_record) do -# self.include_root_in_json = true -# end diff --git a/test/dummy/config/locales/en.yml b/test/dummy/config/locales/en.yml deleted file mode 100644 index 0653957..0000000 --- a/test/dummy/config/locales/en.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. - -en: - hello: "Hello world" diff --git a/test/dummy/config/routes.rb b/test/dummy/config/routes.rb deleted file mode 100644 index 3f66539..0000000 --- a/test/dummy/config/routes.rb +++ /dev/null @@ -1,56 +0,0 @@ -Rails.application.routes.draw do - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end -end diff --git a/test/dummy/config/secrets.yml b/test/dummy/config/secrets.yml deleted file mode 100644 index c621c5a..0000000 --- a/test/dummy/config/secrets.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure the secrets in this file are kept private -# if you're sharing your code publicly. - -development: - secret_key_base: c53b94057e642e092f31259835d5d0e5f5a8ddafd9c909d0b3fa4b8d8943376e8b75272b304e851a78d3fe5bcc0876f0a5c087f9ed2f29d238194d573bfd247a - -test: - secret_key_base: 1795e84e03b4646722454c9658d58cc88dca7e3469605daf77a5143c0fbf7b0c67a6b95684b2c693c5d19aab955daa070fa889ca2714e345be478e686237a335 - -# Do not keep production secrets in the repository, -# instead read values from the environment. -production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/test/dummy/lib/assets/.keep b/test/dummy/lib/assets/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/dummy/log/.keep b/test/dummy/log/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/dummy/public/404.html b/test/dummy/public/404.html deleted file mode 100644 index b612547..0000000 --- a/test/dummy/public/404.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The page you were looking for doesn't exist (404) - - - - - - -
    -
    -

    The page you were looking for doesn't exist.

    -

    You may have mistyped the address or the page may have moved.

    -
    -

    If you are the application owner check the logs for more information.

    -
    - - diff --git a/test/dummy/public/422.html b/test/dummy/public/422.html deleted file mode 100644 index a21f82b..0000000 --- a/test/dummy/public/422.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The change you wanted was rejected (422) - - - - - - -
    -
    -

    The change you wanted was rejected.

    -

    Maybe you tried to change something you didn't have access to.

    -
    -

    If you are the application owner check the logs for more information.

    -
    - - diff --git a/test/dummy/public/500.html b/test/dummy/public/500.html deleted file mode 100644 index 061abc5..0000000 --- a/test/dummy/public/500.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - We're sorry, but something went wrong (500) - - - - - - -
    -
    -

    We're sorry, but something went wrong.

    -
    -

    If you are the application owner check the logs for more information.

    -
    - - diff --git a/test/dummy/public/favicon.ico b/test/dummy/public/favicon.ico deleted file mode 100644 index e69de29..0000000 diff --git a/test/helpers/seminar_helper_test.rb b/test/helpers/seminar_helper_test.rb deleted file mode 100644 index b3b3157..0000000 --- a/test/helpers/seminar_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class SeminarHelperTest < ActionView::TestCase -end diff --git a/test/seminar_test.rb b/test/seminar_test.rb deleted file mode 100644 index b1770aa..0000000 --- a/test/seminar_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class SeminarTest < ActiveSupport::TestCase - test "truth" do - assert_kind_of Module, Seminar - end -end diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index ec238d9..0000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,18 +0,0 @@ -# Configure Rails Environment -ENV["RAILS_ENV"] = "test" - -require File.expand_path("../../test/dummy/config/environment.rb", __FILE__) -ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)] -require "rails/test_help" - -# Filter out Minitest backtrace while allowing backtrace from other libraries -# to be shown. -Minitest.backtrace_filter = Minitest::BacktraceFilter.new - -# Load support files -Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } - -# Load fixtures from the engine -if ActiveSupport::TestCase.method_defined?(:fixture_path=) - ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__) -end