refine co-authro page

This commit is contained in:
Rueshyna 2012-12-01 00:21:49 +08:00 committed by chris
parent 5986817e16
commit 5dabfe9319
3 changed files with 7 additions and 20 deletions

View File

@ -55,27 +55,10 @@ class Desktop::CoAuthorsController < ApplicationController
end
end
def delete
def destroy
@co_author = CoAuthor.find(params[:id])
@co_author.destroy
#respond_to do |format|
# format.html { redirect_to desktop_co_authors_url, :layout => false }
# format.json { head :no_content }
#end
end
def get_co_authors_json
@co_authors = CoAuthor.where(name_id: current_user.id)
data = Array.new
@co_authors.each do |co_author|
data << {
author: co_author.co_author,
email: co_author.email,
type: co_author.type
}
end
render json: JSON.pretty_generate(data)
render :json => {success: true, msg: "Paper deleted successfully!"}
end
end

View File

@ -1,3 +1,6 @@
<h1>list all coauthor</h1>
<%= link_to "New Co-Author", new_desktop_co_author_path %>
<%= link_to "New Type", "#" %>
<table>
<tr>
<th>Name</th>
@ -13,6 +16,7 @@
<td><%= co_author.co_author %></td>
<td><%= co_author.email %></td>
<td><%= co_author.type%></td>
<td><%= link_to 'Edit', edit_desktop_co_author_path(co_author) %></td>
<td><%= link_to 'Destroy', desktop_co_author_path(co_author), method: :delete, confirm: 'Are you sure?' %></td>
</tr>
<% end %>

View File

@ -16,7 +16,7 @@
<li><a href="<%= desktop_journal_pages_path %>" callback-method="list" load="true" class="hh2 w2 hp thmc1 thmtxt xx" onclick='return false;'>List</a></li>
<li><a href="<%= new_desktop_journal_page_path %>" callback-method="addpaper" custom-load="addpaper" class="admtxt hh2 w2 hp xx" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= desktop_journal_lists_path %>" callback-method="journal" class="admtxt hh2 w2 hp" onclick='return false;'>Journals</a></li>
<li><a href="<%= new_desktop_co_author_path %>" class="admtxt hh2 w2 hp" callback-method="coauthor" custom-load="coauthor" onclick='return false;'>Co-Authors</a></li>
<li><a href="<%= desktop_co_authors_path %>" class="admtxt hh2 w2 hp" callback-method="coauthor" custom-load="coauthor" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Tags &amp; 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>