-
+
+
@@ -9,167 +9,9 @@
All Sections
-
diff --git a/app/views/desktop/app_manager.html.erb b/app/views/desktop/app_manager.html.erb
index b6a54fe3b..68e16a881 100644
--- a/app/views/desktop/app_manager.html.erb
+++ b/app/views/desktop/app_manager.html.erb
@@ -1,10 +1,10 @@
-
-
+
+
+
-
-
Apps Manager
- Date
- Alphabet [A-Z]
-
+
+
diff --git a/app/views/desktop/app_view1.html.erb b/app/views/desktop/app_view1.html.erb
index 795c9ab00..7e58781e4 100644
--- a/app/views/desktop/app_view1.html.erb
+++ b/app/views/desktop/app_view1.html.erb
@@ -1,8 +1,8 @@
Apps Manager
+ Date
+ Alphabet [A-Z]
+
-
-
Appname
-
+
+
Appname
+
diff --git a/app/views/desktop/appstore.html.erb b/app/views/desktop/appstore.html.erb
index 4aeca5da0..bed665bb4 100644
--- a/app/views/desktop/appstore.html.erb
+++ b/app/views/desktop/appstore.html.erb
@@ -1,7 +1,7 @@
-
-
+
diff --git a/app/views/desktop/appstore/onlinestore.html.erb b/app/views/desktop/appstore/onlinestore.html.erb
index c5df54d96..df32a551d 100644
--- a/app/views/desktop/appstore/onlinestore.html.erb
+++ b/app/views/desktop/appstore/onlinestore.html.erb
@@ -1,4 +1,4 @@
-
+
@@ -10,10 +10,10 @@
App Store
-
-
- Online Store -
- Widgets -
- Apps -
- Registeration +
- Online Store +
- Widgets +
- Apps +
- Registeration
Online Store
+Online Store
diff --git a/app/views/desktop/appstore/widgets.html.erb b/app/views/desktop/appstore/widgets.html.erb
index 4fd150c43..b3eff8b07 100644
--- a/app/views/desktop/appstore/widgets.html.erb
+++ b/app/views/desktop/appstore/widgets.html.erb
@@ -1,4 +1,4 @@
-
Your Widgets
+Your Widgets
diff --git a/app/views/desktop/books.html.erb b/app/views/desktop/books.html.erb
index 80990dc9e..f8303ad03 100644
--- a/app/views/desktop/books.html.erb
+++ b/app/views/desktop/books.html.erb
@@ -1,10 +1,10 @@
-
-
+
+
Books
-
+
@@ -13,14 +13,14 @@
diff --git a/app/views/desktop/books/add.html.erb b/app/views/desktop/books/add.html.erb
index 764f293ef..558362abf 100644
--- a/app/views/desktop/books/add.html.erb
+++ b/app/views/desktop/books/add.html.erb
@@ -1,38 +1,38 @@
-
-
-
- List -
- Add/Edit -
- Books -
- Co-Authors -
- Tags & Keywords -
- Analysis -
- Import -
- Export +
- List +
- Add/Edit +
- Books +
- Co-Authors +
- Tags & Keywords +
- Analysis +
- Import +
- Export
+
-
-
+
+
-
-
Year
+
+
- Year
-
Language
+
-
-
+
+
diff --git a/app/views/desktop/books/list.html.erb b/app/views/desktop/books/list.html.erb
index 30fc4f60c..b459a6601 100644
--- a/app/views/desktop/books/list.html.erb
+++ b/app/views/desktop/books/list.html.erb
@@ -1,68 +1,68 @@
-
-
-
+
+
-
-
More
+
-
-
Tag
+
-
-
Status
+
-
-
View
+
+
- View
-
Share
+
-
-
+
+
diff --git a/app/views/desktop/books/seminar.html.erb b/app/views/desktop/books/seminar.html.erb
index e32e4d6c5..807d6d8c9 100644
--- a/app/views/desktop/books/seminar.html.erb
+++ b/app/views/desktop/books/seminar.html.erb
@@ -1,68 +1,68 @@
-
-
-
+
+
-
-
More
+
-
-
Tag
+
-
-
Status
+
-
-
View
+
+
- View
-
Share
+
-
-
+
+
diff --git a/app/views/desktop/desktop.html.erb b/app/views/desktop/desktop.html.erb
index 938275066..dbdf06a67 100644
--- a/app/views/desktop/desktop.html.erb
+++ b/app/views/desktop/desktop.html.erb
@@ -1,7 +1,7 @@
-
-
+
+
Loading...
-
diff --git a/app/views/desktop/index.html.erb b/app/views/desktop/index.html.erb
index c61aec8e2..37230db86 100644
--- a/app/views/desktop/index.html.erb
+++ b/app/views/desktop/index.html.erb
@@ -1,65 +1,65 @@
- List -
- Add/Edit -
- Domains -
- Co-Authors -
- Tags & Keywords -
- Analysis -
- Import -
- Export +
- List +
- Add/Edit +
- Domains +
- Co-Authors +
- Tags & Keywords +
- Analysis +
- Import +
- Export
- List -
- Add/Edit -
- Projects -
- Co-Authors -
- Tags & Keywords -
- Analysis -
- Import -
- Export +
- List +
- Add/Edit +
- Projects +
- Co-Authors +
- Tags & Keywords +
- Analysis +
- Import +
- Export
- Overview -
- Account -
- Sections -
- Theme -
- Connection +
- Overview +
- Account +
- Sections +
- Theme +
- Connection
- Select Theme -
- Custom Theme -
- Wallpaper +
- Select Theme +
- Custom Theme +
- Wallpaper
- <%= f.label :current_password %> @@ -11,7 +11,7 @@
- <%= f.label :password_confirmation %> <%= f.password_field :password_confirmation %>
-
- <%= conference_co_author_relation.relation %>-- <%= link_to 'Edit', edit_panel_personal_conference_desktop_conference_co_author_relation_path(conference_co_author_relation), :class => "bt-edit-type admbg2 admtxt", "content-holder"=>"#form_space_"+i.to_s, "ajax-remote"=>"get" %> - <%= link_to 'Destroy', panel_personal_conference_desktop_conference_co_author_relation_path(conference_co_author_relation), "confirm-message"=>'Are you sure?', "ajax-remote"=>"delete", :class=>"bt-delete admbg2 admtxt" %> --
- <% if ( i % 6 ) == 5 %>
-
-
+ <%= conference_co_author_relation.relation %>++ <%= link_to t('edit'), edit_panel_personal_conference_desktop_conference_co_author_relation_path(conference_co_author_relation), :class => "bt-edit-type admbg2 admtxt", "content-holder"=>"#form_space_"+i.to_s, "ajax-remote"=>"get" %> + <%= link_to t('delete'), panel_personal_conference_desktop_conference_co_author_relation_path(conference_co_author_relation), "confirm-message"=>t('sure?'), "ajax-remote"=>"delete", :class=>"bt-delete admbg2 admtxt" %>+
<% end %>
-<% end %>
+
- <%= render 'new' %>
- +
-
- <%= co_author.co_author %>
- <%= co_author.email %>
- <%= @conference_co_author_relations.find(co_author.conference_co_author_relations_id).relation unless co_author.conference_co_author_relations_id.nil?%>
- <%= link_to 'Edit', edit_panel_personal_conference_desktop_conference_co_author_path(co_author), :class => "bt-edit admbg2 admtxt", "ajax-remote"=>"get" %> - <%= link_to 'Destroy', panel_personal_conference_desktop_conference_co_author_path(co_author), "ajax-remote"=>"delete", "confirm-message"=>'Are you sure?', "callback-method"=>"paperDelete", :class=>"bt-delete admbg2 admtxt" %> + <%= link_to t('edit'), edit_panel_personal_conference_desktop_conference_co_author_path(co_author), :class => "bt-edit admbg2 admtxt", "ajax-remote"=>"get" %> + <%= link_to t('delete'), panel_personal_conference_desktop_conference_co_author_path(co_author), "ajax-remote"=>"delete", "confirm-message"=>t('sure?'), "callback-method"=>"paperDelete", :class=>"bt-delete admbg2 admtxt" %>
- <% if ( i % 4 ) == 3 %>
- - <%= f.fields_for :paper_title_translations do |f| %> - <%= f.text_area locale, - class: "s_grid_6 s_grid", - size: "20x2", - placeholder: t("personal_conference.paper_title"), - value: (@writing_conference.paper_title_translations[locale.to_s] rescue nil) %> - <% end %> - - -
- - <%= f.fields_for :conference_title_translations do |f| %> - <%= f.text_field locale, - size: "20", - placeholder: t("personal_conference.conference_title"), - class: "s_grid_6 s_grid", - # "autocomplete-list" => "conference_title_autocomplete_list", - value: (@writing_conference.conference_title_translations[locale.to_s] rescue nil) %> - <% end %> - - - -
-
- - <%= label_tag("", t("personal_conference.paper_type")) %> --
-
- <% @paper_types.each_with_index do |paper_type, i| %>
-
- - <%= radio_button_tag "writing_conference[conference_paper_type_ids][]", - paper_type.id, - @writing_conference.conference_paper_type_ids.include?(paper_type.id), - id: "field-#{i}" - %><%= label_tag("field-#{i}", paper_type.title) %> - - <% end %> -
-
- - - <%= f.text_field :keywords, size: "20", placeholder: t("personal_conference.keywords"), class: "s_grid_6 s_grid"%> - - -
-
- - <%= label_tag("", t("personal_conference.conference_time")) %> --
-
-
- - <%= label_tag("", t("personal_conference.period_start_date"), class: "s_grid_1 s_grid") %> - <%= f.date_select :period_start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %> - - -
- - <%= label_tag("", t("personal_conference.period_end_date"), class: "s_grid_1 s_grid") %> - <%= f.date_select :period_end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %> - -
-
- - - <%= label_tag("", t("personal_conference.sponsor"), class: "s_grid_2 s_grid") %><%= f.text_field :sponsor, size: "20", placeholder: "Sponsor", class: "s_grid_4 s_grid"%> - - -
- - <%= label_tag("", t("personal_conference.location"), class: "s_grid_2 s_grid") %><%= f.text_field :location, size: "20", placeholder: "Location", class: "s_grid_4 s_grid"%> - - -
- - <%= label_tag("", t("personal_conference.url"), class: "s_grid_2 s_grid") %><%= f.text_field :url, size: "20", placeholder: "www.sample.com", class: "s_grid_4 s_grid"%> - - +
- - <%= f.fields_for :authors_translations do |f| %> - <%= f.text_area locale, - class: "s_grid_6 s_grid", - size: "20x2", - placeholder: t("personal_conference.authors"), - # "autocomplete-list" => "coauthor_autocomplete_list", - value: (@writing_conference.authors_translations[locale.to_s] rescue nil) %> - <% end %> - - - -
- - - - -
- - - - -
- - <%= label_tag("", t("personal_conference.publication_date"), class: "s_grid_3 s_grid") %> - <%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %> - - -
- - <%= f.label :year, t("personal_conference.year"), :class => "s_grid_2 s_grid" %> - <%= select_year((@writing_conference.year ? @writing_conference.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_conference[year]', :class => "s_grid_4 s_grid"} ) %> - - -
- > - -
- - <%= f.text_area :abstract, size: "20x22", placeholder: t("personal_conference.abstract"), class: "s_grid_6 s_grid full_height"%> - -
-
-
- -
-- - - -<%= t("personal_conference.file")%> -<%= t("personal_conference.file_name")%> -<%= t("personal_conference.description") %> -- - - - <% @writing_conference.writing_conference_files.each_with_index do |writing_conference_file, i| %> - <%= f.fields_for :writing_conference_files, writing_conference_file do |f| %> - <%= render :partial => 'form_file', :object => writing_conference_file, :locals => {:f => f, :i => i} %> - <% end %> - <% end %> - -- -- <%= hidden_field_tag 'plugin_file_field_count', @writing_conference.writing_conference_files.count %> - add --
- -
-
-
- <%= f.text_area :note, size: "20x22", placeholder: t("personal_conference.note"), class: "s_grid_6 s_grid full_height"%>
-
- + <%= f.fields_for :paper_title_translations do |f| %> + <%= f.text_area locale, + class: "s_grid_6 s_grid", + size: "20x2", + placeholder: t("personal_conference.paper_title"), + value: (@writing_conference.paper_title_translations[locale.to_s] rescue nil) %> + <% end %> + +
- + <%= f.fields_for :conference_title_translations do |f| %> + <%= f.text_field locale, + size: "20", + placeholder: t("personal_conference.conference_title"), + class: "s_grid_6 s_grid", + # "autocomplete-list" => "conference_title_autocomplete_list", + value: (@writing_conference.conference_title_translations[locale.to_s] rescue nil) %> + <% end %> + + +
-
+ + <%= label_tag("", t("personal_conference.paper_type")) %> ++
-
+ <% @paper_types.each_with_index do |paper_type, i| %>
+
- + <%= radio_button_tag "writing_conference[conference_paper_type_ids][]", + paper_type.id, + @writing_conference.conference_paper_type_ids.include?(paper_type.id), + id: "field-#{i}" + %><%= label_tag("field-#{i}", paper_type.title) %> + + <% end %> +
+ - + <%= f.text_field :keywords, size: "20", placeholder: t("personal_conference.keywords"), class: "s_grid_6 s_grid"%> + +
-
+ + <%= label_tag("", t("personal_conference.conference_time")) %> ++
-
+
- + <%= label_tag("", t("personal_conference.period_start_date"), class: "s_grid_1 s_grid") %> + <%= f.date_select :period_start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %> + - +
- + <%= label_tag("", t("personal_conference.period_end_date"), class: "s_grid_1 s_grid") %> + <%= f.date_select :period_end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %> + +
+ - + <%= label_tag("", t("personal_conference.sponsor"), class: "s_grid_2 s_grid") %><%= f.text_field :sponsor, size: "20", placeholder: "Sponsor", class: "s_grid_4 s_grid"%> + +
- + <%= label_tag("", t("personal_conference.location"), class: "s_grid_2 s_grid") %><%= f.text_field :location, size: "20", placeholder: "Location", class: "s_grid_4 s_grid"%> + +
- + <%= label_tag("", t("personal_conference.url"), class: "s_grid_2 s_grid") %><%= f.text_field :url, size: "20", placeholder: "www.sample.com", class: "s_grid_4 s_grid"%> + - +
- + + + +
- + <%= label_tag("", t("personal_conference.publication_date"), class: "s_grid_3 s_grid") %> + <%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %> + + +
- + <%= f.label :year, t("personal_conference.year"), :class => "s_grid_2 s_grid" %> + <%= select_year((@writing_conference.year ? @writing_conference.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_conference[year]', :class => "s_grid_4 s_grid"} ) %> + + +
- > + +
- + <%= f.text_area :abstract, size: "20x22", placeholder: t("personal_conference.abstract"), class: "s_grid_6 s_grid full_height"%> + +
-
+
+ +
++ + + +<%= t("personal_conference.file")%> +<%= t("personal_conference.file_name")%> +<%= t("personal_conference.description") %> ++ + + + <% @writing_conference.writing_conference_files.each_with_index do |writing_conference_file, i| %> + <%= f.fields_for :writing_conference_files, writing_conference_file do |f| %> + <%= render :partial => 'form_file', :object => writing_conference_file, :locals => {:f => f, :i => i} %> + <% end %> + <% end %> + ++ ++ <%= hidden_field_tag 'plugin_file_field_count', @writing_conference.writing_conference_files.count %> + add ++
+ -
+
-
+ <%= f.text_area :note, size: "20x22", placeholder: t("personal_conference.note"), class: "s_grid_6 s_grid full_height"%>
+
+ - +
-
<%= title %><%= level.join(",") %>
- <% if ( i % 5 ) == 4 %>
- <%= link_to "Conference", panel_personal_conference_desktop_conference_pages_path + "?view=conference_title", :class => "hp hh2 admtxt", "ajax-remote" => "get" %> -
- <%= link_to "Title", panel_personal_conference_desktop_conference_pages_path + "?view=paper_title", :class => "hp hh2 admtxt", "ajax-remote" => "get" %> -
- <%= link_to "File", panel_personal_conference_desktop_conference_pages_path + "?view=file", :class => "hp hh2 admtxt", "ajax-remote" => "get" %> -
- <%= link_to "Keywords", panel_personal_conference_desktop_conference_pages_path + "?view=keywords", :class => "hp hh2 admtxt", "ajax-remote" => "get" %> -
- <%= link_to "Abstract", panel_personal_conference_desktop_conference_pages_path + "?view=abstract", :class => "hp hh2 admtxt", "ajax-remote" => "get" %> +
- <%= link_to "Conference", panel_personal_conference_desktop_conference_pages_path + "?view=conference_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %> +
- <%= link_to "Title", panel_personal_conference_desktop_conference_pages_path + "?view=paper_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %> +
- <%= link_to "File", panel_personal_conference_desktop_conference_pages_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %> +
- <%= link_to "Keywords", panel_personal_conference_desktop_conference_pages_path + "?view=keywords", :class => "hp hh1 admtxt", "ajax-remote" => "get" %> +
- <%= link_to "Abstract", panel_personal_conference_desktop_conference_pages_path + "?view=abstract", :class => "hp hh1 admtxt", "ajax-remote" => "get" %>
- List -
- Add/Edit -
- Conference -
- Co-Authors -
- Tags & Keywords -
- Analysis -
- Import -
- Export +
- List +
- Add/Edit +
- Conference +
- Co-Authors +
- Tags & Keywords +
- Analysis +
- Import +
- Export
- '+journal.title+''+paper.title+'');
- // column.find("ul").append(li);
- // if(counter%5==0){
- // $("#journal_p div#paper_list div.overview").append(column);
- // column = $('
- '+paper.title+''+paper.keywords+'');
- // column.find("ul").append(li);
- // if(counter%5==0){
- // $("#journal_p div#paper_list div.overview").append(column);
- // column = $('
- '+paper.title+'');
- // column.find("ul").append(li);
- // if(counter%5==0){
- // $("#journal_p div#paper_list div.overview").append(column);
- // column = $('
- '+paper.title+''+paper.abstract+'');
- // column.find("ul").append(li);
- // $("#journal_p div#paper_list div.overview").append(column);
- // column = $('
-
- <%= journal_co_author_relation.relation %>-- <%= link_to 'Edit', edit_panel_personal_journal_desktop_journal_co_author_relation_path(journal_co_author_relation), :class => "bt-edit-type admbg2 admtxt", "content-holder"=>"#form_space_"+i.to_s, "ajax-remote"=>"get" %> - <%= link_to 'Destroy', panel_personal_journal_desktop_journal_co_author_relation_path(journal_co_author_relation), "confirm-message"=>'Are you sure?', "ajax-remote"=>"delete", :class=>"bt-delete admbg2 admtxt" %> --
- <% if ( i % 6 ) == 5 %>
-
-
+ <%= journal_co_author_relation.relation %>++ <%= link_to t('edit'), edit_panel_personal_journal_desktop_journal_co_author_relation_path(journal_co_author_relation), :class => "bt-edit-type admbg2 admtxt", "content-holder"=>"#form_space_"+i.to_s, "ajax-remote"=>"get" %> + <%= link_to t('delete'), panel_personal_journal_desktop_journal_co_author_relation_path(journal_co_author_relation), "confirm-message"=>t('sure?'), "ajax-remote"=>"delete", :class=>"bt-delete admbg2 admtxt" %>+
<% end %>
-<% end %>
+
- <%= render 'new' %>
- <%= f.label :type, class: "s_grid s_grid_2"%> -
-
+
diff --git a/app/views/desktop/orbit.html.erb b/app/views/desktop/orbit.html.erb
index b9bcbda63..e2727a41f 100644
--- a/app/views/desktop/orbit.html.erb
+++ b/app/views/desktop/orbit.html.erb
@@ -1,27 +1,27 @@
-
-
+
+
TimeLine
-
+
-
-
+
diff --git a/app/views/desktop/patents/add.html.erb b/app/views/desktop/patents/add.html.erb
index 28283456f..77d4b4c06 100644
--- a/app/views/desktop/patents/add.html.erb
+++ b/app/views/desktop/patents/add.html.erb
@@ -1,38 +1,38 @@
-
+
-
-
+
+
-
-
Year
+
+
- Year
-
Language
+
-
-
+
+
diff --git a/app/views/desktop/patents/list.html.erb b/app/views/desktop/patents/list.html.erb
index e32e4d6c5..807d6d8c9 100644
--- a/app/views/desktop/patents/list.html.erb
+++ b/app/views/desktop/patents/list.html.erb
@@ -1,68 +1,68 @@
-
-
-
+
+
-
-
More
+
-
-
Tag
+
-
-
Status
+
-
-
View
+
+
- View
-
Share
+
-
-
+
+
diff --git a/app/views/desktop/research_d.html.erb b/app/views/desktop/research_d.html.erb
index c74f04692..6fb4fe123 100644
--- a/app/views/desktop/research_d.html.erb
+++ b/app/views/desktop/research_d.html.erb
@@ -1,10 +1,10 @@
-
-
+
+
Research Domain
-
+
@@ -13,14 +13,14 @@
diff --git a/app/views/desktop/research_domain/add.html.erb b/app/views/desktop/research_domain/add.html.erb
index 28283456f..77d4b4c06 100644
--- a/app/views/desktop/research_domain/add.html.erb
+++ b/app/views/desktop/research_domain/add.html.erb
@@ -1,38 +1,38 @@
-
-
-
+
-
-
+
+
-
-
Year
+
+
- Year
-
Language
+
-
-
+
+
diff --git a/app/views/desktop/research_domain/list.html.erb b/app/views/desktop/research_domain/list.html.erb
index e32e4d6c5..807d6d8c9 100644
--- a/app/views/desktop/research_domain/list.html.erb
+++ b/app/views/desktop/research_domain/list.html.erb
@@ -1,68 +1,68 @@
-
-
-
+
+
-
-
More
+
-
-
Tag
+
-
-
Status
+
-
-
View
+
+
- View
-
Share
+
-
-
+
+
diff --git a/app/views/desktop/research_p.html.erb b/app/views/desktop/research_p.html.erb
index 2d38c05cf..68fbf4cc3 100644
--- a/app/views/desktop/research_p.html.erb
+++ b/app/views/desktop/research_p.html.erb
@@ -1,10 +1,10 @@
-
-
+
+
Research Projects
-
+
@@ -13,14 +13,14 @@
diff --git a/app/views/desktop/research_project/add.html.erb b/app/views/desktop/research_project/add.html.erb
index 28283456f..77d4b4c06 100644
--- a/app/views/desktop/research_project/add.html.erb
+++ b/app/views/desktop/research_project/add.html.erb
@@ -1,38 +1,38 @@
-
-
-
+
-
-
+
+
-
-
Year
+
+
- Year
-
Language
+
-
-
+
+
diff --git a/app/views/desktop/research_project/list.html.erb b/app/views/desktop/research_project/list.html.erb
index e32e4d6c5..807d6d8c9 100644
--- a/app/views/desktop/research_project/list.html.erb
+++ b/app/views/desktop/research_project/list.html.erb
@@ -1,68 +1,68 @@
-
-
-
+
+
-
-
More
+
-
-
Tag
+
-
-
Status
+
-
-
View
+
+
- View
-
Share
+
-
-
+
+
diff --git a/app/views/desktop/settings.html.erb b/app/views/desktop/settings.html.erb
index eecd9f4aa..7ad35dfbf 100644
--- a/app/views/desktop/settings.html.erb
+++ b/app/views/desktop/settings.html.erb
@@ -1,7 +1,7 @@
-
-
+
diff --git a/app/views/desktop/settings/sections.html.erb b/app/views/desktop/settings/sections.html.erb
index dcb922379..bb2dff7ec 100644
--- a/app/views/desktop/settings/sections.html.erb
+++ b/app/views/desktop/settings/sections.html.erb
@@ -1,8 +1,8 @@
+
@@ -9,11 +9,11 @@
Settings
-
-
-
diff --git a/app/views/desktop/settings/themes.html.erb b/app/views/desktop/settings/themes.html.erb
index fb1ac8a5a..be08bcd83 100644
--- a/app/views/desktop/settings/themes.html.erb
+++ b/app/views/desktop/settings/themes.html.erb
@@ -1,14 +1,14 @@
-
-
-
+
<% @themes.each do |theme| %>
@@ -19,9 +19,9 @@
") render json: {success: false, msg: error_msg}.to_json @@ -37,7 +37,7 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorRelationsController if @conference_co_author_relation.update_attributes(params[:conference_co_author_relation]) @conference_co_author_relations = ConferenceCoAuthorRelation.all newv = render_to_string partial: "show_form", object: @conference_co_author_relations - render json: {success: true, msg: "New Relation successfully updated!", newvalue: newv}.to_json + render json: {success: true, msg: t("update_success"), newvalue: newv}.to_json else error_msg = @conference_co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -49,15 +49,15 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorRelationsController @conference_co_author_relation.destroy reset_co_author_relation - render :json => {success: true, msg: "deleted successfully!"} + render :json => {success: true, msg: t("delete_success")} end private def reset_co_author_relation - co_author = ConferenceCoAuthor.where(co_author_relations_id: @co_author_relation.id) + co_author = ConferenceCoAuthor.where(conference_co_author_relations_id: @conference_co_author_relation.id) co_author.map do |c| - c.update_attributes(co_author_relations_id: nil) + c.update_attributes(conference_co_author_relations_id: nil) end end end diff --git a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_co_authors_controller.rb b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_co_authors_controller.rb index f371b7e75..ed8a3dc9d 100644 --- a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_co_authors_controller.rb +++ b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_co_authors_controller.rb @@ -32,7 +32,7 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorsController < Applic @conference_co_author.name_id= current_user.id if @conference_co_author.save - render json: {success:true, msg: t('create.sucess.co_author')}.to_json + render json: {success:true, msg: t('create_success')}.to_json else error_msg = @conference_co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -42,8 +42,8 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorsController < Applic def update @conference_co_author = ConferenceCoAuthor.find(params[:id]) - if @conference_co_author.update_attributes(params[:co_author]) - render json: {success:true, msg: t('update.sucess.co_author')}.to_json + if @conference_co_author.update_attributes(params[:conference_co_author]) + render json: {success:true, msg: t('update_success')}.to_json else error_msg = @conference_co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -54,6 +54,6 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorsController < Applic @conference_co_author = ConferenceCoAuthor.find(params[:id]) @conference_co_author.destroy - render :json => {success: true, msg: "Co-author deleted successfully!"} + render :json => {success: true, msg: "delete_success"} end end diff --git a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_pages_controller.rb b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_pages_controller.rb index 2021e94e0..1dc4b6a5e 100644 --- a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_pages_controller.rb +++ b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_pages_controller.rb @@ -23,13 +23,24 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio @writing_conference = WritingConference.new @paper_types = ConferencePaperType.all @author_types = ConferenceAuthorType.all - #@co_author_candidate = - # CoAuthor.where(name_id: current_user.id).map{|c|c.co_author} - #@conference_candidate = - # WritingConference.where(create_user_id: current_user.id).map{|j|j.conference_title}.uniq + + @conference_candidate = + WritingConference.where(create_user_id: current_user.id).map{|j|j.conference_title}.uniq + + if (not params[:q].nil?) and (current_user.name.include?params[:q]) + @user = [{ :id => 0, :name => current_user.name}] # self account name + else + @user = [] + end + + @co_authors = ConferenceCoAuthor.where(name_id: current_user.id, :co_author => /#{params[:q]}/) + @co_authors = [{ :id => params[:q], :name => params[:q] }] + # search string + @user + # self account name + @co_authors.map{|m| { :id => m.id, :name => m.co_author } } # match pattern respond_to do |format| format.html { render :layout => false} + format.json { render :json => @co_authors.to_json } end end @@ -47,7 +58,7 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio @writing_conference = WritingConference.new(params[:writing_conference]) if @writing_conference.save - render json: {success: true, msg: t('create.success.paper')}.to_json + render json: {success: true, msg: t('create_success')}.to_json else error_msg = @writing_conference.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -59,7 +70,7 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio @writing_conference= WritingConference.find(params[:id]) if @writing_conference.update_attributes(params[:writing_conference]) - render json: {success: true, msg: t('update.success.paper')}.to_json + render json: {success: true, msg: t('update_success')}.to_json else error_msg = @writing_conference.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -69,7 +80,7 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio def destroy @writing_conference = WritingConference.find(params[:id]) @writing_conference.destroy - render :json => {success: true, msg: t('delete.success.paper')} + render :json => {success: true, msg: t('delete_success')} end def conference_type diff --git a/vendor/built_in_modules/personal_conference/app/helpers/panel/personal_conference/desktop/conference_pages_helper.rb b/vendor/built_in_modules/personal_conference/app/helpers/panel/personal_conference/desktop/conference_pages_helper.rb index afff7344f..c30254c47 100644 --- a/vendor/built_in_modules/personal_conference/app/helpers/panel/personal_conference/desktop/conference_pages_helper.rb +++ b/vendor/built_in_modules/personal_conference/app/helpers/panel/personal_conference/desktop/conference_pages_helper.rb @@ -1,6 +1,7 @@ module Panel::PersonalConference::Desktop::ConferencePagesHelper def publication_record publication, view content_tag :li, + "item" => "true", :class => "list_t_item" do marker + \ content(publication, view) + \ @@ -11,8 +12,14 @@ module Panel::PersonalConference::Desktop::ConferencePagesHelper def marker content_tag :div, :class => "list_item_action" - content_tag(:a, "", :class => "icon-check-empty") + \ - content_tag(:a, "", :class => "icon-star-empty") + 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 def content publication, view @@ -43,6 +50,7 @@ module Panel::PersonalConference::Desktop::ConferencePagesHelper content_tag(:a, t("edit"), :class => "journal_paper_edit admbg2 admtxt", :href => edit_panel_personal_conference_desktop_conference_page_path(publication), + "callback-method" => "editpaper", "ajax-remote" => "get") + \ content_tag(:a, t("delete"), "ajax-remote" => "delete", @@ -71,4 +79,16 @@ module Panel::PersonalConference::Desktop::ConferencePagesHelper file_type = "" end end + + def generate_authors_name ids + author_name = ids.map{|m| + if m == "0" + {:id => 0, :name => current_user.name} + else + {:id => m, :name => ConferenceCoAuthor.find(m).co_author} + end + } + + author_name.to_json + end end diff --git a/vendor/built_in_modules/personal_conference/app/models/conference_co_author.rb b/vendor/built_in_modules/personal_conference/app/models/conference_co_author.rb index 71e5b17f3..1f0db8840 100644 --- a/vendor/built_in_modules/personal_conference/app/models/conference_co_author.rb +++ b/vendor/built_in_modules/personal_conference/app/models/conference_co_author.rb @@ -3,11 +3,12 @@ class ConferenceCoAuthor LANGUAGE_TYPES = [ "English", "Chinese" ] - field :name_id, type: BSON::ObjectId + field :name_id, type: BSON::ObjectId # this is author field :co_author, localize: true field :email belongs_to :conference_co_author_relations + has_and_belongs_to_many :writing_conferences VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/ validates :email, format: { with: VALID_EMAIL_REGEX }, diff --git a/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb b/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb index 9248c9775..c74eccbcf 100644 --- a/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb +++ b/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb @@ -16,6 +16,7 @@ class WritingConference has_and_belongs_to_many :tags, :class_name => "PersonalConferenceTag" has_and_belongs_to_many :conference_author_types has_and_belongs_to_many :conference_paper_types + has_and_belongs_to_many :conference_co_authors field :year field :language @@ -43,6 +44,25 @@ class WritingConference after_save :save_writing_conference_files validates :url, :format => /^(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?/i, :unless => Proc.new{self.url.blank?} + attr_reader :author_tokens + + def author_tokens=(ids) + authors_ids = ids.split(",").map{|id| + begin + ConferenceCoAuthor.find(m).id + rescue + if id != "0" + new_co_author = ConferenceCoAuthor.new(:co_author => id, :name_id => create_user_id) + new_co_author.save + new_co_author.id + else + id + end + end + } + self.conference_co_author_ids = authors_ids + end + def self.search( category_id = nil ) if category_id.to_s.size > 0 find(:all, :conditions => {writing_conference_category_id: category_id}).desc( :is_top, :title ) diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_form.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_form.html.erb index d6f16b23d..d43c81f0c 100644 --- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_form.html.erb +++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_form.html.erb @@ -5,7 +5,7 @@ value: (@conference_co_author_relation.relation_translations[locale] rescue nil) %> <#% end %> --> -<%= f.submit "Save", class: "ini_input hp hh2 thmtxt thmc2", style: "margin-left: 10px;" %> +<%= f.submit t("save"), class: "ini_input hp hh1 thmtxt thmc2", style: "margin-left: 10px;" %> <% if not @conference_co_author_relation.new_record? %> - <%= submit_tag "Cancel", :type => "button", class: "bt-cancel-type ini_input hp hh2 thmtxt" %> + <%= submit_tag t("cancel"), "ajax-remote" => "get", :herf => panel_personal_conference_desktop_conference_co_author_relations_path ,:type => "button", class: "bt-cancel-type ini_input hp hh1 thmtxt" %> <% end %> diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_show_form.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_show_form.html.erb index 72566f1a9..8756c04ce 100644 --- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_show_form.html.erb +++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_show_form.html.erb @@ -1,17 +1,11 @@ -<% @conference_co_author_relations.each_with_index do |conference_co_author_relation,i| %> - <% if ( i % 6 ) == 0 %> -
-
diff --git a/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery_frontend.css b/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery_frontend.css
old mode 100755
new mode 100644
index 7e9b24211..f449178d5
--- a/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery_frontend.css
+++ b/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery_frontend.css
@@ -231,7 +231,7 @@
.slidelist {
position: absolute;
bottom: 30px;
- z-index: 99;
+ z-index: 98;
width: 100%;
height: 0;
overflow: auto;
@@ -251,7 +251,7 @@
border: solid 2px #fff;
display: block;
width: 120px;
- height: 90px;
+ height: 96px;
position: relative;
box-shadow: 0 0 6px rgba(0,0,0,0.7);
diff --git a/vendor/built_in_modules/gallery/app/assets/stylesheets/widget_gallery.css b/vendor/built_in_modules/gallery/app/assets/stylesheets/widget_gallery.css
old mode 100755
new mode 100644
index df7bf2c2c..dd9f95947
--- a/vendor/built_in_modules/gallery/app/assets/stylesheets/widget_gallery.css
+++ b/vendor/built_in_modules/gallery/app/assets/stylesheets/widget_gallery.css
@@ -32,9 +32,13 @@
.w1.c4 li { width: 23%; }
.w1.c5 li { width: 18%; }
.w1.c6 li { width: 14.6666%; }
+.w1 li a {
+ -webkit-transition: opacity 0.3s ease;
+ -moz-transition: opacity 0.3s ease;
+ transition: opacity 0.3s ease;
+}
.w1 li a:hover {
- box-shadow: 0 0 20px rgba(0,0,0,0.9);
- outline: solid 4px #429DFF;
+ opacity: 0.8;
position: relative;
}
.w1 li a img {
diff --git a/vendor/built_in_modules/personal_conference/app/assets/javascripts/personal_conference/desktop/conference_pages.js b/vendor/built_in_modules/personal_conference/app/assets/javascripts/personal_conference/desktop/conference_pages.js
index fdf3c3899..eaefe0f5f 100644
--- a/vendor/built_in_modules/personal_conference/app/assets/javascripts/personal_conference/desktop/conference_pages.js
+++ b/vendor/built_in_modules/personal_conference/app/assets/javascripts/personal_conference/desktop/conference_pages.js
@@ -1,58 +1,106 @@
-orbitDesktop.prototype.initializeConference = function(target,url,cache){
-
- this.initializeConference.list = function(){
- var bindHandlers = function(){
- o.tinyscrollbar_ext({
- main : ".tinycanvas",
- fill : ".list_t"
- })
+orbitDesktop.prototype.initializeConferencePapers = function(target,url,cache){ // this init conference papers
+ this.initializeConferencePapers.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");
}
-
-
- bindHandlers();
-
}
- this.initializeConference.addconference = function(){
- var bindHandlers = function(){
+ this.initializeConferencePapers.list = function(){ // to open list part in conference papers page
+ var conferenceData;
+ var bindHandlers = function(){ // to bind handlers for list page
o.simple_drop_down();
-
- o.tinyscrollbar_ext({
- main: '.tinycanvas',
- fill: '.s_grid_con'
- })
}
- bindHandlers();
-
+ var bindSecondaryHandlers = function(){
+ $("#conference_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.initializeConference.conference = function(){
- var bindHandlers = function(){
+ this.initializeConferencePapers.paperDelete = function(data,dom){
+ var parent = dom.parent().parent();
+ if(data.success){
+ parent.hide("slide",function(){parent.remove();});
+ o.notify(data.msg,"success");
+ }
+ }
+
+ this.initializeConferencePapers.editpaper = function(){
+ o.highlight_sub_menu_item(1)
+ }
+
+ this.initializeConferencePapers.addpaper = function(){ // to open add pages in conference papers page
+ var bindHandlers = function(){ // to bind handlers for add page
o.simple_drop_down();
+ $('#add_plugin_file a.add').click(function(){
+ var new_id = $(this).prev().attr('value');
+ var old_id = new RegExp("new_writing_conference_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;
+ });
- o.tinyscrollbar_ext({
- main: '.tinycanvas',
- fill: '.s_grid_con'
- })
+ $('.action a.remove_existing_record').click(function(){
+ $(this).next('.should_destroy').attr('value', 1);
+ $("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
+ });
}
-
bindHandlers();
-
}
- this.initializeConference.coauthor = function(){
- var bindHandlers = function(){
+
+ this.initializeConferencePapers.conference = function(){ // to open add pages in conference papers page
+ var bindHandlers = function(){ // to bind handlers for add page
o.simple_drop_down();
-
- o.tinyscrollbar_ext({
- main: '.tinycanvas',
- fill: '.s_grid_con'
- })
}
-
bindHandlers();
-
}
-
- this.initializeConference.list();
+ this.initializeConferencePapers.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.initializeConferencePapers.coauthor = function(){ // to open add pages in coauthor page
+ var bindHandlers = function(){ // to bind handlers for add page
+ o.simple_drop_down();
+ }
+ bindHandlers();
}
+ this.initializeConferencePapers.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.initializeConferencePapers.coauthorRelationEditForm = function(data){
+ if(data.success){
+ o.notify(data.msg,"success");
+ $("#co_author_relation_table").html(data.newvalue);
+ }else{
+ o.notify(data.msg,"alert");
+ }
+ }
+};
+
diff --git a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_co_author_relations_controller.rb b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_co_author_relations_controller.rb
index bfc09055c..3bfe63e88 100644
--- a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_co_author_relations_controller.rb
+++ b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_co_author_relations_controller.rb
@@ -25,7 +25,7 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorRelationsController
if @conference_co_author_relation.save
newv = render_to_string partial: "show_form", object: @conference_co_author_relations
- render json: {success: true, msg: "New Relation successfully saved!", newvalue: newv}.to_json
+ render json: {success: true, msg: t("create_success") , newvalue: newv}.to_json
else
error_msg = @conference_co_author_relation.errors.full_messages.join("Preview
+ Preview
-
diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb
index 2cedcb009..badbbdf40 100644
--- a/app/views/devise/registrations/edit.html.erb
+++ b/app/views/devise/registrations/edit.html.erb
@@ -1,5 +1,5 @@
Theme Text1
+ Theme Text1
-
diff --git a/lib/desktopapp/views/index.html.erb b/lib/desktopapp/views/index.html.erb
index 47fca2a7c..aadb39ad5 100755
--- a/lib/desktopapp/views/index.html.erb
+++ b/lib/desktopapp/views/index.html.erb
@@ -81,8 +81,8 @@
Password Managment
+ Password Managment
<%= form_for(resource, :as => resource_name, :url => users_passwd_path(resource_name), :html => { :method => :put, "form-type"=>"ajax_form" ,"callback-method"=>"passwordUpdate" }) do |f| %>
<%= f.submit "Update", :class => "setting_btn thmc1 thmtxt w1 hh2 hp" %>
+ <%= f.submit "Update", :class => "setting_btn thmc1 thmtxt w1 hh1 hp" %>
<% end %>
") render json: {success: false, msg: error_msg}.to_json @@ -37,7 +37,7 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorRelationsController if @conference_co_author_relation.update_attributes(params[:conference_co_author_relation]) @conference_co_author_relations = ConferenceCoAuthorRelation.all newv = render_to_string partial: "show_form", object: @conference_co_author_relations - render json: {success: true, msg: "New Relation successfully updated!", newvalue: newv}.to_json + render json: {success: true, msg: t("update_success"), newvalue: newv}.to_json else error_msg = @conference_co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -49,15 +49,15 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorRelationsController @conference_co_author_relation.destroy reset_co_author_relation - render :json => {success: true, msg: "deleted successfully!"} + render :json => {success: true, msg: t("delete_success")} end private def reset_co_author_relation - co_author = ConferenceCoAuthor.where(co_author_relations_id: @co_author_relation.id) + co_author = ConferenceCoAuthor.where(conference_co_author_relations_id: @conference_co_author_relation.id) co_author.map do |c| - c.update_attributes(co_author_relations_id: nil) + c.update_attributes(conference_co_author_relations_id: nil) end end end diff --git a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_co_authors_controller.rb b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_co_authors_controller.rb index f371b7e75..ed8a3dc9d 100644 --- a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_co_authors_controller.rb +++ b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_co_authors_controller.rb @@ -32,7 +32,7 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorsController < Applic @conference_co_author.name_id= current_user.id if @conference_co_author.save - render json: {success:true, msg: t('create.sucess.co_author')}.to_json + render json: {success:true, msg: t('create_success')}.to_json else error_msg = @conference_co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -42,8 +42,8 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorsController < Applic def update @conference_co_author = ConferenceCoAuthor.find(params[:id]) - if @conference_co_author.update_attributes(params[:co_author]) - render json: {success:true, msg: t('update.sucess.co_author')}.to_json + if @conference_co_author.update_attributes(params[:conference_co_author]) + render json: {success:true, msg: t('update_success')}.to_json else error_msg = @conference_co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -54,6 +54,6 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorsController < Applic @conference_co_author = ConferenceCoAuthor.find(params[:id]) @conference_co_author.destroy - render :json => {success: true, msg: "Co-author deleted successfully!"} + render :json => {success: true, msg: "delete_success"} end end diff --git a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_pages_controller.rb b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_pages_controller.rb index 2021e94e0..1dc4b6a5e 100644 --- a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_pages_controller.rb +++ b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/desktop/conference_pages_controller.rb @@ -23,13 +23,24 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio @writing_conference = WritingConference.new @paper_types = ConferencePaperType.all @author_types = ConferenceAuthorType.all - #@co_author_candidate = - # CoAuthor.where(name_id: current_user.id).map{|c|c.co_author} - #@conference_candidate = - # WritingConference.where(create_user_id: current_user.id).map{|j|j.conference_title}.uniq + + @conference_candidate = + WritingConference.where(create_user_id: current_user.id).map{|j|j.conference_title}.uniq + + if (not params[:q].nil?) and (current_user.name.include?params[:q]) + @user = [{ :id => 0, :name => current_user.name}] # self account name + else + @user = [] + end + + @co_authors = ConferenceCoAuthor.where(name_id: current_user.id, :co_author => /#{params[:q]}/) + @co_authors = [{ :id => params[:q], :name => params[:q] }] + # search string + @user + # self account name + @co_authors.map{|m| { :id => m.id, :name => m.co_author } } # match pattern respond_to do |format| format.html { render :layout => false} + format.json { render :json => @co_authors.to_json } end end @@ -47,7 +58,7 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio @writing_conference = WritingConference.new(params[:writing_conference]) if @writing_conference.save - render json: {success: true, msg: t('create.success.paper')}.to_json + render json: {success: true, msg: t('create_success')}.to_json else error_msg = @writing_conference.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -59,7 +70,7 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio @writing_conference= WritingConference.find(params[:id]) if @writing_conference.update_attributes(params[:writing_conference]) - render json: {success: true, msg: t('update.success.paper')}.to_json + render json: {success: true, msg: t('update_success')}.to_json else error_msg = @writing_conference.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -69,7 +80,7 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio def destroy @writing_conference = WritingConference.find(params[:id]) @writing_conference.destroy - render :json => {success: true, msg: t('delete.success.paper')} + render :json => {success: true, msg: t('delete_success')} end def conference_type diff --git a/vendor/built_in_modules/personal_conference/app/helpers/panel/personal_conference/desktop/conference_pages_helper.rb b/vendor/built_in_modules/personal_conference/app/helpers/panel/personal_conference/desktop/conference_pages_helper.rb index afff7344f..c30254c47 100644 --- a/vendor/built_in_modules/personal_conference/app/helpers/panel/personal_conference/desktop/conference_pages_helper.rb +++ b/vendor/built_in_modules/personal_conference/app/helpers/panel/personal_conference/desktop/conference_pages_helper.rb @@ -1,6 +1,7 @@ module Panel::PersonalConference::Desktop::ConferencePagesHelper def publication_record publication, view content_tag :li, + "item" => "true", :class => "list_t_item" do marker + \ content(publication, view) + \ @@ -11,8 +12,14 @@ module Panel::PersonalConference::Desktop::ConferencePagesHelper def marker content_tag :div, :class => "list_item_action" - content_tag(:a, "", :class => "icon-check-empty") + \ - content_tag(:a, "", :class => "icon-star-empty") + 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 def content publication, view @@ -43,6 +50,7 @@ module Panel::PersonalConference::Desktop::ConferencePagesHelper content_tag(:a, t("edit"), :class => "journal_paper_edit admbg2 admtxt", :href => edit_panel_personal_conference_desktop_conference_page_path(publication), + "callback-method" => "editpaper", "ajax-remote" => "get") + \ content_tag(:a, t("delete"), "ajax-remote" => "delete", @@ -71,4 +79,16 @@ module Panel::PersonalConference::Desktop::ConferencePagesHelper file_type = "" end end + + def generate_authors_name ids + author_name = ids.map{|m| + if m == "0" + {:id => 0, :name => current_user.name} + else + {:id => m, :name => ConferenceCoAuthor.find(m).co_author} + end + } + + author_name.to_json + end end diff --git a/vendor/built_in_modules/personal_conference/app/models/conference_co_author.rb b/vendor/built_in_modules/personal_conference/app/models/conference_co_author.rb index 71e5b17f3..1f0db8840 100644 --- a/vendor/built_in_modules/personal_conference/app/models/conference_co_author.rb +++ b/vendor/built_in_modules/personal_conference/app/models/conference_co_author.rb @@ -3,11 +3,12 @@ class ConferenceCoAuthor LANGUAGE_TYPES = [ "English", "Chinese" ] - field :name_id, type: BSON::ObjectId + field :name_id, type: BSON::ObjectId # this is author field :co_author, localize: true field :email belongs_to :conference_co_author_relations + has_and_belongs_to_many :writing_conferences VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/ validates :email, format: { with: VALID_EMAIL_REGEX }, diff --git a/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb b/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb index 9248c9775..c74eccbcf 100644 --- a/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb +++ b/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb @@ -16,6 +16,7 @@ class WritingConference has_and_belongs_to_many :tags, :class_name => "PersonalConferenceTag" has_and_belongs_to_many :conference_author_types has_and_belongs_to_many :conference_paper_types + has_and_belongs_to_many :conference_co_authors field :year field :language @@ -43,6 +44,25 @@ class WritingConference after_save :save_writing_conference_files validates :url, :format => /^(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?/i, :unless => Proc.new{self.url.blank?} + attr_reader :author_tokens + + def author_tokens=(ids) + authors_ids = ids.split(",").map{|id| + begin + ConferenceCoAuthor.find(m).id + rescue + if id != "0" + new_co_author = ConferenceCoAuthor.new(:co_author => id, :name_id => create_user_id) + new_co_author.save + new_co_author.id + else + id + end + end + } + self.conference_co_author_ids = authors_ids + end + def self.search( category_id = nil ) if category_id.to_s.size > 0 find(:all, :conditions => {writing_conference_category_id: category_id}).desc( :is_top, :title ) diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_form.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_form.html.erb index d6f16b23d..d43c81f0c 100644 --- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_form.html.erb +++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_form.html.erb @@ -5,7 +5,7 @@ value: (@conference_co_author_relation.relation_translations[locale] rescue nil) %> <#% end %> --> -<%= f.submit "Save", class: "ini_input hp hh2 thmtxt thmc2", style: "margin-left: 10px;" %> +<%= f.submit t("save"), class: "ini_input hp hh1 thmtxt thmc2", style: "margin-left: 10px;" %> <% if not @conference_co_author_relation.new_record? %> - <%= submit_tag "Cancel", :type => "button", class: "bt-cancel-type ini_input hp hh2 thmtxt" %> + <%= submit_tag t("cancel"), "ajax-remote" => "get", :herf => panel_personal_conference_desktop_conference_co_author_relations_path ,:type => "button", class: "bt-cancel-type ini_input hp hh1 thmtxt" %> <% end %> diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_show_form.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_show_form.html.erb index 72566f1a9..8756c04ce 100644 --- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_show_form.html.erb +++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_author_relations/_show_form.html.erb @@ -1,17 +1,11 @@ -<% @conference_co_author_relations.each_with_index do |conference_co_author_relation,i| %> - <% if ( i % 6 ) == 0 %> -
-
-
- <% end %>
-
-
+ <% @conference_co_author_relations.each_with_index do |conference_co_author_relation,i| %>
+
+
-
-
Create
+
+
- <%= submit_tag "Back", :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_co_authors_path, class: "bt-cancel fn_btn ini_input hp hh2 thmtxt" %>
+ <%= submit_tag t("back"), :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_co_authors_path, class: "bt-cancel fn_btn ini_input hp hh1 thmtxt" %>
<%=t("add") %>
-
+
diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_authors/_form.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_authors/_form.html.erb
index 22efcbf58..5bbe30fe8 100644
--- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_authors/_form.html.erb
+++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_authors/_form.html.erb
@@ -1,7 +1,7 @@
-
<%= render :partial => 'show_form'%>
+
- <%= f.submit "Save", name: "commit", value: "Save", class: "fn_btn ini_input hp hh2 thmc2 thmtxt" %>
- <%= submit_tag "Cancel", :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_co_authors_path, class: "bt-cancel fn_btn ini_input hp hh2 thmtxt" %>
+ <%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
+ <%= submit_tag t("back"), :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_co_authors_path, class: "fn_btn ini_input hp hh1 thmtxt" %>
diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_authors/index.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_authors/index.html.erb
index bc1e6bca8..aba28c137 100644
--- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_authors/index.html.erb
+++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_authors/index.html.erb
@@ -1,33 +1,29 @@
-
+
- <%= link_to "New Co-Author", new_panel_personal_conference_desktop_conference_co_author_path, :class=>"bt-co-author fn_btn hp hh2 thmc2 thmtxt", "ajax-remote"=>"get" %>
- <%= link_to "New Type", panel_personal_conference_desktop_conference_co_author_relations_path, :class=>"bt-new-type fn_btn hp hh2 thmc2 thmtxt", "ajax-remote"=>"get" %>
+ <%= link_to "New Co-Author", new_panel_personal_conference_desktop_conference_co_author_path, :class=>"bt-co-author fn_btn hp hh1 thmc2 thmtxt", "ajax-remote"=>"get" %>
+ <%= link_to "New Type", panel_personal_conference_desktop_conference_co_author_relations_path, :class=>"bt-new-type fn_btn hp hh1 thmc2 thmtxt", "ajax-remote"=>"get" %>
-
+
diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_authors/new.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_authors/new.html.erb
index 14e5a8b56..54901469e 100644
--- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_authors/new.html.erb
+++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_co_authors/new.html.erb
@@ -1,3 +1,3 @@
-<%= form_for @conference_co_author, html: { multipart: true ,"form-type"=>"ajax_form", "callback-method"=>"conferenceCoAuthorformCallback"} , url: panel_personal_conference_desktop_conference_co_authors_path do |f| %>
+<%= form_for @conference_co_author, html: { multipart: true ,"form-type"=>"ajax_form", "callback-method"=>"coAuthorformCallback"} , url: panel_personal_conference_desktop_conference_co_authors_path do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<% end %>
diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/_form.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/_form.html.erb
index fd6e59c92..608eee5b6 100644
--- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/_form.html.erb
+++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/_form.html.erb
@@ -1,220 +1,239 @@
-
<% @conference_co_authors.each_with_index do |co_author,i| %>
- <% if ( i % 4 ) == 0 %>
- <% end %>
<% end %>
-
- <% end %>
-
+
- <%= f.submit t("save"), name: "commit", value: "Save", class: "fn_btn ini_input hp hh2 thmc2 thmtxt" %>
-
+ <%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
<% if not @writing_conference.new_record? %>
- <%= submit_tag t("cancel"), :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_pages_path, class: "bt-cancel ini_input hp hh2 thmadm thmtxt" %>
+ <%= submit_tag t("cancel"), :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_pages_path, class: "ini_input hp hh1 thmadm thmtxt" %>
<% end %>
-
-
Share
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
-
-
- -
-
-
- -
-
-
+
+
+ <%= stylesheet_link_tag "token-input-facebook" %>
+ <%= javascript_include_tag :defaults, "jquery.tokeninput" %>
+
+
+
+
+
+
+
diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/conference_type.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/conference_type.html.erb
index a4fd58b24..a29fcfdb8 100644
--- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/conference_type.html.erb
+++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/conference_type.html.erb
@@ -1,28 +1,26 @@
-
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+
-
-
Share
+
+
-
-
+
+
-
+
diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/edit.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/edit.html.erb
index 860d2ef4f..0300177c7 100644
--- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/edit.html.erb
+++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/edit.html.erb
@@ -1,4 +1,4 @@
-<%= form_for @writing_conference, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_conference_desktop_conference_page_path(@writing_conference) do |f| %>
+<%= form_for @writing_conference, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"coAuthorformCallback"}, url: panel_personal_conference_desktop_conference_page_path(@writing_conference) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>
diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/index.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/index.html.erb
index e30c9e4a7..5b27892a9 100644
--- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/index.html.erb
+++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/index.html.erb
@@ -1,74 +1,74 @@
-
<% @conference_lists.each_with_index do |conference_list,i| %>
- <% if ( i % 5 ) == 0 %>
- <% end %>
<% end %>
-
- <% end %>
-
-
-
+
+
-
-
More
+
-
-
Tag
+
-
-
Status
+
-
-
View
+
+
- View
-
-
-
Share
+
-
-
+
+
-
+
<% @writing_conferences.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/new.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/new.html.erb
index eb8f87519..0a2f80815 100644
--- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/new.html.erb
+++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/new.html.erb
@@ -1,4 +1,4 @@
-<%= form_for @writing_conference, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_conference_desktop_conference_pages_path do |f| %>
- <%= render partial: 'panel/personal_conference/desktop/conference_pages/form', locals: {:f => f} %>
+<%= form_for @writing_conference, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"coAuthorformCallback"}, url: panel_personal_conference_desktop_conference_pages_path do |f| %>
+ <%= render partial: 'form', locals: {:f => f} %>
<%end%>
diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_window.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_window.html.erb
index 303aa092e..efa655ff7 100644
--- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_window.html.erb
+++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_window.html.erb
@@ -1,10 +1,10 @@
-
-
+
+
Conference
-
+
@@ -13,14 +13,14 @@
diff --git a/vendor/built_in_modules/personal_conference/config/locales/en.yml b/vendor/built_in_modules/personal_conference/config/locales/en.yml
index b137de643..d4cd006b2 100644
--- a/vendor/built_in_modules/personal_conference/config/locales/en.yml
+++ b/vendor/built_in_modules/personal_conference/config/locales/en.yml
@@ -28,11 +28,13 @@ en:
file_name : "File Name"
description : "File Description"
+ create_success : "Successfully Create"
+ update_success : "Successfully Update"
+ delete_success : "Successfully Delete"
add: "Add"
back: "Back"
delete: "Delete"
edit: "Edit"
- no_: "No"
nothing: "Nothing"
show: "Show"
sure?: "Are you sure?"
@@ -41,6 +43,9 @@ en:
no_: "No"
cancel : "Cancel"
save: "save"
+ hintText: "Type in a search term"
+ noResultsText: "No results"
+ searchingText: "Searching…"
error_msg:
time_series_illegal: "must be before end time"
diff --git a/vendor/built_in_modules/personal_conference/config/locales/zh_tw.yml b/vendor/built_in_modules/personal_conference/config/locales/zh_tw.yml
index 6d10cf65e..967d14d0c 100644
--- a/vendor/built_in_modules/personal_conference/config/locales/zh_tw.yml
+++ b/vendor/built_in_modules/personal_conference/config/locales/zh_tw.yml
@@ -28,11 +28,12 @@ zh_tw:
file_name : "檔案名稱"
description : "描述"
+ create_success : "新增完成!!"
+ update_success : "更新完成!!"
add: "新增"
back: "返回"
delete: "刪除"
edit: "編輯"
- no_: "No"
nothing: "無"
show: "顯示"
sure?: "您肯定嗎?"
@@ -41,6 +42,9 @@ zh_tw:
no_: "否"
cancel : "取消"
save: "儲存"
+ hintText: "請輸入搜尋關鍵字"
+ noResultsText: "沒有相關的比對結果"
+ searchingText: "搜尋中…"
error_msg:
time_series_illegal: "啟始時間必須早於結束時間"
diff --git a/vendor/built_in_modules/personal_journal/app/assets/javascripts/personal_journal/desktop/journal_pages.js b/vendor/built_in_modules/personal_journal/app/assets/javascripts/personal_journal/desktop/journal_pages.js
index a3e89dabc..fd0a6acd0 100644
--- a/vendor/built_in_modules/personal_journal/app/assets/javascripts/personal_journal/desktop/journal_pages.js
+++ b/vendor/built_in_modules/personal_journal/app/assets/javascripts/personal_journal/desktop/journal_pages.js
@@ -12,43 +12,6 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
var journalData;
var bindHandlers = function(){ // to bind handlers for list page
o.simple_drop_down();
-
- o.tinyscrollbar_ext({
- main: '.tinycanvas',
- fill: '.list_t'
- })
-
- // $("#journal_selection_options a").click(function(){
- // switch($(this).attr("href")){
- // case "all":
- // $(".list_item_action > .icon-check-empty").switchClass("icon-check-empty","icon-check",0);
- // break;
- // case "none":
- // $(".list_item_action > .icon-check").switchClass("icon-check","icon-check-empty",0);
- // break;
- // }
- // return false;
- // })
- // $("#journal_view_selection a").click(function(){
- // switch($(this).attr("href")){
- // case "journal":
- // journalview();
- // break;
- // case "keywords":
- // keywordsview();
- // break;
- // case "title":
- // titleview();
- // break;
- // case "abstract":
- // abstractview();
- // break;
- // case "file":
- // fileview();
- // break;
- // }
- // return false;
- // })
}
var bindSecondaryHandlers = function(){
@@ -65,125 +28,6 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
return false;
})
}
-
-
- // var journalview = function(){
- // $("#journal_p div#paper_list div.overview").empty();
- // var column = $(''),
- // counter = 1,
- // li;
- // $.each(journalData,function(i,journal){
- // $.each(journal.papers,function(j,paper){
- // li = $('');
- // }
- // counter++;
- // })
- // })
- // $("#journal_p div#paper_list div.overview").append(column);
- // bindSecondaryHandlers();
- // }
- // var fileview = function(){
- // $("#journal_p div#paper_list div.overview").empty();
- // var column = $(''),
- // counter = 1,
- // li = null;
- // $.each(journalData,function(i,journal){
- // $.each(journal.papers,function(j,paper){
- // li = null;
- // li = $('');
- // li.append('');
- // }
- // counter++;
- // })
- // })
- // $("#journal_p div#paper_list div.overview").append(column);
- // bindSecondaryHandlers();
- // }
- // var keywordsview = function(){
- // $("#journal_p div#paper_list div.overview").empty();
- // var column = $(''),
- // counter = 1,
- // li;
- // $.each(journalData,function(i,journal){
- // $.each(journal.papers,function(j,paper){
- // li = $('');
- // }
- // counter++;
- // })
- // })
- // $("#journal_p div#paper_list div.overview").append(column);
- // bindSecondaryHandlers();
- // }
-
- // var titleview = function(){
- // $("#journal_p div#paper_list div.overview").empty();
- // var column = $(''),
- // counter = 1,
- // li;
- // $.each(journalData,function(i,journal){
- // $.each(journal.papers,function(j,paper){
- // li = $('');
- // }
- // counter++;
- // })
- // })
- // $("#journal_p div#paper_list div.overview").append(column);
- // bindSecondaryHandlers();
- // }
-
- // var abstractview = function(){
- // $("#journal_p div#paper_list div.overview").empty();
- // var column = $(''),
- // li;
- // $.each(journalData,function(i,journal){
- // $.each(journal.papers,function(j,paper){
- // li = $('');
- // })
- // })
- // $("#journal_p div#paper_list div.overview").append(column);
- // bindSecondaryHandlers();
- // }
-
- // var getData = function(){
- // $.getJSON("/panel/personal_journal/desktop/get_journals_json",function(journals){
- // journalData = eval(journals);
- // journalview();
- // bindHandlers();
- // })
- // }
- // getData();
}
this.initializeJournalPapers.paperDelete = function(data,dom){
var parent = dom.parent().parent();
@@ -192,14 +36,31 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
o.notify(data.msg,"success");
}
}
+
+ this.initializeJournalPapers.editpaper = function(){
+ o.highlight_sub_menu_item(1)
+ }
+
this.initializeJournalPapers.addpaper = function(){ // to open add pages in journal papers page
var bindHandlers = function(){ // to bind handlers for add page
o.simple_drop_down();
+ $('#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;
+ });
- o.tinyscrollbar_ext({
- main: '.tinycanvas',
- fill: '.s_grid_con'
- })
+ $('.action a.remove_existing_record').click(function(){
+ $(this).next('.should_destroy').attr('value', 1);
+ $("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
+ });
}
bindHandlers();
}
@@ -207,10 +68,6 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
this.initializeJournalPapers.journal = function(){ // to open add pages in journal papers page
var bindHandlers = function(){ // to bind handlers for add page
o.simple_drop_down();
- o.tinyscrollbar_ext({
- main: '.tinycanvas',
- fill: '.g_col'
- })
}
bindHandlers();
}
@@ -218,7 +75,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
this.initializeJournalPapers.coAuthorformCallback = function(data){
if(data.success){
o.notify(data.msg,"success");
- o.sub_menu_item($("div[content-type=menu] a").eq(0));
+ o.sub_menu_item($("div[content-type=menu] a").eq(3));
}else{
o.notify(data.msg,"alert");
}
@@ -226,13 +83,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
this.initializeJournalPapers.coauthor = function(){ // to open add pages in coauthor page
var bindHandlers = function(){ // to bind handlers for add page
o.simple_drop_down();
-
- o.tinyscrollbar_ext({
- main: '.tinycanvas',
- fill: '.g_col'
- })
-
- }
+ }
bindHandlers();
}
this.initializeJournalPapers.coauthorRelationForm = function(data){
diff --git a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_co_author_relations_controller.rb b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_co_author_relations_controller.rb
index 22e42f221..2cb72eeb4 100644
--- a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_co_author_relations_controller.rb
+++ b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_co_author_relations_controller.rb
@@ -25,7 +25,7 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorRelationsController < Appl
if @journal_co_author_relation.save
newv = render_to_string partial: "show_form", object: @journal_co_author_relations
- render json: {success: true, msg: "New Relation successfully saved!", newvalue: newv}.to_json
+ render json: {success: true, msg: "create_success", newvalue: newv}.to_json
else
error_msg = @journal_co_author_relation.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -37,7 +37,7 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorRelationsController < Appl if @journal_co_author_relation.update_attributes(params[:journal_co_author_relation]) @journal_co_author_relations = JournalCoAuthorRelation.all newv = render_to_string partial: "show_form", object: @journal_co_author_relations - render json: {success: true, msg: "New Relation successfully updated!", newvalue: newv}.to_json + render json: {success: true, msg: "update_success", newvalue: newv}.to_json else error_msg = @journal_co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -49,15 +49,15 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorRelationsController < Appl @journal_co_author_relation.destroy reset_co_author_relation - render :json => {success: true, msg: "deleted successfully!"} + render :json => {success: true, msg: "delete_success"} end private def reset_co_author_relation - co_author = JournalCoAuthor.where(co_author_relations_id: @co_author_relation.id) + co_author = JournalCoAuthor.where(journal_co_author_relations_id: @journal_co_author_relation.id) co_author.map do |c| - c.update_attributes(co_author_relations_id: nil) + c.update_attributes(journal_co_author_relations_id: nil) end end end diff --git a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_co_authors_controller.rb b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_co_authors_controller.rb index 6ddd86bda..e7f557743 100644 --- a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_co_authors_controller.rb +++ b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_co_authors_controller.rb @@ -28,11 +28,11 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorsController < ApplicationC end def create - @journal_co_author = JournalCoAuthor.new(params[:co_author]) + @journal_co_author = JournalCoAuthor.new(params[:journal_co_author]) @journal_co_author.name_id= current_user.id if @journal_co_author.save - render json: {success:true, msg: t('create.sucess.co_author')}.to_json + render json: {success:true, msg: t('create_success')}.to_json else error_msg = @journal_co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -42,8 +42,8 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorsController < ApplicationC def update @journal_co_author = JournalCoAuthor.find(params[:id]) - if @journal_co_author.update_attributes(params[:co_author]) - render json: {success:true, msg: t('update.sucess.co_author')}.to_json + if @journal_co_author.update_attributes(params[:journal_co_author]) + render json: {success:true, msg: t('update_success')}.to_json else error_msg = @journal_co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -54,6 +54,6 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorsController < ApplicationC @journal_co_author = JournalCoAuthor.find(params[:id]) @journal_co_author.destroy - render :json => {success: true, msg: "Co-author deleted successfully!"} + render :json => {success: true, msg: "delete_success"} end end diff --git a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb index eff597fbf..42210178a 100644 --- a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb +++ b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb @@ -22,13 +22,24 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr @level_types = JournalLevelType.all @author_types = JournalAuthorType.all @paper_types= JournalPaperType.all - @journal_co_author_candidate = - JournalCoAuthor.where(name_id: current_user.id).map{|c|c.co_author} + #@journal_co_author_candidate = + # JournalCoAuthor.where(name_id: current_user.id).map{|c|c.co_author} @journal_candidate = WritingJournal.where(create_user_id: current_user.id).map{|j|j.journal_title}.uniq + if (not params[:q].nil?) and (current_user.name.include?params[:q]) + @user = [{ :id => 0, :name => current_user.name}] # self account name + else + @user = [] + end + + @co_authors = JournalCoAuthor.where(name_id: current_user.id, :co_author => /#{params[:q]}/) + @co_authors = [{ :id => params[:q], :name => params[:q] }] + # search string + @user + # self account name + @co_authors.map{|m| { :id => m.id, :name => m.co_author } } # match pattern respond_to do |format| format.html { render :layout => false} + format.json { render :json => @co_authors.to_json } end end @@ -48,7 +59,7 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr @writing_journal = WritingJournal.new(params[:writing_journal]) if @writing_journal.save - render json: {success: true, msg: t('create.success.paper')}.to_json + render json: {success: true, msg: t('create_success')}.to_json else error_msg = @writing_journal.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -60,31 +71,23 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr @writing_journal= WritingJournal.find(params[:id]) if @writing_journal.update_attributes(params[:writing_journal]) - render json: {success: true, msg: t('update.success.paper')}.to_json + render json: {success: true, msg: t('update_success')}.to_json else error_msg = @writing_journal.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json end 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 destroy @writing_journal = WritingJournal.find(params[:id]) @writing_journal.destroy - render :json => {success: true, msg: t('delete.success.paper')} + render :json => {success: true, msg: t('delete_success')} end def journal_type level_types = JournalLevelType.all all_journal_lists = WritingJournal.where(create_user_id: current_user.id) + all_journal_lists = all_journal_lists.asc(:journal_title) all_journal_lists = all_journal_lists.map do |j| [ j.journal_title, j.journal_level_type_ids.map do |type| diff --git a/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb b/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb index bdddd92ec..75f7bd6a0 100644 --- a/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb +++ b/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb @@ -1,6 +1,7 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper def publication_record publication, view content_tag :li, + "item" => "true", :class => "list_t_item" do marker + \ content(publication, view) + \ @@ -11,8 +12,14 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper def marker content_tag :div, :class => "list_item_action" - content_tag(:a, "", :class => "icon-check-empty") + \ - content_tag(:a, "", :class => "icon-star-empty") + 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 def content publication, view @@ -43,6 +50,7 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper content_tag(:a, t("edit"), :class => "journal_paper_edit admbg2 admtxt", :href => edit_panel_personal_journal_desktop_journal_page_path(publication), + "callback-method" => "editpaper", "ajax-remote" => "get") + \ content_tag(:a, t("delete"), "ajax-remote" => "delete", @@ -71,4 +79,16 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper file_type = "" end end + + def generate_authors_name ids + author_name = ids.map{|m| + if m == "0" + {:id => 0, :name => current_user.name} + else + {:id => m, :name => ConferenceCoAuthor.find(m).co_author} + end + } + + author_name.to_json + end end diff --git a/vendor/built_in_modules/personal_journal/app/models/journal_co_author.rb b/vendor/built_in_modules/personal_journal/app/models/journal_co_author.rb index 5d8617c7a..4edf44b2c 100644 --- a/vendor/built_in_modules/personal_journal/app/models/journal_co_author.rb +++ b/vendor/built_in_modules/personal_journal/app/models/journal_co_author.rb @@ -8,6 +8,7 @@ class JournalCoAuthor field :email belongs_to :journal_co_author_relations + has_and_belongs_to_many :writing_journals VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/ validates :email, format: { with: VALID_EMAIL_REGEX }, diff --git a/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb b/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb index 7374abbf4..8c721b64a 100644 --- a/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb +++ b/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb @@ -12,6 +12,7 @@ class WritingJournal has_and_belongs_to_many :tags, :class_name => "PersonalJournalTag" has_and_belongs_to_many :journal_author_types has_and_belongs_to_many :journal_level_types + has_and_belongs_to_many :journal_co_authors has_many :writing_journal_files, :autosave => true, :dependent => :destroy belongs_to :journal_paper_type @@ -35,25 +36,44 @@ class WritingJournal accepts_nested_attributes_for :writing_journal_files, :allow_destroy => true after_save :save_writing_journal_files before_validation :add_http - before_save :save_co_author + #before_save :save_co_author validates :paper_title, :at_least_one => true validates :url, :format => /^(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?/i, :unless => Proc.new{self.url.blank?} - def save_co_author - authors_list = authors.split(",").map{|n| n.strip.gsub(/\s+/," ")}.reject{|n| n.empty? } - if new_record? - current_user = create_user_id - else - current_user = update_user_id - end + attr_reader :author_tokens - authors_db = JournalCoAuthor.where(:name_id => current_user).map(&:co_author) - authors_list.delete(User.find(current_user).name) - authors_list = authors_list.delete_if{|author| authors_db.include?author} - authors_list.each do |author| - JournalCoAuthor.new(:co_author => author, :name_id => current_user).save - end + def author_tokens=(ids) + authors_ids = ids.split(",").map{|id| + begin + JournalCoAuthor.find(m).id + rescue + if id != "0" + new_co_author = JournalCoAuthor.new(:co_author => id, :name_id => create_user_id) + new_co_author.save + new_co_author.id + else + id + end + end + } + self.journal_co_author_ids = authors_ids end + # old method + #def save_co_author + # authors_list = authors.split(",").map{|n| n.strip.gsub(/\s+/," ")}.reject{|n| n.empty? } + # if new_record? + # current_user = create_user_id + # else + # current_user = update_user_id + # end + + # authors_db = JournalCoAuthor.where(:name_id => current_user).map(&:co_author) + # authors_list.delete(User.find(current_user).name) + # authors_list = authors_list.delete_if{|author| authors_db.include?author} + # authors_list.each do |author| + # JournalCoAuthor.new(:co_author => author, :name_id => current_user).save + # end + #end def self.search( category_id = nil ) if category_id.to_s.size > 0 diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_form.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_form.html.erb index bffde52fa..9cf116365 100644 --- a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_form.html.erb +++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_form.html.erb @@ -5,7 +5,7 @@ value: (@journal_co_author_relation.co_author_relation_translations[locale] rescue nil) %> <#% end %> --> -<%= f.submit "Save", class: "ini_input hp hh2 thmtxt thmc2", style: "margin-left: 10px;" %> +<%= f.submit t("save"), class: "ini_input hp hh1 thmtxt thmc2", style: "margin-left: 10px;" %> <% if not @journal_co_author_relation.new_record? %> - <%= submit_tag "Cancel", :type => "button", class: "bt-cancel-type ini_input hp hh2 thmtxt" %> + <%= submit_tag t("back"), :type => "button", class: "bt-cancel-type ini_input hp hh1 thmtxt" %> <% end %> diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_show_form.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_show_form.html.erb index e43c6f17a..4efbace0a 100644 --- a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_show_form.html.erb +++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_show_form.html.erb @@ -1,17 +1,11 @@ -<% @journal_co_author_relations.each_with_index do |journal_co_author_relation,i| %> - <% if ( i % 6 ) == 0 %> -
-
-
'+journal.title+'
');
- // var file_list = li.find('.list_t_des');
- // $.each(paper.files,function(k,file){
- // var thistitle = file.title;
- // if(!thistitle)
- // thistitle = "";
- // thistitle = ( thistitle.length > 8 )? thistitle.substring(0,8)+'...' : thistitle;
- // if(!file.title){
- // thistitle = "Untitled File";
- // }
- // var img = $(''+thistitle+'');
- // file_list.append(img);
- // })
- // li.append('');
- // column.find("ul").append(li);
- // if(counter%3==0){
- // $("#journal_p div#paper_list div.overview").append(column);
- // column = $('") render json: {success: false, msg: error_msg}.to_json @@ -37,7 +37,7 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorRelationsController < Appl if @journal_co_author_relation.update_attributes(params[:journal_co_author_relation]) @journal_co_author_relations = JournalCoAuthorRelation.all newv = render_to_string partial: "show_form", object: @journal_co_author_relations - render json: {success: true, msg: "New Relation successfully updated!", newvalue: newv}.to_json + render json: {success: true, msg: "update_success", newvalue: newv}.to_json else error_msg = @journal_co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -49,15 +49,15 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorRelationsController < Appl @journal_co_author_relation.destroy reset_co_author_relation - render :json => {success: true, msg: "deleted successfully!"} + render :json => {success: true, msg: "delete_success"} end private def reset_co_author_relation - co_author = JournalCoAuthor.where(co_author_relations_id: @co_author_relation.id) + co_author = JournalCoAuthor.where(journal_co_author_relations_id: @journal_co_author_relation.id) co_author.map do |c| - c.update_attributes(co_author_relations_id: nil) + c.update_attributes(journal_co_author_relations_id: nil) end end end diff --git a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_co_authors_controller.rb b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_co_authors_controller.rb index 6ddd86bda..e7f557743 100644 --- a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_co_authors_controller.rb +++ b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_co_authors_controller.rb @@ -28,11 +28,11 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorsController < ApplicationC end def create - @journal_co_author = JournalCoAuthor.new(params[:co_author]) + @journal_co_author = JournalCoAuthor.new(params[:journal_co_author]) @journal_co_author.name_id= current_user.id if @journal_co_author.save - render json: {success:true, msg: t('create.sucess.co_author')}.to_json + render json: {success:true, msg: t('create_success')}.to_json else error_msg = @journal_co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -42,8 +42,8 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorsController < ApplicationC def update @journal_co_author = JournalCoAuthor.find(params[:id]) - if @journal_co_author.update_attributes(params[:co_author]) - render json: {success:true, msg: t('update.sucess.co_author')}.to_json + if @journal_co_author.update_attributes(params[:journal_co_author]) + render json: {success:true, msg: t('update_success')}.to_json else error_msg = @journal_co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -54,6 +54,6 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorsController < ApplicationC @journal_co_author = JournalCoAuthor.find(params[:id]) @journal_co_author.destroy - render :json => {success: true, msg: "Co-author deleted successfully!"} + render :json => {success: true, msg: "delete_success"} end end diff --git a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb index eff597fbf..42210178a 100644 --- a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb +++ b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb @@ -22,13 +22,24 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr @level_types = JournalLevelType.all @author_types = JournalAuthorType.all @paper_types= JournalPaperType.all - @journal_co_author_candidate = - JournalCoAuthor.where(name_id: current_user.id).map{|c|c.co_author} + #@journal_co_author_candidate = + # JournalCoAuthor.where(name_id: current_user.id).map{|c|c.co_author} @journal_candidate = WritingJournal.where(create_user_id: current_user.id).map{|j|j.journal_title}.uniq + if (not params[:q].nil?) and (current_user.name.include?params[:q]) + @user = [{ :id => 0, :name => current_user.name}] # self account name + else + @user = [] + end + + @co_authors = JournalCoAuthor.where(name_id: current_user.id, :co_author => /#{params[:q]}/) + @co_authors = [{ :id => params[:q], :name => params[:q] }] + # search string + @user + # self account name + @co_authors.map{|m| { :id => m.id, :name => m.co_author } } # match pattern respond_to do |format| format.html { render :layout => false} + format.json { render :json => @co_authors.to_json } end end @@ -48,7 +59,7 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr @writing_journal = WritingJournal.new(params[:writing_journal]) if @writing_journal.save - render json: {success: true, msg: t('create.success.paper')}.to_json + render json: {success: true, msg: t('create_success')}.to_json else error_msg = @writing_journal.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -60,31 +71,23 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr @writing_journal= WritingJournal.find(params[:id]) if @writing_journal.update_attributes(params[:writing_journal]) - render json: {success: true, msg: t('update.success.paper')}.to_json + render json: {success: true, msg: t('update_success')}.to_json else error_msg = @writing_journal.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json end 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 destroy @writing_journal = WritingJournal.find(params[:id]) @writing_journal.destroy - render :json => {success: true, msg: t('delete.success.paper')} + render :json => {success: true, msg: t('delete_success')} end def journal_type level_types = JournalLevelType.all all_journal_lists = WritingJournal.where(create_user_id: current_user.id) + all_journal_lists = all_journal_lists.asc(:journal_title) all_journal_lists = all_journal_lists.map do |j| [ j.journal_title, j.journal_level_type_ids.map do |type| diff --git a/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb b/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb index bdddd92ec..75f7bd6a0 100644 --- a/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb +++ b/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb @@ -1,6 +1,7 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper def publication_record publication, view content_tag :li, + "item" => "true", :class => "list_t_item" do marker + \ content(publication, view) + \ @@ -11,8 +12,14 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper def marker content_tag :div, :class => "list_item_action" - content_tag(:a, "", :class => "icon-check-empty") + \ - content_tag(:a, "", :class => "icon-star-empty") + 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 def content publication, view @@ -43,6 +50,7 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper content_tag(:a, t("edit"), :class => "journal_paper_edit admbg2 admtxt", :href => edit_panel_personal_journal_desktop_journal_page_path(publication), + "callback-method" => "editpaper", "ajax-remote" => "get") + \ content_tag(:a, t("delete"), "ajax-remote" => "delete", @@ -71,4 +79,16 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper file_type = "" end end + + def generate_authors_name ids + author_name = ids.map{|m| + if m == "0" + {:id => 0, :name => current_user.name} + else + {:id => m, :name => ConferenceCoAuthor.find(m).co_author} + end + } + + author_name.to_json + end end diff --git a/vendor/built_in_modules/personal_journal/app/models/journal_co_author.rb b/vendor/built_in_modules/personal_journal/app/models/journal_co_author.rb index 5d8617c7a..4edf44b2c 100644 --- a/vendor/built_in_modules/personal_journal/app/models/journal_co_author.rb +++ b/vendor/built_in_modules/personal_journal/app/models/journal_co_author.rb @@ -8,6 +8,7 @@ class JournalCoAuthor field :email belongs_to :journal_co_author_relations + has_and_belongs_to_many :writing_journals VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/ validates :email, format: { with: VALID_EMAIL_REGEX }, diff --git a/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb b/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb index 7374abbf4..8c721b64a 100644 --- a/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb +++ b/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb @@ -12,6 +12,7 @@ class WritingJournal has_and_belongs_to_many :tags, :class_name => "PersonalJournalTag" has_and_belongs_to_many :journal_author_types has_and_belongs_to_many :journal_level_types + has_and_belongs_to_many :journal_co_authors has_many :writing_journal_files, :autosave => true, :dependent => :destroy belongs_to :journal_paper_type @@ -35,25 +36,44 @@ class WritingJournal accepts_nested_attributes_for :writing_journal_files, :allow_destroy => true after_save :save_writing_journal_files before_validation :add_http - before_save :save_co_author + #before_save :save_co_author validates :paper_title, :at_least_one => true validates :url, :format => /^(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?/i, :unless => Proc.new{self.url.blank?} - def save_co_author - authors_list = authors.split(",").map{|n| n.strip.gsub(/\s+/," ")}.reject{|n| n.empty? } - if new_record? - current_user = create_user_id - else - current_user = update_user_id - end + attr_reader :author_tokens - authors_db = JournalCoAuthor.where(:name_id => current_user).map(&:co_author) - authors_list.delete(User.find(current_user).name) - authors_list = authors_list.delete_if{|author| authors_db.include?author} - authors_list.each do |author| - JournalCoAuthor.new(:co_author => author, :name_id => current_user).save - end + def author_tokens=(ids) + authors_ids = ids.split(",").map{|id| + begin + JournalCoAuthor.find(m).id + rescue + if id != "0" + new_co_author = JournalCoAuthor.new(:co_author => id, :name_id => create_user_id) + new_co_author.save + new_co_author.id + else + id + end + end + } + self.journal_co_author_ids = authors_ids end + # old method + #def save_co_author + # authors_list = authors.split(",").map{|n| n.strip.gsub(/\s+/," ")}.reject{|n| n.empty? } + # if new_record? + # current_user = create_user_id + # else + # current_user = update_user_id + # end + + # authors_db = JournalCoAuthor.where(:name_id => current_user).map(&:co_author) + # authors_list.delete(User.find(current_user).name) + # authors_list = authors_list.delete_if{|author| authors_db.include?author} + # authors_list.each do |author| + # JournalCoAuthor.new(:co_author => author, :name_id => current_user).save + # end + #end def self.search( category_id = nil ) if category_id.to_s.size > 0 diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_form.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_form.html.erb index bffde52fa..9cf116365 100644 --- a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_form.html.erb +++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_form.html.erb @@ -5,7 +5,7 @@ value: (@journal_co_author_relation.co_author_relation_translations[locale] rescue nil) %> <#% end %> --> -<%= f.submit "Save", class: "ini_input hp hh2 thmtxt thmc2", style: "margin-left: 10px;" %> +<%= f.submit t("save"), class: "ini_input hp hh1 thmtxt thmc2", style: "margin-left: 10px;" %> <% if not @journal_co_author_relation.new_record? %> - <%= submit_tag "Cancel", :type => "button", class: "bt-cancel-type ini_input hp hh2 thmtxt" %> + <%= submit_tag t("back"), :type => "button", class: "bt-cancel-type ini_input hp hh1 thmtxt" %> <% end %> diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_show_form.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_show_form.html.erb index e43c6f17a..4efbace0a 100644 --- a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_show_form.html.erb +++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_author_relations/_show_form.html.erb @@ -1,17 +1,11 @@ -<% @journal_co_author_relations.each_with_index do |journal_co_author_relation,i| %> - <% if ( i % 6 ) == 0 %> -
-
-
- <% end %>
-
-
+ <% @journal_co_author_relations.each_with_index do |journal_co_author_relation,i| %>
+
+
-
-
Create
+
+
- <%= submit_tag "Back", :type => "button", "ajax-remote" => "get", :href => panel_personal_journal_desktop_journal_co_authors_path, class: "fn_btn ini_input hp hh2 thmtxt" %>
+ <%= submit_tag t("back"), :type => "button", "ajax-remote" => "get", :href => panel_personal_journal_desktop_journal_co_authors_path, class: "fn_btn ini_input hp hh1 thmtxt" %>
<%= t("add") %>
-
+
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_authors/_form.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_authors/_form.html.erb
index 494b3df47..f67a51ec1 100644
--- a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_authors/_form.html.erb
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_co_authors/_form.html.erb
@@ -1,7 +1,7 @@
-
<%= render :partial => 'show_form'%>
+
- <%= f.submit "Save", name: "commit", value: "Save", class: "fn_btn ini_input hp hh2 thmc2 thmtxt" %>
- <%= submit_tag "Cancel", :type => "button", "ajax-remote" => "get", :href => panel_personal_journal_desktop_journal_co_authors_path, class: "fn_btn ini_input hp hh2 thmtxt" %>
+ <%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
+ <%= submit_tag t("back"), :type => "button", "ajax-remote" => "get", :href => panel_personal_journal_desktop_journal_co_authors_path, class: "fn_btn ini_input hp hh1 thmtxt" %>
@@ -23,7 +23,7 @@