From d941e096bae31c2520aec6214ca3e3c248db191c Mon Sep 17 00:00:00 2001 From: Saurabh Bhatia Date: Wed, 25 Jun 2014 21:43:04 +0800 Subject: [PATCH] added brief intro --- app/assets/javascripts/admin/journal_paper_intros.js | 2 ++ app/assets/stylesheets/admin/journal_paper_intros.css | 4 ++++ .../admin/journal_paper_intros_controller.rb | 8 ++++++++ app/helpers/admin/journal_paper_intros_helper.rb | 2 ++ app/models/journal_paper_intro.rb | 3 +++ app/views/admin/journal_papers/index.html.erb | 2 +- app/views/plugin/journal_paper/_profile.html.erb | 5 ++++- config/locales/en.yml | 2 +- config/locales/zh_tw.yml | 2 +- config/routes.rb | 1 + lib/personal_journal/engine.rb | 4 ++-- .../admin/journal_paper_intros_controller_test.rb | 7 +++++++ test/fixtures/journal_paper_intros.yml | 11 +++++++++++ .../helpers/admin/journal_paper_intros_helper_test.rb | 4 ++++ test/models/journal_paper_intro_test.rb | 7 +++++++ 15 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 app/assets/javascripts/admin/journal_paper_intros.js create mode 100644 app/assets/stylesheets/admin/journal_paper_intros.css create mode 100644 app/controllers/admin/journal_paper_intros_controller.rb create mode 100644 app/helpers/admin/journal_paper_intros_helper.rb create mode 100644 app/models/journal_paper_intro.rb create mode 100644 test/controllers/admin/journal_paper_intros_controller_test.rb create mode 100644 test/fixtures/journal_paper_intros.yml create mode 100644 test/helpers/admin/journal_paper_intros_helper_test.rb create mode 100644 test/models/journal_paper_intro_test.rb diff --git a/app/assets/javascripts/admin/journal_paper_intros.js b/app/assets/javascripts/admin/journal_paper_intros.js new file mode 100644 index 0000000..dee720f --- /dev/null +++ b/app/assets/javascripts/admin/journal_paper_intros.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/admin/journal_paper_intros.css b/app/assets/stylesheets/admin/journal_paper_intros.css new file mode 100644 index 0000000..afad32d --- /dev/null +++ b/app/assets/stylesheets/admin/journal_paper_intros.css @@ -0,0 +1,4 @@ +/* + Place all the styles related to the matching controller here. + They will automatically be included in application.css. +*/ diff --git a/app/controllers/admin/journal_paper_intros_controller.rb b/app/controllers/admin/journal_paper_intros_controller.rb new file mode 100644 index 0000000..f2efd52 --- /dev/null +++ b/app/controllers/admin/journal_paper_intros_controller.rb @@ -0,0 +1,8 @@ +class Admin::JournalPaperIntrosController < Admin::PersonalPluginIntrosController + def initialize + super + @app_type = 'journal_paper_intro' + @app_type_name = 'journal_paper' + @reback_name = 'JournalPaper' + end +end diff --git a/app/helpers/admin/journal_paper_intros_helper.rb b/app/helpers/admin/journal_paper_intros_helper.rb new file mode 100644 index 0000000..3dc03bf --- /dev/null +++ b/app/helpers/admin/journal_paper_intros_helper.rb @@ -0,0 +1,2 @@ +module Admin::JournalPaperIntrosHelper +end diff --git a/app/models/journal_paper_intro.rb b/app/models/journal_paper_intro.rb new file mode 100644 index 0000000..570724e --- /dev/null +++ b/app/models/journal_paper_intro.rb @@ -0,0 +1,3 @@ +class JournalPaperIntro < PersonalPluginIntro + +end diff --git a/app/views/admin/journal_papers/index.html.erb b/app/views/admin/journal_papers/index.html.erb index aab137b..5e43349 100644 --- a/app/views/admin/journal_papers/index.html.erb +++ b/app/views/admin/journal_papers/index.html.erb @@ -12,7 +12,7 @@ <%= t('personal_journal.year') %> - <%= t('module_name.personal_journal') %> + <%= t('module_name.journal_paper') %> <%= t('personal_journal.authors') %> diff --git a/app/views/plugin/journal_paper/_profile.html.erb b/app/views/plugin/journal_paper/_profile.html.erb index c5a492e..0ccd75e 100644 --- a/app/views/plugin/journal_paper/_profile.html.erb +++ b/app/views/plugin/journal_paper/_profile.html.erb @@ -47,7 +47,7 @@ <% end -%> <%= t('personal_journal.year') %> - <%= t('module_name.personal_journal') %> + <%= t('module_name.journal_paper') %> <% if not @user%> <%= t('personal_journal.authors') %> <% end %> @@ -85,7 +85,10 @@ <% if current_user.is_admin? %>
+
+ <%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.edit_brief_intro'),admin_journal_paper_intros_path(member_profile_id: @member.id), :class => 'btn btn-primary' %> + <%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_admin_journal_paper_path(member_profile_id: @member.id), :class => 'btn btn-primary' %>