refine co-authro page
This commit is contained in:
parent
5986817e16
commit
5dabfe9319
|
@ -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
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -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 & 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>
|
||||
|
|
Reference in New Issue