From b51e89156b8078aac7f991cdb762e2837b40788e Mon Sep 17 00:00:00 2001 From: rulingcom Date: Tue, 2 Jun 2026 16:30:29 +0800 Subject: [PATCH] first commit --- Gemfile | 13 + Gemfile.lock | 104 +++++ MIT-LICENSE | 20 + README.rdoc | 3 + Rakefile | 30 ++ .../desktop/personal_thesis_guidance.svg | 17 + .../images/personal_thesis_guidance/.keep | 0 .../admin/thesis_guidance_levels.js | 2 + .../thesis_guidance_paper_author_types.js | 2 + .../admin/thesis_guidance_paper_intros.js | 2 + .../admin/thesis_guidance_paper_types.js | 2 + .../admin/thesis_guidance_papers.js | 5 + .../personal_thesis_guidance/.keep | 0 .../personal_thesis_guidance/author.js.erb | 24 ++ .../journal_paper_file.js.erb | 24 ++ .../javascripts/thesis_guidance_papers.js | 2 + .../admin/thesis_guidance_levels.css | 4 + .../thesis_guidance_paper_author_types.css | 4 + .../admin/thesis_guidance_paper_intros.css | 4 + .../admin/thesis_guidance_paper_types.css | 4 + .../admin/thesis_guidance_papers.css | 4 + .../personal_thesis_guidance/.keep | 0 .../stylesheets/thesis_guidance_papers.css | 4 + app/controllers/.keep | 0 .../thesis_guidance_levels_controller.rb | 43 ++ ..._guidance_paper_author_types_controller.rb | 43 ++ .../thesis_guidance_paper_types_controller.rb | 43 ++ .../thesis_guidance_papers_controller.rb | 259 ++++++++++++ .../admin/thesis_guidance_types_controller.rb | 43 ++ .../personal_thesis_guidances_controller.bak | 27 ++ .../personal_thesis_guidances_controller.rb | 238 +++++++++++ app/helpers/.keep | 0 .../admin/thesis_guidance_papers_helper.rb | 257 ++++++++++++ app/mailers/.keep | 0 app/models/.keep | 0 app/models/thesis_guidance_level.rb | 17 + app/models/thesis_guidance_paper.rb | 323 +++++++++++++++ app/models/thesis_guidance_paper_author.rb | 15 + .../thesis_guidance_paper_author_type.rb | 10 + app/models/thesis_guidance_paper_file.rb | 12 + app/models/thesis_guidance_paper_intro.rb | 3 + app/models/thesis_guidance_paper_type.rb | 9 + app/models/thesis_guidance_type.rb | 7 + app/views/.keep | 0 .../thesis_guidance_levels/_form.html.erb | 24 ++ .../thesis_guidance_levels/_index.js.erb | 2 + .../admin/thesis_guidance_levels/edit.js.erb | 1 + .../admin/thesis_guidance_levels/new.js.erb | 1 + .../_form.html.erb | 24 ++ .../_list.js.erb | 2 + .../edit.js.erb | 1 + .../new.js.erb | 1 + .../_form.html.erb | 24 ++ .../thesis_guidance_paper_types/_index.js.erb | 2 + .../thesis_guidance_paper_types/edit.js.erb | 1 + .../thesis_guidance_paper_types/new.js.erb | 1 + .../thesis_guidance_papers/_form.html.erb | 382 ++++++++++++++++++ .../_form_author.html.erb | 39 ++ .../_form_file.html.erb | 45 +++ .../_list_author_type.html.erb | 10 + .../_list_journal_type.html.erb | 10 + .../_list_level_type.html.erb | 10 + .../_list_paper_type.html.erb | 10 + .../_writing_journal.html.erb | 19 + .../thesis_guidance_papers/analysis.html.erb | 116 ++++++ .../analysis_report.html.erb | 1 + .../thesis_guidance_papers/destroy.js.erb | 1 + .../download_excel.xlsx.axlsx | 96 +++++ .../thesis_guidance_papers/edit.html.erb | 5 + .../excel_format.xlsx.axlsx | 153 +++++++ .../frontend_setting.html.erb | 94 +++++ .../thesis_guidance_papers/index.html.erb | 53 +++ .../thesis_guidance_papers/index_js.html.erb | 4 + .../thesis_guidance_papers/merge.html.erb | 118 ++++++ .../admin/thesis_guidance_papers/new.html.erb | 5 + .../thesis_guidance_papers/setting.html.erb | 149 +++++++ .../thesis_guidance_types/_form.html.erb | 24 ++ .../admin/thesis_guidance_types/_list.js.erb | 2 + .../admin/thesis_guidance_types/edit.js.erb | 1 + .../admin/thesis_guidance_types/new.js.erb | 1 + .../get_fields_for_index.html.erb | 48 +++ .../personal_thesis_guidances/index.html.erb | 1 + .../personal_thesis_guidances/show.html.erb | 1 + .../_profile.html.erb | 85 ++++ bin/rails | 16 + config/locales/en.yml | 70 ++++ config/locales/zh_tw.yml | 69 ++++ config/routes.rb | 42 ++ get_rail_path.rb | 1 + lib/personal_thesis_guidance.rb | 4 + lib/personal_thesis_guidance/engine.rb | 38 ++ lib/personal_thesis_guidance/version.rb | 3 + lib/tasks/personal_thesis_guidance.rake | 14 + .../personal_thesis_guidance/index.html.erb | 14 + .../index_by_author.html.erb | 13 + .../index_search1.html.erb | 38 ++ modules/personal_thesis_guidance/info.json | 28 ++ .../personal_thesis_guidance/show.html.erb | 8 + .../personal_thesis_guidance/thumbs/thumb.png | Bin 0 -> 4075 bytes personal_thesis_guidance.gemspec | 34 ++ .../thesis_guidance_levels_controller_test.rb | 7 + ...ance_paper_author_types_controller_test.rb | 7 + ...s_guidance_paper_intros_controller_test.rb | 7 + ...is_guidance_paper_types_controller_test.rb | 7 + .../thesis_guidance_papers_controller_test.rb | 9 + .../thesis_guidance_papers_controller_test.rb | 9 + 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 | 29 ++ test/dummy/config/boot.rb | 5 + test/dummy/config/environment.rb | 5 + test/dummy/config/environments/development.rb | 34 ++ test/dummy/config/environments/production.rb | 80 ++++ test/dummy/config/environments/test.rb | 39 ++ .../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 | 9 + 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/fixtures/thesis_guidance_levels.yml | 9 + .../thesis_guidance_paper_author_types.yml | 7 + .../thesis_guidance_paper_authors.yml | 9 + test/fixtures/thesis_guidance_paper_files.yml | 11 + .../fixtures/thesis_guidance_paper_intros.yml | 11 + test/fixtures/thesis_guidance_paper_types.yml | 9 + test/fixtures/thesis_guidance_papers.yml | 39 ++ .../thesis_guidance_levels_helper_test.rb | 4 + ...guidance_paper_author_types_helper_test.rb | 4 + ...hesis_guidance_paper_intros_helper_test.rb | 4 + ...thesis_guidance_paper_types_helper_test.rb | 4 + .../thesis_guidance_papers_helper_test.rb | 4 + .../thesis_guidance_papers_helper_test.rb | 4 + test/integration/navigation_test.rb | 9 + test/models/thesis_guidance_level_test.rb | 7 + .../thesis_guidance_paper_author_test.rb | 7 + .../thesis_guidance_paper_author_type_test.rb | 7 + .../models/thesis_guidance_paper_file_test.rb | 7 + .../thesis_guidance_paper_intro_test.rb | 7 + test/models/thesis_guidance_paper_test.rb | 7 + .../models/thesis_guidance_paper_type_test.rb | 7 + test/personal_thesis_guidance_test.rb | 7 + test/test_helper.rb | 15 + 167 files changed, 4464 insertions(+) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 MIT-LICENSE create mode 100644 README.rdoc create mode 100644 Rakefile create mode 100644 app/assets/images/desktop/personal_thesis_guidance.svg create mode 100644 app/assets/images/personal_thesis_guidance/.keep create mode 100644 app/assets/javascripts/admin/thesis_guidance_levels.js create mode 100644 app/assets/javascripts/admin/thesis_guidance_paper_author_types.js create mode 100644 app/assets/javascripts/admin/thesis_guidance_paper_intros.js create mode 100644 app/assets/javascripts/admin/thesis_guidance_paper_types.js create mode 100644 app/assets/javascripts/admin/thesis_guidance_papers.js create mode 100644 app/assets/javascripts/personal_thesis_guidance/.keep create mode 100644 app/assets/javascripts/personal_thesis_guidance/author.js.erb create mode 100644 app/assets/javascripts/personal_thesis_guidance/journal_paper_file.js.erb create mode 100644 app/assets/javascripts/thesis_guidance_papers.js create mode 100644 app/assets/stylesheets/admin/thesis_guidance_levels.css create mode 100644 app/assets/stylesheets/admin/thesis_guidance_paper_author_types.css create mode 100644 app/assets/stylesheets/admin/thesis_guidance_paper_intros.css create mode 100644 app/assets/stylesheets/admin/thesis_guidance_paper_types.css create mode 100644 app/assets/stylesheets/admin/thesis_guidance_papers.css create mode 100644 app/assets/stylesheets/personal_thesis_guidance/.keep create mode 100644 app/assets/stylesheets/thesis_guidance_papers.css create mode 100644 app/controllers/.keep create mode 100644 app/controllers/admin/thesis_guidance_levels_controller.rb create mode 100644 app/controllers/admin/thesis_guidance_paper_author_types_controller.rb create mode 100644 app/controllers/admin/thesis_guidance_paper_types_controller.rb create mode 100644 app/controllers/admin/thesis_guidance_papers_controller.rb create mode 100644 app/controllers/admin/thesis_guidance_types_controller.rb create mode 100644 app/controllers/desktop/personal_thesis_guidances_controller.bak create mode 100644 app/controllers/personal_thesis_guidances_controller.rb create mode 100644 app/helpers/.keep create mode 100644 app/helpers/admin/thesis_guidance_papers_helper.rb create mode 100644 app/mailers/.keep create mode 100644 app/models/.keep create mode 100644 app/models/thesis_guidance_level.rb create mode 100644 app/models/thesis_guidance_paper.rb create mode 100644 app/models/thesis_guidance_paper_author.rb create mode 100644 app/models/thesis_guidance_paper_author_type.rb create mode 100644 app/models/thesis_guidance_paper_file.rb create mode 100644 app/models/thesis_guidance_paper_intro.rb create mode 100644 app/models/thesis_guidance_paper_type.rb create mode 100644 app/models/thesis_guidance_type.rb create mode 100644 app/views/.keep create mode 100644 app/views/admin/thesis_guidance_levels/_form.html.erb create mode 100644 app/views/admin/thesis_guidance_levels/_index.js.erb create mode 100644 app/views/admin/thesis_guidance_levels/edit.js.erb create mode 100644 app/views/admin/thesis_guidance_levels/new.js.erb create mode 100644 app/views/admin/thesis_guidance_paper_author_types/_form.html.erb create mode 100644 app/views/admin/thesis_guidance_paper_author_types/_list.js.erb create mode 100644 app/views/admin/thesis_guidance_paper_author_types/edit.js.erb create mode 100644 app/views/admin/thesis_guidance_paper_author_types/new.js.erb create mode 100644 app/views/admin/thesis_guidance_paper_types/_form.html.erb create mode 100644 app/views/admin/thesis_guidance_paper_types/_index.js.erb create mode 100644 app/views/admin/thesis_guidance_paper_types/edit.js.erb create mode 100644 app/views/admin/thesis_guidance_paper_types/new.js.erb create mode 100644 app/views/admin/thesis_guidance_papers/_form.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/_form_author.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/_form_file.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/_list_author_type.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/_list_journal_type.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/_list_level_type.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/_list_paper_type.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/_writing_journal.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/analysis.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/analysis_report.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/destroy.js.erb create mode 100644 app/views/admin/thesis_guidance_papers/download_excel.xlsx.axlsx create mode 100644 app/views/admin/thesis_guidance_papers/edit.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/excel_format.xlsx.axlsx create mode 100644 app/views/admin/thesis_guidance_papers/frontend_setting.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/index.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/index_js.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/merge.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/new.html.erb create mode 100644 app/views/admin/thesis_guidance_papers/setting.html.erb create mode 100644 app/views/admin/thesis_guidance_types/_form.html.erb create mode 100644 app/views/admin/thesis_guidance_types/_list.js.erb create mode 100644 app/views/admin/thesis_guidance_types/edit.js.erb create mode 100644 app/views/admin/thesis_guidance_types/new.js.erb create mode 100644 app/views/personal_thesis_guidances/get_fields_for_index.html.erb create mode 100644 app/views/personal_thesis_guidances/index.html.erb create mode 100644 app/views/personal_thesis_guidances/show.html.erb create mode 100644 app/views/plugin/personal_thesis_guidance/_profile.html.erb create mode 100644 bin/rails create mode 100644 config/locales/en.yml create mode 100644 config/locales/zh_tw.yml create mode 100644 config/routes.rb create mode 100644 get_rail_path.rb create mode 100644 lib/personal_thesis_guidance.rb create mode 100644 lib/personal_thesis_guidance/engine.rb create mode 100644 lib/personal_thesis_guidance/version.rb create mode 100644 lib/tasks/personal_thesis_guidance.rake create mode 100644 modules/personal_thesis_guidance/index.html.erb create mode 100644 modules/personal_thesis_guidance/index_by_author.html.erb create mode 100644 modules/personal_thesis_guidance/index_search1.html.erb create mode 100644 modules/personal_thesis_guidance/info.json create mode 100644 modules/personal_thesis_guidance/show.html.erb create mode 100644 modules/personal_thesis_guidance/thumbs/thumb.png create mode 100644 personal_thesis_guidance.gemspec create mode 100644 test/controllers/admin/thesis_guidance_levels_controller_test.rb create mode 100644 test/controllers/admin/thesis_guidance_paper_author_types_controller_test.rb create mode 100644 test/controllers/admin/thesis_guidance_paper_intros_controller_test.rb create mode 100644 test/controllers/admin/thesis_guidance_paper_types_controller_test.rb create mode 100644 test/controllers/admin/thesis_guidance_papers_controller_test.rb create mode 100644 test/controllers/thesis_guidance_papers_controller_test.rb create mode 100644 test/dummy/README.rdoc create mode 100644 test/dummy/Rakefile create mode 100644 test/dummy/app/assets/images/.keep create mode 100644 test/dummy/app/assets/javascripts/application.js create mode 100644 test/dummy/app/assets/stylesheets/application.css create mode 100644 test/dummy/app/controllers/application_controller.rb create mode 100644 test/dummy/app/controllers/concerns/.keep create mode 100644 test/dummy/app/helpers/application_helper.rb create mode 100644 test/dummy/app/mailers/.keep create mode 100644 test/dummy/app/models/.keep create mode 100644 test/dummy/app/models/concerns/.keep create mode 100644 test/dummy/app/views/layouts/application.html.erb create mode 100644 test/dummy/bin/bundle create mode 100644 test/dummy/bin/rails create mode 100644 test/dummy/bin/rake create mode 100644 test/dummy/config.ru create mode 100644 test/dummy/config/application.rb create mode 100644 test/dummy/config/boot.rb create mode 100644 test/dummy/config/environment.rb create mode 100644 test/dummy/config/environments/development.rb create mode 100644 test/dummy/config/environments/production.rb create mode 100644 test/dummy/config/environments/test.rb create mode 100644 test/dummy/config/initializers/backtrace_silencers.rb create mode 100644 test/dummy/config/initializers/cookies_serializer.rb create mode 100644 test/dummy/config/initializers/filter_parameter_logging.rb create mode 100644 test/dummy/config/initializers/inflections.rb create mode 100644 test/dummy/config/initializers/mime_types.rb create mode 100644 test/dummy/config/initializers/session_store.rb create mode 100644 test/dummy/config/initializers/wrap_parameters.rb create mode 100644 test/dummy/config/locales/en.yml create mode 100644 test/dummy/config/routes.rb create mode 100644 test/dummy/config/secrets.yml create mode 100644 test/dummy/lib/assets/.keep create mode 100644 test/dummy/log/.keep create mode 100644 test/dummy/public/404.html create mode 100644 test/dummy/public/422.html create mode 100644 test/dummy/public/500.html create mode 100644 test/dummy/public/favicon.ico create mode 100644 test/fixtures/thesis_guidance_levels.yml create mode 100644 test/fixtures/thesis_guidance_paper_author_types.yml create mode 100644 test/fixtures/thesis_guidance_paper_authors.yml create mode 100644 test/fixtures/thesis_guidance_paper_files.yml create mode 100644 test/fixtures/thesis_guidance_paper_intros.yml create mode 100644 test/fixtures/thesis_guidance_paper_types.yml create mode 100644 test/fixtures/thesis_guidance_papers.yml create mode 100644 test/helpers/admin/thesis_guidance_levels_helper_test.rb create mode 100644 test/helpers/admin/thesis_guidance_paper_author_types_helper_test.rb create mode 100644 test/helpers/admin/thesis_guidance_paper_intros_helper_test.rb create mode 100644 test/helpers/admin/thesis_guidance_paper_types_helper_test.rb create mode 100644 test/helpers/admin/thesis_guidance_papers_helper_test.rb create mode 100644 test/helpers/thesis_guidance_papers_helper_test.rb create mode 100644 test/integration/navigation_test.rb create mode 100644 test/models/thesis_guidance_level_test.rb create mode 100644 test/models/thesis_guidance_paper_author_test.rb create mode 100644 test/models/thesis_guidance_paper_author_type_test.rb create mode 100644 test/models/thesis_guidance_paper_file_test.rb create mode 100644 test/models/thesis_guidance_paper_intro_test.rb create mode 100644 test/models/thesis_guidance_paper_test.rb create mode 100644 test/models/thesis_guidance_paper_type_test.rb create mode 100644 test/personal_thesis_guidance_test.rb create mode 100644 test/test_helper.rb diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..7b913a2 --- /dev/null +++ b/Gemfile @@ -0,0 +1,13 @@ +source "https://rubygems.org" + +# Declare your gem's dependencies in personal_thesis_guidance.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 new file mode 100644 index 0000000..1b94899 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,104 @@ +PATH + remote: . + specs: + personal_thesis_guidance (0.0.1) + mongoid (= 4.0.0.beta2) + rails (= 4.1.0.rc2) + +GEM + remote: https://rubygems.org/ + specs: + actionmailer (4.1.0.rc2) + actionpack (= 4.1.0.rc2) + actionview (= 4.1.0.rc2) + mail (~> 2.5.4) + actionpack (4.1.0.rc2) + actionview (= 4.1.0.rc2) + activesupport (= 4.1.0.rc2) + rack (~> 1.5.2) + rack-test (~> 0.6.2) + actionview (4.1.0.rc2) + activesupport (= 4.1.0.rc2) + builder (~> 3.1) + erubis (~> 2.7.0) + activemodel (4.1.0.rc2) + activesupport (= 4.1.0.rc2) + builder (~> 3.1) + activerecord (4.1.0.rc2) + activemodel (= 4.1.0.rc2) + activesupport (= 4.1.0.rc2) + arel (~> 5.0.0) + activesupport (4.1.0.rc2) + 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) + bson (2.3.0) + builder (3.2.2) + connection_pool (2.0.0) + erubis (2.7.0) + hike (1.2.3) + i18n (0.6.9) + json (1.8.1) + mail (2.5.4) + mime-types (~> 1.16) + treetop (~> 1.4.8) + mime-types (1.25.1) + minitest (5.3.4) + mongoid (4.0.0.beta2) + activemodel (>= 4.0.0) + moped (~> 2.0.beta6) + origin (~> 2.1) + tzinfo (>= 0.3.37) + moped (2.0.0.rc1) + bson (~> 2.2) + connection_pool (~> 2.0) + optionable (~> 0.2.0) + multi_json (1.10.1) + optionable (0.2.0) + origin (2.1.1) + polyglot (0.3.5) + rack (1.5.2) + rack-test (0.6.2) + rack (>= 1.0) + rails (4.1.0.rc2) + actionmailer (= 4.1.0.rc2) + actionpack (= 4.1.0.rc2) + actionview (= 4.1.0.rc2) + activemodel (= 4.1.0.rc2) + activerecord (= 4.1.0.rc2) + activesupport (= 4.1.0.rc2) + bundler (>= 1.3.0, < 2.0) + railties (= 4.1.0.rc2) + sprockets-rails (~> 2.0.0) + railties (4.1.0.rc2) + actionpack (= 4.1.0.rc2) + activesupport (= 4.1.0.rc2) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (10.3.2) + sprockets (2.12.1) + hike (~> 1.2) + multi_json (~> 1.0) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + sprockets-rails (2.0.1) + actionpack (>= 3.0) + activesupport (>= 3.0) + sprockets (~> 2.8) + thor (0.19.1) + thread_safe (0.3.4) + tilt (1.4.1) + treetop (1.4.15) + polyglot + polyglot (>= 0.3.1) + tzinfo (1.2.1) + thread_safe (~> 0.1) + +PLATFORMS + ruby + +DEPENDENCIES + personal_thesis_guidance! diff --git a/MIT-LICENSE b/MIT-LICENSE new file mode 100644 index 0000000..03d3c85 --- /dev/null +++ b/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright 2014 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 new file mode 100644 index 0000000..61f3adb --- /dev/null +++ b/README.rdoc @@ -0,0 +1,3 @@ += PersonalThesisGuidance + +This project rocks and uses MIT-LICENSE. \ No newline at end of file diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..f1f65f9 --- /dev/null +++ b/Rakefile @@ -0,0 +1,30 @@ +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 = 'PersonalThesisGuidance' + 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/images/desktop/personal_thesis_guidance.svg b/app/assets/images/desktop/personal_thesis_guidance.svg new file mode 100644 index 0000000..0c955a6 --- /dev/null +++ b/app/assets/images/desktop/personal_thesis_guidance.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/app/assets/images/personal_thesis_guidance/.keep b/app/assets/images/personal_thesis_guidance/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/javascripts/admin/thesis_guidance_levels.js b/app/assets/javascripts/admin/thesis_guidance_levels.js new file mode 100644 index 0000000..7576b10 --- /dev/null +++ b/app/assets/javascripts/admin/thesis_guidance_levels.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/javascripts/admin/thesis_guidance_paper_author_types.js b/app/assets/javascripts/admin/thesis_guidance_paper_author_types.js new file mode 100644 index 0000000..7576b10 --- /dev/null +++ b/app/assets/javascripts/admin/thesis_guidance_paper_author_types.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/javascripts/admin/thesis_guidance_paper_intros.js b/app/assets/javascripts/admin/thesis_guidance_paper_intros.js new file mode 100644 index 0000000..7576b10 --- /dev/null +++ b/app/assets/javascripts/admin/thesis_guidance_paper_intros.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/javascripts/admin/thesis_guidance_paper_types.js b/app/assets/javascripts/admin/thesis_guidance_paper_types.js new file mode 100644 index 0000000..7576b10 --- /dev/null +++ b/app/assets/javascripts/admin/thesis_guidance_paper_types.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/javascripts/admin/thesis_guidance_papers.js b/app/assets/javascripts/admin/thesis_guidance_papers.js new file mode 100644 index 0000000..9a7294a --- /dev/null +++ b/app/assets/javascripts/admin/thesis_guidance_papers.js @@ -0,0 +1,5 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. +jQuery -> + $('#product_category_name').autocomplete + source: $('#product_category_name').data('autocomplete-source') diff --git a/app/assets/javascripts/personal_thesis_guidance/.keep b/app/assets/javascripts/personal_thesis_guidance/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/javascripts/personal_thesis_guidance/author.js.erb b/app/assets/javascripts/personal_thesis_guidance/author.js.erb new file mode 100644 index 0000000..a207525 --- /dev/null +++ b/app/assets/javascripts/personal_thesis_guidance/author.js.erb @@ -0,0 +1,24 @@ + $(document).ready(function() { + $('.main-forms .add-on').tooltip(); + $(document).on('click', '#add_author', function(){ + var new_id = $(this).prev().attr('value'); + var old_id = new RegExp("new_authors", "g"); + var on = $('.language-nav li.active').index(); + var le = $(this).parent('.add-btn-box').prev('.add-target-box').children('.start-line').length; + $(this).prev().attr('value', parseInt(new_id) + 1); + $(this).parent().siblings('.add-target-box').append(("<%= escape_javascript(add_attribute 'form_author', f, :thesis_guidance_paper_authors) rescue "" %>").replace(old_id, new_id)); + $(this).parent('.add-btn-box').prev('.add-target-box').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() { + $(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active'); + }); + formTip(); + }); + $(document).on('click', '.delete_file', function(){ + $(this).parents('.input-prepend').remove(); + }); + $(document).on('click', '.remove_existing_record', function(){ + if(confirm("<%= I18n.t(:sure?)%>")){ + $(this).children('.should_destroy').attr('value', 1); + $(this).parents('.start-line').hide(); + } + }); + }); \ No newline at end of file diff --git a/app/assets/javascripts/personal_thesis_guidance/journal_paper_file.js.erb b/app/assets/javascripts/personal_thesis_guidance/journal_paper_file.js.erb new file mode 100644 index 0000000..1bcbb6a --- /dev/null +++ b/app/assets/javascripts/personal_thesis_guidance/journal_paper_file.js.erb @@ -0,0 +1,24 @@ + $(document).ready(function() { + $('.main-forms .add-on').tooltip(); + $(document).on('click', '#add_file', function(){ + var new_id = $(this).prev().attr('value'); + var old_id = new RegExp("new_thesis_guidance_paper_files", "g"); + var on = $('.language-nav li.active').index(); + var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length; + $(this).prev().attr('value', parseInt(new_id) + 1); + $(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'form_file', f, :thesis_guidance_paper_files) rescue "" %>").replace(old_id, new_id)); + $(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() { + $(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active'); + }); + formTip(); + }); + $(document).on('click', '.delete_file', function(){ + $(this).parents('.input-prepend').remove(); + }); + $(document).on('click', '.remove_existing_record', function(){ + if(confirm("<%= I18n.t(:sure?)%>")){ + $(this).children('.should_destroy').attr('value', 1); + $(this).parents('.start-line').hide(); + } + }); + }); \ No newline at end of file diff --git a/app/assets/javascripts/thesis_guidance_papers.js b/app/assets/javascripts/thesis_guidance_papers.js new file mode 100644 index 0000000..7576b10 --- /dev/null +++ b/app/assets/javascripts/thesis_guidance_papers.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/admin/thesis_guidance_levels.css b/app/assets/stylesheets/admin/thesis_guidance_levels.css new file mode 100644 index 0000000..e1b9c43 --- /dev/null +++ b/app/assets/stylesheets/admin/thesis_guidance_levels.css @@ -0,0 +1,4 @@ +/* + Place all the styles related to the matching controller here. + They will automatically be included in application.css. +*/ diff --git a/app/assets/stylesheets/admin/thesis_guidance_paper_author_types.css b/app/assets/stylesheets/admin/thesis_guidance_paper_author_types.css new file mode 100644 index 0000000..e1b9c43 --- /dev/null +++ b/app/assets/stylesheets/admin/thesis_guidance_paper_author_types.css @@ -0,0 +1,4 @@ +/* + Place all the styles related to the matching controller here. + They will automatically be included in application.css. +*/ diff --git a/app/assets/stylesheets/admin/thesis_guidance_paper_intros.css b/app/assets/stylesheets/admin/thesis_guidance_paper_intros.css new file mode 100644 index 0000000..e1b9c43 --- /dev/null +++ b/app/assets/stylesheets/admin/thesis_guidance_paper_intros.css @@ -0,0 +1,4 @@ +/* + Place all the styles related to the matching controller here. + They will automatically be included in application.css. +*/ diff --git a/app/assets/stylesheets/admin/thesis_guidance_paper_types.css b/app/assets/stylesheets/admin/thesis_guidance_paper_types.css new file mode 100644 index 0000000..e1b9c43 --- /dev/null +++ b/app/assets/stylesheets/admin/thesis_guidance_paper_types.css @@ -0,0 +1,4 @@ +/* + Place all the styles related to the matching controller here. + They will automatically be included in application.css. +*/ diff --git a/app/assets/stylesheets/admin/thesis_guidance_papers.css b/app/assets/stylesheets/admin/thesis_guidance_papers.css new file mode 100644 index 0000000..e1b9c43 --- /dev/null +++ b/app/assets/stylesheets/admin/thesis_guidance_papers.css @@ -0,0 +1,4 @@ +/* + Place all the styles related to the matching controller here. + They will automatically be included in application.css. +*/ diff --git a/app/assets/stylesheets/personal_thesis_guidance/.keep b/app/assets/stylesheets/personal_thesis_guidance/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/stylesheets/thesis_guidance_papers.css b/app/assets/stylesheets/thesis_guidance_papers.css new file mode 100644 index 0000000..e1b9c43 --- /dev/null +++ b/app/assets/stylesheets/thesis_guidance_papers.css @@ -0,0 +1,4 @@ +/* + Place all the styles related to the matching controller here. + They will automatically be included in application.css. +*/ diff --git a/app/controllers/.keep b/app/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/controllers/admin/thesis_guidance_levels_controller.rb b/app/controllers/admin/thesis_guidance_levels_controller.rb new file mode 100644 index 0000000..f0e5d79 --- /dev/null +++ b/app/controllers/admin/thesis_guidance_levels_controller.rb @@ -0,0 +1,43 @@ +class Admin::ThesisGuidanceLevelsController < OrbitMemberController + before_action :allow_admin_only + + def new + @paper_level = ThesisGuidanceLevel.new + @url = admin_thesis_guidance_levels_path(@paper_level) + render :layout=>false + end + + def create + @paper_level = ThesisGuidanceLevel.new(paper_level_params) + @paper_level.save + @paper_levels = ThesisGuidanceLevel.all + render :partial=>'index', :layout=>false + end + + def edit + @paper_level = ThesisGuidanceLevel.find(params[:id]) + @url = admin_thesis_guidance_level_path(@paper_level) + render :layout=>false + end + + def update + @paper_level = ThesisGuidanceLevel.find(params[:id]) + @paper_level.update_attributes(paper_level_params) + @paper_level.save + @paper_levels = ThesisGuidanceLevel.all + render :partial=>'index', :layout=>false + end + + def destroy + paper_level = ThesisGuidanceLevel.find(params[:id]) + paper_level.destroy + @paper_levels = ThesisGuidanceLevel.all + render :partial=>'index', :layout=>false + end + + private + + def paper_level_params + params.require(:thesis_guidance_level).permit! rescue nil + end +end \ No newline at end of file diff --git a/app/controllers/admin/thesis_guidance_paper_author_types_controller.rb b/app/controllers/admin/thesis_guidance_paper_author_types_controller.rb new file mode 100644 index 0000000..04662e8 --- /dev/null +++ b/app/controllers/admin/thesis_guidance_paper_author_types_controller.rb @@ -0,0 +1,43 @@ +class Admin::ThesisGuidancePaperAuthorTypesController < OrbitMemberController + before_action :allow_admin_only + + def new + @author_type = ThesisGuidancePaperAuthorType.new + @url = admin_thesis_guidance_paper_author_types_path(@author_type) + render :layout=>false + end + + def create + @author_type = ThesisGuidancePaperAuthorType.new(author_type_params) + @author_type.save + @author_types = ThesisGuidancePaperAuthorType.all + render :partial=>'list', :layout=>false + end + + def edit + @author_type = ThesisGuidancePaperAuthorType.find(params[:id]) + @url = admin_thesis_guidance_paper_author_type_path(@author_type) + render :layout=>false + end + + def update + @author_type = ThesisGuidancePaperAuthorType.find(params[:id]) + @author_type.update_attributes(author_type_params) + @author_type.save + @author_types = ThesisGuidancePaperAuthorType.all + render :partial=>'list', :layout=>false + end + + def destroy + author_type = ThesisGuidancePaperAuthorType.find(params[:id]) + author_type.destroy + @author_types = ThesisGuidancePaperAuthorType.all + render :partial=>'list', :layout=>false + end + + private + + def author_type_params + params.require(:thesis_guidance_paper_author_type).permit! rescue nil + end +end diff --git a/app/controllers/admin/thesis_guidance_paper_types_controller.rb b/app/controllers/admin/thesis_guidance_paper_types_controller.rb new file mode 100644 index 0000000..4b7c1d0 --- /dev/null +++ b/app/controllers/admin/thesis_guidance_paper_types_controller.rb @@ -0,0 +1,43 @@ +class Admin::ThesisGuidancePaperTypesController < OrbitMemberController + before_action :allow_admin_only + + def new + @paper_type = ThesisGuidancePaperType.new + @url = admin_thesis_guidance_paper_types_path(@paper_type) + render :layout=>false + end + + def create + @paper_type = ThesisGuidancePaperType.new(paper_type_params) + @paper_type.save + @paper_types = ThesisGuidancePaperType.all + render :partial=>'index', :layout=>false + end + + def edit + @paper_type = ThesisGuidancePaperType.find(params[:id]) + @url = admin_thesis_guidance_paper_type_path(@paper_type) + render :layout=>false + end + + def update + @paper_type = ThesisGuidancePaperType.find(params[:id]) + @paper_type.update_attributes(paper_type_params) + @paper_type.save + @paper_types = ThesisGuidancePaperType.all + render :partial=>'index', :layout=>false + end + + def destroy + paper_type = ThesisGuidancePaperType.find(params[:id]) + paper_type.destroy + @paper_types = ThesisGuidancePaperType.all + render :partial=>'index', :layout=>false + end + + private + + def paper_type_params + params.require(:thesis_guidance_paper_type).permit! rescue nil + end +end diff --git a/app/controllers/admin/thesis_guidance_papers_controller.rb b/app/controllers/admin/thesis_guidance_papers_controller.rb new file mode 100644 index 0000000..7d4e9b8 --- /dev/null +++ b/app/controllers/admin/thesis_guidance_papers_controller.rb @@ -0,0 +1,259 @@ +require 'rubyXL' +class Admin::ThesisGuidancePapersController < OrbitMemberController + include Admin::ThesisGuidancePapersHelper + layout "member_plugin" + before_action :set_thesis_guidance_paper, only: [:show, :edit , :update, :destroy] + before_action :set_plugin + before_action :get_settings,:only => [:new, :edit, :setting] + + before_action :need_access_right + before_action :allow_admin_only, :only => [:index, :setting] + def merge_process + params['journal_id'].each do |journal_id| + journal_ids = journal_id.split('/') + journals = ThesisGuidancePaper.find(journal_ids) + member_ids = journals.collect(&:member_profile_id).uniq + journals.each_with_index do |journal,index1| + if index1== 0 + journal.member_profile_id = member_ids + journal.save! + else + journal.delete + end + end + end + redirect_to :action=> 'index' + end + def merge + @journals=ThesisGuidancePaper.sort_year_date.map{|value| value}.group_by{|v| [v[:paper_title],v[:journal_title]]} + @journals.each do |key,value| + if value.length<=1 + @journals.delete key + end + end + if params['mode']!='simple' + @journals.each do |key,value| + @journals[key] = value.group_by{|v| [get_level_type(v),get_author_type(v),get_paper_type(v),get_publication_date(v)]} + @journals[key].each do |key1,value1| + if value1.length<=1 + @journals[key].delete key1 + end + end + if @journals[key].length==0 + @journals.delete key + end + end + + end + end + def index + @writing_thesis_guidances = ThesisGuidancePaper.sort_year_date + if params[:keywords] + @writing_thesis_guidances = search_data(@writing_thesis_guidances,[:slug_title]) + end + @writing_thesis_guidances = @writing_thesis_guidances.page(params[:page]).per(10) + if request.xhr? + render "index_js", :layout => false + end + end + + def new + @member = Array(MemberProfile.find_by(:uid=>params['uid'].to_s)) rescue nil + @thesis_guidance_paper = ThesisGuidancePaper.new + + if params[:desktop] + render :layout => false + end + end + + def analysis + end + + def analysis_report + role = params[:role_id] + year_start = params[:year_start].to_i + year_end = params[:year_end].to_i + graph_by = params[:graph_by] + + @data = get_chart_data(year_start,year_end,role,params[:graph_by]) + + render :layout => false + end + + def download_excel + year_start = params[:year_start].to_i + year_end = params[:year_end].to_i + @data = get_data_for_excel(year_start,year_end) + respond_to do |format| + format.xlsx { + response.headers['Content-Disposition'] = 'attachment; filename="thesis_guidance_papers.xlsx"' + } + end + end + + def create + + if !thesis_guidance_paper_params['member_profile_id'].blank? + + @member = MemberProfile.find(thesis_guidance_paper_params['member_profile_id']) rescue nil + @thesis_guidance_paper = ThesisGuidancePaper.new(thesis_guidance_paper_params) + @thesis_guidance_paper.save + + if params[:desktop] == "true" + render json: {"data" => get_paper_list}.to_json + else + redirect_to params['referer_url'] + end + + elsif !params[:author_members].blank? + + #params[:author_members].each do |author_member| + + thesis_guidance_paper_params['member_profile_id'] = params[:author_members] + @thesis_guidance_paper = ThesisGuidancePaper.new(thesis_guidance_paper_params) + @thesis_guidance_paper.save + + if params[:desktop] == "true" + render json: {"data" => get_paper_list}.to_json + end + + #end + + redirect_to params['referer_url'] + + else + + thesis_guidance_paper_params['member_profile_id'] = User.find(current_user.id).member_profile_id + + @thesis_guidance_paper = ThesisGuidancePaper.new(thesis_guidance_paper_params) + @thesis_guidance_paper.save + + if params[:desktop] == "true" + render json: {"data" => get_paper_list}.to_json + end + + redirect_to params['referer_url'] + + end + + end + + def edit + @member = get_member(@thesis_guidance_paper) + if params[:desktop] + render :layout => false + end + end + + def update + @member = get_member(@thesis_guidance_paper) + thesis_guidance_paper_params['member_profile_id'] = params[:author_members] + @thesis_guidance_paper.update_attributes(thesis_guidance_paper_params) + @thesis_guidance_paper.save + if params[:desktop] == "true" + render json: {"data" => get_paper_list}.to_json + else + redirect_to params['referer_url'] + end + end + + def destroy + @thesis_guidance_paper.destroy + respond_to do |format| + format.html { redirect_to(admin_thesis_guidance_papers_url) } + # format.xml { head :ok } + format.js + format.json {render json: {"success" => true}} + end + end + + def excel_format + respond_to do |format| + format.xlsx { + response.headers['Content-Disposition'] = 'attachment; filename="thesis_guidance_paper_format.xlsx"' + } + end + end + + def import_from_excel + workbook = RubyXL::Parser.parse(params["import_file"].tempfile) + sheet = workbook[0] + if sheet.count <= 503 + sheet.each_with_index do |row, i| + next if i < 3 + user = User.where(:user_name => row.cells[0].value).first rescue nil + if !user.nil? + mp = user.member_profile + import_this_thesis_guidance_paper(row,mp) + end + end + redirect_to admin_thesis_guidance_papers_url + else + redirect_to admin_thesis_guidance_papers_url(:error => "1") + end + end + + def toggle_hide + if params[:ids] + @thesis_guidance_papers = ThesisGuidancePaper.any_in(_id: params[:ids]) + + @thesis_guidance_papers.each do |thesis_guidance_paper| + thesis_guidance_paper.is_hidden = params[:disable] + thesis_guidance_paper.save + end + end + + render json: {"success"=>true} + end + + def setting + end + + + def frontend_setting + @member = MemberProfile.find_by(:uid=>params['uid'].to_s) rescue nil + @intro = ThesisGuidancePaperIntro.find_by(:member_profile_id=>@member.id) rescue nil + @intro = @intro.nil? ? ThesisGuidancePaperIntro.new({:member_profile_id=>@member.id}) : @intro + end + + def update_frontend_setting + @member = MemberProfile.find(intro_params['member_profile_id']) rescue nil + @intro = ThesisGuidancePaperIntro.find_by(:member_profile_id=>@member.id) rescue nil + @intro = @intro.nil? ? ThesisGuidancePaperIntro.new({:member_profile_id=>@member.id}) : @intro + @intro.update_attributes(intro_params) + @intro.save + redirect_to URI.encode('/admin/members/'+@member.to_param+'/ThesisGuidancePaper') + end + + def get_settings + @thesis_guidance_levels = ThesisGuidanceLevel.all + @author_types = ThesisGuidancePaperAuthorType.all + @paper_types = ThesisGuidancePaperType.all + @thesis_guidance_types = ThesisGuidanceType.all + end + + def set_plugin + @plugin = OrbitApp::Plugin::Registration.all.select{|plugin| plugin.app_name.eql? 'ThesisGuidancePaper'}.first + end + + private + def set_thesis_guidance_paper + path = request.path.split('/') + if path.last.include? '-' + uid = path[-1].split("-").last + uid = uid.split("?").first + else + uid = path[-2].split("-").last + uid = uid.split("?").first + end + @thesis_guidance_paper = ThesisGuidancePaper.find_by(:uid => uid) rescue ThesisGuidancePaper.find(params[:id]) + end + + def thesis_guidance_paper_params + params.require(:thesis_guidance_paper).permit! rescue nil + end + + def intro_params + params.require(:thesis_guidance_paper_intro).permit! rescue nil + end +end diff --git a/app/controllers/admin/thesis_guidance_types_controller.rb b/app/controllers/admin/thesis_guidance_types_controller.rb new file mode 100644 index 0000000..1d86d15 --- /dev/null +++ b/app/controllers/admin/thesis_guidance_types_controller.rb @@ -0,0 +1,43 @@ +class Admin::ThesisGuidanceTypesController < OrbitMemberController + before_action :allow_admin_only + + def new + @thesis_guidance_type = ThesisGuidanceType.new + @url = admin_thesis_guidance_types_path(@thesis_guidance_type) + render :layout=>false + end + + def create + @thesis_guidance_type = ThesisGuidanceType.new(thesis_guidance_type_params) + @thesis_guidance_type.save + @thesis_guidance_types = ThesisGuidanceType.all + render :partial=>'list', :layout=>false + end + + def edit + @thesis_guidance_type = ThesisGuidanceType.find(params[:id]) + @url = admin_thesis_guidance_type_path(@thesis_guidance_type) + render :layout=>false + end + + def update + @thesis_guidance_type = ThesisGuidanceType.find(params[:id]) + @thesis_guidance_type.update_attributes(thesis_guidance_type_params) + @thesis_guidance_type.save + @thesis_guidance_types = ThesisGuidanceType.all + render :partial=>'list', :layout=>false + end + + def destroy + thesis_guidance_type = ThesisGuidanceType.find(params[:id]) + thesis_guidance_type.destroy + @thesis_guidance_types = ThesisGuidanceType.all + render :partial=>'list', :layout=>false + end + + private + + def thesis_guidance_type_params + params.require(:thesis_guidance_type).permit! rescue nil + end +end diff --git a/app/controllers/desktop/personal_thesis_guidances_controller.bak b/app/controllers/desktop/personal_thesis_guidances_controller.bak new file mode 100644 index 0000000..9a181b6 --- /dev/null +++ b/app/controllers/desktop/personal_thesis_guidances_controller.bak @@ -0,0 +1,27 @@ +class Desktop::PersonalThesisGuidancesController < DesktopAdminController + include Admin::ThesisGuidancePapersHelper + def menu + user = OrbitHelper.current_user + [ + { + "title" => "List", + "layout" => "list" + }, + { + "title" => "Add/Edit", + "layout" => "form", + "new_file_attributes" => { + "file" => "thesis_guidance_paper[thesis_guidance_paper_files_attributes][{number}][thesis_guidance_file]", + "title" => "thesis_guidance_paper[thesis_guidance_paper_files_attributes][{number}][title_translations][{langugae}]" + }, + "new_path" => "/admin/members/#{user.member_profile.to_param}/thesis_guidance_papers/new" + } + ] + end + + def list + get_paper_list + end + + +end \ No newline at end of file diff --git a/app/controllers/personal_thesis_guidances_controller.rb b/app/controllers/personal_thesis_guidances_controller.rb new file mode 100644 index 0000000..5b79355 --- /dev/null +++ b/app/controllers/personal_thesis_guidances_controller.rb @@ -0,0 +1,238 @@ +class PersonalThesisGuidancesController < ApplicationController + include Admin::ThesisGuidancePapersHelper + def index + params = OrbitHelper.params + page_data_count = OrbitHelper.page_data_count + page = OrbitHelper.page + custom_data_field = page.custom_data_field || {} + thesis_guidance_paper_query = ThesisGuidancePaper.sort_for_frontend + page_year = custom_data_field[:year] + page_thesis_guidance_type = custom_data_field[:thesis_guidance_type] + if (page_year.present?) + thesis_guidance_paper_query = thesis_guidance_paper_query.where(:year.in => page_year.to_a ) + end + if (page_thesis_guidance_type.present?) + thesis_guidance_paper_query = thesis_guidance_paper_query.where(:thesis_guidance_type_ids.in => page_thesis_guidance_type.to_a ) + end + thesis_guidance_papers = thesis_guidance_paper_query.page(OrbitHelper.params[:page_no]).per(page_data_count) + if params[:layout_type].start_with?('index_by_author') + return index_by_author(thesis_guidance_papers) + end + page = OrbitHelper.page + if page.custom_string_field == 'table' + fields_to_show = page.custom_array_field rescue [] + if fields_to_show.blank? + fields_to_show = %w[ + paper_title + journal_title + authors + year + vol_no + issue_no + level_type + ] + end + else + fields_to_show = %w[ + year + paper_title + ] + end + if !params[:selectbox].nil? + thesis_guidance_papers_temp = thesis_guidance_paper_query.sort_by { |tp| [-tp[:year].to_i, -tp[:publication_date].to_i] } + case params[:selectbox] + when 'paper_title', 'default' + if page.custom_string_field == 'table' + thesis_guidance_papers_show = thesis_guidance_papers_temp.select { |value| search_all_words(value.paper_title, params[:keywords]) } + else + thesis_guidance_papers_show = thesis_guidance_papers_temp.select { |value| search_all_words(value.create_link, params[:keywords]) } + end + when 'level_type' + thesis_guidance_papers_show = thesis_guidance_papers_temp.select { |value| search_all_words(value.thesis_guidance_levels.collect(&:title).join(', ').to_s, params[:keywords]) } + when 'publication_date' + thesis_guidance_papers_show = thesis_guidance_papers_temp.select { |value| search_all_words((value.send('publication_date').strftime('%Y/%m/%d') rescue ''), params[:keywords]) } + when 'author_type' + thesis_guidance_papers_show = thesis_guidance_papers_temp.select { |value| search_all_words(value.thesis_guidance_paper_author_types.collect(&:title).join(', '), params[:keywords]) } + when 'paper_type' + thesis_guidance_papers_show = thesis_guidance_papers_temp.select { |value| search_all_words((value.thesis_guidance_paper_type.title rescue ''), params[:keywords]) } + when 'language' + thesis_guidance_papers_show = thesis_guidance_papers_temp.select { |value| search_all_words((!value.language.nil? ? t(value.language.to_s) : ''), params[:keywords]) } + when 'authors' + thesis_guidance_papers_show = thesis_guidance_papers_temp.select { |value| search_all_words(get_authors_text(value), params[:keywords]) } + else + if fields_to_show.include?(params[:selectbox]) + thesis_guidance_papers_show = thesis_guidance_papers_temp.select { |value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords]) } + else + thesis_guidance_papers_show = thesis_guidance_papers_temp + end + end + page_to_show = params[:page_no].nil? ? 1 : params[:page_no].to_i + thesis_guidance_papers = thesis_guidance_papers_show[(page_to_show - 1) * page_data_count...page_to_show * page_data_count] + thesis_guidance_papers_total_pages = (thesis_guidance_papers_show.length / page_data_count.to_f).ceil + else + thesis_guidance_papers_total_pages = thesis_guidance_papers.total_pages + end + thesis_guidance_paper_list = [] + thesis_guidance_papers.each do |thesis_guidance_paper| + t = [] + fields_to_show.each do |fs| + case fs + when 'paper_title' + if page.custom_string_field == 'table' + t << { 'value' => "#{thesis_guidance_paper.paper_title}" } + else + t << { 'value' => "#{thesis_guidance_paper.create_link}" } + end + when 'level_type' + t << { 'value' => (!thesis_guidance_paper.thesis_guidance_levels.blank? ? "(#{thesis_guidance_paper.thesis_guidance_levels.collect(&:title).join(', ')})" : nil) } + when 'publication_date' + t << { 'value' => (thesis_guidance_paper.send(fs).strftime('%Y/%m') rescue '') } + when 'author_type' + t << { 'value' => (thesis_guidance_paper.thesis_guidance_paper_author_types.collect(&:title).join(', ') rescue '') } + when 'paper_type' + t << { 'value' => (thesis_guidance_paper.thesis_guidance_paper_type.title rescue '') } + when 'language' + t << { 'value' => (!thesis_guidance_paper.language.nil? ? t(thesis_guidance_paper.language.to_s) : '') } + when 'url' + t << { 'value' => thesis_guidance_paper.url.to_s.blank? ? "" : "#{thesis_guidance_paper.url}"} + when 'authors' + t << { 'value' => get_authors_show(thesis_guidance_paper) } + else + t << { 'value' => (thesis_guidance_paper.send(fs) rescue '') } + end + end + thesis_guidance_paper_list << { 'jps' => t } + end + headers = [] + choice_show = [] + fields_to_show.each do |fs| + col = 2 + col = 3 if fs == 'paper_title' + headers << { + 'head-title' => t("personal_thesis_guidance.#{fs}"), + 'col' => col + } + choice_show << t("personal_thesis_guidance.#{fs}") + end + choice_value = fields_to_show + choice_value.unshift('default') + choice_select = choice_value.map { |iter| iter == params[:selectbox] ? 'selected' : '' } + choice_select = choice_select.map { |value| { 'choice_select' => value } } + choice_value = choice_value.map { |value| { 'choice_value' => value } } + choice_default = t('personal_thesis_guidance.select_class') + choice_show.unshift(choice_default) + choice_show = choice_show.map { |value| { 'choice_show' => value } } + choice = choice_value.zip(choice_show, choice_select) + choice = choice.map { |value| value.inject :merge } + select_text = t('personal_thesis_guidance.search_class') + search_text = t('personal_thesis_guidance.word_to_search') + @_request = OrbitHelper.request + csrf_value = form_authenticity_token + { + 'thesis_guidance_papers' => thesis_guidance_paper_list, + 'headers' => headers, + 'extras' => { 'widget-title' => t('module_name.thesis_guidance_paper'), + 'url' => '/' + I18n.locale.to_s + params[:url], + 'select_text' => select_text, + 'search_text' => search_text, + 'search_value' => params[:keywords].to_s.gsub(/\"/,''), + 'csrf_value' => csrf_value }, + 'total_pages' => thesis_guidance_papers_total_pages, + 'choice' => choice + } + end + + def index_by_author(thesis_guidance_papers) + thesis_guidance_papers_total_pages = thesis_guidance_papers.total_pages + thesis_guidance_papers_list = thesis_guidance_papers.group_by{|jp| jp.year}.collect do |year, jps| + jps_data = jps.group_by do |jp| + jp.member_profiles.collect{|v| v.name}.join(', ') rescue jp.authors + end.collect do |name, jps| + jps_data = jps.collect do |jp| + {'title' => jp.create_link_tag_for_title} + end + {'name' => name, 'jps' => jps_data} + end + {'year' => year, 'jps_list'=> jps_data} + end + { + 'thesis_guidance_papers' => thesis_guidance_papers_list, + 'extras' => { 'widget-title' => t('module_name.thesis_guidance_paper')}, + 'total_pages' => thesis_guidance_papers_total_pages + } + end + + def show + params = OrbitHelper.params + plugin = ThesisGuidancePaper.where(is_hidden: false).find_by(uid: params[:uid].to_s) + fields_to_show = %w[ + year + authors + author_type + paper_title + journal_title + vol_no + issue_no + form_to + level_type + paper_type + total_pages + publication_date + isbn + abstract + language + url + associated_project + file + ] + { 'plugin_datas' => plugin.get_plugin_data(fields_to_show) } + end + + def get_fields_for_index + @page = Page.find(params[:page_id]) rescue nil + @fields_to_show = %w[ + year + authors + author_type + paper_title + journal_title + vol_no + issue_no + form_to + level_type + paper_type + total_pages + publication_date + isbn + abstract + language + url + ] + @fields_to_show = @fields_to_show.map { |fs| [t("personal_thesis_guidance.#{fs}"), fs] } + @default_fields_to_show = %w[ + paper_title + journal_title + authors + year + issue_no + vol_no + level_type + ] + render layout: false + end + + def save_index_fields + page = Page.find(params[:page_id]) rescue nil + page.custom_array_field = params[:keys] + page.save + render json: { 'success' => true }.to_json + end + + private + + def search_all_words(target, word) + target = target.upcase + words = word.upcase.split(' ') + words.select { |value| target.include? value } == words + end +end diff --git a/app/helpers/.keep b/app/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/helpers/admin/thesis_guidance_papers_helper.rb b/app/helpers/admin/thesis_guidance_papers_helper.rb new file mode 100644 index 0000000..62165f9 --- /dev/null +++ b/app/helpers/admin/thesis_guidance_papers_helper.rb @@ -0,0 +1,257 @@ +module Admin::ThesisGuidancePapersHelper + def get_authors_text(journal) + authors_text = Nokogiri::HTML(journal.authors.to_s).text + split_text = authors_text.match(/[、,,\/]/) + split_text = split_text.nil? ? '/' : split_text[0] + if authors_text.present? + authors_names = authors_text.split(split_text) + else + authors_names = [] + end + full_authors_names = get_member(journal).collect do |member| + member_name = member.name + idx = authors_names.index{|a| a.match(/(^|[ \(\[])#{::Regexp.escape(member_name)}([ \)\]\*]|$)/)} + if idx + member_name = authors_names[idx] + authors_names[idx] = nil + end + member_name + end + full_authors_names += authors_names.compact + full_authors_names.join(split_text) + end + def get_authors_show(journal) + authors_text = Nokogiri::HTML(journal.authors.to_s).text + split_text = authors_text.match(/[、,,\/]/) + split_text = split_text.nil? ? '/' : split_text[0] + if authors_text.present? + authors_names = authors_text.split(split_text) + else + authors_names = [] + end + full_authors = get_member(journal).collect do |member| + member_name = member.name + idx = authors_names.index{|a| a.match(/(^|[ \(\[])#{::Regexp.escape(member_name)}([ \)\]\*]|$)/)} + if idx + member_name = authors_names[idx] + authors_names[idx] = nil + end + "#{member_name}" + end + full_authors += authors_names.compact + full_authors.join(split_text) + end + def get_member(journal) + Array(MemberProfile.where(:id.in=>Array(journal).collect(&:member_profile_id).flatten)) + end + def get_a_tag_from_members(members) + members.collect{|member| "#{member.name}"} + end + def get_member_show(journal) + get_a_tag_from_members(get_member(journal)).join('、') + end + def get_level_type(journal) + !journal.thesis_guidance_levels.blank? ? "(#{journal.thesis_guidance_levels.collect(&:title).join(', ')})" : nil + end + def get_author_type(journal) + journal.thesis_guidance_paper_author_types.collect(&:title).join(', ') rescue '' + end + def get_paper_type(journal) + journal.thesis_guidance_paper_type.title rescue '' + end + def get_publication_date(journal) + journal.publication_date.strftime('%Y/%m/%d') rescue '' + end + def page_for_thesis_guidance_paper(thesis_guidance_paper_object) + thesis_guidance_paper_page = nil + pages = Page.where(:module=>"thesis_guidance_paper") + + thesis_guidance_paper_page = pages.first if thesis_guidance_paper_page.nil? + request.protocol+(request.host_with_port+thesis_guidance_paper_page.url+'/'+thesis_guidance_paper_object.to_param).gsub('//','/') rescue "/" + end + def get_paper_list + user = current_user.nil? ? OrbitHelper.current_user : current_user + user_profile = user.member_profile + journals = ThesisGuidancePaper.where(:member_profile_id => user_profile.id) + journals = journals.collect do |j| + files = j.thesis_guidance_paper_files.collect do |jpf| + { + "title" => jpf.title, + "description" => jpf.description, + "link" => jpf.thesis_guidance_file.url, + "extension" => (jpf.thesis_guidance_file.url.split(".").last rescue "") + } + end + + { + "id" => j.id.to_s, + "edit_url" => "/#{I18n.locale.to_s}/admin/members/#{user_profile.to_param}/thesis_guidance_papers/#{j.to_param}/edit", + "delete_url" => "/#{I18n.locale.to_s}/admin/thesis_guidance_papers/#{j.id.to_s}", + "paper_title" => j.paper_title, + "journal_title" => j.journal_title, + "keywords" => j.keywords, + "abstract" => j.abstract, + "files" => files + } + end + journals + end + def import_this_thesis_guidance_paper(row,mp) + value = nil + jp = ThesisGuidancePaper.new + row.cells.each_with_index do |cell,index| + next if index < 2 + next if cell.nil? + val = cell.value + next if val.nil? || val == "" + case index + when 2 + value = {"en" => val} + when 3 + begin + value["zh_tw"] = val + rescue + value = {"zh_tw" => val} + end + jp.paper_title_translations = value + when 4 + value = {"en" => val} + when 5 + begin + value["zh_tw"] = val + rescue + value = {"zh_tw" => val} + end + jp.journal_title_translations = value + when 6 + value = {"en" => val} + when 7 + begin + value["zh_tw"] = val + rescue + value = {"zh_tw" => val} + end + jp.authors_translations = value + when 8 + jp.year = val + when 9 + jp.language = val + when 10 + jp.vol_no = val + when 11 + jp.issue_no = val + when 12 + jp.form_to_start = val + when 13 + jp.form_to_end = val + when 14 + jp.total_pages = val + when 15 + jls = ThesisGuidanceLevel.asc(:created_at).all.to_a + ts = val.to_s.split(",") + ts.each do |t| + jp.thesis_guidance_level_ids << jls[t.to_i].id if t.to_s.is_i? && t.to_i < jls.count + end + when 16 + jpts = ThesisGuidancePaperType.asc(:created_at).all.to_a + jp.thesis_guidance_paper_type = jpts[val.to_i] if val.to_s.is_i? && val.to_i < jpts.count + when 17 + jpas = ThesisGuidancePaperAuthorType.asc(:created_at).all.to_a + ts = val.to_s.split(",") + ts.each do |t| + jp.thesis_guidance_paper_author_type_ids << jpas[t.to_i].id if t.to_s.is_i? && t.to_i < jpas.count + end + when 18 + jp.number_of_authors = val + when 19 + jp.isbn = val + when 20 + jp.publication_date = val + when 21 + jp.url = val + when 22 + jp.keywords = val + when 23 + jp.abstract = val + when 24 + jp.note = val + when 25 + jp.associated_project_translations = {"en" => val, "zh_tw" => val} + end + end + jp.member_profile = mp + jp.save + end + + def get_data_for_excel(year_start,year_end) + data = [] + roles = Role.where(:disabled => false, :title.ne => "", :title.ne => nil).asc(:key) + roles.each do |role| + d = {} + d["name"] = role.title + mps = role.member_profile_ids + d1 = DateTime.new(year_start,1,1,0,0) + d2 = DateTime.new(year_end,12,31,23,59) + d["data"] = ThesisGuidancePaper.where(:publication_date.gte => d1, :publication_date.lte => d2, :member_profile_id.in => mps) rescue [] + data << d + end + return data + end + + def get_chart_data(year_start,year_end,role,type) + case type + when "paper_type" + jls = ThesisGuidancePaperType.all + when "level_type" + jls = ThesisGuidanceLevel.all + when "author_type" + jls = ThesisGuidancePaperAuthorType.all + end + + finaldata = [] + role = Role.find(role) rescue nil + mps = [] + if !role.nil? + mps = role.member_profile_ids + end + jls.each do |jl| + data = {} + data["name"] = jl.title + data["data"] = {} + (year_start..year_end).each do |year| + d1 = DateTime.new(year,1,1,0,0) + d2 = DateTime.new(year,12,31,23,59) + t = jl.thesis_guidance_papers.where(:publication_date.gte => d1, :publication_date.lte => d2, :member_profile_id.in => mps).count rescue 0 + data["data"][year.to_s] = t + end + finaldata << data + end + data = {"name" => "N/A", "data" => {}} + (year_start..year_end).each do |year| + d1 = DateTime.new(year,1,1,0,0) + d2 = DateTime.new(year,12,31,23,59) + case type + when "paper_type" + t = ThesisGuidancePaper.where(:publication_date.gte => d1, :publication_date.lte => d2, :member_profile_id.in => mps, :thesis_guidance_paper_type_id => nil).count rescue 0 + when "level_type" + t = ThesisGuidancePaper.where(:publication_date.gte => d1, :publication_date.lte => d2, :member_profile_id.in => mps, :thesis_guidance_level_ids => nil).count rescue 0 + when "author_type" + t = ThesisGuidancePaper.where(:publication_date.gte => d1, :publication_date.lte => d2, :member_profile_id.in => mps, :thesis_guidance_paper_author_type_ids => nil).count rescue 0 + end + + data["data"][year.to_s] = t + end + finaldata << data + finaldata + end + +end + + + + + + + + + diff --git a/app/mailers/.keep b/app/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/.keep b/app/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/thesis_guidance_level.rb b/app/models/thesis_guidance_level.rb new file mode 100644 index 0000000..fa874cf --- /dev/null +++ b/app/models/thesis_guidance_level.rb @@ -0,0 +1,17 @@ +class ThesisGuidanceLevel + include Mongoid::Document + include Mongoid::Timestamps + + field :key, type: String + field :title, type: String, localize: true + + has_and_belongs_to_many :thesis_guidance_papers + + def self.from_id(id) + self.find(id) rescue nil + end + + def self.is_localized?(field_name) + self.fields[field_name.to_s].localized? + end +end diff --git a/app/models/thesis_guidance_paper.rb b/app/models/thesis_guidance_paper.rb new file mode 100644 index 0000000..fef38b4 --- /dev/null +++ b/app/models/thesis_guidance_paper.rb @@ -0,0 +1,323 @@ +class ThesisGuidancePaper + include Mongoid::Document + include Mongoid::Timestamps + include Mongoid::Attributes::Dynamic + include Admin::ThesisGuidancePapersHelper + include OrbitModel::Status + include MemberHelper + include Slug + HideTimeInLinK = (File.exist?("#{Rails.root}/hide_time_fields_for_plugins.txt") rescue false) + field :paper_title, as: :slug_title, type: String, localize: true + field :journal_title, type: String, localize: true + field :supervising_teacher, type: String, localize: true + field :degree, type: String, localize: true + field :graduation_semester, type: String, localize: true + field :graduation_year, type: String, localize: true + field :authors, type: String, localize: true + field :associated_project , type: String, localize: true + + field :year, type: String + field :language, type: String + field :isbn, type: String + field :vol_no, type: String + field :issue_no, type: String + field :form_to_start, type: String + field :form_to_end, type: String + field :total_pages, type: String + field :keywords, type: String + field :abstract, type: String + field :publication_date, type: DateTime + field :url, type: String + field :note, type: String + field :number_of_authors + field :rss2_id + + # paginates_per 10 + + #relations + field :member_profile_id, type: Array + + belongs_to :thesis_guidance_paper_type + has_and_belongs_to_many :thesis_guidance_types + + has_and_belongs_to_many :thesis_guidance_levels + + has_many :thesis_guidance_paper_files, autosave: true, dependent: :destroy + accepts_nested_attributes_for :thesis_guidance_paper_files, :allow_destroy => true + + # has_and_belongs_to_many :thesis_guidance_paper_authors, dependent: :destroy + # accepts_nested_attributes_for :thesis_guidance_paper_authors + + has_and_belongs_to_many :thesis_guidance_paper_author_types + + # after_save :save_thesis_guidance_paper_files, :save_thesis_guidance_paper_authors + + before_validation :add_http + # validates :paper_title, presence: true + index({year: -1, :publication_date => -1, _id: -1}, { unique: false, background: false }) + scope :sort_year_date, ->{ order_by(:year => "desc", :publication_date => "desc", :id=>"desc") } + scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc", :publication_date => "desc", :id=>"desc") } + + before_save :fix_member_profile_id + after_save :reload_member_profiles + + def fix_member_profile_id + org_member_profile_id = self[:member_profile_id] + if org_member_profile_id.class == Array + self.member_profile_id = self[:member_profile_id].map{|id| BSON::ObjectId(id)} + else + self.member_profile_id = Array(org_member_profile_id).compact.map{|id| BSON::ObjectId(id)} + end + true + end + def reload_member_profiles + @member_profiles = MemberProfile.where(:id.in=>self.member_profile_id).to_a + @member_profile = @member_profiles.first + return @member_profiles + end + + def create_link + title = [] + + title << self.authors if !self.authors.blank? + title << self.paper_title if self.paper_title.present? + title << self.journal_title if self.journal_title.present? + title << "vol. " + self.vol_no.strip if (self.vol_no.present? && self.vol_no != "0") + title << self.issue_no if (self.issue_no.present? && self.issue_no != "0") + title << "pp. " + self.form_to_start.to_s+"-"+self.form_to_end.to_s if (self.form_to_start.present? && self.form_to_start != "0") + # title << ( !self.thesis_guidance_levels.blank? ? "(#{self.thesis_guidance_levels.collect{|x| x.title}.join(', ')})" : nil) + unless HideTimeInLinK + if !self.publication_date.nil? + title << (self.publication_date.strftime("%b. %Y") rescue nil) + elsif self.year.present? + title << self.year + end + end + title.delete(nil) + title.join(', ').sub(/^\\s*,/,'').gsub(/,(\s*,)+/,',').strip + end + def form_to + if (self.form_to_start.present? && self.form_to_start != "0") + self.form_to_start.to_s+"-"+self.form_to_end.to_s + else + "" + end + end + def self.get_plugin_datas_to_member(datas) + page = Page.where(:module => "personal_thesis_guidance").first rescue nil + + if !page.nil? && page.custom_string_field == "table" + if !page.custom_array_field.blank? + fields_to_show = page.custom_array_field + else + fields_to_show = [ + "paper_title", + "journal_title", + "authors", + "year", + "issue_no", + "vol_no", + "level_type" + ] + end + else + fields_to_show = [ + "year", + "paper_title" + ] + end + + fields_to_remove = [] + + pd_title = [] + + fields_to_show.each do |t| + if (self.fields[t].type.to_s == "String" rescue false) + fields_to_remove << t if (datas.where(t.to_sym.ne => nil).or(t.to_sym.ne => "").count == 0 rescue false) + else + t2 = t + case t + when "form_to" + t2 = "form_to_start" + when "author_type" + t2 = "thesis_guidance_paper_author_types" + end + fields_to_remove << t if (datas.where(t2.to_sym.ne => nil).count == 0 rescue false) + end + pd_title << { + "plugin_data_title" => I18n.t("personal_thesis_guidance.#{t}") + } if !fields_to_remove.include?(t) + end + + fields_to_show = fields_to_show - fields_to_remove + + plugin_datas = datas.sort_for_frontend.collect do |p| + pd_data = [] + + p_keywords = p.keywords.to_s.strip rescue "" + rep_mark_html = "" + fields_to_show.each do |t| + if !page.nil? && page.custom_string_field == "table" + case t + when "paper_title" + link = OrbitHelper.url_to_plugin_show(p.to_param,'personal_thesis_guidance') + url_to_plugin_show_blank = OrbitHelper.instance_variable_get(:@url_to_plugin_show_blank) + tmp_title = p.paper_title + title_content = (url_to_plugin_show_blank ? tmp_title : "#{tmp_title}") + pd_data << { "data_title" => "#{title_content}#{rep_mark_html}".html_safe } + when "level_type" + pd_data << {"data_title" => ( !p.thesis_guidance_levels.blank? ? "(#{p.thesis_guidance_levels.collect{|x| x.title}.join(', ')})" : nil)} + when "publication_date" + pd_data << {"data_title" => (p.send(t).strftime("%Y/%m") rescue "")} + when "author_type" + pd_data << {"data_title" => (p.thesis_guidance_paper_author_types.collect{|jat| jat.title}.join(", ") rescue "")} + else + pd_data << {"data_title" => p.send(t)} + end + else + if t == "paper_title" + pd_data << { "data_title" => "#{p.create_link_tag_for_title}#{rep_mark_html}".html_safe } + else + pd_data << { "data_title" => p.send(t) } + end + end + end + + { + "pd_datas" => pd_data + } + end + + return [pd_title,plugin_datas] + end + + def create_link_tag_for_title + link = OrbitHelper.url_to_plugin_show(self.to_param,'personal_thesis_guidance') + url_to_plugin_show_blank = OrbitHelper.instance_variable_get(:@url_to_plugin_show_blank) + tmp_title = self.create_link + (url_to_plugin_show_blank ? tmp_title : "#{tmp_title}") + end + # def self.member_data + # members = MemberProfile.all + # member_data = [] + # members.each do |m| + # if (m.first_name || m.last_name) + # member_data << {"memberId" => m.id.to_s, "memberName" => m.name} + # else + # member_data << {"memberId" => m.id.to_s, "memberName" => "No Name"} + # end + # end + # member_data.to_json + # end + + # def save_thesis_guidance_paper_files + # self.thesis_guidance_paper_files.each do |t| + # if t.should_destroy + # t.destroy + # end + # end + # end + + # def save_thesis_guidance_paper_authors + # self.thesis_guidance_paper_authors.each do |t| + # if t.should_destroy + # t.destroy + # end + # end + # end + + def get_plugin_data(fields_to_show) + plugin_datas = [] + fields_to_show.each do |field| + plugin_data = self.get_plugin_field_data(field) rescue nil + next if plugin_data.blank? or plugin_data['value'].blank? + plugin_datas << plugin_data + end + plugin_datas + end + + def member_profiles + @member_profiles ||= MemberProfile.where(:id.in=>self.member_profile_id).to_a + @member_profiles + end + + def member_profiles=(mps) + self.member_profile_id = mps.map(&:id) + @member_profiles = mps + @member_profile = @member_profiles.first + @member_profiles + end + + def member_profile + @member_profile ||= MemberProfile.where(:id.in=>self.member_profile_id).first + @member_profile + end + + def member_profile=(mp) + if mp.class == MemberProfile + self.member_profile_id = [mp.id] + @member_profiles = [mp] + @member_profile = mp + else + self.member_profile_id = mp.map(&:id) + @member_profiles = mp + @member_profile = mp.first + end + end + + def get_plugin_field_data(field) + case field + when "level_type" + value = self.thesis_guidance_levels.collect{|level| level.title}.join(',') rescue "" + when "author_type" + value = self.thesis_guidance_paper_author_types.collect{|type| type.title}.join(',') rescue "" + when "paper_type" + value = self.thesis_guidance_paper_type.title rescue "" + when "author_name" + value = [] + ([I18n.locale]+(Site.first.in_use_locales-[I18n.locale])).each do |locale| + if self.member_profile.first_name_translations[locale] || self.member_profile.last_name_translations[locale] + value << "#{self.member_profile.first_name_translations[locale]} #{self.member_profile.last_name_translations[locale]}" + end + end + value = value.join(" / ") + when "publication_date" + value = self.publication_date.strftime("%Y-%m-%d") rescue "" + when "language" + value = I18n.t(self.language) if !self.language.nil? rescue "" + when "abstract" + value = nl2br(self.abstract) + when "file" + files = [] + self.thesis_guidance_paper_files.each do |file| + url = file.thesis_guidance_file.url + title = ((file.title.blank? ? File.basename(file.thesis_guidance_file.path) : file.title) rescue "") + files << (url.nil? ? "" : "
  • #{title}
  • ") + end + value = files.join("") + when "url" + value = self.url.to_s.blank? ? "" : "#{self.url}" + when "authors" + value = get_authors_show(self) rescue "" + else + value = self.send(field) rescue "" + end + + { + "key"=>field, + "title_class"=>"journal-#{field.gsub('_','-')}-field", + "value_class"=>"journal-#{field.gsub('_','-')}-value", + "title"=>I18n.t('personal_thesis_guidance.'+field), + "value"=>value + } + end + + protected + + def add_http + unless self.url.blank? || self.url[/^http:\/\//] || self.url[/^https:\/\//] + self.url = 'http://' + self.url + end + end + +end diff --git a/app/models/thesis_guidance_paper_author.rb b/app/models/thesis_guidance_paper_author.rb new file mode 100644 index 0000000..6892d55 --- /dev/null +++ b/app/models/thesis_guidance_paper_author.rb @@ -0,0 +1,15 @@ +class ThesisGuidancePaperAuthor + include Mongoid::Document + include Mongoid::Timestamps + + field :name, type: String, localize: true + field :email, type: String + field :should_destroy, type: Boolean + + has_and_belongs_to_many :thesis_guidance_papers + has_and_belongs_to_many :thesis_guidance_paper_author_types + + VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/ + validates :email, format: { with: VALID_EMAIL_REGEX }, + allow_blank: true +end diff --git a/app/models/thesis_guidance_paper_author_type.rb b/app/models/thesis_guidance_paper_author_type.rb new file mode 100644 index 0000000..3d3b3ba --- /dev/null +++ b/app/models/thesis_guidance_paper_author_type.rb @@ -0,0 +1,10 @@ +class ThesisGuidancePaperAuthorType + include Mongoid::Document + include Mongoid::Timestamps + + field :key, type: String + field :title, type: String, localize: true + + has_and_belongs_to_many :thesis_guidance_papers + has_and_belongs_to_many :thesis_guidance_paper_authors +end diff --git a/app/models/thesis_guidance_paper_file.rb b/app/models/thesis_guidance_paper_file.rb new file mode 100644 index 0000000..33e7b4a --- /dev/null +++ b/app/models/thesis_guidance_paper_file.rb @@ -0,0 +1,12 @@ +class ThesisGuidancePaperFile + include Mongoid::Document + include Mongoid::Timestamps + include Mongoid::Attributes::Dynamic + + field :description, type: String, localize: true + field :title, type: String, localize: true + field :should_destroy, type: Boolean + + mount_uploader :thesis_guidance_file, AssetUploader + belongs_to :thesis_guidance_paper +end diff --git a/app/models/thesis_guidance_paper_intro.rb b/app/models/thesis_guidance_paper_intro.rb new file mode 100644 index 0000000..9d2c2b0 --- /dev/null +++ b/app/models/thesis_guidance_paper_intro.rb @@ -0,0 +1,3 @@ +class ThesisGuidancePaperIntro < PersonalPluginIntro + +end diff --git a/app/models/thesis_guidance_paper_type.rb b/app/models/thesis_guidance_paper_type.rb new file mode 100644 index 0000000..c702c8c --- /dev/null +++ b/app/models/thesis_guidance_paper_type.rb @@ -0,0 +1,9 @@ +class ThesisGuidancePaperType + include Mongoid::Document + include Mongoid::Timestamps + + field :key, type: String + field :title, type: String, localize: true + + has_many :thesis_guidance_papers +end diff --git a/app/models/thesis_guidance_type.rb b/app/models/thesis_guidance_type.rb new file mode 100644 index 0000000..1891d1f --- /dev/null +++ b/app/models/thesis_guidance_type.rb @@ -0,0 +1,7 @@ +class ThesisGuidanceType + include Mongoid::Document + include Mongoid::Timestamps + + field :title, type: String, localize: true + +end diff --git a/app/views/.keep b/app/views/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/views/admin/thesis_guidance_levels/_form.html.erb b/app/views/admin/thesis_guidance_levels/_form.html.erb new file mode 100644 index 0000000..dc5cc6f --- /dev/null +++ b/app/views/admin/thesis_guidance_levels/_form.html.erb @@ -0,0 +1,24 @@ +<%= form_for(@paper_level, :html =>{:class=>"form-horizontal", :style=>"margin: 0;"}, :remote => true, :url => @url ) do |f| %> + + + + + +<% end %> \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_levels/_index.js.erb b/app/views/admin/thesis_guidance_levels/_index.js.erb new file mode 100644 index 0000000..051e6aa --- /dev/null +++ b/app/views/admin/thesis_guidance_levels/_index.js.erb @@ -0,0 +1,2 @@ +$('#paper_levels tbody').html("<%= j render :partial => '/admin/thesis_guidance_papers/list_level_type', :collection => @paper_levels %>"); +$('#paper_level_modal').modal('hide'); \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_levels/edit.js.erb b/app/views/admin/thesis_guidance_levels/edit.js.erb new file mode 100644 index 0000000..baee16d --- /dev/null +++ b/app/views/admin/thesis_guidance_levels/edit.js.erb @@ -0,0 +1 @@ +$('#paper_level_modal').html("<%= j render 'form' %>"); \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_levels/new.js.erb b/app/views/admin/thesis_guidance_levels/new.js.erb new file mode 100644 index 0000000..baee16d --- /dev/null +++ b/app/views/admin/thesis_guidance_levels/new.js.erb @@ -0,0 +1 @@ +$('#paper_level_modal').html("<%= j render 'form' %>"); \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_paper_author_types/_form.html.erb b/app/views/admin/thesis_guidance_paper_author_types/_form.html.erb new file mode 100644 index 0000000..0fbc2b5 --- /dev/null +++ b/app/views/admin/thesis_guidance_paper_author_types/_form.html.erb @@ -0,0 +1,24 @@ +<%= form_for(@author_type, :html =>{:class=>"form-horizontal", :style=>"margin: 0;"}, :remote => true, :url => @url ) do |f| %> + + + + + +<% end %> \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_paper_author_types/_list.js.erb b/app/views/admin/thesis_guidance_paper_author_types/_list.js.erb new file mode 100644 index 0000000..9553b8b --- /dev/null +++ b/app/views/admin/thesis_guidance_paper_author_types/_list.js.erb @@ -0,0 +1,2 @@ +$('#author_types tbody').html("<%= j render :partial => '/admin/thesis_guidance_papers/list_author_type', :collection => @author_types %>"); +$('#author_type_modal').modal('hide'); \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_paper_author_types/edit.js.erb b/app/views/admin/thesis_guidance_paper_author_types/edit.js.erb new file mode 100644 index 0000000..3ac7380 --- /dev/null +++ b/app/views/admin/thesis_guidance_paper_author_types/edit.js.erb @@ -0,0 +1 @@ +$('#author_type_modal').html("<%= j render 'form' %>"); \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_paper_author_types/new.js.erb b/app/views/admin/thesis_guidance_paper_author_types/new.js.erb new file mode 100644 index 0000000..3ac7380 --- /dev/null +++ b/app/views/admin/thesis_guidance_paper_author_types/new.js.erb @@ -0,0 +1 @@ +$('#author_type_modal').html("<%= j render 'form' %>"); \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_paper_types/_form.html.erb b/app/views/admin/thesis_guidance_paper_types/_form.html.erb new file mode 100644 index 0000000..088c71c --- /dev/null +++ b/app/views/admin/thesis_guidance_paper_types/_form.html.erb @@ -0,0 +1,24 @@ +<%= form_for(@paper_type, :html =>{:class=>"form-horizontal", :style=>"margin: 0;"}, :remote => true, :url => @url ) do |f| %> + + + + + +<% end %> \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_paper_types/_index.js.erb b/app/views/admin/thesis_guidance_paper_types/_index.js.erb new file mode 100644 index 0000000..3780a59 --- /dev/null +++ b/app/views/admin/thesis_guidance_paper_types/_index.js.erb @@ -0,0 +1,2 @@ +$('#paper_types tbody').html("<%= j render :partial => '/admin/thesis_guidance_papers/list_paper_type', :collection => @paper_types %>"); +$('#paper_type_modal').modal('hide'); \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_paper_types/edit.js.erb b/app/views/admin/thesis_guidance_paper_types/edit.js.erb new file mode 100644 index 0000000..e738913 --- /dev/null +++ b/app/views/admin/thesis_guidance_paper_types/edit.js.erb @@ -0,0 +1 @@ +$('#paper_type_modal').html("<%= j render 'form' %>"); \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_paper_types/new.js.erb b/app/views/admin/thesis_guidance_paper_types/new.js.erb new file mode 100644 index 0000000..e738913 --- /dev/null +++ b/app/views/admin/thesis_guidance_paper_types/new.js.erb @@ -0,0 +1 @@ +$('#paper_type_modal').html("<%= j render 'form' %>"); \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/_form.html.erb b/app/views/admin/thesis_guidance_papers/_form.html.erb new file mode 100644 index 0000000..7900e72 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/_form.html.erb @@ -0,0 +1,382 @@ +<% # encoding: utf-8 %> +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "lib/main-forms" %> + <%= stylesheet_link_tag "lib/fileupload" %> + <%= stylesheet_link_tag "lib/main-list" %> + <%= stylesheet_link_tag "lib/main-form-col2" %> +<% end %> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "lib/bootstrap-fileupload" %> + <%= javascript_include_tag "lib/file-type" %> + <%= javascript_include_tag "lib/module-area" %> + <%= javascript_include_tag "lib/bootstrap-datetimepicker.js" %> + <%= javascript_include_tag "lib/bootstrap-typeahead.js" %> + <%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %> + <%= javascript_include_tag "lib/datetimepicker/datetimepicker" %> +<% end %> +
    +
    <%= @thesis_guidance_paper.errors.full_messages.first if @thesis_guidance_paper.errors.any? %>
    +
    + +
    + + + + + + +
    + + <% @site_in_use_locales.each_with_index do |locale, i| %> + +
    "> + + +
    + +
    + <%= f.fields_for :paper_title_translations do |f| %> + <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_thesis_guidance.paper_title"), value: (@thesis_guidance_paper.paper_title_translations[locale] rescue nil) %> + <% end %> +
    +
    + + +
    + +
    + <%= f.fields_for :journal_title_translations do |f| %> + <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_thesis_guidance.journal_title"), value: (@thesis_guidance_paper.journal_title_translations[locale] rescue nil) %> + <% end %> +
    +
    + + +
    + +
    + <%= f.fields_for :supervising_teacher_translations do |f| %> + <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_thesis_guidance.supervising_teacher"), value: (@thesis_guidance_paper.supervising_teacher_translations[locale] rescue nil) %> + <% end %> +
    +
    + + +
    + +
    + <%= f.fields_for :degree_translations do |f| %> + <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_thesis_guidance.degree"), value: (@thesis_guidance_paper.degree_translations[locale] rescue nil) %> + <% end %> +
    +
    + + +
    + +
    + <%= f.fields_for :graduation_semester_translations do |f| %> + <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_thesis_guidance.graduation_semester"), value: (@thesis_guidance_paper.graduation_semester_translations[locale] rescue nil) %> + <% end %> +
    +
    + + +
    + +
    + <%= f.fields_for :graduation_year_translations do |f| %> + <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_thesis_guidance.graduation_year"), value: (@thesis_guidance_paper.graduation_year_translations[locale] rescue nil) %> + <% end %> +
    +
    + + +
    + +
    + <%= f.fields_for :authors_translations do |f| %> + <%= f.text_area locale, class: "ckeditor input-block-level", placeholder: t("personal_thesis_guidance.authors"), value: (@thesis_guidance_paper.authors_translations[locale] rescue nil) %> + <% end %> +
    +
    + +
    + + <% end %> + + +
    + +
    + + + <% if @thesis_guidance_paper && !@thesis_guidance_paper.thesis_guidance_paper_files.blank? %> +
    + <% @thesis_guidance_paper.thesis_guidance_paper_files.each_with_index do |writing_thesis_guidance_file, i| %> + <%= f.fields_for :thesis_guidance_paper_files, writing_thesis_guidance_file do |f| %> + <%= render :partial => 'form_file', :object => writing_thesis_guidance_file, :locals => {:f => f, :i => i} %> + <% end %> + <% end %> +
    +
    + <% end %> + + +
    +
    +

    + <%= hidden_field_tag 'plugin_file_field_count', @thesis_guidance_paper.thesis_guidance_paper_files.count %> + <%= t(:add) %> +

    + +
    +
    +
    + + + + + +
    + + +
    + +
    + +
    + <% if !@member.nil? %> + <%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'author_members[]', email_members:@member} %> + <% else %> + <%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'author_members[]', email_members:[]} %> + <% end %> +
    +
    + + +
    + +
    + <%= select_year((@thesis_guidance_paper.year ? @thesis_guidance_paper.year.to_i : DateTime.now.year), {:start_year => (DateTime.now.year+5), :end_year => 1930}, {:name => 'thesis_guidance_paper[year]', :class => "span1"} ) %> +
    +
    + + +
    + +
    + +
    +
    + + +
    + +
    + <%= f.text_field :vol_no %> +
    +
    + + +
    + +
    + <%= f.text_field :issue_no %> +
    +
    + + +
    + +
    + <%= f.text_field :form_to_start, :class=>'span1' %> ~ <%= f.text_field :form_to_end, :class=>'span1' %> +
    +
    + + +
    + +
    + <%= f.text_field :total_pages %> +
    +
    + + +
    + +
    + <% @thesis_guidance_levels.each do |level_type| %> + <%= content_tag :label,:class => "checkbox inline" do -%> + <%= check_box_tag 'thesis_guidance_paper[thesis_guidance_level_ids][]', level_type.id, @thesis_guidance_paper.thesis_guidance_level_ids.include?(level_type.id)%> + <%= level_type.title %> + <%= hidden_field_tag 'thesis_guidance_paper[thesis_guidance_level_ids][]', '' %> + <% end %> + <% end %> +
    +
    + + +
    + +
    + <%= f.select :thesis_guidance_type_ids, @thesis_guidance_types.collect {|t| [ t.title, t.id ]}, {include_blank: ''}, {multiple: true, :class => "span3"} %> +
    +
    + + +
    + +
    + <%= f.select :thesis_guidance_paper_type_id, @paper_types.collect {|t| [ t.title, t.id ]}, :class => "span3" %> +
    +
    + + +
    + +
    + <% @author_types.each do |author_type| %> + <%= content_tag :label,:class => "checkbox inline" do -%> + <%= check_box_tag 'thesis_guidance_paper[thesis_guidance_paper_author_type_ids][]', author_type.id, @thesis_guidance_paper.thesis_guidance_paper_author_type_ids.include?(author_type.id)%> + <%= author_type.title %> + <% end %> + <% end %> +
    +
    + + +
    + +
    + <%= f.text_field :number_of_authors, :class=>'span1' %> +
    +
    + + +
    + +
    + <%= f.text_field :isbn %> +
    +
    + + +
    + +
    + <%= f.datetime_picker :publication_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD", :value => @thesis_guidance_paper.publication_date, :new_record => @thesis_guidance_paper.new_record? %> +
    +
    + + +
    + +
    + <%= f.text_field :url , :class => "span6" %> +
    +
    + + +
    + +
    + <%= f.text_field :keywords %> +
    +
    + + +
    + +
    + <%= f.text_area :abstract, rows: 2, class: "input-block-level" %> +
    +
    + + +
    + +
    + <%= f.text_area :note, rows: 2, class: "input-block-level" %> +
    +
    + + +
    + +
    + <%= f.text_field :associated_project %> +
    +
    + +
    + + +
    + + +
    + +
    + +
    +
    + +
    + +
    + +
    + + +
    + + <%= f.submit t('submit'), class: 'btn btn-primary' %> + <%= link_to t('cancel'), get_go_back, :class=>"btn" %> +
    + \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/_form_author.html.erb b/app/views/admin/thesis_guidance_papers/_form_author.html.erb new file mode 100644 index 0000000..65f794f --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/_form_author.html.erb @@ -0,0 +1,39 @@ +<% if form_author.new_record? %> +
    +<% else %> +
    + <% if form_author.name.present? %> + <%= form_author.name %> + <% end %> +<% end %> +
    + + + + <% @site_in_use_locales.each_with_index do |locale, i| %> + <%= locale %>"> + <%= f.fields_for :name_translations do |f| %> + <%= f.text_field locale, :class => "input-medium", placeholder: t(:name), :value => (form_author.name_translations[locale] rescue nil) %> + <% end %> + + <% end %> + + + <% if form_author.new_record? %> + + + + <% else %> + + <%= f.hidden_field :id %> + + <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> + + <% end %> +
    +
    \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/_form_file.html.erb b/app/views/admin/thesis_guidance_papers/_form_file.html.erb new file mode 100644 index 0000000..bd18a10 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/_form_file.html.erb @@ -0,0 +1,45 @@ +<% if form_file.new_record? %> +
    +<% else %> +
    + <% if form_file.thesis_guidance_file.blank? %> + <%= t(:no_file) %> + <% else %> + <%= link_to content_tag(:i) + form_file.thesis_guidance_file_identifier, form_file.thesis_guidance_file.url, {:class => 'file-link file-type', :target => '_blank', :title => form_file.thesis_guidance_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 %> + + + <% 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/thesis_guidance_papers/_list_author_type.html.erb b/app/views/admin/thesis_guidance_papers/_list_author_type.html.erb new file mode 100644 index 0000000..d815af9 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/_list_author_type.html.erb @@ -0,0 +1,10 @@ +<% # encoding: utf-8 %> + + + <%= list_author_type.title %> + + + <%= t(:edit) %> + <%= link_to t(:delete_), admin_thesis_guidance_paper_author_type_path(list_author_type), "data-confirm" => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %> + + diff --git a/app/views/admin/thesis_guidance_papers/_list_journal_type.html.erb b/app/views/admin/thesis_guidance_papers/_list_journal_type.html.erb new file mode 100644 index 0000000..ac4be1a --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/_list_journal_type.html.erb @@ -0,0 +1,10 @@ +<% # encoding: utf-8 %> + + + <%= list_thesis_guidance_type.title %> + + + <%= t(:edit) %> + <%= link_to t(:delete_), admin_thesis_guidance_type_path(list_thesis_guidance_type), "data-confirm" => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %> + + \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/_list_level_type.html.erb b/app/views/admin/thesis_guidance_papers/_list_level_type.html.erb new file mode 100644 index 0000000..6d6de51 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/_list_level_type.html.erb @@ -0,0 +1,10 @@ +<% # encoding: utf-8 %> + + + <%= list_level_type.title %> + + + <%= t(:edit) %> + <%= link_to t(:delete_), admin_thesis_guidance_level_path(list_level_type), "data-confirm" => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %> + + \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/_list_paper_type.html.erb b/app/views/admin/thesis_guidance_papers/_list_paper_type.html.erb new file mode 100644 index 0000000..d57e7e9 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/_list_paper_type.html.erb @@ -0,0 +1,10 @@ +<% # encoding: utf-8 %> + + + <%= list_paper_type.title %> + + + <%= t(:edit) %> + <%= link_to t(:delete_), admin_thesis_guidance_paper_type_path(list_paper_type), "data-confirm" => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %> + + \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/_writing_journal.html.erb b/app/views/admin/thesis_guidance_papers/_writing_journal.html.erb new file mode 100644 index 0000000..e0b7856 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/_writing_journal.html.erb @@ -0,0 +1,19 @@ +<% @writing_thesis_guidances.each do |writing_journal| %> + + <%= writing_journal.year %> + + + + <%= "#{Nokogiri::HTML(writing_journal.create_link).text}" %> + + +
    + +
    + + <%= get_member_show(writing_journal).html_safe %> + +<% end %> \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/analysis.html.erb b/app/views/admin/thesis_guidance_papers/analysis.html.erb new file mode 100644 index 0000000..f8f8c69 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/analysis.html.erb @@ -0,0 +1,116 @@ +<% # encoding: utf-8 %> +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "lib/main-forms" %> + <%= stylesheet_link_tag "lib/fileupload" %> + <%= stylesheet_link_tag "lib/main-list" %> + <%= stylesheet_link_tag "lib/main-form-col2" %> + +<% end %> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "//www.google.com/jsapi", "chartkick"%> + <%= javascript_include_tag "justgage.1.0.1.min" %> + <%= javascript_include_tag "raphael.2.1.0.min" %> + <%= javascript_include_tag "validator" %> +<% end %> +
    +
    +
    +
    +
    + +
    + <%= select_year(DateTime.now.year - 5, {:start_year => DateTime.now.year, :end_year => 1950}, {:name => 'start_year', :class => "span1"} ) %> + - + <%= select_year(DateTime.now.year, {:start_year => DateTime.now.year, :end_year => 1950}, {:name => 'end_year', :class => "span1"} ) %> +
    +
    +
    + +
    + <%= t("personal_thesis_guidance.paper_type") %> + <%= t("personal_thesis_guidance.level_type") %> + <%= t("personal_thesis_guidance.author_type") %> +
    +
    +
    +
    + + Export +
    +
    +
    +
    + <% Role.where(:disabled => false, :title.ne => "", :title.ne => nil).asc(:key).each do |role| %> +
    +

    <%= role.title %>

    +
    + loading +
    +
    + <% end %> +
    +
    + + + + + diff --git a/app/views/admin/thesis_guidance_papers/analysis_report.html.erb b/app/views/admin/thesis_guidance_papers/analysis_report.html.erb new file mode 100644 index 0000000..b4e8aa4 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/analysis_report.html.erb @@ -0,0 +1 @@ +<%= column_chart @data, :id => params[:role_id], :height => "350px", :xtitle => "Year", :ytitle => "Total number" %> \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/destroy.js.erb b/app/views/admin/thesis_guidance_papers/destroy.js.erb new file mode 100644 index 0000000..2c122c6 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/destroy.js.erb @@ -0,0 +1 @@ +$("#<%= dom_id @thesis_guidance_paper %>").remove(); \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/download_excel.xlsx.axlsx b/app/views/admin/thesis_guidance_papers/download_excel.xlsx.axlsx new file mode 100644 index 0000000..c4c2d3a --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/download_excel.xlsx.axlsx @@ -0,0 +1,96 @@ +# encoding: utf-8 + +wb = xlsx_package.workbook +@data.each_with_index do |role,idx| + data = role["data"] + wb.add_worksheet(name: role["name"] + "-" + idx.to_s) do |sheet| + + heading = sheet.styles.add_style(:b => true, :locked => true) + + row = ["Name"] + + @site_in_use_locales.each do |locale| + row << t("personal_thesis_guidance.paper_title") + " - " + t(locale.to_s) + end + + @site_in_use_locales.each do |locale| + row << t("personal_thesis_guidance.journal_title") + " - " + t(locale.to_s) + end + + @site_in_use_locales.each do |locale| + row << t("personal_thesis_guidance.authors") + " - " + t(locale) + end + + row << t("personal_thesis_guidance.year") + + row << t("personal_thesis_guidance.language") + + row << t("personal_thesis_guidance.vol_no") + + row << t("personal_thesis_guidance.issue_no") + + row << t("personal_thesis_guidance.form_to_start") + + row << t("personal_thesis_guidance.form_to_end") + + row << t("personal_thesis_guidance.total_pages") + + row << t("personal_thesis_guidance.level_type") + + row << t("personal_thesis_guidance.paper_type") + + row << t("personal_thesis_guidance.author_type") + + row << t("personal_thesis_guidance.number_of_authors") + + row << t("personal_thesis_guidance.isbn") + + row << t("personal_thesis_guidance.publication_date") + + row << t("personal_thesis_guidance.url") + + row << t("personal_thesis_guidance.keywords") + + row << t("personal_thesis_guidance.abstract") + + row << t("personal_thesis_guidance.note") + + row << t("personal_thesis_guidance.associated_project") + + sheet.add_row row, :style => heading + + data.each do |jp| + row = [(jp.member_profile_id.class == Array ? jp.member_profile_id.map{|member_id| MemberProfile.find(member_id).name rescue ""} : [jp.member_profile.name])] + @site_in_use_locales.each do |locale| + row << jp.paper_title_translations[locale.to_s] + end + @site_in_use_locales.each do |locale| + row << jp.journal_title_translations[locale.to_s] + end + @site_in_use_locales.each do |locale| + row << jp.authors_translations[locale.to_s] + end + row << jp.year + row << jp.language + row << jp.vol_no + row << jp.issue_no + row << jp.form_to_start + row << jp.form_to_end + row << jp.total_pages + row << (jp.thesis_guidance_levels.map{|jl| jl.title}.join(", ") rescue "") + row << (jp.thesis_guidance_paper_type.title rescue "") + row << (jp.thesis_guidance_paper_author_types.map{|jl| jl.title}.join(", ") rescue "") + row << jp.number_of_authors + row << jp.isbn + row << jp.publication_date.strftime("%Y-%m-%d") rescue "" + row << jp.url + row << jp.keywords + row << jp.abstract + row << jp.note + row << jp.associated_project + sheet.add_row row + end + end +end + + diff --git a/app/views/admin/thesis_guidance_papers/edit.html.erb b/app/views/admin/thesis_guidance_papers/edit.html.erb new file mode 100644 index 0000000..10b3283 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/edit.html.erb @@ -0,0 +1,5 @@ +<%= form_for @thesis_guidance_paper, url: admin_thesis_guidance_paper_path(@thesis_guidance_paper), html: {class: "form-horizontal main-forms previewable"} do |f| %> +
    + <%= render partial: 'form', locals: {f: f} %> +
    +<% end %> \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/excel_format.xlsx.axlsx b/app/views/admin/thesis_guidance_papers/excel_format.xlsx.axlsx new file mode 100644 index 0000000..d130223 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/excel_format.xlsx.axlsx @@ -0,0 +1,153 @@ +# encoding: utf-8 + +wb = xlsx_package.workbook + +wb.add_worksheet(name: "Thesis Guidance") do |sheet| + + heading = sheet.styles.add_style(:b => true, :locked => true) + example = sheet.styles.add_style(:i => true) + + row = ["user_id"] + row1 = [""] + row2 = [""] + + row << "name" + row1 << "" + row2 << "" + + row << t("personal_thesis_guidance.paper_title") + " - " + t("en") + row1 << "textfield" + row2 << "" + row << t("personal_thesis_guidance.paper_title") + " - " + t("zh_tw") + row1 << "textfield" + row2 << "" + + row << t("personal_thesis_guidance.journal_title") + " - " + t("en") + row1 << "textfield" + row2 << "" + row << t("personal_thesis_guidance.journal_title") + " - " + t("zh_tw") + row1 << "textfield" + row2 << "" + + row << t("personal_thesis_guidance.authors") + " - " + t("en") + row1 << "textarea" + row2 << "" + row << t("personal_thesis_guidance.authors") + " - " + t("zh_tw") + row1 << "textarea" + row2 << "" + + row << t("personal_thesis_guidance.year") + row1 << "number" + row2 << "Example : 2015 or 2014 or 1987" + + row << t("personal_thesis_guidance.language") + row1 << "select" + row2 << "en -> English, zh_tw -> Chinese" + + row << t("personal_thesis_guidance.vol_no") + row1 << "textfield" + row2 << "" + + row << t("personal_thesis_guidance.issue_no") + row1 << "textfield" + row2 << "" + + row << t("personal_thesis_guidance.form_to_start") + row1 << "number" + row2 << "Example: 11 or 21" + + row << t("personal_thesis_guidance.form_to_end") + row1 << "number" + row2 << "Example: 13 or 23" + + row << t("personal_thesis_guidance.total_pages") + row1 << "number" + row2 << "Example: 10 or 20 or 100" + + row << t("personal_thesis_guidance.level_type") + row1 << "checkbox" + t = "" + ThesisGuidanceLevel.asc(:created_at).each_with_index do |jl,i| + t = t + "#{i}" + " -> " + jl.title + ", " + end + if ThesisGuidanceLevel.count > 0 + t = t + " Example : 0, if more than one then : 0,1" + else + t = "Leave this field blank" + end + row2 << t + + row << t("personal_thesis_guidance.paper_type") + row1 << "select" + t = "" + ThesisGuidancePaperType.asc(:created_at).each_with_index do |jl,i| + t = t + "#{i}" + " -> " + jl.title + ", " + end + if ThesisGuidancePaperType.count > 0 + t = t + " Example : 0" + else + t = "Leave this field blank" + end + row2 << t + + row << t("personal_thesis_guidance.author_type") + row1 << "checkbox" + t = "" + ThesisGuidancePaperAuthorType.asc(:created_at).each_with_index do |jl,i| + t = t + "#{i}" + " -> " + jl.title + ", " + end + if ThesisGuidancePaperAuthorType.count > 0 + t = t + " Example : 0, if more than one then : 0,1" + else + t = "Leave this field blank" + end + row2 << t + + row << t("personal_thesis_guidance.number_of_authors") + row1 << "number" + row2 << "Example: 1 or 2 or 10" + + row << t("personal_thesis_guidance.isbn") + row1 << "textfield" + row2 << "" + + row << t("personal_thesis_guidance.publication_date") + row1 << "date" + row2 << "Format: YYYY/MM/DD, Example: 2015/12/10" + + row << t("personal_thesis_guidance.url") + row1 << "textfield" + row2 << "http://domain.com/path" + + row << t("personal_thesis_guidance.keywords") + row1 << "textfield" + row2 << "Example: keyword1,keyword2" + + row << t("personal_thesis_guidance.abstract") + row1 << "textarea" + row2 << "" + + row << t("personal_thesis_guidance.note") + row1 << "textarea" + row2 << "" + + row << t("personal_thesis_guidance.associated_project") + row1 << "textfield" + row2 << "" + + + + sheet.add_row row, :style => heading + sheet.add_row row1 + sheet.add_row row2, :style => example + + User.where(:user_name.ne => "rulingcom").each do |user| + + r = [user.user_name] + r << user.name + + sheet.add_row r + end + + +end diff --git a/app/views/admin/thesis_guidance_papers/frontend_setting.html.erb b/app/views/admin/thesis_guidance_papers/frontend_setting.html.erb new file mode 100644 index 0000000..17a8df2 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/frontend_setting.html.erb @@ -0,0 +1,94 @@ +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "lib/main-forms" %> + <%= stylesheet_link_tag "lib/main-list" %> +<% end %> + +<%= form_for(:thesis_guidance_paper_intro, :url => update_frontend_setting_admin_thesis_guidance_papers_path, :method => "post", html: {class: "form-horizontal main-forms previewable"} ) do |f| %> +
    + +
    + + + + + + +
    + +
    + <% if !@member.blank? %> +
    + +
    + <%= @member.name rescue ''%> + <%= f.hidden_field :member_profile_id, :value => @member.id %> +
    +
    + <% end %> + +
    + +
    + <%= f.check_box :brief_intro, :checked => @intro.brief_intro %> <%= t("personal_plugins.brief_intro") %> + <%= f.check_box :complete_list, :checked => @intro.complete_list %> <%= t("personal_plugins.complete_list") %> +
    +
    +
    +
    + + + + + + +
    + + <% @site_in_use_locales.each_with_index do |locale, i| %> + +
    "> + + +
    + +
    +
    + <%= f.fields_for :text_translations do |f| %> + <%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@intro.text_translations[locale] rescue nil) %> + <% end %> +
    +
    +
    + + +
    + + <% end %> + + + +
    + + + +
    + + +
    + <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> + <%= hidden_field_tag :member_profile_id, @member.id.to_s %> + <%= f.submit t('submit'), class: 'btn btn-primary' %> + <%= link_to t('cancel'), get_go_back, :class=>"btn" %> +
    +
    +<% end %> \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/index.html.erb b/app/views/admin/thesis_guidance_papers/index.html.erb new file mode 100644 index 0000000..7cee763 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/index.html.erb @@ -0,0 +1,53 @@ + + +<%= render_filter nil, "tbody_writing_thesis_guidances" %> + + + + + + + + + + <%= render 'writing_journal' %> + +
    <%= t('personal_thesis_guidance.year') %><%= t('module_name.thesis_guidance_paper') %><%= t("personal_plugins.author") %>
    + +
    +
    +
    + + + +
    + <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:new_), new_admin_thesis_guidance_paper_path, :class => 'btn btn-primary' %> + <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), admin_writing_journal_setting_path, :class => 'btn btn-primary pull-right' %> +
    + +
    +<% if params[:error] == "1" %> + +<% end %> \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/index_js.html.erb b/app/views/admin/thesis_guidance_papers/index_js.html.erb new file mode 100644 index 0000000..6a82617 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/index_js.html.erb @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/merge.html.erb b/app/views/admin/thesis_guidance_papers/merge.html.erb new file mode 100644 index 0000000..c15a7f2 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/merge.html.erb @@ -0,0 +1,118 @@ +<%= csrf_meta_tags %> +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "lib/main-forms" %> + <%= stylesheet_link_tag "lib/fileupload" %> + <%= stylesheet_link_tag "lib/main-list" %> + <%= stylesheet_link_tag "lib/main-form-col2" %> + +<% end %> + + +
    + <%= t('strict_compare_mode') +':' %> + + <% if params['mode']!='simple' %> + <%= t('yes_') %> + <% else %> + <%= t('no_') %> + <% end %> + +
    +
    +
    +<%= token_tag(nil) %> + + + + + +<% if params['mode']!='simple' %> + + + + +<% end %> + + + + + +<% @journals.each do |key,journals| %> + + <% if params['mode']=='simple' + len = journals.length + else + len = journals.values.reduce(0){|sum,num| sum+num.length} + end + %> + + + <% if params['mode']=='simple' %> + + <% journals.each_with_index do |journal,i| %> + + <% if len!=(i+1) %> + + + <% end %> + <% end %> + <% else %> + <% i=0 %> + <% journals.each do |k,v| %> + <% len1 = v.length %> + <% k.each do |keychild| %> + + <% end %> + + <% v.each_with_index do |journal_child,index1| %> + + <% if len1!=index1 %> + + + <% end %> + <% end %> + <% if len1!=(i+1) %> + + + <% end %> + <% i =i+1 %> + <% end %> + <% end %> + +<% end %> + +
    <%= t('personal_thesis_guidance.paper_title') %><%= t('personal_thesis_guidance.journal_title') %><%= t('personal_thesis_guidance.level_type') %><%= t('personal_thesis_guidance.author_type') %><%= t('personal_thesis_guidance.paper_type') %><%= t('personal_thesis_guidance.publication_date') %><%= t("personal_thesis_guidance.merge") %><%= t("personal_plugins.author") %>
    + <%= key[0].values.map{|v| v=="" ? t('personal_thesis_guidance.no_input') : v}.join('/') rescue t('personal_thesis_guidance.no_input') %> + + <%= key[1].values.map{|v| v=="" ? t('personal_thesis_guidance.no_input') : v}.join('/') rescue t('personal_thesis_guidance.no_input') %> + + + + + <%= get_member(journal).collect(&:name).join(' / ') rescue t('personal_thesis_guidance.no_input') %> + +
    + <%= keychild.to_s.blank? ? t('personal_thesis_guidance.no_input') : keychild %> + + + + + <%= get_member(journal_child).collect(&:name).join(' / ') rescue t('personal_thesis_guidance.no_input') %> + +
    +
    \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/new.html.erb b/app/views/admin/thesis_guidance_papers/new.html.erb new file mode 100644 index 0000000..2527f43 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/new.html.erb @@ -0,0 +1,5 @@ +<%= form_for @thesis_guidance_paper, url: admin_thesis_guidance_papers_path, html: {class: "form-horizontal main-forms previewable"} do |f| %> +
    + <%= render partial: 'form', locals: {f: f} %> +
    +<% end %> \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_papers/setting.html.erb b/app/views/admin/thesis_guidance_papers/setting.html.erb new file mode 100644 index 0000000..8f37d01 --- /dev/null +++ b/app/views/admin/thesis_guidance_papers/setting.html.erb @@ -0,0 +1,149 @@ + + +
    +
    +
    +

    + <%= t('add')%> + <%= t("personal_thesis_guidance.paper_type") %> +

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + <%= render :partial => 'list_paper_type', :collection => @paper_types %> + +
    +
    +
    +
    +
    +
    + +
    +
    +

    + <%= t('add')%> + <%= t("personal_thesis_guidance.level_type") %> +

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + <%= render :partial => 'list_level_type', :collection => @thesis_guidance_levels %> + +
    +
    +
    +
    +
    +
    + +
    +
    +

    + <%= t('add')%> + <%= t("personal_thesis_guidance.author_type") %> +

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + <%= render :partial => 'list_author_type', :collection => @author_types %> + +
    +
    +
    +
    +
    +
    + +
    +
    +

    + <%= t('add')%> + <%= t("personal_thesis_guidance.thesis_guidance_type") %> +

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + <%= render :partial => 'list_thesis_guidance_type', :collection => @thesis_guidance_types %> + +
    +
    +
    +
    +
    +
    +
    + +
    + +
    + +
    + +
    + +
    + +
    + + +
    + +
    \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_types/_form.html.erb b/app/views/admin/thesis_guidance_types/_form.html.erb new file mode 100644 index 0000000..699610c --- /dev/null +++ b/app/views/admin/thesis_guidance_types/_form.html.erb @@ -0,0 +1,24 @@ +<%= form_for(@thesis_guidance_type, :html =>{:class=>"form-horizontal", :style=>"margin: 0;"}, :remote => true, :url => @url ) do |f| %> + + + + + +<% end %> \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_types/_list.js.erb b/app/views/admin/thesis_guidance_types/_list.js.erb new file mode 100644 index 0000000..22ecb20 --- /dev/null +++ b/app/views/admin/thesis_guidance_types/_list.js.erb @@ -0,0 +1,2 @@ +$('#thesis_guidance_types tbody').html("<%= j render :partial => '/admin/thesis_guidance_papers/list_thesis_guidance_type', :collection => @thesis_guidance_types %>"); +$('#thesis_guidance_type_modal').modal('hide'); \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_types/edit.js.erb b/app/views/admin/thesis_guidance_types/edit.js.erb new file mode 100644 index 0000000..8f59ef7 --- /dev/null +++ b/app/views/admin/thesis_guidance_types/edit.js.erb @@ -0,0 +1 @@ +$('#thesis_guidance_type_modal').html("<%= j render 'form' %>"); \ No newline at end of file diff --git a/app/views/admin/thesis_guidance_types/new.js.erb b/app/views/admin/thesis_guidance_types/new.js.erb new file mode 100644 index 0000000..8f59ef7 --- /dev/null +++ b/app/views/admin/thesis_guidance_types/new.js.erb @@ -0,0 +1 @@ +$('#thesis_guidance_type_modal').html("<%= j render 'form' %>"); \ No newline at end of file diff --git a/app/views/personal_thesis_guidances/get_fields_for_index.html.erb b/app/views/personal_thesis_guidances/get_fields_for_index.html.erb new file mode 100644 index 0000000..e088fb2 --- /dev/null +++ b/app/views/personal_thesis_guidances/get_fields_for_index.html.erb @@ -0,0 +1,48 @@ +<% if !@page.nil? %> +
    +
    +
      + <% if @page.custom_array_field.blank? %> + <% @default_fields_to_show.each do |fs| %> +
    • <%= t("personal_thesis_guidance.#{fs}") %>
    • + <% end %> + <% else %> + <% @page.custom_array_field.each do |fs| %> +
    • <%= t("personal_thesis_guidance.#{fs}") %>
    • + <% end %> + <% end %> +
    +
    + +
    + +
    + +
    + <%= select_tag "fields_to_show_for_pp", options_for_select(@fields_to_show), prompt: "---Select something---" %> +
    +
    + Add Field + + +
    +
    + +<% else %> +

    Page not found.

    +<% end %> \ No newline at end of file diff --git a/app/views/personal_thesis_guidances/index.html.erb b/app/views/personal_thesis_guidances/index.html.erb new file mode 100644 index 0000000..832b54c --- /dev/null +++ b/app/views/personal_thesis_guidances/index.html.erb @@ -0,0 +1 @@ +<%= render_view%> \ No newline at end of file diff --git a/app/views/personal_thesis_guidances/show.html.erb b/app/views/personal_thesis_guidances/show.html.erb new file mode 100644 index 0000000..648b75c --- /dev/null +++ b/app/views/personal_thesis_guidances/show.html.erb @@ -0,0 +1 @@ +<%= render_view %> \ No newline at end of file diff --git a/app/views/plugin/personal_thesis_guidance/_profile.html.erb b/app/views/plugin/personal_thesis_guidance/_profile.html.erb new file mode 100644 index 0000000..9310d3f --- /dev/null +++ b/app/views/plugin/personal_thesis_guidance/_profile.html.erb @@ -0,0 +1,85 @@ +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "lib/list-check" %> +<% end %> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "lib/list-check" %> +<% end %> +<% + if has_access? + @writing_thesis_guidances = ThesisGuidancePaper.where(member_profile_id: @member.id).sort_year_date.page(params[:page]).per(10) + else + @writing_thesis_guidances = ThesisGuidancePaper.where(is_hidden: false, member_profile_id: @member.id).sort_year_date.page(params[:page]).per(10) + end +%> +<% if has_access? %> +
    +
    + <%= link_to('Hide', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-hide", :rel => toggle_hide_admin_thesis_guidance_papers_path(member_profile_id: @member.id.to_s, disable: 'true') ) %> + <%= link_to('Show', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-show", :rel => toggle_hide_admin_thesis_guidance_papers_path(member_profile_id: @member.id.to_s, disable: 'false') ) %> +
    +
    +<% end -%> + + + + <% if has_access? %> + + <% end -%> + + + <% if not @user%> + + <% end %> + + + + + <% @writing_thesis_guidances.each do |writing_journal| %> + + "> + <% if has_access? %> + + <% end -%> + + + + + + <% end %> + +
    <%= t('personal_thesis_guidance.year') %><%= t('module_name.thesis_guidance_paper') %><%= t('personal_thesis_guidance.authors') %>
    + <%= check_box_tag 'to_change[]', writing_journal.id.to_s, false, :class => "list-check" %> + <%= writing_journal.year %> + <% link = OrbitHelper.url_to_plugin_show(writing_journal.to_param,'personal_thesis_guidance') %> + <%= (link =='#') ? writing_journal.create_link : link_to(writing_journal.create_link, link, target: "blank") %> +
    + +
    +
    <%= writing_journal.authors %>
    +
    + <% if has_access? %> +
    + <%= link_to content_tag(:i, nil, :class => 'icon-edit') +' '+ t('setting'),'/admin/members/'+@member.to_param+'/thesis_guidance_papers/frontend_setting', :class => 'btn btn-primary' %> + <%= link_to content_tag(:i, nil, :class => 'icon-plus') +' '+ t('new_'), + '/admin/members/'+@member.to_param+'/thesis_guidance_papers/new', :class => 'btn btn-primary' %> +
    + <% end %> + +
    + diff --git a/bin/rails b/bin/rails new file mode 100644 index 0000000..415de71 --- /dev/null +++ b/bin/rails @@ -0,0 +1,16 @@ +#!/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/personal_thesis_guidance/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 "action_controller/railtie" +require "action_mailer/railtie" +require "sprockets/railtie" +require "rails/test_unit/railtie" +require "mongoid" +require 'rails/engine/commands' \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..7dbfdc1 --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,70 @@ +en: + module_name: + personal_thesis_guidance: Thesis Guidance + thesis_guidance_paper: Thesis Guidance + personal_thesis_guidance: + merge: Merge + upload: Upload + no_input: No Input + select_class: "——select class——" + search_class: "search class:" + word_to_search: "word to search:" + paper_title : "Paper Title" + associated_project: Associated Project + paper_type : "Paper Type" + number_of_authors: "Number of Authors" + journal_title : "Journal Title" + supervising_teacher : "Supervising Teacher" + degree : "Degree" + graduation_semester : "Graduation Semester" + graduation_year : "Graduation Year" + authors : "Authors" + author: "Author" + author_name: "Author Name" + co-authors: "Co-Authors" + tags : "Tags" + year : "Year" + language : "Language" + isbn : "ISSN(ISBN)" + vol_no : "Vol.No" + issue_no : "Issue.No" + form_to: "Page(s)" + form_to_start : "From" + form_to_end : "To" + total_pages : "Total Pages" + keywords : "Keywords" + abstract : "Abstract" + publication_date : "Date of Publication" + url : "Reference URL" + note : "Note" + level_type : "Level Type" + author_type : "Author Type" + from : "From" + to : "To" + graph_by : "Graph by" + file : "File" + file_name : "File name" + description : "File Description" + graph_by : "Graph By" + frontend: + writing_thesis_guidances: "Thesis Guidance Front-end" + thesis_guidance_type: Journal Name + strict_compare_mode: Strict Compare mode + create_success : "Successfully Create" + update_success : "Successfully Update" + delete_success : "Successfully Delete" + add: "Add" + back: "Back" + delete: "Delete" + edit: "Edit" + nothing: "Nothing" + show: "Show" + sure?: "Are you sure?" + update: "Update" + yes_: "Yes" + no_: "No" + cancel : "Cancel" + save: "Save" + hintText: "Type in a search term" + noResultsText: "No results" + searchingText: "Searching…" \ No newline at end of file diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml new file mode 100644 index 0000000..0458de9 --- /dev/null +++ b/config/locales/zh_tw.yml @@ -0,0 +1,69 @@ +zh_tw: + module_name: + personal_thesis_guidance: 論文指導 + thesis_guidance_paper: 論文指導 + personal_thesis_guidance: + merge: "合併" + upload: "上傳" + no_input: "未輸入" + select_class: "——選取分類——" + search_class: "搜尋類別:" + word_to_search: "關鍵字搜尋:" + associated_project: "所屬計畫案" + number_of_authors: "著作人數" + paper_title : "論文名稱" + journal_title : "期刊名稱" + supervising_teacher : "指導教師" + degree : "學位" + graduation_semester : "畢業學期" + graduation_year : "畢業學年度" + authors : "學生" + author: "作者" + author_name: "作者姓名" + tags : "領域" + year : "年度" + language : "語言" + isbn : "ISSN(ISBN)" + vol_no : "卷數" + issue_no : "期數" + form_to: "頁碼" + form_to_start : "起頁" + form_to_end : "迄頁" + total_pages : "總頁數" + keywords : "關鍵字" + abstract : "摘要" + publication_date : "發表日期" + url : "參考連結" + note : "記事" + level_type : "期刊等級" + author_type : "作者類別" + paper_type: "論文類型" + from : "起" + to : "迄" + graph_by : "Graph by" + file : "檔案" + file_name : "檔案名稱" + description : "描述" + graph_by : "Graph By" + frontend: + writing_thesis_guidances: "論文指導前台" + thesis_guidance_type: 期刊類別 + strict_compare_mode: "嚴格比較模式" + create_success : "新增完成!!" + update_success : "更新完成!!" + delete_success : "刪除成功!!" + add: "新增" + back: "返回" + delete: "刪除" + edit: "編輯" + nothing: "無" + show: "顯示" + sure?: "您肯定嗎?" + update: "更新" + yes_: "是" + no_: "否" + cancel : "取消" + save: "儲存" + hintText: "請輸入搜尋關鍵字" + noResultsText: "沒有相關的比對結果" + searchingText: "搜尋中…" diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..f2f1ab3 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,42 @@ +Rails.application.routes.draw do + locales = Site.find_by(site_active: true).in_use_locales rescue I18n.available_locales + scope "(:locale)", locale: Regexp.new(locales.join("|")) do + namespace :admin do + get 'writing_journal_setting' => "thesis_guidance_papers#setting" + get 'thesis_guidance_papers/download_excel_format' => 'thesis_guidance_papers#excel_format' + post 'thesis_guidance_papers/import_from_excel' => 'thesis_guidance_papers#import_from_excel' + + resources :thesis_guidance_papers do + collection do + post 'merge_process' => 'thesis_guidance_papers#merge_process' + get 'merge' => 'thesis_guidance_papers#merge' + get 'toggle_hide' => 'thesis_guidance_papers#toggle_hide' + get 'analysis' + get 'analysis_report' + get "download_excel" + end + end + + resources :members do + collection do + scope '(:name-:uid)' do + resources :thesis_guidance_papers do + collection do + get 'frontend_setting' => 'thesis_guidance_papers#frontend_setting' + post 'update_frontend_setting' => 'thesis_guidance_papers#update_frontend_setting' + end + end + end + end + end + + resources :thesis_guidance_levels + resources :thesis_guidance_paper_author_types + resources :thesis_guidance_paper_types + resources :thesis_guidance_types + resources :thesis_guidance_paper_intros + end + get "/xhr/personal_thesis_guidance/get_fields_for_index" => "personal_thesis_guidances#get_fields_for_index" + post "/xhr/personal_thesis_guidance/save_index_fields" => "personal_thesis_guidances#save_index_fields" + end +end diff --git a/get_rail_path.rb b/get_rail_path.rb new file mode 100644 index 0000000..916cfe1 --- /dev/null +++ b/get_rail_path.rb @@ -0,0 +1 @@ +puts Rails.root \ No newline at end of file diff --git a/lib/personal_thesis_guidance.rb b/lib/personal_thesis_guidance.rb new file mode 100644 index 0000000..42d267f --- /dev/null +++ b/lib/personal_thesis_guidance.rb @@ -0,0 +1,4 @@ +require "personal_thesis_guidance/engine" + +module PersonalThesisGuidance +end diff --git a/lib/personal_thesis_guidance/engine.rb b/lib/personal_thesis_guidance/engine.rb new file mode 100644 index 0000000..b73483e --- /dev/null +++ b/lib/personal_thesis_guidance/engine.rb @@ -0,0 +1,38 @@ +module PersonalThesisGuidance + class Engine < ::Rails::Engine + initializer "personal_thesis_guidance" do + require File.expand_path('../../../app/models/thesis_guidance_paper', __FILE__) + mp_id_maps = {} + ThesisGuidancePaper.where({'member_profile_id.0'=> {'$exists'=> false}, 'member_profile_id' => {'$ne'=> nil}}).pluck(:id, :member_profile_id).each do |jpv| + mp_id_maps[jpv[1]] = [] if !mp_id_maps[jpv[1]] + mp_id_maps[jpv[1]] << jpv[0] + end + mp_id_maps.each do |mp_id, ids| + ThesisGuidancePaper.where(:id.in => ids).update_all(member_profile_id: [mp_id]) + end + OrbitApp.registration "PersonalThesisGuidance",:type=> 'ModuleApp' do + module_label 'module_name.thesis_guidance_paper' + base_url File.expand_path File.dirname(__FILE__) + personal_plugin :enable => true, :sort_number => '5', :app_name=>"ThesisGuidancePaper", :intro_app_name=>"ThesisGuidancePaperlIntro",:path=>"/plugin/personal_thesis_guidance/profile",:front_path=>"/profile",:admin_path=>"/admin/thesis_guidance_papers/",:i18n=>'module_name.thesis_guidance_paper', :module_app_name=>'PersonalThesisGuidance', :one_line_title => true, :field_modifiable => true, :analysis => true, :analysis_path => "/admin/thesis_guidance_papers/analysis" + + begin + page_custom_option({year: '<%= select_tag "#{f.object_name}[custom_data_field][year][]", options_for_select((1930...(DateTime.now.year+5)).to_a.reverse, (f.object.custom_data_field[:year].to_a rescue [])), {multiple: true} %>'}) + page_custom_option({thesis_guidance_type: '<% ThesisGuidanceType.all.each do |thesis_guidance_type| %><% end %>'}) + rescue => e + puts ['there_was_no_page_custom_option',e] + end + version "0.1" + desktop_enabled true + organization "Rulingcom" + author "RD dep" + intro "I am intro" + update_info 'some update_info' + authorizable + frontend_enabled + icon_class_no_sidebar "icons-user" + data_count 1..10 + end + end + end +end + diff --git a/lib/personal_thesis_guidance/version.rb b/lib/personal_thesis_guidance/version.rb new file mode 100644 index 0000000..2219e36 --- /dev/null +++ b/lib/personal_thesis_guidance/version.rb @@ -0,0 +1,3 @@ +module PersonalThesisGuidance + VERSION = "0.0.1" +end diff --git a/lib/tasks/personal_thesis_guidance.rake b/lib/tasks/personal_thesis_guidance.rake new file mode 100644 index 0000000..7602403 --- /dev/null +++ b/lib/tasks/personal_thesis_guidance.rake @@ -0,0 +1,14 @@ +namespace :personal_thesis_guidance do + desc 'set_thesis_guidance_type' + task :set_thesis_guidance_type => :environment do |task,args| + ThesisGuidancePaper.where(:rss2_id.ne=>nil).update_all({"$unset"=>{"thesis_guidance_type_ids"=>""}}) + MemberTag.all.each do |mt| + thesis_guidance_type = ThesisGuidanceType.where(:title=>mt.title).first + thesis_guidance_type = ThesisGuidanceType.create(:title_translations=>mt.title_translations) if thesis_guidance_type.nil? + thesis_guidance_type_id = thesis_guidance_type.id + thesis_guidance_paper_ids = ThesisGuidancePaper.where(:member_profile_id.in=>mt.member_profile_ids, :rss2_id.ne=>nil).pluck(:id) + ThesisGuidancePaper.where(:id.in=>thesis_guidance_paper_ids).update_all({"$addToSet"=>{"thesis_guidance_type_ids"=>thesis_guidance_type.id}}) + # ThesisGuidanceType.where(:id=>thesis_guidance_type_id).update_all({"$addToSet"=>{"thesis_guidance_paper_ids"=>{"$each"=>thesis_guidance_paper_ids}}}) + end + end +end \ No newline at end of file diff --git a/modules/personal_thesis_guidance/index.html.erb b/modules/personal_thesis_guidance/index.html.erb new file mode 100644 index 0000000..557acd1 --- /dev/null +++ b/modules/personal_thesis_guidance/index.html.erb @@ -0,0 +1,14 @@ + + + + + + + + + + + + +

    {{widget-title}}

    {{head-title}}
    {{value}}
    +{{pagination_goes_here}} \ No newline at end of file diff --git a/modules/personal_thesis_guidance/index_by_author.html.erb b/modules/personal_thesis_guidance/index_by_author.html.erb new file mode 100644 index 0000000..b34062e --- /dev/null +++ b/modules/personal_thesis_guidance/index_by_author.html.erb @@ -0,0 +1,13 @@ +

    {{page-title}}

    +
    +
    +

    {{year}}

    +
    +

    {{name}}

    +
      +
    • {{title}}
    • +
    +
    +
    +
    +{{pagination_goes_here}} \ No newline at end of file diff --git a/modules/personal_thesis_guidance/index_search1.html.erb b/modules/personal_thesis_guidance/index_search1.html.erb new file mode 100644 index 0000000..7ec7fdd --- /dev/null +++ b/modules/personal_thesis_guidance/index_search1.html.erb @@ -0,0 +1,38 @@ + +

    {{widget-title}}

    +
    +
    + + {{select_text}} + + {{search_text}} + + + Clear +
    +
    + + + + + + + + + + + +
    {{head-title}}
    {{value}}
    +{{pagination_goes_here}} \ No newline at end of file diff --git a/modules/personal_thesis_guidance/info.json b/modules/personal_thesis_guidance/info.json new file mode 100644 index 0000000..8d14a5f --- /dev/null +++ b/modules/personal_thesis_guidance/info.json @@ -0,0 +1,28 @@ +{ + "frontend": [ + { + "filename" : "index", + "name" : { + "zh_tw" : "1. 列表", + "en" : "1. List" + }, + "thumbnail" : "thumb.png" + }, + { + "filename" : "index_search1", + "name" : { + "zh_tw" : "2. 列表(含搜尋)", + "en" : "2. List which includes search" + }, + "thumbnail" : "thumb.png" + }, + { + "filename" : "index_by_author", + "name" : { + "zh_tw" : "3. 作者論文", + "en" : "3. List by Author" + }, + "thumbnail" : "thumb.png" + } + ] +} \ No newline at end of file diff --git a/modules/personal_thesis_guidance/show.html.erb b/modules/personal_thesis_guidance/show.html.erb new file mode 100644 index 0000000..982887a --- /dev/null +++ b/modules/personal_thesis_guidance/show.html.erb @@ -0,0 +1,8 @@ + + + + + + + +
    {{title}}{{value}}
    diff --git a/modules/personal_thesis_guidance/thumbs/thumb.png b/modules/personal_thesis_guidance/thumbs/thumb.png new file mode 100644 index 0000000000000000000000000000000000000000..266af5606742714c262a949cd58aedc2b84b1959 GIT binary patch literal 4075 zcmcgvYdBPE`=8Q@or=MZk}-~jIXD}qFebzhVvsZ#jA2HMW=0OFFbKQkR5@2;7{)1- z&=wM+oMYofvU8{uIS&7&UHkuj*w_2v{qU~qTI;!=weH`2-_Lz|o)v3@JtZh0Apin_ z1kKIRw!l~h+!g!w0MC|jUMDb!Q%!MHJBk;Th7Tlwj65ms1cm?>ZoCb zunI6C_z=xP0tt2@SbL8Ul825b)X)H;M@Iny{0US%gzoQ04nooOq2J}A0DAj1918i) zLM7=#|1t_^Wdkvx1QH+`FocQ+LK6wmREHte5jyHR$`Dlq5&=i5!Vy|3NCZkl3xz;J zeq2yMTcD>G$`+0Jp$nMlLw%^!02CZfqtReAH5et(8;;b`(SajW;i{@C0EbEtgG|NK zRmedyKP8|EK^}p`04k9}hHOj3yHkRx`cS~qzn0)1U}g2UU~4vB3<+^0l07N3pzZMdwOTYGka&sUi3z0mL%#bLMf?Z- z>ZS-JMhk;Ms+p<-HXx1FOpGw9+S;btnx?86+SLrFqmAt8Lvxw>O#9Ok(U(6adi=}!UB|h@GFIv~ z3by;zyIaw_j2w*cMtljDe@vCYYBBN{3B_}Vjo?=y5{HRi5Qzi{pS+umos~BYBNJa& zkB#!~P<#uqTbUmXSksK04_O}zQA=O@9o_oaC^d(oz7rtA`(Fz|ZJl&3e@9oBUHof} zii!$-7EjmN-Q6)UF+u6`U4kzeZoO$!*c@J5RNonGEUj;m*6pneu6?<%aM4#VPAhUf8>TQU zggnVU*>r`u;}8-A-Gko$zozhV-1BvXNA*K07ecJnTNzBq!E9)tfjr4yJM48svB1DR(~qCqDFK6W{c3 zH6;U@u$qM5KnN;IP3F7D9z3f3I$hbkK$rIMoRCAwHLHipoCjs(ktYRPYby(rqTtfW z7fFr>j_DmvnAA>kT~$YLGg+S9*wr7Xw)3Wu%pe!sRi1%Rt_BUV0-C(c?B3zSEr zhH7b)e3<)El-#ka)_#IVH0^z&`U1{dmX%seHb(vOMs!!~hq<>EFU{{XL5-qiu9m3X zFi*!wq?oQAXfH&aIseu9xKWe7vpau}vc;d8={1&3PO#V}#$-#v`?2zx+$FnvMUGs| zhQY zv|2uUKg)>djjunlqw$VPb5YP@ElI^eek&T)dwhI1&|~8+I@^icFhGv8YH{sS`ceUPyi9m3ekAZ*W@Ati|`yP&xel^fU=*AW>a4 zZd+$%EfR$e`To`2gg9oV&u7IB z#kt*zr*$^sOlv~URCa1ng@WEaP4^*orb@Z^)1CXE(e8Gsbz+utIg27K!o$f7J@3wY zv7@|OQj)MC7FL>e`PN|K+=^ZIcmS!ofLH8wBz(!GNSAiWMlF@>x3BuHDEoOS8&z6< zpPc=oigpP$V+ES6>G{z?!vor#COgNcSD`y-ofGsk~b~sChbDiXtak z(l;uY@`kK%IhUv~48$w>qUehm1rA^4`F_RsUs-8Yp&tj!JWP)&B_~~D){0ovg8BV@ z7M9oRPUqk&q@dpz$#hv&FcYhKM542fki29$&)6rmJ0~Cz?l)Q2cB>GaGDZt=+bis? zXqNo~cTbhFQzAAtbD3}Ng3pPDmj+L>BpqG_hS|y_=(8HvpJnz&E=LZt`J`AK&|?`r zox)c%&@*rB8F{&HH~K$^)NzW|gdTzo`(~a^TxZ<6o4=77#<$TLhr7L+<6&`wk)Svp zD}vr1rqJ~~ue|>JvtoHRlP(&Y@75|OAl21J3K`wo5IEHq_tN$4Dxr6GKR3CF*BIZH z`ut1YTvC9_eWpp|>Ym~BPC)9;e2iU$tybvJ<->-vV?vcch8R{jw$sK{7C5ty zf`oNblLmwJ>JQxZqE|Gr#EY&C5~uB*i`%3gY8Ck3y>}_P`#I73Lhw$I5Ff-Hgx=3Q z3{dYn3;&2)UHv-U*2A(^k}?eU+o-!VKh*XzS>ZBvxxd&YWxItZ9@V*8erUm>vXwW{ z98VbYAF57n z524D!g-bbHbpCSq#jQ;qX47-ZZs1M9zsB&QOx(`Vy34f5icu@Y@{(_1x@Pt~k$_si zvHH3%z#i06u(POF0od>&Oj;?UPl<83yztEpM$dH0(r7isjR5Qn?aDb>va)`P)d%p3 z`ax%V%{^B|J2l%YXZe)wH6%{Ar@^bFau(K?KaD9R9n*JCJviki+4;?AwxZ2rwe+d@ zcyQxdsXEV0 z+UkxzW!Q8li3R$euYdX9dw%Fdp*GY zog?xFXZ#%Ww<{`H5~T&!%?l3tnu{@+T64SD>Qmv2=*NqL{156qSS@P5RC;%1JxuaT zsPZ4KYB>a;##o$Eil@f?iR-EDs4LZ1oKm~uUrm?=@D4|HbUQnFtoA?hXlJ}PP?QWR zTeQ`azZ6#abhJC2>l0qYbMtmOvwCaPvE$39-rp`wN=HxBhpv`O?}1||BTG*852Fdi zf=bq!Y)hxw^KZ}{@?OYaIJ4|?Z86-WfT&Z+h7^$wIQ)6H8xhTE`Qp%t27{yI5x&}n zjGJe_fr|$Pt|~uDnhZ1N{|vMz!Q7S573!lkX`w*`M_tsqp5B&;jQ4iu-%6ZvY&d?S z(Yb!KKCBjcBfE4hloZ^UW{2r=yHy0PzyN)UnCjQ^&}bh?xwb$$BT+V%+b{b zq?WOa<=b6)e-`d$?21O2jFEohz$tKYMmUzXr zv!G#9d=mkj!$T|>;o(^`Q6(9fne#dcS*H7Knqnn^b1|?Q$rake doc:app. diff --git a/test/dummy/Rakefile b/test/dummy/Rakefile new file mode 100644 index 0000000..6ea7d63 --- /dev/null +++ b/test/dummy/Rakefile @@ -0,0 +1,6 @@ +# 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 new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/assets/javascripts/application.js b/test/dummy/app/assets/javascripts/application.js new file mode 100644 index 0000000..0957fe9 --- /dev/null +++ b/test/dummy/app/assets/javascripts/application.js @@ -0,0 +1,13 @@ +// 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 new file mode 100644 index 0000000..cfc4988 --- /dev/null +++ b/test/dummy/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * 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 new file mode 100644 index 0000000..3b371ba --- /dev/null +++ b/test/dummy/app/controllers/application_controller.rb @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/helpers/application_helper.rb b/test/dummy/app/helpers/application_helper.rb new file mode 100644 index 0000000..bf7774a --- /dev/null +++ b/test/dummy/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/test/dummy/app/mailers/.keep b/test/dummy/app/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/models/.keep b/test/dummy/app/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/models/concerns/.keep b/test/dummy/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/views/layouts/application.html.erb b/test/dummy/app/views/layouts/application.html.erb new file mode 100644 index 0000000..47cf1a7 --- /dev/null +++ b/test/dummy/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + 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 new file mode 100644 index 0000000..9c6dfa0 --- /dev/null +++ b/test/dummy/bin/bundle @@ -0,0 +1,3 @@ +#!/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 new file mode 100644 index 0000000..7b28f23 --- /dev/null +++ b/test/dummy/bin/rails @@ -0,0 +1,4 @@ +#!/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 new file mode 100644 index 0000000..8704afd --- /dev/null +++ b/test/dummy/bin/rake @@ -0,0 +1,4 @@ +#!/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 new file mode 100644 index 0000000..085f31c --- /dev/null +++ b/test/dummy/config.ru @@ -0,0 +1,4 @@ +# 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 new file mode 100644 index 0000000..f3282e8 --- /dev/null +++ b/test/dummy/config/application.rb @@ -0,0 +1,29 @@ +require File.expand_path('../boot', __FILE__) + +# Pick the frameworks you want: +# require "active_record/railtie" +require "action_controller/railtie" +require "action_mailer/railtie" +require "action_view/railtie" +require "sprockets/railtie" +require "rails/test_unit/railtie" + +Bundler.require(*Rails.groups) +require "personal_thesis_guidance" + +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 new file mode 100644 index 0000000..72c2a82 --- /dev/null +++ b/test/dummy/config/boot.rb @@ -0,0 +1,5 @@ +# 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/environment.rb b/test/dummy/config/environment.rb new file mode 100644 index 0000000..a925c89 --- /dev/null +++ b/test/dummy/config/environment.rb @@ -0,0 +1,5 @@ +# 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 new file mode 100644 index 0000000..b5c4dfe --- /dev/null +++ b/test/dummy/config/environments/development.rb @@ -0,0 +1,34 @@ +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 + + # 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 new file mode 100644 index 0000000..5b15148 --- /dev/null +++ b/test/dummy/config/environments/production.rb @@ -0,0 +1,80 @@ +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 + + # Version of your assets, change this if you want to expire all your assets. + config.assets.version = '1.0' + + # 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" + + # Precompile additional assets. + # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. + # config.assets.precompile += %w( search.js ) + + # 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 +end diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb new file mode 100644 index 0000000..63d9b10 --- /dev/null +++ b/test/dummy/config/environments/test.rb @@ -0,0 +1,39 @@ +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/backtrace_silencers.rb b/test/dummy/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..803738d --- /dev/null +++ b/test/dummy/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# 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 new file mode 100644 index 0000000..c944d3a --- /dev/null +++ b/test/dummy/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# 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 new file mode 100644 index 0000000..180af8a --- /dev/null +++ b/test/dummy/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# 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 new file mode 100644 index 0000000..d173fb9 --- /dev/null +++ b/test/dummy/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# 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 new file mode 100644 index 0000000..b9979aa --- /dev/null +++ b/test/dummy/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# 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 new file mode 100644 index 0000000..0315b1b --- /dev/null +++ b/test/dummy/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# 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 new file mode 100644 index 0000000..64ec71f --- /dev/null +++ b/test/dummy/config/initializers/wrap_parameters.rb @@ -0,0 +1,9 @@ +# 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 diff --git a/test/dummy/config/locales/en.yml b/test/dummy/config/locales/en.yml new file mode 100644 index 0000000..374ca54 --- /dev/null +++ b/test/dummy/config/locales/en.yml @@ -0,0 +1,23 @@ +# 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 new file mode 100644 index 0000000..4da8a99 --- /dev/null +++ b/test/dummy/config/routes.rb @@ -0,0 +1,56 @@ +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 new file mode 100644 index 0000000..9779b51 --- /dev/null +++ b/test/dummy/config/secrets.yml @@ -0,0 +1,22 @@ +# 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: 76c33f414884094e8661421d8cd79f3e40f867dd3a607d0fef58fcb7e74e97e542ee07a3d89f46065159908785cc469f236684e6086894b0f877bf402779fe47 + +test: + secret_key_base: 7ae3036ebc5442111c4819444e964cfc963e07efcdd800d617c489ab591ae482ec3918b8cdc3290f626d9b960c8777a5a0269c536f17e924c44773045d297d70 + +# 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 new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/log/.keep b/test/dummy/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/public/404.html b/test/dummy/public/404.html new file mode 100644 index 0000000..00431b8 --- /dev/null +++ b/test/dummy/public/404.html @@ -0,0 +1,67 @@ + + + + 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 new file mode 100644 index 0000000..f313786 --- /dev/null +++ b/test/dummy/public/422.html @@ -0,0 +1,67 @@ + + + + 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 new file mode 100644 index 0000000..860aefd --- /dev/null +++ b/test/dummy/public/500.html @@ -0,0 +1,66 @@ + + + + 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 new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/thesis_guidance_levels.yml b/test/fixtures/thesis_guidance_levels.yml new file mode 100644 index 0000000..f84843b --- /dev/null +++ b/test/fixtures/thesis_guidance_levels.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + key: MyString + title: MyString + +two: + key: MyString + title: MyString diff --git a/test/fixtures/thesis_guidance_paper_author_types.yml b/test/fixtures/thesis_guidance_paper_author_types.yml new file mode 100644 index 0000000..1623038 --- /dev/null +++ b/test/fixtures/thesis_guidance_paper_author_types.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + title: MyString + +two: + title: MyString diff --git a/test/fixtures/thesis_guidance_paper_authors.yml b/test/fixtures/thesis_guidance_paper_authors.yml new file mode 100644 index 0000000..00a530e --- /dev/null +++ b/test/fixtures/thesis_guidance_paper_authors.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + email: MyString + +two: + name: MyString + email: MyString diff --git a/test/fixtures/thesis_guidance_paper_files.yml b/test/fixtures/thesis_guidance_paper_files.yml new file mode 100644 index 0000000..8a680c5 --- /dev/null +++ b/test/fixtures/thesis_guidance_paper_files.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + description: MyString + should_destroy: false + title: MyString + +two: + description: MyString + should_destroy: false + title: MyString diff --git a/test/fixtures/thesis_guidance_paper_intros.yml b/test/fixtures/thesis_guidance_paper_intros.yml new file mode 100644 index 0000000..8c4cd95 --- /dev/null +++ b/test/fixtures/thesis_guidance_paper_intros.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/thesis_guidance_paper_types.yml b/test/fixtures/thesis_guidance_paper_types.yml new file mode 100644 index 0000000..f84843b --- /dev/null +++ b/test/fixtures/thesis_guidance_paper_types.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + key: MyString + title: MyString + +two: + key: MyString + title: MyString diff --git a/test/fixtures/thesis_guidance_papers.yml b/test/fixtures/thesis_guidance_papers.yml new file mode 100644 index 0000000..014af81 --- /dev/null +++ b/test/fixtures/thesis_guidance_papers.yml @@ -0,0 +1,39 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + title: MyString + paper_title: MyString + journal_title: MyString + authors: MyText + year: MyString + language: MyString + isbn: MyString + vol_no: MyString + issue_no: MyString + form_to_start: MyString + form_to_end: MyString + total_pages: MyString + keywords: MyString + abstract: MyString + publication_date: 2014-06-04 + url: MyString + note: MyString + +two: + title: MyString + paper_title: MyString + journal_title: MyString + authors: MyText + year: MyString + language: MyString + isbn: MyString + vol_no: MyString + issue_no: MyString + form_to_start: MyString + form_to_end: MyString + total_pages: MyString + keywords: MyString + abstract: MyString + publication_date: 2014-06-04 + url: MyString + note: MyString diff --git a/test/helpers/admin/thesis_guidance_levels_helper_test.rb b/test/helpers/admin/thesis_guidance_levels_helper_test.rb new file mode 100644 index 0000000..eee916e --- /dev/null +++ b/test/helpers/admin/thesis_guidance_levels_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class Admin::ThesisGuidanceLevelsHelperTest < ActionView::TestCase +end diff --git a/test/helpers/admin/thesis_guidance_paper_author_types_helper_test.rb b/test/helpers/admin/thesis_guidance_paper_author_types_helper_test.rb new file mode 100644 index 0000000..7e7e40c --- /dev/null +++ b/test/helpers/admin/thesis_guidance_paper_author_types_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class Admin::ThesisGuidancePaperAuthorTypesHelperTest < ActionView::TestCase +end diff --git a/test/helpers/admin/thesis_guidance_paper_intros_helper_test.rb b/test/helpers/admin/thesis_guidance_paper_intros_helper_test.rb new file mode 100644 index 0000000..ffee08c --- /dev/null +++ b/test/helpers/admin/thesis_guidance_paper_intros_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class Admin::ThesisGuidancePaperIntrosHelperTest < ActionView::TestCase +end diff --git a/test/helpers/admin/thesis_guidance_paper_types_helper_test.rb b/test/helpers/admin/thesis_guidance_paper_types_helper_test.rb new file mode 100644 index 0000000..8258ab6 --- /dev/null +++ b/test/helpers/admin/thesis_guidance_paper_types_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class Admin::ThesisGuidancePaperTypesHelperTest < ActionView::TestCase +end diff --git a/test/helpers/admin/thesis_guidance_papers_helper_test.rb b/test/helpers/admin/thesis_guidance_papers_helper_test.rb new file mode 100644 index 0000000..0809ab2 --- /dev/null +++ b/test/helpers/admin/thesis_guidance_papers_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class Admin::ThesisGuidancePapersHelperTest < ActionView::TestCase +end diff --git a/test/helpers/thesis_guidance_papers_helper_test.rb b/test/helpers/thesis_guidance_papers_helper_test.rb new file mode 100644 index 0000000..c5616e4 --- /dev/null +++ b/test/helpers/thesis_guidance_papers_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ThesisGuidancePapersHelperTest < ActionView::TestCase +end diff --git a/test/integration/navigation_test.rb b/test/integration/navigation_test.rb new file mode 100644 index 0000000..824b28c --- /dev/null +++ b/test/integration/navigation_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class NavigationTest < ActionDispatch::IntegrationTest + + # test "the truth" do + # assert true + # end +end + diff --git a/test/models/thesis_guidance_level_test.rb b/test/models/thesis_guidance_level_test.rb new file mode 100644 index 0000000..dc83542 --- /dev/null +++ b/test/models/thesis_guidance_level_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ThesisGuidanceLevelTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/thesis_guidance_paper_author_test.rb b/test/models/thesis_guidance_paper_author_test.rb new file mode 100644 index 0000000..e64c35c --- /dev/null +++ b/test/models/thesis_guidance_paper_author_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ThesisGuidancePaperAuthorTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/thesis_guidance_paper_author_type_test.rb b/test/models/thesis_guidance_paper_author_type_test.rb new file mode 100644 index 0000000..82f694d --- /dev/null +++ b/test/models/thesis_guidance_paper_author_type_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ThesisGuidancePaperAuthorTypeTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/thesis_guidance_paper_file_test.rb b/test/models/thesis_guidance_paper_file_test.rb new file mode 100644 index 0000000..70feea9 --- /dev/null +++ b/test/models/thesis_guidance_paper_file_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ThesisGuidancePaperFileTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/thesis_guidance_paper_intro_test.rb b/test/models/thesis_guidance_paper_intro_test.rb new file mode 100644 index 0000000..04df5d6 --- /dev/null +++ b/test/models/thesis_guidance_paper_intro_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ThesisGuidancePaperIntroTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/thesis_guidance_paper_test.rb b/test/models/thesis_guidance_paper_test.rb new file mode 100644 index 0000000..fcb2340 --- /dev/null +++ b/test/models/thesis_guidance_paper_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ThesisGuidancePaperTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/thesis_guidance_paper_type_test.rb b/test/models/thesis_guidance_paper_type_test.rb new file mode 100644 index 0000000..819da0c --- /dev/null +++ b/test/models/thesis_guidance_paper_type_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ThesisGuidancePaperTypeTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/personal_thesis_guidance_test.rb b/test/personal_thesis_guidance_test.rb new file mode 100644 index 0000000..4b1678a --- /dev/null +++ b/test/personal_thesis_guidance_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class PersonalThesisGuidanceTest < ActiveSupport::TestCase + test "truth" do + assert_kind_of Module, PersonalThesisGuidance + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..d41a138 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,15 @@ +# Configure Rails Environment +ENV["RAILS_ENV"] = "test" + +require File.expand_path("../dummy/config/environment.rb", __FILE__) +require "rails/test_help" + +Rails.backtrace_cleaner.remove_silencers! + +# 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