finished some method of list and journal
This commit is contained in:
1 parent
7e9b60a527
commit
5eb8cc4063
20 files changed
+306
-316
No files matched your search
Whitespace-only changes.
@@ -586,7 +586,7 @@ var orbitDesktop = function(dom){
|
||||
$(this).val(sectionnames[i]);
|
||||
})
|
||||
bindHandlers();
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
class Desktop::JournalPagesController < ApplicationController
|
||||
def index
|
||||
@writing_journal = WritingJournal.where(create_user_id: current_user.id)
|
||||
@level_types = JournalLevelType.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html { render :layout => false}
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@writing_journal = WritingJournal.new
|
||||
@level_types = JournalLevelType.all
|
||||
@author_types = JournalAuthorType.all
|
||||
@paper_types= JournalPaperType.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html { render :layout => false}
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def create
|
||||
if params[:commit].eql?"Save"
|
||||
if not params[:writing_journal][:publication_date].nil?
|
||||
params[:writing_journal][:publication_date] = \
|
||||
Date.new *(params[:writing_journal][:publication_date].split("/").map{|s| s.to_i})
|
||||
end
|
||||
|
||||
params[:writing_journal][:create_user_id] = current_user.id
|
||||
|
||||
@writing_journal = WritingJournal.new(params[:writing_journal])
|
||||
if @writing_journal.save
|
||||
respond_to do |format|
|
||||
format.html { redirect_to desktop_journal_pages_url, :layout => false, notice: 'User was successfully created.'}
|
||||
# format.json { render json: @writing_journal, status: :created, location: @writing_journal}
|
||||
# format.js
|
||||
end
|
||||
else
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def update
|
||||
if params[:commit].eql?"Edit"
|
||||
params[:writing_journal][:update_user_id] = current_user.id
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -4,21 +4,29 @@ class DesktopPublicationsController< ApplicationController
|
||||
def journal_p
|
||||
render "desktop/journal_p", :layout => false
|
||||
end
|
||||
#
|
||||
# def journal_p_list
|
||||
# render "desktop/journal_pages/list", :layout => false
|
||||
# end
|
||||
|
||||
def journal_p_list
|
||||
render "desktop/journal_pages/list", :layout => false
|
||||
end
|
||||
|
||||
def journal_p_add
|
||||
@writing_journal = WritingJournal.new
|
||||
@level_types = JournalLevelType.all
|
||||
|
||||
# def journal_p_add
|
||||
# @writing_journal = WritingJournal.new
|
||||
# @level_types = JournalLevelType.all
|
||||
#
|
||||
# respond_to do |format|
|
||||
# format.html # new.html.erb
|
||||
# format.xml { render :xml => @writing_journal }
|
||||
# format.html { render "desktop/journal_pages/add", :layout => false}
|
||||
# end
|
||||
render "desktop/journal_pages/add", :layout => false
|
||||
end
|
||||
# end
|
||||
#
|
||||
# def journal_p_create
|
||||
# @writing_journal = WritingJournal.all.first
|
||||
# @level_types = JournalLevelType.all
|
||||
# respond_to do |format|
|
||||
# format.html { render "desktop/journal_pages/list", :layout => false}
|
||||
# #format.js
|
||||
# end
|
||||
#
|
||||
# end
|
||||
|
||||
def books
|
||||
render "desktop/books", :layout => false
|
||||
@@ -75,8 +83,6 @@ class DesktopPublicationsController< ApplicationController
|
||||
|
||||
def getjournals
|
||||
publications = WritingJournal.where(create_user_id: current_user.id)
|
||||
p current_user.id
|
||||
p "======="
|
||||
|
||||
sort_publications= Hash.new
|
||||
data = Array.new
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
<div id="journal_p">
|
||||
<div id="content">
|
||||
<div id="header" class="hh3">
|
||||
<div class="dtitle w2 hh3 hp">
|
||||
<span class="thmtxth">Journal Papers</span>
|
||||
</div>
|
||||
<div id="search_app" class="hfn w2 hh2 hp thmc3">
|
||||
<input type="text" class="ini_input form" value="Search" id="searchbox" />
|
||||
<input type="submit" class="ini_input submit thmc1" value="Submit"/>
|
||||
</div>
|
||||
</div>
|
||||
<div id="holder">
|
||||
<div id="panel_l" class="ph">
|
||||
<div class="s_menu sm_v">
|
||||
<ul id='setting_left_nav'>
|
||||
<li><a href="<%= desktop_publications_journal_p_list_path %>" data-method="list" class="hh2 w2 hp active thmc1 thmtxt xx" onclick='return false;'>List</a></li>
|
||||
<li><a href="<%= desktop_publications_journal_p_add_path %>" data-method="addpaper" class="admtxt hh2 w2 hp xx" onclick='return false;'>Add/Edit</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Journals</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Co-Authors</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Tags & Keywords</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Analysis</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Import</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Export</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="panel_r" class="ph pw admbg hp">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="header" class="hh3">
|
||||
<div class="dtitle w2 hh3 hp">
|
||||
<span class="thmtxth">Journal Papers</span>
|
||||
</div>
|
||||
<div id="search_app" class="hfn w2 hh2 hp thmc3">
|
||||
<input type="text" class="ini_input form" value="Search" id="searchbox" />
|
||||
<input type="submit" class="ini_input submit thmc1" value="Submit"/>
|
||||
</div>
|
||||
</div>
|
||||
<div id="holder">
|
||||
<div id="panel_l" class="ph">
|
||||
<div class="s_menu sm_v">
|
||||
<ul id='setting_left_nav'>
|
||||
<li><a href="<%= desktop_journal_pages_path %>" data-method="list" class="hh2 w2 hp active thmc1 thmtxt xx" onclick='return false;'>List</a></li>
|
||||
<li><a href="<%= new_desktop_journal_page_path %>" data-method="addpaper" class="admtxt hh2 w2 hp xx" onclick='return false;'>Add/Edit</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Journals</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Co-Authors</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Tags & Keywords</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Analysis</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Import</a></li>
|
||||
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Export</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="panel_r" class="ph pw admbg hp">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -60,7 +60,7 @@
|
||||
<ul>
|
||||
<% @level_types.each_with_index do |level_type, i| %>
|
||||
<li>
|
||||
<%= check_box_tag "field-#{i}",
|
||||
<%= check_box_tag "writing_journal[journal_level_type_ids][]",
|
||||
level_type.id,
|
||||
@writing_journal.journal_level_type_ids.include?(level_type.id)
|
||||
%><%= label_tag("field-#{i}", level_type.title) %>
|
||||
@@ -117,22 +117,22 @@
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
|
||||
<select name="" id="" class="s_grid s_grid_4">
|
||||
<%= options_for_select([["Author Type", 1],
|
||||
["First Author", 2],
|
||||
["Corresponding Author", 3],
|
||||
["Second Author", 4],
|
||||
["Third Author", 5],
|
||||
["Fourth Author", 6]], 1)
|
||||
<select name="writing_journal[journal_author_type_ids][]" id="" class="s_grid s_grid_4">
|
||||
<%= options_for_select(
|
||||
@author_types.map do |author_type|
|
||||
[author_type.title, author_type.id]
|
||||
end
|
||||
)
|
||||
%>
|
||||
</select>
|
||||
|
||||
<select name="" id="" class="s_grid s_grid_2">
|
||||
<%= options_for_select([['Status', 1],
|
||||
['Published', 2],
|
||||
['Pending', 3],
|
||||
['Writing', 4]], 1)
|
||||
%>
|
||||
<select name="writing_journal[journal_paper_type_ids][]" id="" class="s_grid s_grid_2">
|
||||
<%= options_for_select(
|
||||
@paper_types.map do |paper_type|
|
||||
[paper_type.title, paper_type.id]
|
||||
end
|
||||
)
|
||||
%>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<%= form_for @writing_journal, url: desktop_publications_journal_p_add_path do |f| %>
|
||||
<%= render partial: 'desktop/journal_pages/form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
@@ -0,0 +1,2 @@
|
||||
<h1>Desktop::JournalPages#edit</h1>
|
||||
<p>Find me in app/views/desktop/journal_pages/edit.html.erb</p>
|
||||
@@ -0,0 +1,88 @@
|
||||
<div class="toolbar hh2">
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2"><span class="icon-check"></span></div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_selection_options">
|
||||
<li><a class="hp hh2 admtxt" href="all">All</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="none">None</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">More</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">Delete</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Tag</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">Tag</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Starred</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">MIT</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">Status</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Published</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Pending</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">View</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_view_selection">
|
||||
<li><a class="hp hh2 admtxt" href="journal">Journal</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="title">Title</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="file">File</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="keywords">Keywords</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="abstract">Abstract</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2" id='ns'>New Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt remote_url" href="<%= panel_personal_journal_plugin_writing_journals_path %>">Full</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="paper_list" class="tinycanvas vp">
|
||||
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
|
||||
<div class="viewport">
|
||||
<div class="overview">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
<div class="toolbar hh2">
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2"><span class="icon-check"></span></div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_selection_options">
|
||||
<li><a class="hp hh2 admtxt" href="all">All</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="none">None</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">More</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">Delete</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Tag</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">Tag</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Starred</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">MIT</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">Status</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Published</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Pending</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">View</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_view_selection">
|
||||
<li><a class="hp hh2 admtxt" href="journal">Journal</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="title">Title</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="file">File</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="keywords">Keywords</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="abstract">Abstract</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2" id='ns'>New Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh2 admtxt remote_url" href="<%= panel_personal_journal_plugin_writing_journals_path %>">Full</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh2 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh2 hp sdm">
|
||||
<div class="sdm_t hh2"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="paper_list" class="tinycanvas vp">
|
||||
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
|
||||
<div class="viewport">
|
||||
<div class="overview">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<%= form_for @writing_journal, url: desktop_journal_pages_path do |f| %>
|
||||
<%= render partial: 'desktop/journal_pages/form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
@@ -0,0 +1,2 @@
|
||||
<h1>Desktop::JournalPages#show</h1>
|
||||
<p>Find me in app/views/desktop/journal_pages/show.html.erb</p>
|
||||
Reference in new issue
Block a user