From c2f223b82cc45cee0bcff61c7dd6197d8a3e0ab1 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 5 Aug 2013 18:35:04 +0800 Subject: [PATCH] new plugins added for desktop --- .gitignore | 1 + .../desktop_publications_controller.rb | 15 -- .../desktop_research_controller.rb | 26 --- app/views/desktop/books/add.html.erb | 87 ---------- app/views/desktop/books/list.html.erb | 72 -------- app/views/desktop/books/seminar.html.erb | 75 -------- app/views/desktop/index.html.erb | 16 +- .../desktop/research_domain/add.html.erb | 107 ------------ .../desktop/research_domain/list.html.erb | 75 -------- .../desktop/research_project/add.html.erb | 107 ------------ .../desktop/research_project/list.html.erb | 75 -------- config/routes.rb | 14 -- sftp-config.json | 42 +++++ .../personal_book/desktop/personal_books.js | 158 +++++++++++++++++ .../personal_book/personal_book.js | 1 + .../desktop/personal_books_controller.rb | 73 ++++++++ .../desktop/personal_books_helper.rb | 96 ++++++++++ .../desktop/personal_books/_form.html.erb | 164 ++++++++++++++++++ .../personal_books/_form_file.html.erb | 33 ++++ .../personal_books/books_window.html.erb | 16 +- .../desktop/personal_books/edit.html.erb | 3 + .../desktop/personal_books/index.html.erb | 84 +++++++++ .../desktop/personal_books/new.html.erb | 3 + .../personal_book/config/locales/en.yml | 51 +++++- .../personal_book/config/locales/zh_tw.yml | 51 +++++- .../personal_book/config/routes.rb | 5 + .../desktop/personal_diploma.js | 158 +++++++++++++++++ .../personal_diploma/personal_diploma.css | 115 ++++++++++++ .../personal_diploma/personal_diploma.scss | 123 +++++++++++++ .../desktop/personal_diplomas_controller.rb | 51 ++++++ .../desktop/personal_diplomas_helper.rb | 96 ++++++++++ .../desktop/personal_diplomas/_form.html.erb | 98 +++++++++++ .../personal_diplomas/diploma_window.html.erb | 35 ++++ .../desktop/personal_diplomas/edit.html.erb | 3 + .../desktop/personal_diplomas/index.html.erb | 84 +++++++++ .../desktop/personal_diplomas/new.html.erb | 3 + .../personal_diploma/config/locales/en.yml | 55 +++++- .../personal_diploma/config/locales/zh_tw.yml | 55 +++++- .../personal_diploma/config/routes.rb | 4 + .../desktop/personal_experiences.js | 158 +++++++++++++++++ .../desktop/personal_experience.css | 115 ++++++++++++ .../desktop/personal_experience.scss | 123 +++++++++++++ .../personal_experiences_controller.rb | 72 ++++++++ .../desktop/personal_experiences_helper.rb | 96 ++++++++++ .../personal_experiences/_form.html.erb | 93 ++++++++++ .../personal_experiences/edit.html.erb | 3 + .../experience_window.html.erb | 35 ++++ .../personal_experiences/index.html.erb | 84 +++++++++ .../desktop/personal_experiences/new.html.erb | 3 + .../personal_experience/config/locales/en.yml | 55 +++++- .../config/locales/zh_tw.yml | 55 +++++- .../personal_experience/config/routes.rb | 4 + .../personal_honor/desktop/personal_honors.js | 158 +++++++++++++++++ .../personal_honor/desktop/personal_honor.css | 115 ++++++++++++ .../desktop/personal_honor.scss | 123 +++++++++++++ .../desktop/personal_honors_controller.rb | 71 ++++++++ .../desktop/personal_honors_helper.rb | 87 ++++++++++ .../desktop/personal_honors/_form.html.erb | 66 +++++++ .../desktop/personal_honors/edit.html.erb | 3 + .../personal_honors/honors_window.html.erb | 35 ++++ .../desktop/personal_honors/index.html.erb | 84 +++++++++ .../desktop/personal_honors/new.html.erb | 3 + .../personal_honor/config/locales/en.yml | 54 +++++- .../personal_honor/config/locales/zh_tw.yml | 54 +++++- .../personal_honor/config/routes.rb | 5 + .../personal_lab/desktop/personal_lab.js | 158 +++++++++++++++++ .../personal_lab/desktop/personal_lab.css | 115 ++++++++++++ .../personal_lab/desktop/personal_lab.scss | 123 +++++++++++++ .../desktop/personal_labs_controller.rb | 71 ++++++++ .../desktop/personal_labs_helper.rb | 96 ++++++++++ .../desktop/personal_labs/_form.html.erb | 141 +++++++++++++++ .../desktop/personal_labs/_form_file.html.erb | 33 ++++ .../desktop/personal_labs/edit.html.erb | 3 + .../desktop/personal_labs/index.html.erb | 83 +++++++++ .../desktop/personal_labs/lab_window.html.erb | 16 +- .../desktop/personal_labs/new.html.erb | 3 + .../personal_lab/config/locales/en.yml | 57 +++++- .../personal_lab/config/locales/zh_tw.yml | 57 +++++- .../personal_lab/config/routes.rb | 4 + .../desktop/personal_patent.js | 158 +++++++++++++++++ .../desktop/personal_patent.css | 115 ++++++++++++ .../desktop/personal_patent.scss | 123 +++++++++++++ .../desktop/personal_patents_controller.rb | 71 ++++++++ .../desktop/personal_patents_helper.rb | 96 ++++++++++ .../desktop/personal_patents/_form.html.erb | 120 +++++++++++++ .../personal_patents/_form_file.html.erb | 33 ++++ .../desktop/personal_patents/edit.html.erb | 3 + .../desktop/personal_patents/index.html.erb | 82 +++++++++ .../desktop/personal_patents/new.html.erb | 3 + .../personal_patents/patent_window.html.erb | 35 ++++ .../personal_patent/config/locales/en.yml | 54 +++++- .../personal_patent/config/locales/zh_tw.yml | 54 +++++- .../personal_patent/config/routes.rb | 4 + .../desktop/personal_project.js | 158 +++++++++++++++++ .../desktop/personal_project.css | 115 ++++++++++++ .../desktop/personal_project.scss | 123 +++++++++++++ .../desktop/personal_projects_controller.rb | 71 ++++++++ .../desktop/personal_projects_helper.rb | 96 ++++++++++ .../desktop/personal_projects/_form.html.erb | 155 +++++++++++++++++ .../personal_projects/_form_file.html.erb | 33 ++++ .../desktop/personal_projects/edit.html.erb | 3 + .../desktop/personal_projects/index.html.erb | 83 +++++++++ .../desktop/personal_projects/new.html.erb | 3 + .../personal_projects/project_window.html.erb | 35 ++++ .../personal_project/config/locales/en.yml | 56 +++++- .../personal_project/config/locales/zh_tw.yml | 56 +++++- .../personal_project/config/routes.rb | 4 + .../desktop/personal_research.js | 158 +++++++++++++++++ .../desktop/personal_research.css | 115 ++++++++++++ .../desktop/personal_research.scss | 123 +++++++++++++ .../desktop/personal_researchs_controller.rb | 71 ++++++++ .../desktop/personal_researchs_helper.rb | 96 ++++++++++ .../desktop/personal_researchs/_form.html.erb | 109 ++++++++++++ .../personal_researchs/_form_file.html.erb | 33 ++++ .../desktop/personal_researchs/edit.html.erb | 3 + .../desktop/personal_researchs/index.html.erb | 83 +++++++++ .../desktop/personal_researchs/new.html.erb | 3 + .../research_window.html.erb | 35 ++++ .../personal_research/config/locales/en.yml | 51 +++++- .../config/locales/zh_tw.yml | 51 +++++- .../personal_research/config/routes.rb | 4 + 121 files changed, 7213 insertions(+), 708 deletions(-) delete mode 100644 app/controllers/desktop_publications_controller.rb delete mode 100644 app/controllers/desktop_research_controller.rb delete mode 100644 app/views/desktop/books/add.html.erb delete mode 100644 app/views/desktop/books/list.html.erb delete mode 100644 app/views/desktop/books/seminar.html.erb delete mode 100644 app/views/desktop/research_domain/add.html.erb delete mode 100644 app/views/desktop/research_domain/list.html.erb delete mode 100644 app/views/desktop/research_project/add.html.erb delete mode 100644 app/views/desktop/research_project/list.html.erb create mode 100644 sftp-config.json create mode 100644 vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/desktop/personal_books.js create mode 100644 vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/personal_book.js create mode 100644 vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/desktop/personal_books_controller.rb create mode 100644 vendor/built_in_modules/personal_book/app/helpers/panel/personal_book/desktop/personal_books_helper.rb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/_form.html.erb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/_form_file.html.erb rename app/views/desktop/research_d.html.erb => vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/books_window.html.erb (54%) create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/edit.html.erb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/index.html.erb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/new.html.erb create mode 100644 vendor/built_in_modules/personal_diploma/app/assets/javascripts/personal_diploma/desktop/personal_diploma.js create mode 100644 vendor/built_in_modules/personal_diploma/app/assets/stylesheets/personal_diploma/personal_diploma.css create mode 100644 vendor/built_in_modules/personal_diploma/app/assets/stylesheets/personal_diploma/personal_diploma.scss create mode 100644 vendor/built_in_modules/personal_diploma/app/controllers/panel/personal_diploma/desktop/personal_diplomas_controller.rb create mode 100644 vendor/built_in_modules/personal_diploma/app/helpers/panel/personal_diploma/desktop/personal_diplomas_helper.rb create mode 100644 vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/desktop/personal_diplomas/_form.html.erb create mode 100644 vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/desktop/personal_diplomas/diploma_window.html.erb create mode 100644 vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/desktop/personal_diplomas/edit.html.erb create mode 100644 vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/desktop/personal_diplomas/index.html.erb create mode 100644 vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/desktop/personal_diplomas/new.html.erb create mode 100644 vendor/built_in_modules/personal_experience/app/assets/javascripts/personal_experience/desktop/personal_experiences.js create mode 100644 vendor/built_in_modules/personal_experience/app/assets/stylesheets/personal_experience/desktop/personal_experience.css create mode 100644 vendor/built_in_modules/personal_experience/app/assets/stylesheets/personal_experience/desktop/personal_experience.scss create mode 100644 vendor/built_in_modules/personal_experience/app/controllers/panel/personal_experience/desktop/personal_experiences_controller.rb create mode 100644 vendor/built_in_modules/personal_experience/app/helpers/panel/personal_experience/desktop/personal_experiences_helper.rb create mode 100644 vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/desktop/personal_experiences/_form.html.erb create mode 100644 vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/desktop/personal_experiences/edit.html.erb create mode 100644 vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/desktop/personal_experiences/experience_window.html.erb create mode 100644 vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/desktop/personal_experiences/index.html.erb create mode 100644 vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/desktop/personal_experiences/new.html.erb create mode 100644 vendor/built_in_modules/personal_honor/app/assets/javascripts/personal_honor/desktop/personal_honors.js create mode 100644 vendor/built_in_modules/personal_honor/app/assets/stylesheets/personal_honor/desktop/personal_honor.css create mode 100644 vendor/built_in_modules/personal_honor/app/assets/stylesheets/personal_honor/desktop/personal_honor.scss create mode 100644 vendor/built_in_modules/personal_honor/app/controllers/panel/personal_honor/desktop/personal_honors_controller.rb create mode 100644 vendor/built_in_modules/personal_honor/app/helpers/panel/personal_honor/desktop/personal_honors_helper.rb create mode 100644 vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/_form.html.erb create mode 100644 vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/edit.html.erb create mode 100644 vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/honors_window.html.erb create mode 100644 vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/index.html.erb create mode 100644 vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/new.html.erb create mode 100644 vendor/built_in_modules/personal_lab/app/assets/javascripts/personal_lab/desktop/personal_lab.js create mode 100644 vendor/built_in_modules/personal_lab/app/assets/stylesheets/personal_lab/desktop/personal_lab.css create mode 100644 vendor/built_in_modules/personal_lab/app/assets/stylesheets/personal_lab/desktop/personal_lab.scss create mode 100644 vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/desktop/personal_labs_controller.rb create mode 100644 vendor/built_in_modules/personal_lab/app/helpers/panel/personal_lab/desktop/personal_labs_helper.rb create mode 100644 vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/_form.html.erb create mode 100644 vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/_form_file.html.erb create mode 100644 vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/edit.html.erb create mode 100644 vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/index.html.erb rename app/views/desktop/research_p.html.erb => vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/lab_window.html.erb (55%) create mode 100644 vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/new.html.erb create mode 100644 vendor/built_in_modules/personal_patent/app/assets/javascripts/personal_patent/desktop/personal_patent.js create mode 100644 vendor/built_in_modules/personal_patent/app/assets/stylesheets/personal_patent/desktop/personal_patent.css create mode 100644 vendor/built_in_modules/personal_patent/app/assets/stylesheets/personal_patent/desktop/personal_patent.scss create mode 100644 vendor/built_in_modules/personal_patent/app/controllers/panel/personal_patent/desktop/personal_patents_controller.rb create mode 100644 vendor/built_in_modules/personal_patent/app/helpers/panel/personal_patent/desktop/personal_patents_helper.rb create mode 100644 vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/desktop/personal_patents/_form.html.erb create mode 100644 vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/desktop/personal_patents/_form_file.html.erb create mode 100644 vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/desktop/personal_patents/edit.html.erb create mode 100644 vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/desktop/personal_patents/index.html.erb create mode 100644 vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/desktop/personal_patents/new.html.erb create mode 100644 vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/desktop/personal_patents/patent_window.html.erb create mode 100644 vendor/built_in_modules/personal_project/app/assets/javascripts/personal_project/desktop/personal_project.js create mode 100644 vendor/built_in_modules/personal_project/app/assets/stylesheets/personal_project/desktop/personal_project.css create mode 100644 vendor/built_in_modules/personal_project/app/assets/stylesheets/personal_project/desktop/personal_project.scss create mode 100644 vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/desktop/personal_projects_controller.rb create mode 100644 vendor/built_in_modules/personal_project/app/helpers/panel/personal_project/desktop/personal_projects_helper.rb create mode 100644 vendor/built_in_modules/personal_project/app/views/panel/personal_project/desktop/personal_projects/_form.html.erb create mode 100644 vendor/built_in_modules/personal_project/app/views/panel/personal_project/desktop/personal_projects/_form_file.html.erb create mode 100644 vendor/built_in_modules/personal_project/app/views/panel/personal_project/desktop/personal_projects/edit.html.erb create mode 100644 vendor/built_in_modules/personal_project/app/views/panel/personal_project/desktop/personal_projects/index.html.erb create mode 100644 vendor/built_in_modules/personal_project/app/views/panel/personal_project/desktop/personal_projects/new.html.erb create mode 100644 vendor/built_in_modules/personal_project/app/views/panel/personal_project/desktop/personal_projects/project_window.html.erb create mode 100644 vendor/built_in_modules/personal_research/app/assets/javascripts/personal_research/desktop/personal_research.js create mode 100644 vendor/built_in_modules/personal_research/app/assets/stylesheets/personal_research/desktop/personal_research.css create mode 100644 vendor/built_in_modules/personal_research/app/assets/stylesheets/personal_research/desktop/personal_research.scss create mode 100644 vendor/built_in_modules/personal_research/app/controllers/panel/personal_research/desktop/personal_researchs_controller.rb create mode 100644 vendor/built_in_modules/personal_research/app/helpers/panel/personal_research/desktop/personal_researchs_helper.rb create mode 100644 vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/_form.html.erb create mode 100644 vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/_form_file.html.erb create mode 100644 vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/edit.html.erb create mode 100644 vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/index.html.erb create mode 100644 vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/new.html.erb create mode 100644 vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/research_window.html.erb diff --git a/.gitignore b/.gitignore index 9243ca71..023345b6 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ uploads/**/* .sass-cache/* *.supported mongoid.yml +*. diff --git a/app/controllers/desktop_publications_controller.rb b/app/controllers/desktop_publications_controller.rb deleted file mode 100644 index 918b99e2..00000000 --- a/app/controllers/desktop_publications_controller.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'mime/types' - -class DesktopPublicationsController< ApplicationController - def books - render "desktop/books", :layout => false - end - - def books_list - render "desktop/books/list", :layout => false - end - - def books_add - render "desktop/books/add", :layout => false - end -end diff --git a/app/controllers/desktop_research_controller.rb b/app/controllers/desktop_research_controller.rb deleted file mode 100644 index 5e528762..00000000 --- a/app/controllers/desktop_research_controller.rb +++ /dev/null @@ -1,26 +0,0 @@ -class DesktopResearchController< ApplicationController - - def research_d - render "desktop/research_d", :layout=>false - end - def research_d_list - render "desktop/research_domain/list", :layout=>false - end - - def research_d_add - render "desktop/research_domain/add", :layout=>false - end - - def research_p - render "desktop/research_p", :layout=>false - end - def research_p_list - render "desktop/research_project/list", :layout=>false - end - - def research_p_add - render "desktop/research_project/add", :layout=>false - end - - -end \ No newline at end of file diff --git a/app/views/desktop/books/add.html.erb b/app/views/desktop/books/add.html.erb deleted file mode 100644 index 558362ab..00000000 --- a/app/views/desktop/books/add.html.erb +++ /dev/null @@ -1,87 +0,0 @@ -
-
- - -
-
-
Year
-
- -
-
-
-
Language
-
- -
-
-
-
-
-
-
-
-
-
-
-
    -
  • Books - Chapter
  • -
  • -
  • -
  • ~
  • -
  • -
  • - -
-
-
-
    -
  • -
  • - - -
  • -
  • -
  • -
  • -
  • -
  • -
-
-
-
    -
  • -
-
-
-
-
\ No newline at end of file diff --git a/app/views/desktop/books/list.html.erb b/app/views/desktop/books/list.html.erb deleted file mode 100644 index d410e57b..00000000 --- a/app/views/desktop/books/list.html.erb +++ /dev/null @@ -1,72 +0,0 @@ -
-
-
-
- -
-
-
-
More
-
- -
-
-
-
Tag
-
- -
-
-
-
Status
-
- -
-
-
-
View
-
- -
-
-
-
Share
-
- -
-
-
-
-
-
- -
- -
- diff --git a/app/views/desktop/books/seminar.html.erb b/app/views/desktop/books/seminar.html.erb deleted file mode 100644 index 807d6d8c..00000000 --- a/app/views/desktop/books/seminar.html.erb +++ /dev/null @@ -1,75 +0,0 @@ -
-
-
-
- -
-
-
-
More
-
- -
-
-
-
Tag
-
- -
-
-
-
Status
-
- -
-
-
-
View
-
- -
-
-
-
Share
-
- -
-
-
-
-
-
-
-
-
-
- -
-
-
\ No newline at end of file diff --git a/app/views/desktop/index.html.erb b/app/views/desktop/index.html.erb index f2d14663..dbc1a826 100644 --- a/app/views/desktop/index.html.erb +++ b/app/views/desktop/index.html.erb @@ -15,23 +15,23 @@
  • Conference Papers
  • -
  • Books
  • +
  • Books
  • Research
  • Experience diff --git a/app/views/desktop/research_domain/add.html.erb b/app/views/desktop/research_domain/add.html.erb deleted file mode 100644 index 77d4b4c0..00000000 --- a/app/views/desktop/research_domain/add.html.erb +++ /dev/null @@ -1,107 +0,0 @@ -
    -
    - - -
    -
    -
    Year
    -
    - -
    -
    -
    -
    Language
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
      -
    • -
    • - OralPoster
    • -
    • - -
    • - - - - - -
    • - -
    • -
    • - -
    -
    -
    -
      -
    • -
    • - - -
    • - -
    • - -
    • -
    • -
    • -
    • -
    • - - -
    -
    -
    -
      -
    • -
    • -
    -
    -
    -
    -
    diff --git a/app/views/desktop/research_domain/list.html.erb b/app/views/desktop/research_domain/list.html.erb deleted file mode 100644 index 807d6d8c..00000000 --- a/app/views/desktop/research_domain/list.html.erb +++ /dev/null @@ -1,75 +0,0 @@ -
    -
    -
    -
    - -
    -
    -
    -
    More
    -
    - -
    -
    -
    -
    Tag
    -
    - -
    -
    -
    -
    Status
    -
    - -
    -
    -
    -
    View
    -
    - -
    -
    -
    -
    Share
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    \ No newline at end of file diff --git a/app/views/desktop/research_project/add.html.erb b/app/views/desktop/research_project/add.html.erb deleted file mode 100644 index 77d4b4c0..00000000 --- a/app/views/desktop/research_project/add.html.erb +++ /dev/null @@ -1,107 +0,0 @@ -
    -
    - - -
    -
    -
    Year
    -
    - -
    -
    -
    -
    Language
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
      -
    • -
    • - OralPoster
    • -
    • - -
    • - - - - - -
    • - -
    • -
    • - -
    -
    -
    -
      -
    • -
    • - - -
    • - -
    • - -
    • -
    • -
    • -
    • -
    • - - -
    -
    -
    -
      -
    • -
    • -
    -
    -
    -
    -
    diff --git a/app/views/desktop/research_project/list.html.erb b/app/views/desktop/research_project/list.html.erb deleted file mode 100644 index 807d6d8c..00000000 --- a/app/views/desktop/research_project/list.html.erb +++ /dev/null @@ -1,75 +0,0 @@ -
    -
    -
    -
    - -
    -
    -
    -
    More
    -
    - -
    -
    -
    -
    Tag
    -
    - -
    -
    -
    -
    Status
    -
    - -
    -
    -
    -
    View
    -
    - -
    -
    -
    -
    Share
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 81ab2d26..5f2e8bff 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -268,21 +268,7 @@ Orbit::Application.routes.draw do match '/desktop/widget_layout' => 'desktop#widget_layout' match '/desktop/temp_func/'=>'desktop#temp_func' - # namespace :desktop_publications do - match 'desktop_publications/books' => 'desktop_publications#books' - match 'desktop_publications/books_list'=>'desktop_publications#books_list' - match 'desktop_publications/books_add'=>'desktop_publications#books_add' - # namespace :desktop_research do - match 'desktop_research/research_d' => 'desktop_research#research_d' - match 'desktop_research/research_d_list/' => 'desktop_research#research_d_list' - match 'desktop_research/research_d_add' => 'desktop_research#research_d_add' - - match 'desktop_research/research_p' => 'desktop_research#research_p' - match 'desktop_research/research_p_list/' => 'desktop_research#research_p_list' - match 'desktop_research/research_p_add' => 'desktop_research#research_p_add' - # end - match '/twitter/'=>'otheraccounts#twitter' match '/forgmail/'=>'otheraccounts#gmail' match '/otheraccounts/getaccounts'=>'otheraccounts#getaccounts' diff --git a/sftp-config.json b/sftp-config.json new file mode 100644 index 00000000..f489bec4 --- /dev/null +++ b/sftp-config.json @@ -0,0 +1,42 @@ +{ + // The tab key will cycle through the settings when first created + // Visit http://wbond.net/sublime_packages/sftp/settings for help + + // sftp, ftp or ftps + "type": "sftp", + + "save_before_upload": true, + "upload_on_save": false, + "sync_down_on_open": false, + "sync_skip_deletes": false, + "confirm_downloads": false, + "confirm_sync": true, + "confirm_overwrite_newer": false, + + "host": "tp.rulingcom.com", + "user": "rulingcom", + "password": "bjo4xjp6", + //"port": "22", + + "remote_path": "/home/rulingcom/design_demo_site/orbit_d5", + "ignore_regexes": [ + "\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json", + "sftp-settings\\.json", "/venv/", "\\.svn", "\\.hg", "\\.git", + "\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini" + ], + //"file_permissions": "664", + //"dir_permissions": "775", + + //"extra_list_connections": 0, + + "connect_timeout": 30, + //"keepalive": 120, + //"ftp_passive_mode": true, + //"ssh_key_file": "~/.ssh/id_rsa", + //"sftp_flags": ["-F", "/path/to/ssh_config"], + + //"preserve_modification_times": false, + //"remote_time_offset_in_hours": 0, + //"remote_encoding": "utf-8", + //"remote_locale": "C", +} \ No newline at end of file diff --git a/vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/desktop/personal_books.js b/vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/desktop/personal_books.js new file mode 100644 index 00000000..86b31328 --- /dev/null +++ b/vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/desktop/personal_books.js @@ -0,0 +1,158 @@ +orbitDesktop.prototype.initializePersonalBook = function(target,url,cache){ // this init journal papers + this.initializePersonalBook.formCallback = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + o.sub_menu_item($("div[content-type=menu] a").eq(0)); + }else{ + o.notify(data.msg,"alert"); + } + } + + this.initializePersonalBook.list = function(){ // to open list part in journal papers page + var journalData; + var bindHandlers = function(){ // to bind handlers for list page + + } + bindHandlers(); + + var bindSecondaryHandlers = function(){ + $("#journal_p div#paper_list a.icon-check-empty").click(function(){ + if($(this).hasClass("icon-check-empty")){ + $(this).switchClass("icon-check-empty","icon-check",0); + } else if($(this) .hasClass("icon-check")) { + $(this).switchClass("icon-check","icon-check-empty",0); + } else if($(this).hasClass("icon-star")){ + $(this).removeClass("icon-star").addClass("icon-star-empty"); + } else if($(this).hasClass("icon-star-empty")){ + $(this).removeClass("icon-star-empty").addClass("icon-star"); + } + return false; + }) + } + } + this.initializePersonalBook.bookDelete = function(data,dom){ + var parent = dom.parent().parent(); + if(data.success){ + parent.hide("slide",function(){parent.remove();}); + o.notify(data.msg,"success"); + } + } + + this.initializePersonalBook.cancelbook = function(){ + o.highlight_sub_menu_item(0); + } + + this.initializePersonalBook.editbook = function(){ + o.highlight_sub_menu_item(1); + var uploadFiles = function(){ + $('#add_plugin_file a.add').click(function(){ + var new_id = $(this).prev().attr('value'); + var old_id = new RegExp("new_writing_journal_files", "g"); + $(this).prev().attr('value', parseInt(new_id) + 1); + var x = get_html(old_id,new_id); + var newfield = $(x); + $(this).parents('table').append(newfield); + newfield.find('.action a.delete').click(function(){ + newfield.remove(); + }); + return false; + }); + $('.action a.remove_existing_record').click(function(){ + $(this).next('.should_destroy').attr('value', 1); + $("tr#add_plugin_file_" + $(this).prev().attr('value')).hide(); + }); + } + + + var preData = function(){ + $("#writing_journal_author_tokens").select2('data', JSON.parse($("#writing_journal_author_tokens").attr('data-pre'))); + } + uploadFiles(); + // preData(); + } + + this.initializePersonalBook.addbook = function(){ // to open add pages in journal papers page + var uploadFiles = function(){ + $('#add_plugin_file a.add').click(function(){ + var new_id = $(this).prev().attr('value'); + var old_id = new RegExp("new_writing_journal_files", "g"); + $(this).prev().attr('value', parseInt(new_id) + 1); + var x = get_html(old_id,new_id); + var newfield = $(x); + $(this).parents('table').append(newfield); + newfield.find('.action a.delete').click(function(){ + newfield.remove(); + }); + return false; + }); + $('.action a.remove_existing_record').click(function(){ + $(this).next('.should_destroy').attr('value', 1); + $("tr#add_plugin_file_" + $(this).prev().attr('value')).hide(); + }); + } + + // console.log("hi"); + var bindHandlers = function(){ + + + } + bindHandlers(); + uploadFiles(); + + } + + + this.initializePersonalBook.coAuthorformCallback = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + o.sub_menu_item($("div[content-type=menu] a").eq(3)); + }else{ + o.notify(data.msg,"alert"); + } + } + this.initializePersonalBook.coauthor = function(){ // to open add pages in coauthor page + var bindHandlers = function(){ // to bind handlers for add page + + } + bindHandlers(); + } + this.initializePersonalBook.coauthorRelationForm = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + $("#co_author_relation_table").html(data.newvalue); + }else{ + o.notify(data.msg,"alert"); + } + } + this.initializePersonalBook.coauthorRelationEditForm = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + var x = o.layout_data.generate_layout_html(data.newvalue); + $("div[container=true] div.overview").html(x.markup); + }else{ + o.notify(data.msg,"alert"); + } + } + this.initializePersonalBook.allnone = function(d,o){ + switch(o.attr("href")){ + case "all": + $("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check"); + break; + case "none": + $("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty"); + break; + } + } + this.initializePersonalBook.allnone = function(d,o){ + switch(o.attr("href")){ + case "all": + $("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check"); + break; + case "none": + $("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty"); + break; + } + } +}; + + diff --git a/vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/personal_book.js b/vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/personal_book.js new file mode 100644 index 00000000..738b18ed --- /dev/null +++ b/vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/personal_book.js @@ -0,0 +1 @@ +//= require_tree ./personal_book/desktop \ No newline at end of file diff --git a/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/desktop/personal_books_controller.rb b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/desktop/personal_books_controller.rb new file mode 100644 index 00000000..c81eda79 --- /dev/null +++ b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/desktop/personal_books_controller.rb @@ -0,0 +1,73 @@ +class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationController + + def index + @writing_books = WritingBook.where(create_user_id: current_user.id) + @view_by = params[:view] + page = params[:page] + page ||= 1 + + @per_column = 5 + + case @view_by + when "abstract" + @per_column = 1 + when "file" + @per_column = 2 + end + + if @view_by.nil? + @view_by = " " + @writing_books = @writing_books.asc(:paper_title) + else + @writing_books = @writing_books.asc(@view_by).asc(:paper_title) + end + @writing_books = @writing_books.page(page).per(50) + respond_to do |format| + format.html { render :layout => false} + end + end + + def new + @personal_book = WritingBook.new + @author_types = BookAuthorType.all + render :layout => false + end + + def create + params[:writing_book][:create_user_id] = current_user.id + @personal_book = WritingBook.new(params[:writing_book]) + if @personal_book.save + render json: {success: true, msg: t('create_success')}.to_json + else + error_msg = @personal_book.errors.full_messages.join("
    ") + render json: {success: false, msg: error_msg}.to_json + end + end + + def edit + @personal_book = WritingBook.find(params[:id]) + @author_types = BookAuthorType.all + render :layout => false + end + + def update + params[:writing_book][:create_user_id] = current_user.id + @personal_book = WritingBook.new(params[:writing_book]) + if @personal_book.update_attributes(params[:writing_book]) + render json: {success: true, msg: t('create_success')}.to_json + else + error_msg = @personal_book.errors.full_messages.join("
    ") + render json: {success: false, msg: error_msg}.to_json + end + end + + def destroy + @personal_book = WritingBook.find(params[:id]) + @personal_book.destroy + render :json => {success: true, msg: t('delete_success')} + end + + def books_window + render :layout => false + end +end \ No newline at end of file diff --git a/vendor/built_in_modules/personal_book/app/helpers/panel/personal_book/desktop/personal_books_helper.rb b/vendor/built_in_modules/personal_book/app/helpers/panel/personal_book/desktop/personal_books_helper.rb new file mode 100644 index 00000000..5823dc3a --- /dev/null +++ b/vendor/built_in_modules/personal_book/app/helpers/panel/personal_book/desktop/personal_books_helper.rb @@ -0,0 +1,96 @@ +module Panel::PersonalBook::Desktop::PersonalBooksHelper + def publication_record publication, view + content_tag :li, + "item" => "true", + :class => "list_t_item" do + marker + \ + content(publication, view) + \ + edit_or_delete(publication) + end + end + + def marker + content_tag :div, + :class => "list_item_action" do + content_tag(:a, "",:href=>"", + :class => "icon-check-empty", + "toggle-onclick"=>"icon-check-empty icon-check", + "ajax-remote"=>"false") + \ + content_tag(:a, "",:href=>"", + :class => "icon-star-empty", + "toggle-onclick"=>"icon-star-empty icon-star", + "ajax-remote"=>"false") + end + end + + def content publication, view + case view + when "conference_title" + des = content_tag(:div, publication.book_title, + :class => "list_t_des") + when "keywords" + des = content_tag(:div, publication.keywords, + :class => "list_t_des") + when "abstract" + des = content_tag(:div, publication.abstract, + :class => "list_t_des") + when "file" + des = content_tag(:div, link_publication_file(publication), + :class => "list_t_des") + else + end + + content_tag(:div, publication.paper_title, + :class => "list_t_title") + des + + end + + def edit_or_delete publication + content_tag :div, + :class => "list_item_function" do + content_tag(:a, t("edit"), + :class => "journal_paper_edit admbg2 admtxt", + :href => edit_panel_personal_book_desktop_personal_book_path(publication), + "callback-method" => "editbook", + "ajax-remote" => "get") + \ + content_tag(:a, t(:delete_), + "ajax-remote" => "delete", + "confirm-message" => t("sure?"), + "callback-method" => "bookDelete", + :class => "journal_paper_delete admbg2 admtxt", + :href => panel_personal_book_desktop_personal_book_path(publication)) + end + end + + def link_publication_file publication + publication.writing_book_files.map{|file| + link_to(image_tag(check_file_type(file.file.url)) + \ + content_tag(:span, file.title, :class => "filetitle"), + file.file.url, + :class => "file", + "target" => "_blank") + }.inject(:+) + end + + def check_file_type file + if not file.nil? + file_type = MIME::Types.type_for(file).first.to_s.split("/")[1] + file_type = "/assets/ft-icons/#{file_type}/#{file_type}-48_32.png" + else + file_type = "" + end + end + + def generate_authors_name ids + author_name = ids.map{|m| + if m == "0" + #{:id => 0, :text => current_user.name, :email => current_user.email } + {:id => 0, :text => current_user.name } + else + #{:id => m, :text => ConferenceCoAuthor.find(m).co_author, :email => ConferenceCoAuthor.find(m).email} + {:id => m, :text => ConferenceCoAuthor.find(m).co_author} + end + } + author_name.to_json + end +end diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/_form.html.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/_form.html.erb new file mode 100644 index 00000000..6220508b --- /dev/null +++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/_form.html.erb @@ -0,0 +1,164 @@ +
    +
    + + <%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %> + <% if not @personal_book.new_record? %> + <%= submit_tag t("cancel"), :type => "button", "callback-method"=>"cancelbook", "ajax-remote" => "get", :href => panel_personal_book_desktop_personal_books_path, class: "fn_btn ini_input hp hh1 admbg2 admtxt" %> + + <% end %> +
    +
    +
    Share
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
      +
    • + <%= f.fields_for :paper_title_translations do |f| %> + <%= f.text_area locale, + class: "s_grid_12 s_grid s_grid_h_3", + size: "20x4", + placeholder: t("personal_book.paper_title"), + value: (@personal_book.paper_title_translations[locale.to_s] rescue nil) %> + <% end %> +
    • +
    • + <%= f.fields_for :book_title_translations do |f| %> + <%= f.text_field locale, + size: "20", + placeholder: t("personal_book.book_title"), + class: "s_grid_12 s_grid", + value: (@personal_book.book_title_translations[locale.to_s] rescue nil) %> + <% end %> +
    • +
    • + <%= label_tag("", t("personal_book.book_paper_type"), class: "s_grid_4 s_grid") %> + <%= f.select :book_paper_type_id, BookPaperType.all.collect {|t| [ t.title, t.id ]}, {:class => "s_grid s_grid_8"} %> +
    • +
    • + <%= label_tag("", t("personal_book.author_type"), class: "s_grid_4 s_grid") %> + <% @author_types.each do |author_type| %> + <%= content_tag :label,:class => "s_grid_4 s_grid" do -%> + <%= check_box_tag 'writing_book[book_author_type_ids][]', author_type.id, @personal_book.book_author_type_ids.include?(author_type.id)%> + <%= author_type.title %> + <%= hidden_field_tag 'writing_book[book_author_type_ids][]', '' %> + <% end %> + <% end %> +
    • +
    • + <%= f.fields_for :extracted_chapters_translations do |f| %> + <%= f.text_field locale, + size: "20", + placeholder: t("personal_book.extracted_chapters"), + class: "s_grid_12 s_grid", + value: (@personal_book.extracted_chapters_translations[locale.to_s] rescue nil) %> + <% end %> +
    • +
    • + <%= f.fields_for :publishers_translations do |f| %> + <%= f.text_field locale, + size: "20", + placeholder: t("personal_book.publishers"), + class: "s_grid_12 s_grid", + value: (@personal_book.publishers_translations[locale.to_s] rescue nil) %> + <% end %> +
    • + +
    • + <%= label_tag("", t("personal_book.publication_date"), class: "s_grid_4 s_grid") %> + <%= f.date_select :publish_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %> + <%= f.date_select :publish_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %> +
    • +
    • + <%= label_tag("", t("personal_book.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%> +
    • + +
    +
    +
    +
    +
    +
      +
    • + <%= f.text_area :keywords, size: "20x3", placeholder: t("personal_book.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%> +
    • +
    • + <%= label_tag("", t("personal_book.pages"), class: "s_grid_4 s_grid") %><%= f.text_field :pages, size: "20", class: "s_grid_8 s_grid"%> +
    • +
    • + <%= f.label :language, t("personal_book.language"), :class => "s_grid s_grid_4" %> + <%= f.select :language, WritingBook::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %> +
    • +
    • + <%= label_tag("", t("personal_book.isbn"), class: "s_grid_4 s_grid") %><%= f.text_field :isbn, size: "20", class: "s_grid_8 s_grid"%> +
    • +
    • + <%= f.text_area :note, size: "20x3", placeholder: t("personal_book.note"), class: "s_grid_12 s_grid s_grid_h_5"%> +
    • +
    +
    +
    +
    +
    +
      +
    • + + + + + + + + + + + + + + + + <% @personal_book.writing_book_files.each_with_index do |writing_book_file, i| %> + <%= f.fields_for :writing_book_files, writing_book_file do |f| %> + <%= render :partial => 'form_file', :object => writing_book_file, :locals => {:f => f, :i => i} %> + <% end %> + <% end %> + +
      <%= t("personal_book.file")%><%= t("personal_book.file_name")%><%= t("personal_book.description") %>
      +
      + <%= hidden_field_tag 'plugin_file_field_count', @personal_book.writing_book_files.count %> + add +
      +
      +
    • +
    +
    +
    +
    + \ No newline at end of file diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/_form_file.html.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/_form_file.html.erb new file mode 100644 index 00000000..646677d4 --- /dev/null +++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/_form_file.html.erb @@ -0,0 +1,33 @@ +" class="list_item"> + +
    + <% if form_file.new_record? %> + <%= f.file_field :file, class: "s_grid_2" %> + <% end %> +
    + + + <%= f.text_field :title, :class => 's_grid_4' %> + + + <%= f.fields_for :file_title_translations do |f| %> + <%= f.text_field locale, + class: 's_grid_4', + value: (form_file.file_title_translations[locale] rescue nil) %> + <% end %> + + + + + <% if form_file.new_record? %> + + <% else %> + <%= f.hidden_field :id %> + + <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> + <% end %> + <%= form_file.file.file ? ( link_to '', form_file.file.url, {:class => 'icon-eye-open', :target => '_blank', :title => t(:view)} ) : '' %> + + + + diff --git a/app/views/desktop/research_d.html.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/books_window.html.erb similarity index 54% rename from app/views/desktop/research_d.html.erb rename to vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/books_window.html.erb index 6fb4fe12..4f299ab1 100644 --- a/app/views/desktop/research_d.html.erb +++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/books_window.html.erb @@ -1,8 +1,10 @@ -
    +<%= stylesheet_link_tag "/assets/personal_book/desktop/personal_book" %> +<%= javascript_include_tag "personal_book/desktop/personal_books" %> +
    \ No newline at end of file diff --git a/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/desktop/personal_experiences/index.html.erb b/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/desktop/personal_experiences/index.html.erb new file mode 100644 index 00000000..b7c351f5 --- /dev/null +++ b/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/desktop/personal_experiences/index.html.erb @@ -0,0 +1,84 @@ +
    +
    +
    +
    + +
    +
    +
    +
    More
    +
    + +
    +
    +
    +
    Tag
    +
    + +
    +
    +
    +
    Status
    +
    + +
    +
    +
    +
    View
    +
    +
      +
    • <%= link_to "Journal", panel_personal_experience_desktop_personal_experiences_path + "?view=organizationt_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "Title", panel_personal_experience_desktop_personal_experiences_path + "?view=paper_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "File", panel_personal_experience_desktop_personal_experiences_path + "?view=job_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "Keywords", panel_personal_experience_desktop_personal_experiences_path + "?view=department", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "Abstract", panel_personal_experience_desktop_personal_experiences_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    +
    +
    +
    +
    Share
    +
    + +
    +
    +
    +
    New Share
    +
    + +
    +
    +
    +
    +
    +
    +
    + <% @experiences.each do |w| %> + <%= publication_record w, @view_by%> + <% end %> +
    \ No newline at end of file diff --git a/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/desktop/personal_experiences/new.html.erb b/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/desktop/personal_experiences/new.html.erb new file mode 100644 index 00000000..7a835058 --- /dev/null +++ b/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/desktop/personal_experiences/new.html.erb @@ -0,0 +1,3 @@ +<%= form_for @experience, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_experience_desktop_personal_experiences_path do |f| %> + <%= render partial: 'form', locals: {:f => f} %> +<%end%> diff --git a/vendor/built_in_modules/personal_experience/config/locales/en.yml b/vendor/built_in_modules/personal_experience/config/locales/en.yml index a96b3993..7b99824f 100644 --- a/vendor/built_in_modules/personal_experience/config/locales/en.yml +++ b/vendor/built_in_modules/personal_experience/config/locales/en.yml @@ -1,4 +1,55 @@ en: - module_name: - personal_experience: Experience \ No newline at end of file + personal_experience: Book + personal_experience: + department : "Department" + experience_category : "Experience Category" + organizationt_title : "Organization Title" + paper_title : "Paper Title" + book_title : "Book Title" + job_title : "Job Title" + extracted_chapters : "Extracted Chapters" + publishers : "Publishers" + authors : "Authors" + tags : "Tags" + year : "Year" + language : "Language" + isbn : "ISSN(ISBN)" + vol_no : "Vol.No" + issue_no : "Issue.No" + 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" + file : "File" + file_name : "File name" + description : "File Description" + pages : "Pages" + book_paper_type : "Book Paper Type" + + 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…" diff --git a/vendor/built_in_modules/personal_experience/config/locales/zh_tw.yml b/vendor/built_in_modules/personal_experience/config/locales/zh_tw.yml index cfe8fd2c..da0a37f6 100644 --- a/vendor/built_in_modules/personal_experience/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/personal_experience/config/locales/zh_tw.yml @@ -1,5 +1,54 @@ zh_tw: - module_name: - personal_experience: 經歷 - \ No newline at end of file + personal_experience: 期刊著作 + personal_experience: + department : "Department" + organizationt_title : "Organization Title" + paper_title : "論文名稱" + book_title : "期刊名稱" + job_title : "Job Title" + extracted_chapters : "Extracted Chapters" + publishers : "Publishers" + authors : "作者" + tags : "領域" + year : "年度" + language : "語言" + isbn : "ISSN(ISBN)" + vol_no : "卷數" + issue_no : "期數" + form_to_start : "起" + form_to_end : "訖" + total_pages : "總頁數" + keywords : "關鍵字" + abstract : "摘要" + publication_date : "發表日期" + url : "參考連結" + note : "記事" + level_type : "期刊類別" + author_type : "作者類別" + from : "起" + to : "訖" + file : "檔案" + file_name : "檔案名稱" + description : "描述" + pages : "Pages" + book_paper_type : "Book Paper Type" + + create_success : "新增完成!!" + update_success : "更新完成!!" + delete_success : "刪除成功!!" + add: "新增" + back: "返回" + delete: "刪除" + edit: "編輯" + nothing: "無" + show: "顯示" + sure?: "您肯定嗎?" + update: "更新" + yes_: "是" + no_: "否" + cancel : "取消" + save: "儲存" + hintText: "請輸入搜尋關鍵字" + noResultsText: "沒有相關的比對結果" + searchingText: "搜尋中…" diff --git a/vendor/built_in_modules/personal_experience/config/routes.rb b/vendor/built_in_modules/personal_experience/config/routes.rb index 21c37de6..3cf82617 100644 --- a/vendor/built_in_modules/personal_experience/config/routes.rb +++ b/vendor/built_in_modules/personal_experience/config/routes.rb @@ -2,6 +2,10 @@ Rails.application.routes.draw do namespace :panel do namespace :personal_experience do + namespace :desktop do + match "experience_window" => "personal_experiences#experience_window" + resources :personal_experiences + end namespace :back_end do match 'experience_setting' => "experiences#experience_setting" ,:as => :experience_setting diff --git a/vendor/built_in_modules/personal_honor/app/assets/javascripts/personal_honor/desktop/personal_honors.js b/vendor/built_in_modules/personal_honor/app/assets/javascripts/personal_honor/desktop/personal_honors.js new file mode 100644 index 00000000..e4d64469 --- /dev/null +++ b/vendor/built_in_modules/personal_honor/app/assets/javascripts/personal_honor/desktop/personal_honors.js @@ -0,0 +1,158 @@ +orbitDesktop.prototype.initializePersonalHonor = function(target,url,cache){ // this init journal papers + this.initializePersonalHonor.formCallback = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + o.sub_menu_item($("div[content-type=menu] a").eq(0)); + }else{ + o.notify(data.msg,"alert"); + } + } + + this.initializePersonalHonor.list = function(){ // to open list part in journal papers page + var journalData; + var bindHandlers = function(){ // to bind handlers for list page + + } + bindHandlers(); + + var bindSecondaryHandlers = function(){ + $("#journal_p div#paper_list a.icon-check-empty").click(function(){ + if($(this).hasClass("icon-check-empty")){ + $(this).switchClass("icon-check-empty","icon-check",0); + } else if($(this) .hasClass("icon-check")) { + $(this).switchClass("icon-check","icon-check-empty",0); + } else if($(this).hasClass("icon-star")){ + $(this).removeClass("icon-star").addClass("icon-star-empty"); + } else if($(this).hasClass("icon-star-empty")){ + $(this).removeClass("icon-star-empty").addClass("icon-star"); + } + return false; + }) + } + } + this.initializePersonalHonor.honorDelete = function(data,dom){ + var parent = dom.parent().parent(); + if(data.success){ + parent.hide("slide",function(){parent.remove();}); + o.notify(data.msg,"success"); + } + } + + this.initializePersonalHonor.cancelhonor = function(){ + o.highlight_sub_menu_item(0); + } + + this.initializePersonalHonor.edithonor = function(){ + o.highlight_sub_menu_item(1); + var uploadFiles = function(){ + $('#add_plugin_file a.add').click(function(){ + var new_id = $(this).prev().attr('value'); + var old_id = new RegExp("new_writing_journal_files", "g"); + $(this).prev().attr('value', parseInt(new_id) + 1); + var x = get_html(old_id,new_id); + var newfield = $(x); + $(this).parents('table').append(newfield); + newfield.find('.action a.delete').click(function(){ + newfield.remove(); + }); + return false; + }); + $('.action a.remove_existing_record').click(function(){ + $(this).next('.should_destroy').attr('value', 1); + $("tr#add_plugin_file_" + $(this).prev().attr('value')).hide(); + }); + } + + + var preData = function(){ + $("#writing_journal_author_tokens").select2('data', JSON.parse($("#writing_journal_author_tokens").attr('data-pre'))); + } + uploadFiles(); + // preData(); + } + + this.initializePersonalHonor.addhonor = function(){ // to open add pages in journal papers page + var uploadFiles = function(){ + $('#add_plugin_file a.add').click(function(){ + var new_id = $(this).prev().attr('value'); + var old_id = new RegExp("new_writing_journal_files", "g"); + $(this).prev().attr('value', parseInt(new_id) + 1); + var x = get_html(old_id,new_id); + var newfield = $(x); + $(this).parents('table').append(newfield); + newfield.find('.action a.delete').click(function(){ + newfield.remove(); + }); + return false; + }); + $('.action a.remove_existing_record').click(function(){ + $(this).next('.should_destroy').attr('value', 1); + $("tr#add_plugin_file_" + $(this).prev().attr('value')).hide(); + }); + } + + // console.log("hi"); + var bindHandlers = function(){ + + + } + bindHandlers(); + uploadFiles(); + + } + + + this.initializePersonalHonor.coAuthorformCallback = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + o.sub_menu_item($("div[content-type=menu] a").eq(3)); + }else{ + o.notify(data.msg,"alert"); + } + } + this.initializePersonalHonor.coauthor = function(){ // to open add pages in coauthor page + var bindHandlers = function(){ // to bind handlers for add page + + } + bindHandlers(); + } + this.initializePersonalHonor.coauthorRelationForm = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + $("#co_author_relation_table").html(data.newvalue); + }else{ + o.notify(data.msg,"alert"); + } + } + this.initializePersonalHonor.coauthorRelationEditForm = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + var x = o.layout_data.generate_layout_html(data.newvalue); + $("div[container=true] div.overview").html(x.markup); + }else{ + o.notify(data.msg,"alert"); + } + } + this.initializePersonalHonor.allnone = function(d,o){ + switch(o.attr("href")){ + case "all": + $("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check"); + break; + case "none": + $("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty"); + break; + } + } + this.initializePersonalHonor.allnone = function(d,o){ + switch(o.attr("href")){ + case "all": + $("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check"); + break; + case "none": + $("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty"); + break; + } + } +}; + + diff --git a/vendor/built_in_modules/personal_honor/app/assets/stylesheets/personal_honor/desktop/personal_honor.css b/vendor/built_in_modules/personal_honor/app/assets/stylesheets/personal_honor/desktop/personal_honor.css new file mode 100644 index 00000000..f0c6ce6e --- /dev/null +++ b/vendor/built_in_modules/personal_honor/app/assets/stylesheets/personal_honor/desktop/personal_honor.css @@ -0,0 +1,115 @@ +/* Books */ +[page-name="books_list"] .list_t_item .inner { + padding-left: 30px; } +[page-name="books_list"] .list_item_action { + font-size: 12px; + float: left; + margin-left: -30px; } + [page-name="books_list"] .list_item_action a { + display: block; + width: 20px; + height: 20px; + line-height: 20px; + margin: 1px 1px 6px 1px; } + [page-name="books_list"] .list_item_action .icon-star-empty { + color: #999; + font-size: 20px; } + [page-name="books_list"] .list_item_action .icon-star { + color: #faa732; + font-size: 20px; } + [page-name="books_list"] .list_item_action .icon-check-empty { + color: #999; + font-size: 20px; } + [page-name="books_list"] .list_item_action .icon-check { + color: #333; + font-size: 20px; } +[page-name="books_list"] .file_view .list_t_des { + overflow: hidden; } +[page-name="books_list"] .file_view .file { + float: left; + width: 120px; + height: 50px; + padding: 6px; + margin: 1px; + position: relative; + -webkit-box-sizing: border-box; + /* webkit */ + -khtml-box-sizing: border-box; + /* konqueror */ + -moz-box-sizing: border-box; + /* firefox */ + -ms-box-sizing: border-box; + /* ie */ + box-sizing: border-box; + /* css3 */ } + [page-name="books_list"] .file_view .file:hover { + background-color: #f7f7f7; } + [page-name="books_list"] .file_view .file img { + width: 38px; + height: 38px; + position: absolute; + left: 6px; + top: 6px; } + [page-name="books_list"] .file_view .file .filetitle { + display: block; + width: 100%; + height: 38px; + padding-left: 40px; + overflow: hidden; + -webkit-box-sizing: border-box; + /* webkit */ + -khtml-box-sizing: border-box; + /* konqueror */ + -moz-box-sizing: border-box; + /* firefox */ + -ms-box-sizing: border-box; + /* ie */ + box-sizing: border-box; + /* css3 */ } + +/* Books Books list */ +[page-name="books_books"] .datalist_item .inner { + padding-left: 30px; } +[page-name="books_books"] .list_item_action { + font-size: 12px; + float: left; + margin-left: -30px; } +[page-name="books_books"] .list_item_action i { + color: #999; + font-size: 20px; + display: block; + width: 20px; + height: 20px; + line-height: 20px; + margin: 1px 1px 6px 1px; } +[page-name="books_books"] .list_t_desc { + font-family: Arial, sans-serif; + font-size: 12px; + color: #999; } + +/* Books Co-Author */ +[page-name="books_coauthor"] .list_t_item { + height: 110px; } +[page-name="books_coauthor"] .list_item_function a { + display: inline-block; + padding: 4px; + font-family: Arial, sans-serif; + font-size: 11px; + -webkit-text-size-adjust: none; } +[page-name="books_coauthor"] .info { + font-family: Arial, sans-serif; } +[page-name="books_coauthor"] .info li { + margin-bottom: 8px; + color: #999; } +[page-name="books_coauthor"] .info .name { + font-size: 18px; + line-height: 24px; + color: #333; } + +/* Books Co-Author Relationship*/ +[page-name="books_coauthor_relation"] .edit_co_author_relation { + /*margin-left: -10px;*/ } +[page-name="books_coauthor_relation"] .form_space { + margin-bottom: 10px; + font-size: 18px; + font-family: Arial, sans-serif; } diff --git a/vendor/built_in_modules/personal_honor/app/assets/stylesheets/personal_honor/desktop/personal_honor.scss b/vendor/built_in_modules/personal_honor/app/assets/stylesheets/personal_honor/desktop/personal_honor.scss new file mode 100644 index 00000000..ddafade9 --- /dev/null +++ b/vendor/built_in_modules/personal_honor/app/assets/stylesheets/personal_honor/desktop/personal_honor.scss @@ -0,0 +1,123 @@ +@import "desktop-helper"; + +/* Books */ +[page-name="books_list"] { + .list_t_item .inner { padding-left: 30px; } + .list_item_action { + font-size: 12px; + float: left; + margin-left: -30px; + + a { + display: block; + width: 20px; + height: 20px; + line-height: 20px; + margin: 1px 1px 6px 1px; + } + .icon-star-empty { color: #999; font-size: 20px; } + .icon-star { color: #faa732; font-size: 20px; } + .icon-check-empty { color: #999; font-size: 20px; } + .icon-check { color: #333; font-size: 20px; } + } + + .file_view { + .list_t_des { + overflow: hidden; + } + .file { + float: left; + width: 120px; + height: 50px; + padding: 6px; + margin: 1px; + position: relative; + @include box-sizing; + + &:hover { + background-color: lighten($gray, 10%); + } + img { + width: 38px; + height: 38px; + position: absolute; + left: 6px; + top: 6px; + } + .filetitle { + display: block; + width: 100%; + height: 38px; + padding-left: 40px; + overflow: hidden; + @include box-sizing; + } + } + } +} + +/* Books Books list */ +[page-name="books_books"] { + + .datalist_item .inner { + padding-left: 30px; + } + .list_item_action { + font-size: 12px; + float: left; + margin-left: -30px; + } + .list_item_action i { + color: #999; + font-size: 20px; + display: block; + width: 20px; + height: 20px; + line-height: 20px; + margin: 1px 1px 6px 1px; + } + .list_t_desc { + font-family: Arial, sans-serif; + font-size: 12px; + color: #999; + } +} + +/* Books Co-Author */ +[page-name="books_coauthor"] { + .list_t_item { + height: 110px; + } + .list_item_function {} + .list_item_function a { + display: inline-block; + padding: 4px; + font-family: Arial, sans-serif; + font-size: 11px; + -webkit-text-size-adjust: none; + } + .info { + font-family: Arial, sans-serif; + } + .info li { + margin-bottom: 8px; + color: #999; + } + .info .name { + font-size: 18px; + line-height: 24px; + color: #333; + } +} + +/* Books Co-Author Relationship*/ +[page-name="books_coauthor_relation"]{ + .edit_co_author_relation { + /*margin-left: -10px;*/ + } + .form_space { + margin-bottom: 10px; + font-size: 18px; + font-family: Arial, sans-serif; + } +} \ No newline at end of file diff --git a/vendor/built_in_modules/personal_honor/app/controllers/panel/personal_honor/desktop/personal_honors_controller.rb b/vendor/built_in_modules/personal_honor/app/controllers/panel/personal_honor/desktop/personal_honors_controller.rb new file mode 100644 index 00000000..f7b7e1b5 --- /dev/null +++ b/vendor/built_in_modules/personal_honor/app/controllers/panel/personal_honor/desktop/personal_honors_controller.rb @@ -0,0 +1,71 @@ +class Panel::PersonalHonor::Desktop::PersonalHonorsController < ApplicationController + + def index + @honors = Honor.where(create_user_id: current_user.id) + @view_by = params[:view] + page = params[:page] + page ||= 1 + + @per_column = 5 + + case @view_by + when "abstract" + @per_column = 1 + when "file" + @per_column = 2 + end + + if @view_by.nil? + @view_by = " " + @honors = @honors.asc(:paper_title) + else + @honors = @honors.asc(@view_by).asc(:paper_title) + end + @honors = @honors.page(page).per(50) + respond_to do |format| + format.html { render :layout => false} + end + end + + def new + @honor = Honor.new + render :layout => false + end + + def create + params[:honor][:create_user_id] = current_user.id + @honor = Honor.new(params[:honor]) + if @honor.save + render json: {success: true, msg: t('create_success')}.to_json + else + error_msg = @honor.errors.full_messages.join("
    ") + render json: {success: false, msg: error_msg}.to_json + end + end + + def edit + @honor = Honor.find(params[:id]) + render :layout => false + end + + def update + params[:honor][:create_user_id] = current_user.id + @honor = Honor.new(params[:honor]) + if @honor.update_attributes(params[:honor]) + render json: {success: true, msg: t('create_success')}.to_json + else + error_msg = @honor.errors.full_messages.join("
    ") + render json: {success: false, msg: error_msg}.to_json + end + end + + def destroy + @honor = Honor.find(params[:id]) + @honor.destroy + render :json => {success: true, msg: t('delete_success')} + end + + def honors_window + render :layout => false + end +end \ No newline at end of file diff --git a/vendor/built_in_modules/personal_honor/app/helpers/panel/personal_honor/desktop/personal_honors_helper.rb b/vendor/built_in_modules/personal_honor/app/helpers/panel/personal_honor/desktop/personal_honors_helper.rb new file mode 100644 index 00000000..380ba171 --- /dev/null +++ b/vendor/built_in_modules/personal_honor/app/helpers/panel/personal_honor/desktop/personal_honors_helper.rb @@ -0,0 +1,87 @@ +module Panel::PersonalHonor::Desktop::PersonalHonorsHelper + def publication_record publication, view + content_tag :li, + "item" => "true", + :class => "list_t_item" do + marker + \ + content(publication, view) + \ + edit_or_delete(publication) + end + end + + def marker + content_tag :div, + :class => "list_item_action" do + content_tag(:a, "",:href=>"", + :class => "icon-check-empty", + "toggle-onclick"=>"icon-check-empty icon-check", + "ajax-remote"=>"false") + \ + content_tag(:a, "",:href=>"", + :class => "icon-star-empty", + "toggle-onclick"=>"icon-star-empty icon-star", + "ajax-remote"=>"false") + end + end + + def content publication, view + case view + when "award_name" + des = content_tag(:div, publication.award_name, + :class => "list_t_des") + + end + + content_tag(:div, publication.award_name, + :class => "list_t_title") + des + + end + + def edit_or_delete publication + content_tag :div, + :class => "list_item_function" do + content_tag(:a, t("edit"), + :class => "journal_paper_edit admbg2 admtxt", + :href => edit_panel_personal_honor_desktop_personal_honor_path(publication), + "callback-method" => "edithonor", + "ajax-remote" => "get") + \ + content_tag(:a, t(:delete_), + "ajax-remote" => "delete", + "confirm-message" => t("sure?"), + "callback-method" => "honorDelete", + :class => "journal_paper_delete admbg2 admtxt", + :href => panel_personal_honor_desktop_personal_honor_path(publication)) + end + end + + def link_publication_file publication + publication.writing_book_files.map{|file| + link_to(image_tag(check_file_type(file.file.url)) + \ + content_tag(:span, file.title, :class => "filetitle"), + file.file.url, + :class => "file", + "target" => "_blank") + }.inject(:+) + end + + def check_file_type file + if not file.nil? + file_type = MIME::Types.type_for(file).first.to_s.split("/")[1] + file_type = "/assets/ft-icons/#{file_type}/#{file_type}-48_32.png" + else + file_type = "" + end + end + + def generate_authors_name ids + author_name = ids.map{|m| + if m == "0" + #{:id => 0, :text => current_user.name, :email => current_user.email } + {:id => 0, :text => current_user.name } + else + #{:id => m, :text => ConferenceCoAuthor.find(m).co_author, :email => ConferenceCoAuthor.find(m).email} + {:id => m, :text => ConferenceCoAuthor.find(m).co_author} + end + } + author_name.to_json + end +end diff --git a/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/_form.html.erb b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/_form.html.erb new file mode 100644 index 00000000..6b391994 --- /dev/null +++ b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/_form.html.erb @@ -0,0 +1,66 @@ +
    +
    + + <%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %> + <% if not @honor.new_record? %> + <%= submit_tag t("cancel"), :type => "button", "callback-method"=>"cancelhonor", "ajax-remote" => "get", :href => panel_personal_honor_desktop_personal_honors_path, class: "fn_btn ini_input hp hh1 admbg2 admtxt" %> + + <% end %> +
    +
    +
    Share
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
      +
    • + <%= label_tag("", t("personal_honor.award_name"), class: "s_grid_4 s_grid") %><%= f.text_field :award_name, size: "20", class: "s_grid_8 s_grid"%> +
    • +
    • + <%= label_tag("", t("personal_honor.awarding_unit"), class: "s_grid_4 s_grid") %><%= f.text_field :awarding_unit, size: "20", class: "s_grid_8 s_grid"%> +
    • +
    • + <%= label_tag("", t("personal_honor.year"), class: "s_grid_4 s_grid") %> + <%= select_year((@honor.year ? @honor.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'honor[year]',:class => 's_grid_4 s_grid'} ) %> +
    • +
    • + <%= label_tag("", t("personal_honor.honor_category"), class: "s_grid_4 s_grid") %> + <%= f.select :honor_category_id, HonorCategory.all.collect {|t| [ t.title, t.id ]}, {:class => "s_grid s_grid_4"} %> +
    • +
    • + <%= label_tag("", t("personal_honor.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%> +
    • +
    • + <%= f.text_area :keywords, size: "20x3", placeholder: t("personal_honor.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%> +
    • +
    • + <%= f.label :language, t("personal_honor.language"), :class => "s_grid s_grid_4" %> + <%= f.select :language, Honor::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %> +
    • +
    +
    +
    +
    +
    +
      +
    • + <%= f.text_area :note, size: "20x3", placeholder: t("personal_honor.note"), class: "s_grid_12 s_grid s_grid_h_5"%> +
    • +
    +
    +
    +
    \ No newline at end of file diff --git a/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/edit.html.erb b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/edit.html.erb new file mode 100644 index 00000000..1ce89943 --- /dev/null +++ b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/edit.html.erb @@ -0,0 +1,3 @@ +<%= form_for @honor, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_honor_desktop_personal_honors_path(@personal_book) do |f| %> + <%= render partial: 'form', locals: {:f => f} %> +<%end%> diff --git a/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/honors_window.html.erb b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/honors_window.html.erb new file mode 100644 index 00000000..df8538f0 --- /dev/null +++ b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/honors_window.html.erb @@ -0,0 +1,35 @@ +<%= stylesheet_link_tag "/assets/personal_honor/desktop/personal_honor" %> +<%= javascript_include_tag "personal_honor/desktop/personal_honors" %> +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/index.html.erb b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/index.html.erb new file mode 100644 index 00000000..990302ab --- /dev/null +++ b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/index.html.erb @@ -0,0 +1,84 @@ +
    +
    +
    +
    + +
    +
    +
    +
    More
    +
    + +
    +
    +
    +
    Tag
    +
    + +
    +
    +
    +
    Status
    +
    + +
    +
    +
    +
    View
    +
    +
      +
    • <%= link_to "Journal", panel_personal_honor_desktop_personal_honors_path + "?view=book_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "Title", panel_personal_honor_desktop_personal_honors_path + "?view=paper_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "File", panel_personal_honor_desktop_personal_honors_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "Keywords", panel_personal_honor_desktop_personal_honors_path + "?view=keywords", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "Abstract", panel_personal_honor_desktop_personal_honors_path + "?view=abstract", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    +
    +
    +
    +
    Share
    +
    + +
    +
    +
    +
    New Share
    +
    + +
    +
    +
    +
    +
    +
    +
    + <% @honors.each do |w| %> + <%= publication_record w, @view_by%> + <% end %> +
    \ No newline at end of file diff --git a/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/new.html.erb b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/new.html.erb new file mode 100644 index 00000000..4549628d --- /dev/null +++ b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/desktop/personal_honors/new.html.erb @@ -0,0 +1,3 @@ +<%= form_for @honor, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_honor_desktop_personal_honors_path do |f| %> + <%= render partial: 'form', locals: {:f => f} %> +<%end%> diff --git a/vendor/built_in_modules/personal_honor/config/locales/en.yml b/vendor/built_in_modules/personal_honor/config/locales/en.yml index bafc7443..9a708a4d 100644 --- a/vendor/built_in_modules/personal_honor/config/locales/en.yml +++ b/vendor/built_in_modules/personal_honor/config/locales/en.yml @@ -1,4 +1,54 @@ en: - module_name: - personal_honor: Honor \ No newline at end of file + personal_honor: Book + personal_honor: + paper_title : "Paper Title" + book_title : "Book Title" + award_name : "Award Name" + awarding_unit : "Awarding Unit" + honor_category : "Honor Category" + extracted_chapters : "Extracted Chapters" + publishers : "Publishers" + authors : "Authors" + tags : "Tags" + year : "Year" + language : "Language" + isbn : "ISSN(ISBN)" + vol_no : "Vol.No" + issue_no : "Issue.No" + 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" + file : "File" + file_name : "File name" + description : "File Description" + pages : "Pages" + book_paper_type : "Book Paper Type" + + 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…" diff --git a/vendor/built_in_modules/personal_honor/config/locales/zh_tw.yml b/vendor/built_in_modules/personal_honor/config/locales/zh_tw.yml index cee9079d..ce0a1e13 100644 --- a/vendor/built_in_modules/personal_honor/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/personal_honor/config/locales/zh_tw.yml @@ -1,4 +1,54 @@ zh_tw: - module_name: - personal_honor: 榮譽 \ No newline at end of file + personal_honor: 期刊著作 + personal_honor: + paper_title : "論文名稱" + book_title : "期刊名稱" + award_name : "Award Name" + awarding_unit : "Awarding Unit" + honor_category : "Honor Category" + extracted_chapters : "Extracted Chapters" + publishers : "Publishers" + authors : "作者" + tags : "領域" + year : "年度" + language : "語言" + isbn : "ISSN(ISBN)" + vol_no : "卷數" + issue_no : "期數" + form_to_start : "起" + form_to_end : "訖" + total_pages : "總頁數" + keywords : "關鍵字" + abstract : "摘要" + publication_date : "發表日期" + url : "參考連結" + note : "記事" + level_type : "期刊類別" + author_type : "作者類別" + from : "起" + to : "訖" + file : "檔案" + file_name : "檔案名稱" + description : "描述" + pages : "Pages" + book_paper_type : "Book Paper Type" + + create_success : "新增完成!!" + update_success : "更新完成!!" + delete_success : "刪除成功!!" + add: "新增" + back: "返回" + delete: "刪除" + edit: "編輯" + nothing: "無" + show: "顯示" + sure?: "您肯定嗎?" + update: "更新" + yes_: "是" + no_: "否" + cancel : "取消" + save: "儲存" + hintText: "請輸入搜尋關鍵字" + noResultsText: "沒有相關的比對結果" + searchingText: "搜尋中…" diff --git a/vendor/built_in_modules/personal_honor/config/routes.rb b/vendor/built_in_modules/personal_honor/config/routes.rb index c043ff78..ec5e9097 100644 --- a/vendor/built_in_modules/personal_honor/config/routes.rb +++ b/vendor/built_in_modules/personal_honor/config/routes.rb @@ -2,6 +2,11 @@ Rails.application.routes.draw do namespace :panel do namespace :personal_honor do + namespace :desktop do + match "honor_window" => "personal_honors#honors_window" + resources :personal_honors + end + namespace :back_end do match 'honor_setting' => "honors#honor_setting" ,:as => :honor_setting diff --git a/vendor/built_in_modules/personal_lab/app/assets/javascripts/personal_lab/desktop/personal_lab.js b/vendor/built_in_modules/personal_lab/app/assets/javascripts/personal_lab/desktop/personal_lab.js new file mode 100644 index 00000000..a91b1ddc --- /dev/null +++ b/vendor/built_in_modules/personal_lab/app/assets/javascripts/personal_lab/desktop/personal_lab.js @@ -0,0 +1,158 @@ +orbitDesktop.prototype.initializePersonalLab = function(target,url,cache){ // this init journal papers + this.initializePersonalLab.formCallback = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + o.sub_menu_item($("div[content-type=menu] a").eq(0)); + }else{ + o.notify(data.msg,"alert"); + } + } + + this.initializePersonalLab.list = function(){ // to open list part in journal papers page + var journalData; + var bindHandlers = function(){ // to bind handlers for list page + + } + bindHandlers(); + + var bindSecondaryHandlers = function(){ + $("#journal_p div#paper_list a.icon-check-empty").click(function(){ + if($(this).hasClass("icon-check-empty")){ + $(this).switchClass("icon-check-empty","icon-check",0); + } else if($(this) .hasClass("icon-check")) { + $(this).switchClass("icon-check","icon-check-empty",0); + } else if($(this).hasClass("icon-star")){ + $(this).removeClass("icon-star").addClass("icon-star-empty"); + } else if($(this).hasClass("icon-star-empty")){ + $(this).removeClass("icon-star-empty").addClass("icon-star"); + } + return false; + }) + } + } + this.initializePersonalLab.labDelete = function(data,dom){ + var parent = dom.parent().parent(); + if(data.success){ + parent.hide("slide",function(){parent.remove();}); + o.notify(data.msg,"success"); + } + } + + this.initializePersonalLab.cancellab = function(){ + o.highlight_sub_menu_item(0); + } + + this.initializePersonalLab.editlab = function(){ + o.highlight_sub_menu_item(1); + var uploadFiles = function(){ + $('#add_plugin_file a.add').click(function(){ + var new_id = $(this).prev().attr('value'); + var old_id = new RegExp("new_writing_journal_files", "g"); + $(this).prev().attr('value', parseInt(new_id) + 1); + var x = get_html(old_id,new_id); + var newfield = $(x); + $(this).parents('table').append(newfield); + newfield.find('.action a.delete').click(function(){ + newfield.remove(); + }); + return false; + }); + $('.action a.remove_existing_record').click(function(){ + $(this).next('.should_destroy').attr('value', 1); + $("tr#add_plugin_file_" + $(this).prev().attr('value')).hide(); + }); + } + + + var preData = function(){ + $("#writing_journal_author_tokens").select2('data', JSON.parse($("#writing_journal_author_tokens").attr('data-pre'))); + } + uploadFiles(); + // preData(); + } + + this.initializePersonalLab.addlab = function(){ // to open add pages in journal papers page + var uploadFiles = function(){ + $('#add_plugin_file a.add').click(function(){ + var new_id = $(this).prev().attr('value'); + var old_id = new RegExp("new_writing_journal_files", "g"); + $(this).prev().attr('value', parseInt(new_id) + 1); + var x = get_html(old_id,new_id); + var newfield = $(x); + $(this).parents('table').append(newfield); + newfield.find('.action a.delete').click(function(){ + newfield.remove(); + }); + return false; + }); + $('.action a.remove_existing_record').click(function(){ + $(this).next('.should_destroy').attr('value', 1); + $("tr#add_plugin_file_" + $(this).prev().attr('value')).hide(); + }); + } + + // console.log("hi"); + var bindHandlers = function(){ + + + } + bindHandlers(); + uploadFiles(); + + } + + + this.initializePersonalLab.coAuthorformCallback = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + o.sub_menu_item($("div[content-type=menu] a").eq(3)); + }else{ + o.notify(data.msg,"alert"); + } + } + this.initializePersonalLab.coauthor = function(){ // to open add pages in coauthor page + var bindHandlers = function(){ // to bind handlers for add page + + } + bindHandlers(); + } + this.initializePersonalLab.coauthorRelationForm = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + $("#co_author_relation_table").html(data.newvalue); + }else{ + o.notify(data.msg,"alert"); + } + } + this.initializePersonalLab.coauthorRelationEditForm = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + var x = o.layout_data.generate_layout_html(data.newvalue); + $("div[container=true] div.overview").html(x.markup); + }else{ + o.notify(data.msg,"alert"); + } + } + this.initializePersonalLab.allnone = function(d,o){ + switch(o.attr("href")){ + case "all": + $("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check"); + break; + case "none": + $("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty"); + break; + } + } + this.initializePersonalLab.allnone = function(d,o){ + switch(o.attr("href")){ + case "all": + $("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check"); + break; + case "none": + $("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty"); + break; + } + } +}; + + diff --git a/vendor/built_in_modules/personal_lab/app/assets/stylesheets/personal_lab/desktop/personal_lab.css b/vendor/built_in_modules/personal_lab/app/assets/stylesheets/personal_lab/desktop/personal_lab.css new file mode 100644 index 00000000..f0c6ce6e --- /dev/null +++ b/vendor/built_in_modules/personal_lab/app/assets/stylesheets/personal_lab/desktop/personal_lab.css @@ -0,0 +1,115 @@ +/* Books */ +[page-name="books_list"] .list_t_item .inner { + padding-left: 30px; } +[page-name="books_list"] .list_item_action { + font-size: 12px; + float: left; + margin-left: -30px; } + [page-name="books_list"] .list_item_action a { + display: block; + width: 20px; + height: 20px; + line-height: 20px; + margin: 1px 1px 6px 1px; } + [page-name="books_list"] .list_item_action .icon-star-empty { + color: #999; + font-size: 20px; } + [page-name="books_list"] .list_item_action .icon-star { + color: #faa732; + font-size: 20px; } + [page-name="books_list"] .list_item_action .icon-check-empty { + color: #999; + font-size: 20px; } + [page-name="books_list"] .list_item_action .icon-check { + color: #333; + font-size: 20px; } +[page-name="books_list"] .file_view .list_t_des { + overflow: hidden; } +[page-name="books_list"] .file_view .file { + float: left; + width: 120px; + height: 50px; + padding: 6px; + margin: 1px; + position: relative; + -webkit-box-sizing: border-box; + /* webkit */ + -khtml-box-sizing: border-box; + /* konqueror */ + -moz-box-sizing: border-box; + /* firefox */ + -ms-box-sizing: border-box; + /* ie */ + box-sizing: border-box; + /* css3 */ } + [page-name="books_list"] .file_view .file:hover { + background-color: #f7f7f7; } + [page-name="books_list"] .file_view .file img { + width: 38px; + height: 38px; + position: absolute; + left: 6px; + top: 6px; } + [page-name="books_list"] .file_view .file .filetitle { + display: block; + width: 100%; + height: 38px; + padding-left: 40px; + overflow: hidden; + -webkit-box-sizing: border-box; + /* webkit */ + -khtml-box-sizing: border-box; + /* konqueror */ + -moz-box-sizing: border-box; + /* firefox */ + -ms-box-sizing: border-box; + /* ie */ + box-sizing: border-box; + /* css3 */ } + +/* Books Books list */ +[page-name="books_books"] .datalist_item .inner { + padding-left: 30px; } +[page-name="books_books"] .list_item_action { + font-size: 12px; + float: left; + margin-left: -30px; } +[page-name="books_books"] .list_item_action i { + color: #999; + font-size: 20px; + display: block; + width: 20px; + height: 20px; + line-height: 20px; + margin: 1px 1px 6px 1px; } +[page-name="books_books"] .list_t_desc { + font-family: Arial, sans-serif; + font-size: 12px; + color: #999; } + +/* Books Co-Author */ +[page-name="books_coauthor"] .list_t_item { + height: 110px; } +[page-name="books_coauthor"] .list_item_function a { + display: inline-block; + padding: 4px; + font-family: Arial, sans-serif; + font-size: 11px; + -webkit-text-size-adjust: none; } +[page-name="books_coauthor"] .info { + font-family: Arial, sans-serif; } +[page-name="books_coauthor"] .info li { + margin-bottom: 8px; + color: #999; } +[page-name="books_coauthor"] .info .name { + font-size: 18px; + line-height: 24px; + color: #333; } + +/* Books Co-Author Relationship*/ +[page-name="books_coauthor_relation"] .edit_co_author_relation { + /*margin-left: -10px;*/ } +[page-name="books_coauthor_relation"] .form_space { + margin-bottom: 10px; + font-size: 18px; + font-family: Arial, sans-serif; } diff --git a/vendor/built_in_modules/personal_lab/app/assets/stylesheets/personal_lab/desktop/personal_lab.scss b/vendor/built_in_modules/personal_lab/app/assets/stylesheets/personal_lab/desktop/personal_lab.scss new file mode 100644 index 00000000..ddafade9 --- /dev/null +++ b/vendor/built_in_modules/personal_lab/app/assets/stylesheets/personal_lab/desktop/personal_lab.scss @@ -0,0 +1,123 @@ +@import "desktop-helper"; + +/* Books */ +[page-name="books_list"] { + .list_t_item .inner { padding-left: 30px; } + .list_item_action { + font-size: 12px; + float: left; + margin-left: -30px; + + a { + display: block; + width: 20px; + height: 20px; + line-height: 20px; + margin: 1px 1px 6px 1px; + } + .icon-star-empty { color: #999; font-size: 20px; } + .icon-star { color: #faa732; font-size: 20px; } + .icon-check-empty { color: #999; font-size: 20px; } + .icon-check { color: #333; font-size: 20px; } + } + + .file_view { + .list_t_des { + overflow: hidden; + } + .file { + float: left; + width: 120px; + height: 50px; + padding: 6px; + margin: 1px; + position: relative; + @include box-sizing; + + &:hover { + background-color: lighten($gray, 10%); + } + img { + width: 38px; + height: 38px; + position: absolute; + left: 6px; + top: 6px; + } + .filetitle { + display: block; + width: 100%; + height: 38px; + padding-left: 40px; + overflow: hidden; + @include box-sizing; + } + } + } +} + +/* Books Books list */ +[page-name="books_books"] { + + .datalist_item .inner { + padding-left: 30px; + } + .list_item_action { + font-size: 12px; + float: left; + margin-left: -30px; + } + .list_item_action i { + color: #999; + font-size: 20px; + display: block; + width: 20px; + height: 20px; + line-height: 20px; + margin: 1px 1px 6px 1px; + } + .list_t_desc { + font-family: Arial, sans-serif; + font-size: 12px; + color: #999; + } +} + +/* Books Co-Author */ +[page-name="books_coauthor"] { + .list_t_item { + height: 110px; + } + .list_item_function {} + .list_item_function a { + display: inline-block; + padding: 4px; + font-family: Arial, sans-serif; + font-size: 11px; + -webkit-text-size-adjust: none; + } + .info { + font-family: Arial, sans-serif; + } + .info li { + margin-bottom: 8px; + color: #999; + } + .info .name { + font-size: 18px; + line-height: 24px; + color: #333; + } +} + +/* Books Co-Author Relationship*/ +[page-name="books_coauthor_relation"]{ + .edit_co_author_relation { + /*margin-left: -10px;*/ + } + .form_space { + margin-bottom: 10px; + font-size: 18px; + font-family: Arial, sans-serif; + } +} \ No newline at end of file diff --git a/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/desktop/personal_labs_controller.rb b/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/desktop/personal_labs_controller.rb new file mode 100644 index 00000000..102a51df --- /dev/null +++ b/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/desktop/personal_labs_controller.rb @@ -0,0 +1,71 @@ +class Panel::PersonalLab::Desktop::PersonalLabsController < ApplicationController + + def index + @labs = Lab.where(create_user_id: current_user.id) + @view_by = params[:view] + page = params[:page] + page ||= 1 + + @per_column = 5 + + case @view_by + when "abstract" + @per_column = 1 + when "file" + @per_column = 2 + end + + if @view_by.nil? + @view_by = " " + @labs = @labs.asc(:paper_title) + else + @labs = @labs.asc(@view_by).asc(:paper_title) + end + @labs = @labs.page(page).per(50) + respond_to do |format| + format.html { render :layout => false} + end + end + + def new + @lab = Lab.new + render :layout => false + end + + def create + params[:lab][:create_user_id] = current_user.id + @lab = Lab.new(params[:lab]) + if @lab.save + render json: {success: true, msg: t('create_success')}.to_json + else + error_msg = @lab.errors.full_messages.join("
    ") + render json: {success: false, msg: error_msg}.to_json + end + end + + def edit + @lab = Lab.find(params[:id]) + render :layout => false + end + + def update + params[:lab][:create_user_id] = current_user.id + @lab = Lab.new(params[:lab]) + if @lab.update_attributes(params[:lab]) + render json: {success: true, msg: t('create_success')}.to_json + else + error_msg = @lab.errors.full_messages.join("
    ") + render json: {success: false, msg: error_msg}.to_json + end + end + + def destroy + @lab = Lab.find(params[:id]) + @lab.destroy + render :json => {success: true, msg: t('delete_success')} + end + + def lab_window + render :layout => false + end +end \ No newline at end of file diff --git a/vendor/built_in_modules/personal_lab/app/helpers/panel/personal_lab/desktop/personal_labs_helper.rb b/vendor/built_in_modules/personal_lab/app/helpers/panel/personal_lab/desktop/personal_labs_helper.rb new file mode 100644 index 00000000..2343bfd7 --- /dev/null +++ b/vendor/built_in_modules/personal_lab/app/helpers/panel/personal_lab/desktop/personal_labs_helper.rb @@ -0,0 +1,96 @@ +module Panel::PersonalLab::Desktop::PersonalLabsHelper + def publication_record publication, view + content_tag :li, + "item" => "true", + :class => "list_t_item" do + marker + \ + content(publication, view) + \ + edit_or_delete(publication) + end + end + + def marker + content_tag :div, + :class => "list_item_action" do + content_tag(:a, "",:href=>"", + :class => "icon-check-empty", + "toggle-onclick"=>"icon-check-empty icon-check", + "ajax-remote"=>"false") + \ + content_tag(:a, "",:href=>"", + :class => "icon-star-empty", + "toggle-onclick"=>"icon-star-empty icon-star", + "ajax-remote"=>"false") + end + end + + def content publication, view + case view + when "lab_title" + des = content_tag(:div, publication.lab_title, + :class => "list_t_des") + when "keywords" + des = content_tag(:div, publication.keywords, + :class => "list_t_des") + when "location" + des = content_tag(:div, publication.location, + :class => "list_t_des") + when "file" + des = content_tag(:div, link_publication_file(publication), + :class => "list_t_des") + else + end + + content_tag(:div, publication.lab_title, + :class => "list_t_title") + des + + end + + def edit_or_delete publication + content_tag :div, + :class => "list_item_function" do + content_tag(:a, t("edit"), + :class => "journal_paper_edit admbg2 admtxt", + :href => edit_panel_personal_lab_desktop_personal_lab_path(publication), + "callback-method" => "editlab", + "ajax-remote" => "get") + \ + content_tag(:a, t(:delete_), + "ajax-remote" => "delete", + "confirm-message" => t("sure?"), + "callback-method" => "labDelete", + :class => "journal_paper_delete admbg2 admtxt", + :href => panel_personal_lab_desktop_personal_lab_path(publication)) + end + end + + def link_publication_file publication + publication.lab_files.map{|file| + link_to(image_tag(check_file_type(file.file.url)) + \ + content_tag(:span, file.title, :class => "filetitle"), + file.file.url, + :class => "file", + "target" => "_blank") + }.inject(:+) + end + + def check_file_type file + if not file.nil? + file_type = MIME::Types.type_for(file).first.to_s.split("/")[1] + file_type = "/assets/ft-icons/#{file_type}/#{file_type}-48_32.png" + else + file_type = "" + end + end + + def generate_authors_name ids + author_name = ids.map{|m| + if m == "0" + #{:id => 0, :text => current_user.name, :email => current_user.email } + {:id => 0, :text => current_user.name } + else + #{:id => m, :text => ConferenceCoAuthor.find(m).co_author, :email => ConferenceCoAuthor.find(m).email} + {:id => m, :text => ConferenceCoAuthor.find(m).co_author} + end + } + author_name.to_json + end +end diff --git a/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/_form.html.erb b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/_form.html.erb new file mode 100644 index 00000000..2b39c9a6 --- /dev/null +++ b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/_form.html.erb @@ -0,0 +1,141 @@ +
    +
    + + <%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %> + <% if not @lab.new_record? %> + <%= submit_tag t("cancel"), :type => "button", "callback-method"=>"cancellab", "ajax-remote" => "get", :href => panel_personal_lab_desktop_personal_labs_path, class: "fn_btn ini_input hp hh1 admbg2 admtxt" %> + + <% end %> +
    +
    +
    Share
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
      +
    • + <%= f.fields_for :lab_title_translations do |f| %> + <%= f.text_field locale, + size: "20", + placeholder: t("personal_lab.lab_title"), + class: "s_grid_12 s_grid", + value: (@lab.lab_title_translations[locale.to_s] rescue nil) %> + <% end %> +
    • +
    • + <%= f.fields_for :location_translations do |f| %> + <%= f.text_field locale, + size: "20", + placeholder: t("personal_lab.location"), + class: "s_grid_12 s_grid", + value: (@lab.location_translations[locale.to_s] rescue nil) %> + <% end %> +
    • +
    • + <%= f.fields_for :participating_professor_translations do |f| %> + <%= f.text_field locale, + size: "20", + placeholder: t("personal_lab.participating_professor"), + class: "s_grid_12 s_grid", + value: (@lab.participating_professor_translations[locale.to_s] rescue nil) %> + <% end %> +
    • +
    • + <%= f.fields_for :participating_student_translations do |f| %> + <%= f.text_field locale, + size: "20", + placeholder: t("personal_lab.participating_student"), + class: "s_grid_12 s_grid", + value: (@lab.participating_student_translations[locale.to_s] rescue nil) %> + <% end %> +
    • +
    • + <%= label_tag("", t("personal_lab.extension_no"), class: "s_grid_4 s_grid") %><%= f.text_field :extension_no, size: "20", class: "s_grid_8 s_grid"%> +
    • +
    • + <%= label_tag("", t("personal_lab.research_direction"), class: "s_grid_4 s_grid") %><%= f.text_field :research_direction, size: "20", class: "s_grid_8 s_grid"%> +
    • +
    • + <%= label_tag("", t("personal_lab.facility"), class: "s_grid_4 s_grid") %><%= f.text_field :facility, size: "20", class: "s_grid_8 s_grid"%> +
    • +
    • + <%= label_tag("", t("personal_project.year"), class: "s_grid_4 s_grid") %> + <%= select_year((@lab.year ? @lab.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'lab[year]',:class => 's_grid_4 s_grid'} ) %> +
    • +
    • + <%= f.text_area :keywords, size: "20x3", placeholder: t("personal_lab.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%> +
    • +
    +
    +
    +
    +
    +
      +
    • + <%= label_tag("", t("personal_lab.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%> +
    • +
    • + <%= f.label :language, t("personal_lab.language"), :class => "s_grid s_grid_4" %> + <%= f.select :language, Lab::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %> +
    • +
    • + <%= f.text_area :note, size: "20x3", placeholder: t("personal_lab.note"), class: "s_grid_12 s_grid s_grid_h_5"%> +
    • +
    +
    +
    +
    +
    +
      +
    • + + + + + + + + + + + + + + + + <% @lab.lab_files.each_with_index do |lab_file, i| %> + <%= f.fields_for :lab_files, lab_file do |f| %> + <%= render :partial => 'form_file', :object => lab_file, :locals => {:f => f, :i => i} %> + <% end %> + <% end %> + +
      <%= t("personal_lab.file")%><%= t("personal_lab.file_name")%><%= t("personal_lab.description") %>
      +
      + <%= hidden_field_tag 'plugin_file_field_count', @lab.lab_files.count %> + add +
      +
      +
    • +
    +
    +
    +
    + \ No newline at end of file diff --git a/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/_form_file.html.erb b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/_form_file.html.erb new file mode 100644 index 00000000..646677d4 --- /dev/null +++ b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/_form_file.html.erb @@ -0,0 +1,33 @@ +" class="list_item"> + +
    + <% if form_file.new_record? %> + <%= f.file_field :file, class: "s_grid_2" %> + <% end %> +
    + + + <%= f.text_field :title, :class => 's_grid_4' %> + + + <%= f.fields_for :file_title_translations do |f| %> + <%= f.text_field locale, + class: 's_grid_4', + value: (form_file.file_title_translations[locale] rescue nil) %> + <% end %> + + + + + <% if form_file.new_record? %> + + <% else %> + <%= f.hidden_field :id %> + + <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> + <% end %> + <%= form_file.file.file ? ( link_to '', form_file.file.url, {:class => 'icon-eye-open', :target => '_blank', :title => t(:view)} ) : '' %> + + + + diff --git a/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/edit.html.erb b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/edit.html.erb new file mode 100644 index 00000000..d150519e --- /dev/null +++ b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/edit.html.erb @@ -0,0 +1,3 @@ +<%= form_for @lab, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_lab_desktop_personal_labs_path(@lab) do |f| %> + <%= render partial: 'form', locals: {:f => f} %> +<%end%> diff --git a/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/index.html.erb b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/index.html.erb new file mode 100644 index 00000000..bbe76633 --- /dev/null +++ b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/index.html.erb @@ -0,0 +1,83 @@ +
    +
    +
    +
    + +
    +
    +
    +
    More
    +
    + +
    +
    +
    +
    Tag
    +
    + +
    +
    +
    +
    Status
    +
    + +
    +
    +
    +
    View
    +
    +
      +
    • <%= link_to "Title", panel_personal_lab_desktop_personal_labs_path + "?view=lab_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "File", panel_personal_lab_desktop_personal_labs_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "Keywords", panel_personal_lab_desktop_personal_labs_path + "?view=keywords", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "Location", panel_personal_lab_desktop_personal_labs_path + "?view=location", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    +
    +
    +
    +
    Share
    +
    + +
    +
    +
    +
    New Share
    +
    + +
    +
    +
    +
    +
    +
    +
    + <% @labs.each do |w| %> + <%= publication_record w, @view_by%> + <% end %> +
    \ No newline at end of file diff --git a/app/views/desktop/research_p.html.erb b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/lab_window.html.erb similarity index 55% rename from app/views/desktop/research_p.html.erb rename to vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/lab_window.html.erb index 68fbf4cc..6d1e6ba7 100644 --- a/app/views/desktop/research_p.html.erb +++ b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/lab_window.html.erb @@ -1,8 +1,10 @@ -
    +<%= stylesheet_link_tag "/assets/personal_lab/desktop/personal_lab" %> +<%= javascript_include_tag "personal_lab/desktop/personal_lab" %> +
    \ No newline at end of file diff --git a/vendor/built_in_modules/personal_project/config/locales/en.yml b/vendor/built_in_modules/personal_project/config/locales/en.yml index 63c14b99..251281d7 100644 --- a/vendor/built_in_modules/personal_project/config/locales/en.yml +++ b/vendor/built_in_modules/personal_project/config/locales/en.yml @@ -1,4 +1,56 @@ en: - module_name: - personal_project: Project \ No newline at end of file + personal_project: "Project" + personal_project: + project_title : "Project Title" + job_title : "Job Title" + participator : "Participartor" + project_category : "Project Category" + end_date : "End Date" + start_date : "Start Date" + extracted_chapters : "Extracted Chapters" + unit : "Unit" + publishers : "Publishers" + authors : "Authors" + tags : "Tags" + year : "Year" + language : "Language" + isbn : "ISSN(ISBN)" + vol_no : "Vol.No" + issue_no : "Issue.No" + 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" + file : "File" + file_name : "File name" + description : "File Description" + pages : "Pages" + book_paper_type : "Book Paper Type" + + 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…" diff --git a/vendor/built_in_modules/personal_project/config/locales/zh_tw.yml b/vendor/built_in_modules/personal_project/config/locales/zh_tw.yml index 8c70b557..25b48eda 100644 --- a/vendor/built_in_modules/personal_project/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/personal_project/config/locales/zh_tw.yml @@ -1,4 +1,56 @@ zh_tw: - module_name: - personal_project: 研究計畫 + personal_project: 期刊著作 + personal_project: + project_title : "Project Title" + job_title : "Job Title" + participator : "Participartor" + extracted_chapters : "Extracted Chapters" + project_category : "Project Category" + end_date : "End Date" + start_date : "Start Date" + unit : "Unit" + publishers : "Publishers" + authors : "作者" + tags : "領域" + year : "年度" + language : "語言" + isbn : "ISSN(ISBN)" + vol_no : "卷數" + issue_no : "期數" + form_to_start : "起" + form_to_end : "訖" + total_pages : "總頁數" + keywords : "關鍵字" + abstract : "摘要" + publication_date : "發表日期" + url : "參考連結" + note : "記事" + level_type : "期刊類別" + author_type : "作者類別" + from : "起" + to : "訖" + file : "檔案" + file_name : "檔案名稱" + description : "描述" + pages : "Pages" + book_paper_type : "Book Paper Type" + + create_success : "新增完成!!" + update_success : "更新完成!!" + delete_success : "刪除成功!!" + add: "新增" + back: "返回" + delete: "刪除" + edit: "編輯" + nothing: "無" + show: "顯示" + sure?: "您肯定嗎?" + update: "更新" + yes_: "是" + no_: "否" + cancel : "取消" + save: "儲存" + hintText: "請輸入搜尋關鍵字" + noResultsText: "沒有相關的比對結果" + searchingText: "搜尋中…" diff --git a/vendor/built_in_modules/personal_project/config/routes.rb b/vendor/built_in_modules/personal_project/config/routes.rb index 7ab5843c..907cf3de 100644 --- a/vendor/built_in_modules/personal_project/config/routes.rb +++ b/vendor/built_in_modules/personal_project/config/routes.rb @@ -2,6 +2,10 @@ Rails.application.routes.draw do namespace :panel do namespace :personal_project do + namespace :desktop do + match "project_window" => "personal_projects#project_window" + resources :personal_projects + end namespace :back_end do match 'project_setting' => "projects#project_setting" ,:as => :project_setting diff --git a/vendor/built_in_modules/personal_research/app/assets/javascripts/personal_research/desktop/personal_research.js b/vendor/built_in_modules/personal_research/app/assets/javascripts/personal_research/desktop/personal_research.js new file mode 100644 index 00000000..35a64eee --- /dev/null +++ b/vendor/built_in_modules/personal_research/app/assets/javascripts/personal_research/desktop/personal_research.js @@ -0,0 +1,158 @@ +orbitDesktop.prototype.initializePersonalResearch = function(target,url,cache){ // this init journal papers + this.initializePersonalResearch.formCallback = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + o.sub_menu_item($("div[content-type=menu] a").eq(0)); + }else{ + o.notify(data.msg,"alert"); + } + } + + this.initializePersonalResearch.list = function(){ // to open list part in journal papers page + var journalData; + var bindHandlers = function(){ // to bind handlers for list page + + } + bindHandlers(); + + var bindSecondaryHandlers = function(){ + $("#journal_p div#paper_list a.icon-check-empty").click(function(){ + if($(this).hasClass("icon-check-empty")){ + $(this).switchClass("icon-check-empty","icon-check",0); + } else if($(this) .hasClass("icon-check")) { + $(this).switchClass("icon-check","icon-check-empty",0); + } else if($(this).hasClass("icon-star")){ + $(this).removeClass("icon-star").addClass("icon-star-empty"); + } else if($(this).hasClass("icon-star-empty")){ + $(this).removeClass("icon-star-empty").addClass("icon-star"); + } + return false; + }) + } + } + this.initializePersonalResearch.researchDelete = function(data,dom){ + var parent = dom.parent().parent(); + if(data.success){ + parent.hide("slide",function(){parent.remove();}); + o.notify(data.msg,"success"); + } + } + + this.initializePersonalResearch.cancelresearch = function(){ + o.highlight_sub_menu_item(0); + } + + this.initializePersonalResearch.editresearch = function(){ + o.highlight_sub_menu_item(1); + var uploadFiles = function(){ + $('#add_plugin_file a.add').click(function(){ + var new_id = $(this).prev().attr('value'); + var old_id = new RegExp("new_writing_journal_files", "g"); + $(this).prev().attr('value', parseInt(new_id) + 1); + var x = get_html(old_id,new_id); + var newfield = $(x); + $(this).parents('table').append(newfield); + newfield.find('.action a.delete').click(function(){ + newfield.remove(); + }); + return false; + }); + $('.action a.remove_existing_record').click(function(){ + $(this).next('.should_destroy').attr('value', 1); + $("tr#add_plugin_file_" + $(this).prev().attr('value')).hide(); + }); + } + + + var preData = function(){ + $("#writing_journal_author_tokens").select2('data', JSON.parse($("#writing_journal_author_tokens").attr('data-pre'))); + } + uploadFiles(); + // preData(); + } + + this.initializePersonalResearch.addresearch = function(){ // to open add pages in journal papers page + var uploadFiles = function(){ + $('#add_plugin_file a.add').click(function(){ + var new_id = $(this).prev().attr('value'); + var old_id = new RegExp("new_writing_journal_files", "g"); + $(this).prev().attr('value', parseInt(new_id) + 1); + var x = get_html(old_id,new_id); + var newfield = $(x); + $(this).parents('table').append(newfield); + newfield.find('.action a.delete').click(function(){ + newfield.remove(); + }); + return false; + }); + $('.action a.remove_existing_record').click(function(){ + $(this).next('.should_destroy').attr('value', 1); + $("tr#add_plugin_file_" + $(this).prev().attr('value')).hide(); + }); + } + + // console.log("hi"); + var bindHandlers = function(){ + + + } + bindHandlers(); + uploadFiles(); + + } + + + this.initializePersonalResearch.coAuthorformCallback = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + o.sub_menu_item($("div[content-type=menu] a").eq(3)); + }else{ + o.notify(data.msg,"alert"); + } + } + this.initializePersonalResearch.coauthor = function(){ // to open add pages in coauthor page + var bindHandlers = function(){ // to bind handlers for add page + + } + bindHandlers(); + } + this.initializePersonalResearch.coauthorRelationForm = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + $("#co_author_relation_table").html(data.newvalue); + }else{ + o.notify(data.msg,"alert"); + } + } + this.initializePersonalResearch.coauthorRelationEditForm = function(data){ + if(data.success){ + o.notify(data.msg,"success"); + var x = o.layout_data.generate_layout_html(data.newvalue); + $("div[container=true] div.overview").html(x.markup); + }else{ + o.notify(data.msg,"alert"); + } + } + this.initializePersonalResearch.allnone = function(d,o){ + switch(o.attr("href")){ + case "all": + $("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check"); + break; + case "none": + $("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty"); + break; + } + } + this.initializePersonalResearch.allnone = function(d,o){ + switch(o.attr("href")){ + case "all": + $("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check"); + break; + case "none": + $("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty"); + break; + } + } +}; + + diff --git a/vendor/built_in_modules/personal_research/app/assets/stylesheets/personal_research/desktop/personal_research.css b/vendor/built_in_modules/personal_research/app/assets/stylesheets/personal_research/desktop/personal_research.css new file mode 100644 index 00000000..f0c6ce6e --- /dev/null +++ b/vendor/built_in_modules/personal_research/app/assets/stylesheets/personal_research/desktop/personal_research.css @@ -0,0 +1,115 @@ +/* Books */ +[page-name="books_list"] .list_t_item .inner { + padding-left: 30px; } +[page-name="books_list"] .list_item_action { + font-size: 12px; + float: left; + margin-left: -30px; } + [page-name="books_list"] .list_item_action a { + display: block; + width: 20px; + height: 20px; + line-height: 20px; + margin: 1px 1px 6px 1px; } + [page-name="books_list"] .list_item_action .icon-star-empty { + color: #999; + font-size: 20px; } + [page-name="books_list"] .list_item_action .icon-star { + color: #faa732; + font-size: 20px; } + [page-name="books_list"] .list_item_action .icon-check-empty { + color: #999; + font-size: 20px; } + [page-name="books_list"] .list_item_action .icon-check { + color: #333; + font-size: 20px; } +[page-name="books_list"] .file_view .list_t_des { + overflow: hidden; } +[page-name="books_list"] .file_view .file { + float: left; + width: 120px; + height: 50px; + padding: 6px; + margin: 1px; + position: relative; + -webkit-box-sizing: border-box; + /* webkit */ + -khtml-box-sizing: border-box; + /* konqueror */ + -moz-box-sizing: border-box; + /* firefox */ + -ms-box-sizing: border-box; + /* ie */ + box-sizing: border-box; + /* css3 */ } + [page-name="books_list"] .file_view .file:hover { + background-color: #f7f7f7; } + [page-name="books_list"] .file_view .file img { + width: 38px; + height: 38px; + position: absolute; + left: 6px; + top: 6px; } + [page-name="books_list"] .file_view .file .filetitle { + display: block; + width: 100%; + height: 38px; + padding-left: 40px; + overflow: hidden; + -webkit-box-sizing: border-box; + /* webkit */ + -khtml-box-sizing: border-box; + /* konqueror */ + -moz-box-sizing: border-box; + /* firefox */ + -ms-box-sizing: border-box; + /* ie */ + box-sizing: border-box; + /* css3 */ } + +/* Books Books list */ +[page-name="books_books"] .datalist_item .inner { + padding-left: 30px; } +[page-name="books_books"] .list_item_action { + font-size: 12px; + float: left; + margin-left: -30px; } +[page-name="books_books"] .list_item_action i { + color: #999; + font-size: 20px; + display: block; + width: 20px; + height: 20px; + line-height: 20px; + margin: 1px 1px 6px 1px; } +[page-name="books_books"] .list_t_desc { + font-family: Arial, sans-serif; + font-size: 12px; + color: #999; } + +/* Books Co-Author */ +[page-name="books_coauthor"] .list_t_item { + height: 110px; } +[page-name="books_coauthor"] .list_item_function a { + display: inline-block; + padding: 4px; + font-family: Arial, sans-serif; + font-size: 11px; + -webkit-text-size-adjust: none; } +[page-name="books_coauthor"] .info { + font-family: Arial, sans-serif; } +[page-name="books_coauthor"] .info li { + margin-bottom: 8px; + color: #999; } +[page-name="books_coauthor"] .info .name { + font-size: 18px; + line-height: 24px; + color: #333; } + +/* Books Co-Author Relationship*/ +[page-name="books_coauthor_relation"] .edit_co_author_relation { + /*margin-left: -10px;*/ } +[page-name="books_coauthor_relation"] .form_space { + margin-bottom: 10px; + font-size: 18px; + font-family: Arial, sans-serif; } diff --git a/vendor/built_in_modules/personal_research/app/assets/stylesheets/personal_research/desktop/personal_research.scss b/vendor/built_in_modules/personal_research/app/assets/stylesheets/personal_research/desktop/personal_research.scss new file mode 100644 index 00000000..ddafade9 --- /dev/null +++ b/vendor/built_in_modules/personal_research/app/assets/stylesheets/personal_research/desktop/personal_research.scss @@ -0,0 +1,123 @@ +@import "desktop-helper"; + +/* Books */ +[page-name="books_list"] { + .list_t_item .inner { padding-left: 30px; } + .list_item_action { + font-size: 12px; + float: left; + margin-left: -30px; + + a { + display: block; + width: 20px; + height: 20px; + line-height: 20px; + margin: 1px 1px 6px 1px; + } + .icon-star-empty { color: #999; font-size: 20px; } + .icon-star { color: #faa732; font-size: 20px; } + .icon-check-empty { color: #999; font-size: 20px; } + .icon-check { color: #333; font-size: 20px; } + } + + .file_view { + .list_t_des { + overflow: hidden; + } + .file { + float: left; + width: 120px; + height: 50px; + padding: 6px; + margin: 1px; + position: relative; + @include box-sizing; + + &:hover { + background-color: lighten($gray, 10%); + } + img { + width: 38px; + height: 38px; + position: absolute; + left: 6px; + top: 6px; + } + .filetitle { + display: block; + width: 100%; + height: 38px; + padding-left: 40px; + overflow: hidden; + @include box-sizing; + } + } + } +} + +/* Books Books list */ +[page-name="books_books"] { + + .datalist_item .inner { + padding-left: 30px; + } + .list_item_action { + font-size: 12px; + float: left; + margin-left: -30px; + } + .list_item_action i { + color: #999; + font-size: 20px; + display: block; + width: 20px; + height: 20px; + line-height: 20px; + margin: 1px 1px 6px 1px; + } + .list_t_desc { + font-family: Arial, sans-serif; + font-size: 12px; + color: #999; + } +} + +/* Books Co-Author */ +[page-name="books_coauthor"] { + .list_t_item { + height: 110px; + } + .list_item_function {} + .list_item_function a { + display: inline-block; + padding: 4px; + font-family: Arial, sans-serif; + font-size: 11px; + -webkit-text-size-adjust: none; + } + .info { + font-family: Arial, sans-serif; + } + .info li { + margin-bottom: 8px; + color: #999; + } + .info .name { + font-size: 18px; + line-height: 24px; + color: #333; + } +} + +/* Books Co-Author Relationship*/ +[page-name="books_coauthor_relation"]{ + .edit_co_author_relation { + /*margin-left: -10px;*/ + } + .form_space { + margin-bottom: 10px; + font-size: 18px; + font-family: Arial, sans-serif; + } +} \ No newline at end of file diff --git a/vendor/built_in_modules/personal_research/app/controllers/panel/personal_research/desktop/personal_researchs_controller.rb b/vendor/built_in_modules/personal_research/app/controllers/panel/personal_research/desktop/personal_researchs_controller.rb new file mode 100644 index 00000000..f902fa50 --- /dev/null +++ b/vendor/built_in_modules/personal_research/app/controllers/panel/personal_research/desktop/personal_researchs_controller.rb @@ -0,0 +1,71 @@ +class Panel::PersonalResearch::Desktop::PersonalResearchsController < ApplicationController + + def index + @researches = Research.where(create_user_id: current_user.id) + @view_by = params[:view] + page = params[:page] + page ||= 1 + + @per_column = 5 + + case @view_by + when "abstract" + @per_column = 1 + when "file" + @per_column = 2 + end + + if @view_by.nil? + @view_by = " " + @researches = @researches.asc(:paper_title) + else + @researches = @researches.asc(@view_by).asc(:paper_title) + end + @researches = @researches.page(page).per(50) + respond_to do |format| + format.html { render :layout => false} + end + end + + def new + @research = Research.new + render :layout => false + end + + def create + params[:research][:create_user_id] = current_user.id + @research = Research.new(params[:research]) + if @research.save + render json: {success: true, msg: t('create_success')}.to_json + else + error_msg = @research.errors.full_messages.join("
    ") + render json: {success: false, msg: error_msg}.to_json + end + end + + def edit + @research = Research.find(params[:id]) + render :layout => false + end + + def update + params[:research][:create_user_id] = current_user.id + @research = Research.new(params[:research]) + if @research.update_attributes(params[:research]) + render json: {success: true, msg: t('create_success')}.to_json + else + error_msg = @research.errors.full_messages.join("
    ") + render json: {success: false, msg: error_msg}.to_json + end + end + + def destroy + @research = Research.find(params[:id]) + @research.destroy + render :json => {success: true, msg: t('delete_success')} + end + + def research_window + render :layout => false + end +end \ No newline at end of file diff --git a/vendor/built_in_modules/personal_research/app/helpers/panel/personal_research/desktop/personal_researchs_helper.rb b/vendor/built_in_modules/personal_research/app/helpers/panel/personal_research/desktop/personal_researchs_helper.rb new file mode 100644 index 00000000..204d7c3b --- /dev/null +++ b/vendor/built_in_modules/personal_research/app/helpers/panel/personal_research/desktop/personal_researchs_helper.rb @@ -0,0 +1,96 @@ +module Panel::PersonalResearch::Desktop::PersonalResearchsHelper + def publication_record publication, view + content_tag :li, + "item" => "true", + :class => "list_t_item" do + marker + \ + content(publication, view) + \ + edit_or_delete(publication) + end + end + + def marker + content_tag :div, + :class => "list_item_action" do + content_tag(:a, "",:href=>"", + :class => "icon-check-empty", + "toggle-onclick"=>"icon-check-empty icon-check", + "ajax-remote"=>"false") + \ + content_tag(:a, "",:href=>"", + :class => "icon-star-empty", + "toggle-onclick"=>"icon-star-empty icon-star", + "ajax-remote"=>"false") + end + end + + def content publication, view + case view + when "research_title" + des = content_tag(:div, publication.research_title, + :class => "list_t_des") + when "keywords" + des = content_tag(:div, publication.keywords, + :class => "list_t_des") + when "extracted_chapters" + des = content_tag(:div, publication.extracted_chapters, + :class => "list_t_des") + when "file" + des = content_tag(:div, link_publication_file(publication), + :class => "list_t_des") + else + end + + content_tag(:div, publication.research_title, + :class => "list_t_title") + des + + end + + def edit_or_delete publication + content_tag :div, + :class => "list_item_function" do + content_tag(:a, t("edit"), + :class => "journal_paper_edit admbg2 admtxt", + :href => edit_panel_personal_research_desktop_personal_research_path(publication), + "callback-method" => "editresearch", + "ajax-remote" => "get") + \ + content_tag(:a, t(:delete_), + "ajax-remote" => "delete", + "confirm-message" => t("sure?"), + "callback-method" => "researchDelete", + :class => "journal_paper_delete admbg2 admtxt", + :href => panel_personal_research_desktop_personal_research_path(publication)) + end + end + + def link_publication_file publication + publication.research_files.map{|file| + link_to(image_tag(check_file_type(file.file.url)) + \ + content_tag(:span, file.title, :class => "filetitle"), + file.file.url, + :class => "file", + "target" => "_blank") + }.inject(:+) + end + + def check_file_type file + if not file.nil? + file_type = MIME::Types.type_for(file).first.to_s.split("/")[1] + file_type = "/assets/ft-icons/#{file_type}/#{file_type}-48_32.png" + else + file_type = "" + end + end + + def generate_authors_name ids + author_name = ids.map{|m| + if m == "0" + #{:id => 0, :text => current_user.name, :email => current_user.email } + {:id => 0, :text => current_user.name } + else + #{:id => m, :text => ConferenceCoAuthor.find(m).co_author, :email => ConferenceCoAuthor.find(m).email} + {:id => m, :text => ConferenceCoAuthor.find(m).co_author} + end + } + author_name.to_json + end +end diff --git a/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/_form.html.erb b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/_form.html.erb new file mode 100644 index 00000000..1c5e969b --- /dev/null +++ b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/_form.html.erb @@ -0,0 +1,109 @@ +
    +
    + + <%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %> + <% if not @research.new_record? %> + <%= submit_tag t("cancel"), :type => "button", "callback-method"=>"cancelresearch", "ajax-remote" => "get", :href => panel_personal_research_desktop_personal_researchs_path, class: "fn_btn ini_input hp hh1 admbg2 admtxt" %> + + <% end %> +
    +
    +
    Share
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
      +
    • + <%= f.fields_for :research_title_translations do |f| %> + <%= f.text_field locale, + size: "20", + placeholder: t("personal_research.research_title"), + class: "s_grid_12 s_grid", + value: (@research.research_title_translations[locale.to_s] rescue nil) %> + <% end %> +
    • +
    • + <%= f.fields_for :extracted_chapters_translations do |f| %> + <%= f.text_field locale, + size: "20", + placeholder: t("personal_research.extracted_chapters"), + class: "s_grid_12 s_grid", + value: (@research.extracted_chapters_translations[locale.to_s] rescue nil) %> + <% end %> +
    • +
    • + <%= label_tag("", t("personal_research.publication_date"), class: "s_grid_4 s_grid") %> + <%= f.date_select :publish_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %> + <%= f.date_select :publish_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %> +
    • +
    • + <%= label_tag("", t("personal_research.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%> +
    • +
    • + <%= f.text_area :keywords, size: "20x3", placeholder: t("personal_research.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%> +
    • +
    • + <%= f.label :language, t("personal_research.language"), :class => "s_grid s_grid_4" %> + <%= f.select :language, Research::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %> +
    • +
    • + <%= f.text_area :note, size: "20x3", placeholder: t("personal_research.note"), class: "s_grid_12 s_grid s_grid_h_3"%> +
    • +
    +
    +
    +
    +
    +
      +
    • + + + + + + + + + + + + + + + + <% @research.research_files.each_with_index do |research_file, i| %> + <%= f.fields_for :research_files, research_file do |f| %> + <%= render :partial => 'form_file', :object => research_file, :locals => {:f => f, :i => i} %> + <% end %> + <% end %> + +
      <%= t("personal_research.file")%><%= t("personal_research.file_name")%><%= t("personal_research.description") %>
      +
      + <%= hidden_field_tag 'plugin_file_field_count', @research.research_files.count %> + add +
      +
      +
    • +
    +
    +
    +
    + \ No newline at end of file diff --git a/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/_form_file.html.erb b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/_form_file.html.erb new file mode 100644 index 00000000..646677d4 --- /dev/null +++ b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/_form_file.html.erb @@ -0,0 +1,33 @@ +" class="list_item"> + +
    + <% if form_file.new_record? %> + <%= f.file_field :file, class: "s_grid_2" %> + <% end %> +
    + + + <%= f.text_field :title, :class => 's_grid_4' %> + + + <%= f.fields_for :file_title_translations do |f| %> + <%= f.text_field locale, + class: 's_grid_4', + value: (form_file.file_title_translations[locale] rescue nil) %> + <% end %> + + + + + <% if form_file.new_record? %> + + <% else %> + <%= f.hidden_field :id %> + + <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> + <% end %> + <%= form_file.file.file ? ( link_to '', form_file.file.url, {:class => 'icon-eye-open', :target => '_blank', :title => t(:view)} ) : '' %> + + + + diff --git a/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/edit.html.erb b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/edit.html.erb new file mode 100644 index 00000000..082a2aa5 --- /dev/null +++ b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/edit.html.erb @@ -0,0 +1,3 @@ +<%= form_for @research, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_research_desktop_personal_researchs_path(@personal_book) do |f| %> + <%= render partial: 'form', locals: {:f => f} %> +<%end%> diff --git a/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/index.html.erb b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/index.html.erb new file mode 100644 index 00000000..57b48b85 --- /dev/null +++ b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/index.html.erb @@ -0,0 +1,83 @@ +
    +
    +
    +
    + +
    +
    +
    +
    More
    +
    + +
    +
    +
    +
    Tag
    +
    + +
    +
    +
    +
    Status
    +
    + +
    +
    +
    +
    View
    +
    +
      +
    • <%= link_to "Journal", panel_personal_research_desktop_personal_researchs_path + "?view=research_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "Title", panel_personal_research_desktop_personal_researchs_path + "?view=extracted_chapters", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "File", panel_personal_research_desktop_personal_researchs_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    • <%= link_to "Keywords", panel_personal_research_desktop_personal_researchs_path + "?view=keywords", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
    • +
    +
    +
    +
    +
    Share
    +
    + +
    +
    +
    +
    New Share
    +
    + +
    +
    +
    +
    +
    +
    +
    + <% @researches.each do |w| %> + <%= publication_record w, @view_by%> + <% end %> +
    \ No newline at end of file diff --git a/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/new.html.erb b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/new.html.erb new file mode 100644 index 00000000..4c680946 --- /dev/null +++ b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/new.html.erb @@ -0,0 +1,3 @@ +<%= form_for @research, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_research_desktop_personal_researchs_path do |f| %> + <%= render partial: 'form', locals: {:f => f} %> +<%end%> diff --git a/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/research_window.html.erb b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/research_window.html.erb new file mode 100644 index 00000000..efbdfb76 --- /dev/null +++ b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/desktop/personal_researchs/research_window.html.erb @@ -0,0 +1,35 @@ +<%= stylesheet_link_tag "/assets/personal_research/desktop/personal_research" %> +<%= javascript_include_tag "personal_research/desktop/personal_research" %> +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/vendor/built_in_modules/personal_research/config/locales/en.yml b/vendor/built_in_modules/personal_research/config/locales/en.yml index 23b06009..32f0dc88 100644 --- a/vendor/built_in_modules/personal_research/config/locales/en.yml +++ b/vendor/built_in_modules/personal_research/config/locales/en.yml @@ -1,4 +1,51 @@ en: - module_name: - personal_research: Research \ No newline at end of file + personal_research: Book + personal_research: + paper_title : "Paper Title" + research_title : "Research Title" + extracted_chapters : "Extracted Chapters" + publishers : "Publishers" + authors : "Authors" + tags : "Tags" + year : "Year" + language : "Language" + isbn : "ISSN(ISBN)" + vol_no : "Vol.No" + issue_no : "Issue.No" + 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" + file : "File" + file_name : "File name" + description : "File Description" + pages : "Pages" + book_paper_type : "Book Paper Type" + + 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…" diff --git a/vendor/built_in_modules/personal_research/config/locales/zh_tw.yml b/vendor/built_in_modules/personal_research/config/locales/zh_tw.yml index 1b7a20eb..3a6e8d92 100644 --- a/vendor/built_in_modules/personal_research/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/personal_research/config/locales/zh_tw.yml @@ -1,4 +1,51 @@ zh_tw: - module_name: - personal_research: 研究 + personal_research: 期刊著作 + personal_research: + paper_title : "論文名稱" + research_title : "Research Title" + extracted_chapters : "Extracted Chapters" + publishers : "Publishers" + authors : "作者" + tags : "領域" + year : "年度" + language : "語言" + isbn : "ISSN(ISBN)" + vol_no : "卷數" + issue_no : "期數" + form_to_start : "起" + form_to_end : "訖" + total_pages : "總頁數" + keywords : "關鍵字" + abstract : "摘要" + publication_date : "發表日期" + url : "參考連結" + note : "記事" + level_type : "期刊類別" + author_type : "作者類別" + from : "起" + to : "訖" + file : "檔案" + file_name : "檔案名稱" + description : "描述" + pages : "Pages" + book_paper_type : "Book Paper Type" + + create_success : "新增完成!!" + update_success : "更新完成!!" + delete_success : "刪除成功!!" + add: "新增" + back: "返回" + delete: "刪除" + edit: "編輯" + nothing: "無" + show: "顯示" + sure?: "您肯定嗎?" + update: "更新" + yes_: "是" + no_: "否" + cancel : "取消" + save: "儲存" + hintText: "請輸入搜尋關鍵字" + noResultsText: "沒有相關的比對結果" + searchingText: "搜尋中…" diff --git a/vendor/built_in_modules/personal_research/config/routes.rb b/vendor/built_in_modules/personal_research/config/routes.rb index f9cb8d1c..c753af28 100644 --- a/vendor/built_in_modules/personal_research/config/routes.rb +++ b/vendor/built_in_modules/personal_research/config/routes.rb @@ -2,6 +2,10 @@ Rails.application.routes.draw do namespace :panel do namespace :personal_research do + namespace :desktop do + match "research_window" => "personal_researchs#research_window" + resources :personal_researchs + end namespace :back_end do match 'research_setting' => "researchs#research_setting" ,:as => :research_setting