This commit is contained in:
Harry Bomrah 2013-03-08 12:54:58 +08:00
commit ca64cba9ad
7 changed files with 34 additions and 10 deletions

View File

@ -1,8 +1,11 @@
class Panel::PersonalConference::Desktop::ConferenceCoAuthorRelationsController < ApplicationController
def index
page = params[:page]
page ||= 1
@conference_co_author_relations = ConferenceCoAuthorRelation.all
new
@conference_co_author_relations = @conference_co_author_relations.page(page).per(5)
respond_to do |format|
format.html {render layout: false }
end

View File

@ -1,10 +1,12 @@
class Panel::PersonalConference::Desktop::ConferenceCoAuthorsController < ApplicationController
def index
nils, not_nils = ConferenceCoAuthor.where(name_id: current_user.id)\
.asc(:co_author).partition{|p| p.email.nil?}
@conference_co_authors = not_nils + nils
page = params[:page]
page ||= 1
@conference_co_authors = ConferenceCoAuthor.where(name_id: current_user.id).asc(:co_author)
@conference_co_author_relations = ConferenceCoAuthorRelation.all
@conference_co_authors = @conference_co_authors.page(page).per(5)
respond_to do |format|
format.html { render :layout => false}
end

View File

@ -2,6 +2,8 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio
def index
@view_by = params[:view]
@writing_conferences = WritingConference.where(create_user_id: current_user.id)
page = params[:page]
page ||= 1
if @view_by.nil?
@writing_conferences = @writing_conferences.asc(:paper_title)
@ -11,6 +13,8 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio
@level_types = ConferencePaperType.all
@writing_conferences = @writing_conferences.page(page).per(5)
respond_to do |format|
format.html { render :layout => false}
end
@ -84,9 +88,13 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio
end
def conference_type
page = params[:page]
page ||= 1
conference_types = ConferencePaperType.all
all_conference_lists = WritingConference.where(create_user_id: current_user.id)
all_conference_lists = all_conference_lists.asc(:conference_title)
all_conference_lists = all_conference_lists.page(page).per(5)
all_conference_lists = all_conference_lists.map do |j|
[ j.conference_title,
j.conference_paper_type_ids.map do |type|

View File

@ -1,8 +1,11 @@
class Panel::PersonalJournal::Desktop::JournalCoAuthorRelationsController < ApplicationController
def index
page = params[:page]
page ||= 1
@journal_co_author_relations = JournalCoAuthorRelation.all
new
@journal_co_author_relations = @journal_co_author_relations.page(page).per(5)
respond_to do |format|
format.html {render layout: false }
end

View File

@ -1,10 +1,12 @@
class Panel::PersonalJournal::Desktop::JournalCoAuthorsController < ApplicationController
def index
nils, not_nils = JournalCoAuthor.where(name_id: current_user.id)\
.asc(:co_author).partition{|p| p.email.nil?}
@journal_co_authors = not_nils + nils
page = params[:page]
page ||= 1
@journal_co_authors = JournalCoAuthor.where(name_id: current_user.id).asc(:co_author)
@journal_co_author_relations = JournalCoAuthorRelation.all
@journal_co_authors = @journal_co_authors.page(page).per(5)
respond_to do |format|
format.html { render :layout => false}
end

View File

@ -3,6 +3,8 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr
@writing_journals = WritingJournal.where(create_user_id: current_user.id)
@level_types = JournalLevelType.all
@view_by = params[:view]
page = params[:page]
page ||= 1
if @view_by.nil?
@writing_journals = @writing_journals.asc(:paper_title)
@ -12,6 +14,8 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr
@level_types = ConferencePaperType.all
@writing_journals = @writing_journals.page(page).per(5)
respond_to do |format|
format.html { render :layout => false}
end
@ -85,9 +89,13 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr
end
def journal_type
page = params[:page]
page ||= 1
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.page(page).per(5)
all_journal_lists = all_journal_lists.map do |j|
[ j.journal_title,
j.journal_level_type_ids.map do |type|

View File

@ -1,9 +1,9 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit "Save", name: "commit", value: "Save", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
<% if not @writing_journal.new_record? %>
<%= submit_tag "Cancel", :type => "button", "ajax-remote" => "get", :href => panel_personal_journal_desktop_journal_pages_path, class: "ini_input hp hh1 thmadm thmtxt" %>
<%= submit_tag t("cancel"), :type => "button", "ajax-remote" => "get", :href => panel_personal_journal_desktop_journal_pages_path, class: "ini_input hp hh1 thmadm thmtxt" %>
<% end %>
</div>
@ -190,9 +190,7 @@
<td colspan="3">
<div id='add_plugin_file' class="info_input plugin_files_block s_action">
<%= hidden_field_tag 'plugin_file_field_count', @writing_journal.writing_journal_files.count %>
<a class="add setting_btn thmc1 thmtxt w1 hh1 hp" href="#"><i class="icon-plus icon-white"></i> add</a>
</div>
</td>
</tr>