new plugins added for desktop
This commit is contained in:
1 parent
42615f02ea
commit
c2f223b82c
121 files changed
+7213
-708
No files matched your search
vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/desktop/personal_books.js
Vendored
+158
@@ -0,0 +1,158 @@
|
||||
orbitDesktop.prototype.initializePersonalBook = function(target,url,cache){ // this init journal papers
|
||||
this.initializePersonalBook.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");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalBook.list = function(){ // to open list part in journal papers page
|
||||
var journalData;
|
||||
var bindHandlers = function(){ // to bind handlers for list page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
|
||||
var bindSecondaryHandlers = function(){
|
||||
$("#journal_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.initializePersonalBook.bookDelete = function(data,dom){
|
||||
var parent = dom.parent().parent();
|
||||
if(data.success){
|
||||
parent.hide("slide",function(){parent.remove();});
|
||||
o.notify(data.msg,"success");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalBook.cancelbook = function(){
|
||||
o.highlight_sub_menu_item(0);
|
||||
}
|
||||
|
||||
this.initializePersonalBook.editbook = function(){
|
||||
o.highlight_sub_menu_item(1);
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var preData = function(){
|
||||
$("#writing_journal_author_tokens").select2('data', JSON.parse($("#writing_journal_author_tokens").attr('data-pre')));
|
||||
}
|
||||
uploadFiles();
|
||||
// preData();
|
||||
}
|
||||
|
||||
this.initializePersonalBook.addbook = function(){ // to open add pages in journal papers page
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
// console.log("hi");
|
||||
var bindHandlers = function(){
|
||||
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
uploadFiles();
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.initializePersonalBook.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.initializePersonalBook.coauthor = function(){ // to open add pages in coauthor page
|
||||
var bindHandlers = function(){ // to bind handlers for add page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
}
|
||||
this.initializePersonalBook.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.initializePersonalBook.coauthorRelationEditForm = function(data){
|
||||
if(data.success){
|
||||
o.notify(data.msg,"success");
|
||||
var x = o.layout_data.generate_layout_html(data.newvalue);
|
||||
$("div[container=true] div.overview").html(x.markup);
|
||||
}else{
|
||||
o.notify(data.msg,"alert");
|
||||
}
|
||||
}
|
||||
this.initializePersonalBook.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.initializePersonalBook.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
//= require_tree ./personal_book/desktop
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationController
|
||||
|
||||
def index
|
||||
@writing_books = WritingBook.where(create_user_id: current_user.id)
|
||||
@view_by = params[:view]
|
||||
page = params[:page]
|
||||
page ||= 1
|
||||
|
||||
@per_column = 5
|
||||
|
||||
case @view_by
|
||||
when "abstract"
|
||||
@per_column = 1
|
||||
when "file"
|
||||
@per_column = 2
|
||||
end
|
||||
|
||||
if @view_by.nil?
|
||||
@view_by = " "
|
||||
@writing_books = @writing_books.asc(:paper_title)
|
||||
else
|
||||
@writing_books = @writing_books.asc(@view_by).asc(:paper_title)
|
||||
end
|
||||
@writing_books = @writing_books.page(page).per(50)
|
||||
respond_to do |format|
|
||||
format.html { render :layout => false}
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@personal_book = WritingBook.new
|
||||
@author_types = BookAuthorType.all
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def create
|
||||
params[:writing_book][:create_user_id] = current_user.id
|
||||
@personal_book = WritingBook.new(params[:writing_book])
|
||||
if @personal_book.save
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @personal_book.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@personal_book = WritingBook.find(params[:id])
|
||||
@author_types = BookAuthorType.all
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def update
|
||||
params[:writing_book][:create_user_id] = current_user.id
|
||||
@personal_book = WritingBook.new(params[:writing_book])
|
||||
if @personal_book.update_attributes(params[:writing_book])
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @personal_book.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@personal_book = WritingBook.find(params[:id])
|
||||
@personal_book.destroy
|
||||
render :json => {success: true, msg: t('delete_success')}
|
||||
end
|
||||
|
||||
def books_window
|
||||
render :layout => false
|
||||
end
|
||||
end
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
module Panel::PersonalBook::Desktop::PersonalBooksHelper
|
||||
def publication_record publication, view
|
||||
content_tag :li,
|
||||
"item" => "true",
|
||||
:class => "list_t_item" do
|
||||
marker + \
|
||||
content(publication, view) + \
|
||||
edit_or_delete(publication)
|
||||
end
|
||||
end
|
||||
|
||||
def marker
|
||||
content_tag :div,
|
||||
:class => "list_item_action" do
|
||||
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
|
||||
end
|
||||
|
||||
def content publication, view
|
||||
case view
|
||||
when "conference_title"
|
||||
des = content_tag(:div, publication.book_title,
|
||||
:class => "list_t_des")
|
||||
when "keywords"
|
||||
des = content_tag(:div, publication.keywords,
|
||||
:class => "list_t_des")
|
||||
when "abstract"
|
||||
des = content_tag(:div, publication.abstract,
|
||||
:class => "list_t_des")
|
||||
when "file"
|
||||
des = content_tag(:div, link_publication_file(publication),
|
||||
:class => "list_t_des")
|
||||
else
|
||||
end
|
||||
|
||||
content_tag(:div, publication.paper_title,
|
||||
:class => "list_t_title") + des
|
||||
|
||||
end
|
||||
|
||||
def edit_or_delete publication
|
||||
content_tag :div,
|
||||
:class => "list_item_function" do
|
||||
content_tag(:a, t("edit"),
|
||||
:class => "journal_paper_edit admbg2 admtxt",
|
||||
:href => edit_panel_personal_book_desktop_personal_book_path(publication),
|
||||
"callback-method" => "editbook",
|
||||
"ajax-remote" => "get") + \
|
||||
content_tag(:a, t(:delete_),
|
||||
"ajax-remote" => "delete",
|
||||
"confirm-message" => t("sure?"),
|
||||
"callback-method" => "bookDelete",
|
||||
:class => "journal_paper_delete admbg2 admtxt",
|
||||
:href => panel_personal_book_desktop_personal_book_path(publication))
|
||||
end
|
||||
end
|
||||
|
||||
def link_publication_file publication
|
||||
publication.writing_book_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, file.title, :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank")
|
||||
}.inject(:+)
|
||||
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 generate_authors_name ids
|
||||
author_name = ids.map{|m|
|
||||
if m == "0"
|
||||
#{:id => 0, :text => current_user.name, :email => current_user.email }
|
||||
{:id => 0, :text => current_user.name }
|
||||
else
|
||||
#{:id => m, :text => ConferenceCoAuthor.find(m).co_author, :email => ConferenceCoAuthor.find(m).email}
|
||||
{:id => m, :text => ConferenceCoAuthor.find(m).co_author}
|
||||
end
|
||||
}
|
||||
author_name.to_json
|
||||
end
|
||||
end
|
||||
+164
@@ -0,0 +1,164 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="fn_g hp">
|
||||
|
||||
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
|
||||
<% if not @personal_book.new_record? %>
|
||||
<%= submit_tag t("cancel"), :type => "button", "callback-method"=>"cancelbook", "ajax-remote" => "get", :href => panel_personal_book_desktop_personal_books_path, class: "fn_btn ini_input hp hh1 admbg2 admtxt" %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" content-layout="column" base-width="420">
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :paper_title_translations do |f| %>
|
||||
<%= f.text_area locale,
|
||||
class: "s_grid_12 s_grid s_grid_h_3",
|
||||
size: "20x4",
|
||||
placeholder: t("personal_book.paper_title"),
|
||||
value: (@personal_book.paper_title_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :book_title_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_book.book_title"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@personal_book.book_title_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_book.book_paper_type"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.select :book_paper_type_id, BookPaperType.all.collect {|t| [ t.title, t.id ]}, {:class => "s_grid s_grid_8"} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_book.author_type"), class: "s_grid_4 s_grid") %>
|
||||
<% @author_types.each do |author_type| %>
|
||||
<%= content_tag :label,:class => "s_grid_4 s_grid" do -%>
|
||||
<%= check_box_tag 'writing_book[book_author_type_ids][]', author_type.id, @personal_book.book_author_type_ids.include?(author_type.id)%>
|
||||
<%= author_type.title %>
|
||||
<%= hidden_field_tag 'writing_book[book_author_type_ids][]', '' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :extracted_chapters_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_book.extracted_chapters"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@personal_book.extracted_chapters_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :publishers_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_book.publishers"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@personal_book.publishers_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<!-- <li class="s_grid_row">
|
||||
<%#= f.text_area :author_tokens,
|
||||
class: "s_grid_12 s_grid",
|
||||
size: "20x2",
|
||||
placeholder: t("personal_journal.authors"),
|
||||
"autocomplete" => "/panel/personal_journal/desktop/journal_pages/new.json",
|
||||
"autocomplete-format" => "--:[text,email]",
|
||||
"data-pre" => generate_authors_name(@personal_book.journal_co_author_ids) %>
|
||||
|
||||
</li> -->
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_book.publication_date"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.date_select :publish_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %>
|
||||
<%= f.date_select :publish_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_book.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :keywords, size: "20x3", placeholder: t("personal_book.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_book.pages"), class: "s_grid_4 s_grid") %><%= f.text_field :pages, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.label :language, t("personal_book.language"), :class => "s_grid s_grid_4" %>
|
||||
<%= f.select :language, WritingBook::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_book.isbn"), class: "s_grid_4 s_grid") %><%= f.text_field :isbn, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :note, size: "20x3", placeholder: t("personal_book.note"), class: "s_grid_12 s_grid s_grid_h_5"%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<table class="s_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="s_grid_2"><%= t("personal_book.file")%></th>
|
||||
<th class="s_grid_4"><%= t("personal_book.file_name")%></th>
|
||||
<th class="s_grid_4"><%= t("personal_book.description") %></th>
|
||||
<th class="s_grid_2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div id='add_plugin_file' class="info_input plugin_files_block s_action">
|
||||
<%= hidden_field_tag 'plugin_file_field_count', @personal_book.writing_book_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>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<% @personal_book.writing_book_files.each_with_index do |writing_book_file, i| %>
|
||||
<%= f.fields_for :writing_book_files, writing_book_file do |f| %>
|
||||
<%= render :partial => 'form_file', :object => writing_book_file, :locals => {:f => f, :i => i} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var get_html = function(old_id,new_id){
|
||||
return ("<%= escape_javascript(add_attribute 'form_file', f, :writing_book_files) %>").replace(old_id, new_id);
|
||||
}
|
||||
</script>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class="list_item">
|
||||
<td>
|
||||
<div>
|
||||
<% if form_file.new_record? %>
|
||||
<%= f.file_field :file, class: "s_grid_2" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<%= f.text_field :title, :class => 's_grid_4' %>
|
||||
</td>
|
||||
<td>
|
||||
<%= f.fields_for :file_title_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
class: 's_grid_4',
|
||||
value: (form_file.file_title_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<span class="action">
|
||||
<% if form_file.new_record? %>
|
||||
<a class="delete"><i class="icon-remove"></i></a>
|
||||
<% else %>
|
||||
<%= f.hidden_field :id %>
|
||||
<a class="remove_existing_record"><i class="icon-remove"></i></a>
|
||||
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
|
||||
<% end %>
|
||||
<%= form_file.file.file ? ( link_to '', form_file.file.url, {:class => 'icon-eye-open', :target => '_blank', :title => t(:view)} ) : '' %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<%= stylesheet_link_tag "/assets/personal_book/desktop/personal_book" %>
|
||||
<%= javascript_include_tag "personal_book/desktop/personal_books" %>
|
||||
<div id="books">
|
||||
<div id="content">
|
||||
<div id="header" class="hh2">
|
||||
<div class="dtitle w2 hh2 hp">
|
||||
<span class="thmtxth">Books</span>
|
||||
</div>
|
||||
<div id="search_app" class="hfn w2 hh1 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" content-type="menu">
|
||||
<ul id='setting_left_nav'>
|
||||
<li><a href="<%= panel_personal_book_desktop_personal_books_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
|
||||
<li><a href="<%= new_panel_personal_book_desktop_personal_book_path %>" callback-method="addbook" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
|
||||
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags & Keywords</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Analysis</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Import</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Export</a></li> -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="panel_r" container="true" class="ph pw admbg hp">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @personal_book, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_book_desktop_personal_books_path(@personal_book) do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-check"></span></div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_selection_options">
|
||||
<li><a class="hp hh1 admtxt" href="all" ajax-remote="false" callback-method="allnone">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="none" ajax-remote="false" callback-method="allnone">None</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">More</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Delete</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Tag</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Tag</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Starred</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">MIT</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Status</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Published</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Pending</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">View</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_view_selection">
|
||||
<li><%= link_to "Journal", panel_personal_book_desktop_personal_books_path + "?view=book_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Title", panel_personal_book_desktop_personal_books_path + "?view=paper_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "File", panel_personal_book_desktop_personal_books_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Keywords", panel_personal_book_desktop_personal_books_path + "?view=keywords", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Abstract", panel_personal_book_desktop_personal_books_path + "?view=abstract", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1" id='ns'>New Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt remote_url" href="<%= panel_personal_book_desktop_personal_books_path %>">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" page-name="journal_p_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
|
||||
<% @writing_books.each do |w| %>
|
||||
<%= publication_record w, @view_by%>
|
||||
<% end %>
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @personal_book, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_book_desktop_personal_books_path do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
+49
-2
@@ -1,4 +1,51 @@
|
||||
en:
|
||||
|
||||
module_name:
|
||||
personal_book: Book
|
||||
personal_book: Book
|
||||
personal_book:
|
||||
paper_title : "Paper Title"
|
||||
book_title : "Book Title"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
publishers : "Publishers"
|
||||
authors : "Authors"
|
||||
tags : "Tags"
|
||||
year : "Year"
|
||||
language : "Language"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "Vol.No"
|
||||
issue_no : "Issue.No"
|
||||
form_to_start : "From"
|
||||
form_to_end : "To"
|
||||
total_pages : "Total Pages"
|
||||
keywords : "Keywords"
|
||||
abstract : "Abstract"
|
||||
publication_date : "Date of Publication"
|
||||
url : "Reference URL"
|
||||
note : "Note"
|
||||
level_type : "Level Type"
|
||||
author_type : "Author Type"
|
||||
from : "From"
|
||||
to : "To"
|
||||
file : "File"
|
||||
file_name : "File name"
|
||||
description : "File Description"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
|
||||
create_success : "Successfully Create"
|
||||
update_success : "Successfully Update"
|
||||
delete_success : "Successfully Delete"
|
||||
add: "Add"
|
||||
back: "Back"
|
||||
delete: "Delete"
|
||||
edit: "Edit"
|
||||
nothing: "Nothing"
|
||||
show: "Show"
|
||||
sure?: "Are you sure?"
|
||||
update: "Update"
|
||||
yes_: "Yes"
|
||||
no_: "No"
|
||||
cancel : "Cancel"
|
||||
save: "save"
|
||||
hintText: "Type in a search term"
|
||||
noResultsText: "No results"
|
||||
searchingText: "Searching…"
|
||||
@@ -1,4 +1,51 @@
|
||||
zh_tw:
|
||||
|
||||
module_name:
|
||||
personal_book: 專書
|
||||
personal_book: 期刊著作
|
||||
personal_book:
|
||||
paper_title : "論文名稱"
|
||||
book_title : "期刊名稱"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
publishers : "Publishers"
|
||||
authors : "作者"
|
||||
tags : "領域"
|
||||
year : "年度"
|
||||
language : "語言"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "卷數"
|
||||
issue_no : "期數"
|
||||
form_to_start : "起"
|
||||
form_to_end : "訖"
|
||||
total_pages : "總頁數"
|
||||
keywords : "關鍵字"
|
||||
abstract : "摘要"
|
||||
publication_date : "發表日期"
|
||||
url : "參考連結"
|
||||
note : "記事"
|
||||
level_type : "期刊類別"
|
||||
author_type : "作者類別"
|
||||
from : "起"
|
||||
to : "訖"
|
||||
file : "檔案"
|
||||
file_name : "檔案名稱"
|
||||
description : "描述"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
|
||||
create_success : "新增完成!!"
|
||||
update_success : "更新完成!!"
|
||||
delete_success : "刪除成功!!"
|
||||
add: "新增"
|
||||
back: "返回"
|
||||
delete: "刪除"
|
||||
edit: "編輯"
|
||||
nothing: "無"
|
||||
show: "顯示"
|
||||
sure?: "您肯定嗎?"
|
||||
update: "更新"
|
||||
yes_: "是"
|
||||
no_: "否"
|
||||
cancel : "取消"
|
||||
save: "儲存"
|
||||
hintText: "請輸入搜尋關鍵字"
|
||||
noResultsText: "沒有相關的比對結果"
|
||||
searchingText: "搜尋中…"
|
||||
@@ -2,6 +2,10 @@ Rails.application.routes.draw do
|
||||
|
||||
namespace :panel do
|
||||
namespace :personal_book do
|
||||
namespace :desktop do
|
||||
match 'books_window' => "personal_books#books_window"
|
||||
resources :personal_books
|
||||
end
|
||||
namespace :back_end do
|
||||
|
||||
match 'writing_book_setting' => "writing_books#writing_book_setting" ,:as => :writing_book_setting
|
||||
@@ -33,6 +37,7 @@ Rails.application.routes.draw do
|
||||
match "reload_writing_books" => "writing_books#reload_writing_books"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
match "/appfront/*path" => redirect("/panel/*path")
|
||||
|
||||
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
orbitDesktop.prototype.initializePersonalDiploma = function(target,url,cache){ // this init journal papers
|
||||
this.initializePersonalDiploma.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");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalDiploma.list = function(){ // to open list part in journal papers page
|
||||
var journalData;
|
||||
var bindHandlers = function(){ // to bind handlers for list page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
|
||||
var bindSecondaryHandlers = function(){
|
||||
$("#journal_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.initializePersonalDiploma.diplomaDelete = function(data,dom){
|
||||
var parent = dom.parent().parent();
|
||||
if(data.success){
|
||||
parent.hide("slide",function(){parent.remove();});
|
||||
o.notify(data.msg,"success");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalDiploma.canceldiploma = function(){
|
||||
o.highlight_sub_menu_item(0);
|
||||
}
|
||||
|
||||
this.initializePersonalDiploma.editdiploma = function(){
|
||||
o.highlight_sub_menu_item(1);
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var preData = function(){
|
||||
$("#writing_journal_author_tokens").select2('data', JSON.parse($("#writing_journal_author_tokens").attr('data-pre')));
|
||||
}
|
||||
uploadFiles();
|
||||
// preData();
|
||||
}
|
||||
|
||||
this.initializePersonalDiploma.adddiploma = function(){ // to open add pages in journal papers page
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
// console.log("hi");
|
||||
var bindHandlers = function(){
|
||||
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
uploadFiles();
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.initializePersonalDiploma.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.initializePersonalDiploma.coauthor = function(){ // to open add pages in coauthor page
|
||||
var bindHandlers = function(){ // to bind handlers for add page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
}
|
||||
this.initializePersonalDiploma.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.initializePersonalDiploma.coauthorRelationEditForm = function(data){
|
||||
if(data.success){
|
||||
o.notify(data.msg,"success");
|
||||
var x = o.layout_data.generate_layout_html(data.newvalue);
|
||||
$("div[container=true] div.overview").html(x.markup);
|
||||
}else{
|
||||
o.notify(data.msg,"alert");
|
||||
}
|
||||
}
|
||||
this.initializePersonalDiploma.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.initializePersonalDiploma.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
/* Books */
|
||||
[page-name="books_list"] .list_t_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_list"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_list"] .list_item_action a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star {
|
||||
color: #faa732;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check {
|
||||
color: #333;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .file_view .list_t_des {
|
||||
overflow: hidden; }
|
||||
[page-name="books_list"] .file_view .file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
[page-name="books_list"] .file_view .file:hover {
|
||||
background-color: #f7f7f7; }
|
||||
[page-name="books_list"] .file_view .file img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px; }
|
||||
[page-name="books_list"] .file_view .file .filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] .datalist_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_books"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_books"] .list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_books"] .list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999; }
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] .list_t_item {
|
||||
height: 110px; }
|
||||
[page-name="books_coauthor"] .list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none; }
|
||||
[page-name="books_coauthor"] .info {
|
||||
font-family: Arial, sans-serif; }
|
||||
[page-name="books_coauthor"] .info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999; }
|
||||
[page-name="books_coauthor"] .info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333; }
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"] .edit_co_author_relation {
|
||||
/*margin-left: -10px;*/ }
|
||||
[page-name="books_coauthor_relation"] .form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif; }
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
@import "desktop-helper";
|
||||
|
||||
/* Books */
|
||||
[page-name="books_list"] {
|
||||
.list_t_item .inner { padding-left: 30px; }
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.icon-star-empty { color: #999; font-size: 20px; }
|
||||
.icon-star { color: #faa732; font-size: 20px; }
|
||||
.icon-check-empty { color: #999; font-size: 20px; }
|
||||
.icon-check { color: #333; font-size: 20px; }
|
||||
}
|
||||
|
||||
.file_view {
|
||||
.list_t_des {
|
||||
overflow: hidden;
|
||||
}
|
||||
.file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
@include box-sizing;
|
||||
|
||||
&:hover {
|
||||
background-color: lighten($gray, 10%);
|
||||
}
|
||||
img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px;
|
||||
}
|
||||
.filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
@include box-sizing;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] {
|
||||
|
||||
.datalist_item .inner {
|
||||
padding-left: 30px;
|
||||
}
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
}
|
||||
.list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] {
|
||||
.list_t_item {
|
||||
height: 110px;
|
||||
}
|
||||
.list_item_function {}
|
||||
.list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none;
|
||||
}
|
||||
.info {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999;
|
||||
}
|
||||
.info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"]{
|
||||
.edit_co_author_relation {
|
||||
/*margin-left: -10px;*/
|
||||
}
|
||||
.form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
class Panel::PersonalDiploma::Desktop::PersonalDiplomasController < ApplicationController
|
||||
|
||||
def index
|
||||
@diplomas = Diploma.where(create_user_id: current_user.id)
|
||||
respond_to do |format|
|
||||
format.html { render :layout => false}
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@diploma = Diploma.new
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def create
|
||||
params[:diploma][:create_user_id] = current_user.id
|
||||
@diploma = Diploma.new(params[:diploma])
|
||||
if @diploma.save
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @diploma.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@diploma = Diploma.find(params[:id])
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def update
|
||||
params[:diploma][:create_user_id] = current_user.id
|
||||
@diploma = Diploma.new(params[:diploma])
|
||||
if @diploma.update_attributes(params[:diploma])
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @diploma.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@diploma = Diploma.find(params[:id])
|
||||
@diploma.destroy
|
||||
render :json => {success: true, msg: t('delete_success')}
|
||||
end
|
||||
|
||||
def diploma_window
|
||||
render :layout => false
|
||||
end
|
||||
end
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
module Panel::PersonalDiploma::Desktop::PersonalDiplomasHelper
|
||||
def publication_record publication, view
|
||||
content_tag :li,
|
||||
"item" => "true",
|
||||
:class => "list_t_item" do
|
||||
marker + \
|
||||
content(publication, view) + \
|
||||
edit_or_delete(publication)
|
||||
end
|
||||
end
|
||||
|
||||
def marker
|
||||
content_tag :div,
|
||||
:class => "list_item_action" do
|
||||
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
|
||||
end
|
||||
|
||||
def content publication, view
|
||||
case view
|
||||
when "diploma_title"
|
||||
des = content_tag(:div, publication.diploma_title,
|
||||
:class => "list_t_des")
|
||||
when "keywords"
|
||||
des = content_tag(:div, publication.keywords,
|
||||
:class => "list_t_des")
|
||||
when "abstract"
|
||||
des = content_tag(:div, publication.abstract,
|
||||
:class => "list_t_des")
|
||||
when "file"
|
||||
des = content_tag(:div, link_publication_file(publication),
|
||||
:class => "list_t_des")
|
||||
else
|
||||
end
|
||||
|
||||
content_tag(:div, publication.school_name,
|
||||
:class => "list_t_title") + des
|
||||
|
||||
end
|
||||
|
||||
def edit_or_delete publication
|
||||
content_tag :div,
|
||||
:class => "list_item_function" do
|
||||
content_tag(:a, t("edit"),
|
||||
:class => "journal_paper_edit admbg2 admtxt",
|
||||
:href => edit_panel_personal_diploma_desktop_personal_diploma_path(publication),
|
||||
"callback-method" => "editdiploma",
|
||||
"ajax-remote" => "get") + \
|
||||
content_tag(:a, t(:delete_),
|
||||
"ajax-remote" => "delete",
|
||||
"confirm-message" => t("sure?"),
|
||||
"callback-method" => "diplomaDelete",
|
||||
:class => "journal_paper_delete admbg2 admtxt",
|
||||
:href => panel_personal_diploma_desktop_personal_diploma_path(publication))
|
||||
end
|
||||
end
|
||||
|
||||
def link_publication_file publication
|
||||
publication.writing_conference_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, file.title, :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank")
|
||||
}.inject(:+)
|
||||
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 generate_authors_name ids
|
||||
author_name = ids.map{|m|
|
||||
if m == "0"
|
||||
#{:id => 0, :text => current_user.name, :email => current_user.email }
|
||||
{:id => 0, :text => current_user.name }
|
||||
else
|
||||
#{:id => m, :text => ConferenceCoAuthor.find(m).co_author, :email => ConferenceCoAuthor.find(m).email}
|
||||
{:id => m, :text => ConferenceCoAuthor.find(m).co_author}
|
||||
end
|
||||
}
|
||||
author_name.to_json
|
||||
end
|
||||
end
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="fn_g hp">
|
||||
|
||||
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
|
||||
<% if not @diploma.new_record? %>
|
||||
<%= submit_tag t("cancel"), :type => "button", "callback-method"=>"canceldiploma", "ajax-remote" => "get", :href => panel_personal_diploma_desktop_personal_diplomas_path, class: "fn_btn ini_input hp hh1 admbg2 admtxt" %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" content-layout="column" base-width="420">
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_diploma.start_date"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.date_select :start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %>
|
||||
<%= f.date_select :start_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_diploma.end_date"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.date_select :end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %>
|
||||
<%= f.date_select :end_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :school_name_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_diploma.school_name"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@diploma.school_name_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :country_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_diploma.country"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@diploma.country_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :department_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_diploma.department"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@diploma.department_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :degree_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_diploma.degree"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@diploma.degree_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_diploma.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :keywords, size: "20x3", placeholder: t("personal_diploma.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.label :language, t("personal_diploma.language"), :class => "s_grid s_grid_4" %>
|
||||
<%= f.select :language, Diploma::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :note, size: "20x3", placeholder: t("personal_diploma.note"), class: "s_grid_12 s_grid s_grid_h_5"%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<%= stylesheet_link_tag "/assets/personal_diploma/personal_diploma" %>
|
||||
<%= javascript_include_tag "personal_diploma/desktop/personal_diploma" %>
|
||||
<div id="diploma">
|
||||
<div id="content">
|
||||
<div id="header" class="hh2">
|
||||
<div class="dtitle w2 hh2 hp">
|
||||
<span class="thmtxth">Education</span>
|
||||
</div>
|
||||
<div id="search_app" class="hfn w2 hh1 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" content-type="menu">
|
||||
<ul id='setting_left_nav'>
|
||||
<li><a href="<%= panel_personal_diploma_desktop_personal_diplomas_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
|
||||
<li><a href="<%= new_panel_personal_diploma_desktop_personal_diploma_path %>" callback-method="adddiploma" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
|
||||
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags & Keywords</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Analysis</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Import</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Export</a></li> -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="panel_r" container="true" class="ph pw admbg hp">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @diploma, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_diploma_desktop_personal_diplomas_path(@diploma) do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-check"></span></div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_selection_options">
|
||||
<li><a class="hp hh1 admtxt" href="all" ajax-remote="false" callback-method="allnone">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="none" ajax-remote="false" callback-method="allnone">None</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">More</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Delete</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Tag</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Tag</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Starred</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">MIT</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Status</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Published</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Pending</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">View</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_view_selection">
|
||||
<li><%= link_to "Journal", panel_personal_diploma_desktop_personal_diplomas_path + "?view=diploma_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Title", panel_personal_diploma_desktop_personal_diplomas_path + "?view=paper_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "File", panel_personal_diploma_desktop_personal_diplomas_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Keywords", panel_personal_diploma_desktop_personal_diplomas_path + "?view=keywords", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Abstract", panel_personal_diploma_desktop_personal_diplomas_path + "?view=abstract", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1" id='ns'>New Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt remote_url" href="<%= panel_personal_diploma_desktop_personal_diplomas_path %>">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" page-name="journal_p_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
|
||||
<% @diplomas.each do |w| %>
|
||||
<%= publication_record w, @view_by%>
|
||||
<% end %>
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @diploma, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_diploma_desktop_personal_diplomas_path do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
@@ -1,4 +1,55 @@
|
||||
en:
|
||||
|
||||
module_name:
|
||||
personal_diploma: Diploma
|
||||
personal_diploma: Diploma
|
||||
personal_diploma:
|
||||
paper_title : "Paper Title"
|
||||
book_title : "Book Title"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
publishers : "Publishers"
|
||||
authors : "Authors"
|
||||
tags : "Tags"
|
||||
year : "Year"
|
||||
language : "Language"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "Vol.No"
|
||||
issue_no : "Issue.No"
|
||||
form_to_start : "From"
|
||||
form_to_end : "To"
|
||||
total_pages : "Total Pages"
|
||||
keywords : "Keywords"
|
||||
abstract : "Abstract"
|
||||
publication_date : "Date of Publication"
|
||||
url : "Reference URL"
|
||||
note : "Note"
|
||||
level_type : "Level Type"
|
||||
author_type : "Author Type"
|
||||
from : "From"
|
||||
to : "To"
|
||||
file : "File"
|
||||
file_name : "File name"
|
||||
description : "File Description"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
school_name : "School Name"
|
||||
country : "Country"
|
||||
department : "Department"
|
||||
degree : "Degree"
|
||||
|
||||
create_success : "Successfully Create"
|
||||
update_success : "Successfully Update"
|
||||
delete_success : "Successfully Delete"
|
||||
add: "Add"
|
||||
back: "Back"
|
||||
delete: "Delete"
|
||||
edit: "Edit"
|
||||
nothing: "Nothing"
|
||||
show: "Show"
|
||||
sure?: "Are you sure?"
|
||||
update: "Update"
|
||||
yes_: "Yes"
|
||||
no_: "No"
|
||||
cancel : "Cancel"
|
||||
save: "save"
|
||||
hintText: "Type in a search term"
|
||||
noResultsText: "No results"
|
||||
searchingText: "Searching…"
|
||||
@@ -1,4 +1,55 @@
|
||||
zh_tw:
|
||||
|
||||
module_name:
|
||||
personal_diploma: 學歷
|
||||
personal_diploma: 期刊著作
|
||||
personal_diploma:
|
||||
paper_title : "論文名稱"
|
||||
book_title : "期刊名稱"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
publishers : "Publishers"
|
||||
authors : "作者"
|
||||
tags : "領域"
|
||||
year : "年度"
|
||||
language : "語言"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "卷數"
|
||||
issue_no : "期數"
|
||||
form_to_start : "起"
|
||||
form_to_end : "訖"
|
||||
total_pages : "總頁數"
|
||||
keywords : "關鍵字"
|
||||
abstract : "摘要"
|
||||
publication_date : "發表日期"
|
||||
url : "參考連結"
|
||||
note : "記事"
|
||||
level_type : "期刊類別"
|
||||
author_type : "作者類別"
|
||||
from : "起"
|
||||
to : "訖"
|
||||
file : "檔案"
|
||||
file_name : "檔案名稱"
|
||||
description : "描述"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
school_name : "School Name"
|
||||
country : "Country"
|
||||
department : "Department"
|
||||
degree : "Degree"
|
||||
|
||||
create_success : "新增完成!!"
|
||||
update_success : "更新完成!!"
|
||||
delete_success : "刪除成功!!"
|
||||
add: "新增"
|
||||
back: "返回"
|
||||
delete: "刪除"
|
||||
edit: "編輯"
|
||||
nothing: "無"
|
||||
show: "顯示"
|
||||
sure?: "您肯定嗎?"
|
||||
update: "更新"
|
||||
yes_: "是"
|
||||
no_: "否"
|
||||
cancel : "取消"
|
||||
save: "儲存"
|
||||
hintText: "請輸入搜尋關鍵字"
|
||||
noResultsText: "沒有相關的比對結果"
|
||||
searchingText: "搜尋中…"
|
||||
@@ -2,6 +2,10 @@ Rails.application.routes.draw do
|
||||
|
||||
namespace :panel do
|
||||
namespace :personal_diploma do
|
||||
namespace :desktop do
|
||||
match "diploma_window" => "personal_diplomas#diploma_window"
|
||||
resources :personal_diplomas
|
||||
end
|
||||
namespace :back_end do
|
||||
|
||||
match 'diploma_setting' => "diplomas#diploma_setting" ,:as => :diploma_setting
|
||||
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
orbitDesktop.prototype.initializePersonalExperience = function(target,url,cache){ // this init journal papers
|
||||
this.initializePersonalExperience.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");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalExperience.list = function(){ // to open list part in journal papers page
|
||||
var journalData;
|
||||
var bindHandlers = function(){ // to bind handlers for list page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
|
||||
var bindSecondaryHandlers = function(){
|
||||
$("#journal_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.initializePersonalExperience.experienceDelete = function(data,dom){
|
||||
var parent = dom.parent().parent();
|
||||
if(data.success){
|
||||
parent.hide("slide",function(){parent.remove();});
|
||||
o.notify(data.msg,"success");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalExperience.cancelexperience = function(){
|
||||
o.highlight_sub_menu_item(0);
|
||||
}
|
||||
|
||||
this.initializePersonalExperience.editexperience = function(){
|
||||
o.highlight_sub_menu_item(1);
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var preData = function(){
|
||||
$("#writing_journal_author_tokens").select2('data', JSON.parse($("#writing_journal_author_tokens").attr('data-pre')));
|
||||
}
|
||||
uploadFiles();
|
||||
// preData();
|
||||
}
|
||||
|
||||
this.initializePersonalExperience.addexperience = function(){ // to open add pages in journal papers page
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
// console.log("hi");
|
||||
var bindHandlers = function(){
|
||||
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
uploadFiles();
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.initializePersonalExperience.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.initializePersonalExperience.coauthor = function(){ // to open add pages in coauthor page
|
||||
var bindHandlers = function(){ // to bind handlers for add page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
}
|
||||
this.initializePersonalExperience.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.initializePersonalExperience.coauthorRelationEditForm = function(data){
|
||||
if(data.success){
|
||||
o.notify(data.msg,"success");
|
||||
var x = o.layout_data.generate_layout_html(data.newvalue);
|
||||
$("div[container=true] div.overview").html(x.markup);
|
||||
}else{
|
||||
o.notify(data.msg,"alert");
|
||||
}
|
||||
}
|
||||
this.initializePersonalExperience.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.initializePersonalExperience.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
/* Books */
|
||||
[page-name="books_list"] .list_t_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_list"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_list"] .list_item_action a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star {
|
||||
color: #faa732;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check {
|
||||
color: #333;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .file_view .list_t_des {
|
||||
overflow: hidden; }
|
||||
[page-name="books_list"] .file_view .file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
[page-name="books_list"] .file_view .file:hover {
|
||||
background-color: #f7f7f7; }
|
||||
[page-name="books_list"] .file_view .file img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px; }
|
||||
[page-name="books_list"] .file_view .file .filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] .datalist_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_books"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_books"] .list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_books"] .list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999; }
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] .list_t_item {
|
||||
height: 110px; }
|
||||
[page-name="books_coauthor"] .list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none; }
|
||||
[page-name="books_coauthor"] .info {
|
||||
font-family: Arial, sans-serif; }
|
||||
[page-name="books_coauthor"] .info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999; }
|
||||
[page-name="books_coauthor"] .info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333; }
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"] .edit_co_author_relation {
|
||||
/*margin-left: -10px;*/ }
|
||||
[page-name="books_coauthor_relation"] .form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif; }
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
@import "desktop-helper";
|
||||
|
||||
/* Books */
|
||||
[page-name="books_list"] {
|
||||
.list_t_item .inner { padding-left: 30px; }
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.icon-star-empty { color: #999; font-size: 20px; }
|
||||
.icon-star { color: #faa732; font-size: 20px; }
|
||||
.icon-check-empty { color: #999; font-size: 20px; }
|
||||
.icon-check { color: #333; font-size: 20px; }
|
||||
}
|
||||
|
||||
.file_view {
|
||||
.list_t_des {
|
||||
overflow: hidden;
|
||||
}
|
||||
.file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
@include box-sizing;
|
||||
|
||||
&:hover {
|
||||
background-color: lighten($gray, 10%);
|
||||
}
|
||||
img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px;
|
||||
}
|
||||
.filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
@include box-sizing;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] {
|
||||
|
||||
.datalist_item .inner {
|
||||
padding-left: 30px;
|
||||
}
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
}
|
||||
.list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] {
|
||||
.list_t_item {
|
||||
height: 110px;
|
||||
}
|
||||
.list_item_function {}
|
||||
.list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none;
|
||||
}
|
||||
.info {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999;
|
||||
}
|
||||
.info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"]{
|
||||
.edit_co_author_relation {
|
||||
/*margin-left: -10px;*/
|
||||
}
|
||||
.form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
class Panel::PersonalExperience::Desktop::PersonalExperiencesController < ApplicationController
|
||||
|
||||
def index
|
||||
@experiences = Experience.where(create_user_id: current_user.id)
|
||||
@view_by = params[:view]
|
||||
page = params[:page]
|
||||
page ||= 1
|
||||
|
||||
@per_column = 5
|
||||
|
||||
case @view_by
|
||||
when "abstract"
|
||||
@per_column = 1
|
||||
when "file"
|
||||
@per_column = 2
|
||||
end
|
||||
|
||||
if @view_by.nil?
|
||||
@view_by = " "
|
||||
@experiences = @experiences.asc(:organizationt_title)
|
||||
else
|
||||
@experiences = @experiences.asc(@view_by).asc(:organizationt_title)
|
||||
end
|
||||
@experiences = @experiences.page(page).per(50)
|
||||
respond_to do |format|
|
||||
format.html { render :layout => false}
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@experience = Experience.new
|
||||
# @author_types = BookAuthorType.all
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def create
|
||||
params[:experience][:create_user_id] = current_user.id
|
||||
@experience = Experience.new(params[:experience])
|
||||
if @experience.save
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @experience.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@experience = Experience.find(params[:id])
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def update
|
||||
params[:experience][:create_user_id] = current_user.id
|
||||
@experience = Experience.new(params[:experience])
|
||||
if @experience.update_attributes(params[:writing_book])
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @experience.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@experience = Experience.find(params[:id])
|
||||
@experience.destroy
|
||||
render :json => {success: true, msg: t('delete_success')}
|
||||
end
|
||||
|
||||
def experience_window
|
||||
render :layout => false
|
||||
end
|
||||
end
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
module Panel::PersonalExperience::Desktop::PersonalExperiencesHelper
|
||||
def publication_record publication, view
|
||||
content_tag :li,
|
||||
"item" => "true",
|
||||
:class => "list_t_item" do
|
||||
marker + \
|
||||
content(publication, view) + \
|
||||
edit_or_delete(publication)
|
||||
end
|
||||
end
|
||||
|
||||
def marker
|
||||
content_tag :div,
|
||||
:class => "list_item_action" do
|
||||
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
|
||||
end
|
||||
|
||||
def content publication, view
|
||||
case view
|
||||
when "organizationt_title"
|
||||
des = content_tag(:div, publication.organizationt_title,
|
||||
:class => "list_t_des")
|
||||
when "job_title"
|
||||
des = content_tag(:div, publication.job_title,
|
||||
:class => "list_t_des")
|
||||
when "department"
|
||||
des = content_tag(:div, publication.department,
|
||||
:class => "list_t_des")
|
||||
when "file"
|
||||
des = content_tag(:div, link_publication_file(publication),
|
||||
:class => "list_t_des")
|
||||
else
|
||||
end
|
||||
|
||||
content_tag(:div, publication.organizationt_title,
|
||||
:class => "list_t_title") + des
|
||||
|
||||
end
|
||||
|
||||
def edit_or_delete publication
|
||||
content_tag :div,
|
||||
:class => "list_item_function" do
|
||||
content_tag(:a, t("edit"),
|
||||
:class => "journal_paper_edit admbg2 admtxt",
|
||||
:href => edit_panel_personal_experience_desktop_personal_experience_path(publication),
|
||||
"callback-method" => "editexperience",
|
||||
"ajax-remote" => "get") + \
|
||||
content_tag(:a, t(:delete_),
|
||||
"ajax-remote" => "delete",
|
||||
"confirm-message" => t("sure?"),
|
||||
"callback-method" => "experienceDelete",
|
||||
:class => "journal_paper_delete admbg2 admtxt",
|
||||
:href => panel_personal_experience_desktop_personal_experience_path(publication))
|
||||
end
|
||||
end
|
||||
|
||||
def link_publication_file publication
|
||||
publication.writing_conference_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, file.title, :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank")
|
||||
}.inject(:+)
|
||||
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 generate_authors_name ids
|
||||
author_name = ids.map{|m|
|
||||
if m == "0"
|
||||
#{:id => 0, :text => current_user.name, :email => current_user.email }
|
||||
{:id => 0, :text => current_user.name }
|
||||
else
|
||||
#{:id => m, :text => ConferenceCoAuthor.find(m).co_author, :email => ConferenceCoAuthor.find(m).email}
|
||||
{:id => m, :text => ConferenceCoAuthor.find(m).co_author}
|
||||
end
|
||||
}
|
||||
author_name.to_json
|
||||
end
|
||||
end
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="fn_g hp">
|
||||
|
||||
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
|
||||
<% if not @experience.new_record? %>
|
||||
<%= submit_tag t("cancel"), :type => "button", "callback-method"=>"cancelexperience", "ajax-remote" => "get", :href => panel_personal_experience_desktop_personal_experiences_path, class: "fn_btn ini_input hp hh1 admbg2 admtxt" %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" content-layout="column" base-width="420">
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :organizationt_title_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_experience.organizationt_title"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@experience.organizationt_title_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :department_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_experience.department"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@experience.department_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :job_title_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_experience.job_title"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@experience.job_title_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_experience.experience_category"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.select :experience_category_id, ExperienceCategory.all.collect {|t| [ t.title, t.id ]}, {:class => "s_grid s_grid_8"} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_experience.start_date"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.date_select :start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %>
|
||||
<%= f.date_select :start_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_experience.end_date"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.date_select :end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %>
|
||||
<%= f.date_select :end_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_experience.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :keywords, size: "20x3", placeholder: t("personal_experience.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.label :language, t("personal_experience.language"), :class => "s_grid s_grid_4" %>
|
||||
<%= f.select :language, Experience::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :note, size: "20x3", placeholder: t("personal_experience.note"), value: @experience.note , class: "s_grid_12 s_grid s_grid_h_3"%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @experience, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_experience_desktop_personal_experiences_path(@personal_book) do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<%= stylesheet_link_tag "/assets/personal_experience/desktop/personal_experience" %>
|
||||
<%= javascript_include_tag "personal_experience/desktop/personal_experiences" %>
|
||||
<div id="working">
|
||||
<div id="content">
|
||||
<div id="header" class="hh2">
|
||||
<div class="dtitle w2 hh2 hp">
|
||||
<span class="thmtxth">Experience/Working</span>
|
||||
</div>
|
||||
<div id="search_app" class="hfn w2 hh1 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" content-type="menu">
|
||||
<ul id='setting_left_nav'>
|
||||
<li><a href="<%= panel_personal_experience_desktop_personal_experiences_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
|
||||
<li><a href="<%= new_panel_personal_experience_desktop_personal_experience_path %>" callback-method="addexperience" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
|
||||
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags & Keywords</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Analysis</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Import</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Export</a></li> -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="panel_r" container="true" class="ph pw admbg hp">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-check"></span></div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_selection_options">
|
||||
<li><a class="hp hh1 admtxt" href="all" ajax-remote="false" callback-method="allnone">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="none" ajax-remote="false" callback-method="allnone">None</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">More</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Delete</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Tag</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Tag</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Starred</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">MIT</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Status</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Published</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Pending</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">View</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_view_selection">
|
||||
<li><%= link_to "Journal", panel_personal_experience_desktop_personal_experiences_path + "?view=organizationt_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Title", panel_personal_experience_desktop_personal_experiences_path + "?view=paper_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "File", panel_personal_experience_desktop_personal_experiences_path + "?view=job_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Keywords", panel_personal_experience_desktop_personal_experiences_path + "?view=department", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Abstract", panel_personal_experience_desktop_personal_experiences_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1" id='ns'>New Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt remote_url" href="<%= panel_personal_experience_desktop_personal_experiences_path %>">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" page-name="journal_p_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
|
||||
<% @experiences.each do |w| %>
|
||||
<%= publication_record w, @view_by%>
|
||||
<% end %>
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @experience, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_experience_desktop_personal_experiences_path do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
@@ -1,4 +1,55 @@
|
||||
en:
|
||||
|
||||
module_name:
|
||||
personal_experience: Experience
|
||||
personal_experience: Book
|
||||
personal_experience:
|
||||
department : "Department"
|
||||
experience_category : "Experience Category"
|
||||
organizationt_title : "Organization Title"
|
||||
paper_title : "Paper Title"
|
||||
book_title : "Book Title"
|
||||
job_title : "Job Title"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
publishers : "Publishers"
|
||||
authors : "Authors"
|
||||
tags : "Tags"
|
||||
year : "Year"
|
||||
language : "Language"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "Vol.No"
|
||||
issue_no : "Issue.No"
|
||||
form_to_start : "From"
|
||||
form_to_end : "To"
|
||||
total_pages : "Total Pages"
|
||||
keywords : "Keywords"
|
||||
abstract : "Abstract"
|
||||
publication_date : "Date of Publication"
|
||||
url : "Reference URL"
|
||||
note : "Note"
|
||||
level_type : "Level Type"
|
||||
author_type : "Author Type"
|
||||
from : "From"
|
||||
to : "To"
|
||||
file : "File"
|
||||
file_name : "File name"
|
||||
description : "File Description"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
|
||||
create_success : "Successfully Create"
|
||||
update_success : "Successfully Update"
|
||||
delete_success : "Successfully Delete"
|
||||
add: "Add"
|
||||
back: "Back"
|
||||
delete: "Delete"
|
||||
edit: "Edit"
|
||||
nothing: "Nothing"
|
||||
show: "Show"
|
||||
sure?: "Are you sure?"
|
||||
update: "Update"
|
||||
yes_: "Yes"
|
||||
no_: "No"
|
||||
cancel : "Cancel"
|
||||
save: "save"
|
||||
hintText: "Type in a search term"
|
||||
noResultsText: "No results"
|
||||
searchingText: "Searching…"
|
||||
@@ -1,5 +1,54 @@
|
||||
zh_tw:
|
||||
|
||||
module_name:
|
||||
personal_experience: 經歷
|
||||
|
||||
personal_experience: 期刊著作
|
||||
personal_experience:
|
||||
department : "Department"
|
||||
organizationt_title : "Organization Title"
|
||||
paper_title : "論文名稱"
|
||||
book_title : "期刊名稱"
|
||||
job_title : "Job Title"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
publishers : "Publishers"
|
||||
authors : "作者"
|
||||
tags : "領域"
|
||||
year : "年度"
|
||||
language : "語言"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "卷數"
|
||||
issue_no : "期數"
|
||||
form_to_start : "起"
|
||||
form_to_end : "訖"
|
||||
total_pages : "總頁數"
|
||||
keywords : "關鍵字"
|
||||
abstract : "摘要"
|
||||
publication_date : "發表日期"
|
||||
url : "參考連結"
|
||||
note : "記事"
|
||||
level_type : "期刊類別"
|
||||
author_type : "作者類別"
|
||||
from : "起"
|
||||
to : "訖"
|
||||
file : "檔案"
|
||||
file_name : "檔案名稱"
|
||||
description : "描述"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
|
||||
create_success : "新增完成!!"
|
||||
update_success : "更新完成!!"
|
||||
delete_success : "刪除成功!!"
|
||||
add: "新增"
|
||||
back: "返回"
|
||||
delete: "刪除"
|
||||
edit: "編輯"
|
||||
nothing: "無"
|
||||
show: "顯示"
|
||||
sure?: "您肯定嗎?"
|
||||
update: "更新"
|
||||
yes_: "是"
|
||||
no_: "否"
|
||||
cancel : "取消"
|
||||
save: "儲存"
|
||||
hintText: "請輸入搜尋關鍵字"
|
||||
noResultsText: "沒有相關的比對結果"
|
||||
searchingText: "搜尋中…"
|
||||
@@ -2,6 +2,10 @@ Rails.application.routes.draw do
|
||||
|
||||
namespace :panel do
|
||||
namespace :personal_experience do
|
||||
namespace :desktop do
|
||||
match "experience_window" => "personal_experiences#experience_window"
|
||||
resources :personal_experiences
|
||||
end
|
||||
namespace :back_end do
|
||||
|
||||
match 'experience_setting' => "experiences#experience_setting" ,:as => :experience_setting
|
||||
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
orbitDesktop.prototype.initializePersonalHonor = function(target,url,cache){ // this init journal papers
|
||||
this.initializePersonalHonor.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");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalHonor.list = function(){ // to open list part in journal papers page
|
||||
var journalData;
|
||||
var bindHandlers = function(){ // to bind handlers for list page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
|
||||
var bindSecondaryHandlers = function(){
|
||||
$("#journal_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.initializePersonalHonor.honorDelete = function(data,dom){
|
||||
var parent = dom.parent().parent();
|
||||
if(data.success){
|
||||
parent.hide("slide",function(){parent.remove();});
|
||||
o.notify(data.msg,"success");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalHonor.cancelhonor = function(){
|
||||
o.highlight_sub_menu_item(0);
|
||||
}
|
||||
|
||||
this.initializePersonalHonor.edithonor = function(){
|
||||
o.highlight_sub_menu_item(1);
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var preData = function(){
|
||||
$("#writing_journal_author_tokens").select2('data', JSON.parse($("#writing_journal_author_tokens").attr('data-pre')));
|
||||
}
|
||||
uploadFiles();
|
||||
// preData();
|
||||
}
|
||||
|
||||
this.initializePersonalHonor.addhonor = function(){ // to open add pages in journal papers page
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
// console.log("hi");
|
||||
var bindHandlers = function(){
|
||||
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
uploadFiles();
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.initializePersonalHonor.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.initializePersonalHonor.coauthor = function(){ // to open add pages in coauthor page
|
||||
var bindHandlers = function(){ // to bind handlers for add page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
}
|
||||
this.initializePersonalHonor.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.initializePersonalHonor.coauthorRelationEditForm = function(data){
|
||||
if(data.success){
|
||||
o.notify(data.msg,"success");
|
||||
var x = o.layout_data.generate_layout_html(data.newvalue);
|
||||
$("div[container=true] div.overview").html(x.markup);
|
||||
}else{
|
||||
o.notify(data.msg,"alert");
|
||||
}
|
||||
}
|
||||
this.initializePersonalHonor.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.initializePersonalHonor.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
/* Books */
|
||||
[page-name="books_list"] .list_t_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_list"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_list"] .list_item_action a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star {
|
||||
color: #faa732;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check {
|
||||
color: #333;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .file_view .list_t_des {
|
||||
overflow: hidden; }
|
||||
[page-name="books_list"] .file_view .file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
[page-name="books_list"] .file_view .file:hover {
|
||||
background-color: #f7f7f7; }
|
||||
[page-name="books_list"] .file_view .file img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px; }
|
||||
[page-name="books_list"] .file_view .file .filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] .datalist_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_books"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_books"] .list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_books"] .list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999; }
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] .list_t_item {
|
||||
height: 110px; }
|
||||
[page-name="books_coauthor"] .list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none; }
|
||||
[page-name="books_coauthor"] .info {
|
||||
font-family: Arial, sans-serif; }
|
||||
[page-name="books_coauthor"] .info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999; }
|
||||
[page-name="books_coauthor"] .info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333; }
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"] .edit_co_author_relation {
|
||||
/*margin-left: -10px;*/ }
|
||||
[page-name="books_coauthor_relation"] .form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif; }
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
@import "desktop-helper";
|
||||
|
||||
/* Books */
|
||||
[page-name="books_list"] {
|
||||
.list_t_item .inner { padding-left: 30px; }
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.icon-star-empty { color: #999; font-size: 20px; }
|
||||
.icon-star { color: #faa732; font-size: 20px; }
|
||||
.icon-check-empty { color: #999; font-size: 20px; }
|
||||
.icon-check { color: #333; font-size: 20px; }
|
||||
}
|
||||
|
||||
.file_view {
|
||||
.list_t_des {
|
||||
overflow: hidden;
|
||||
}
|
||||
.file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
@include box-sizing;
|
||||
|
||||
&:hover {
|
||||
background-color: lighten($gray, 10%);
|
||||
}
|
||||
img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px;
|
||||
}
|
||||
.filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
@include box-sizing;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] {
|
||||
|
||||
.datalist_item .inner {
|
||||
padding-left: 30px;
|
||||
}
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
}
|
||||
.list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] {
|
||||
.list_t_item {
|
||||
height: 110px;
|
||||
}
|
||||
.list_item_function {}
|
||||
.list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none;
|
||||
}
|
||||
.info {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999;
|
||||
}
|
||||
.info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"]{
|
||||
.edit_co_author_relation {
|
||||
/*margin-left: -10px;*/
|
||||
}
|
||||
.form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
class Panel::PersonalHonor::Desktop::PersonalHonorsController < ApplicationController
|
||||
|
||||
def index
|
||||
@honors = Honor.where(create_user_id: current_user.id)
|
||||
@view_by = params[:view]
|
||||
page = params[:page]
|
||||
page ||= 1
|
||||
|
||||
@per_column = 5
|
||||
|
||||
case @view_by
|
||||
when "abstract"
|
||||
@per_column = 1
|
||||
when "file"
|
||||
@per_column = 2
|
||||
end
|
||||
|
||||
if @view_by.nil?
|
||||
@view_by = " "
|
||||
@honors = @honors.asc(:paper_title)
|
||||
else
|
||||
@honors = @honors.asc(@view_by).asc(:paper_title)
|
||||
end
|
||||
@honors = @honors.page(page).per(50)
|
||||
respond_to do |format|
|
||||
format.html { render :layout => false}
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@honor = Honor.new
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def create
|
||||
params[:honor][:create_user_id] = current_user.id
|
||||
@honor = Honor.new(params[:honor])
|
||||
if @honor.save
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @honor.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@honor = Honor.find(params[:id])
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def update
|
||||
params[:honor][:create_user_id] = current_user.id
|
||||
@honor = Honor.new(params[:honor])
|
||||
if @honor.update_attributes(params[:honor])
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @honor.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@honor = Honor.find(params[:id])
|
||||
@honor.destroy
|
||||
render :json => {success: true, msg: t('delete_success')}
|
||||
end
|
||||
|
||||
def honors_window
|
||||
render :layout => false
|
||||
end
|
||||
end
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
module Panel::PersonalHonor::Desktop::PersonalHonorsHelper
|
||||
def publication_record publication, view
|
||||
content_tag :li,
|
||||
"item" => "true",
|
||||
:class => "list_t_item" do
|
||||
marker + \
|
||||
content(publication, view) + \
|
||||
edit_or_delete(publication)
|
||||
end
|
||||
end
|
||||
|
||||
def marker
|
||||
content_tag :div,
|
||||
:class => "list_item_action" do
|
||||
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
|
||||
end
|
||||
|
||||
def content publication, view
|
||||
case view
|
||||
when "award_name"
|
||||
des = content_tag(:div, publication.award_name,
|
||||
:class => "list_t_des")
|
||||
|
||||
end
|
||||
|
||||
content_tag(:div, publication.award_name,
|
||||
:class => "list_t_title") + des
|
||||
|
||||
end
|
||||
|
||||
def edit_or_delete publication
|
||||
content_tag :div,
|
||||
:class => "list_item_function" do
|
||||
content_tag(:a, t("edit"),
|
||||
:class => "journal_paper_edit admbg2 admtxt",
|
||||
:href => edit_panel_personal_honor_desktop_personal_honor_path(publication),
|
||||
"callback-method" => "edithonor",
|
||||
"ajax-remote" => "get") + \
|
||||
content_tag(:a, t(:delete_),
|
||||
"ajax-remote" => "delete",
|
||||
"confirm-message" => t("sure?"),
|
||||
"callback-method" => "honorDelete",
|
||||
:class => "journal_paper_delete admbg2 admtxt",
|
||||
:href => panel_personal_honor_desktop_personal_honor_path(publication))
|
||||
end
|
||||
end
|
||||
|
||||
def link_publication_file publication
|
||||
publication.writing_book_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, file.title, :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank")
|
||||
}.inject(:+)
|
||||
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 generate_authors_name ids
|
||||
author_name = ids.map{|m|
|
||||
if m == "0"
|
||||
#{:id => 0, :text => current_user.name, :email => current_user.email }
|
||||
{:id => 0, :text => current_user.name }
|
||||
else
|
||||
#{:id => m, :text => ConferenceCoAuthor.find(m).co_author, :email => ConferenceCoAuthor.find(m).email}
|
||||
{:id => m, :text => ConferenceCoAuthor.find(m).co_author}
|
||||
end
|
||||
}
|
||||
author_name.to_json
|
||||
end
|
||||
end
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="fn_g hp">
|
||||
|
||||
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
|
||||
<% if not @honor.new_record? %>
|
||||
<%= submit_tag t("cancel"), :type => "button", "callback-method"=>"cancelhonor", "ajax-remote" => "get", :href => panel_personal_honor_desktop_personal_honors_path, class: "fn_btn ini_input hp hh1 admbg2 admtxt" %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" content-layout="column" base-width="420">
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_honor.award_name"), class: "s_grid_4 s_grid") %><%= f.text_field :award_name, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_honor.awarding_unit"), class: "s_grid_4 s_grid") %><%= f.text_field :awarding_unit, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_honor.year"), class: "s_grid_4 s_grid") %>
|
||||
<%= select_year((@honor.year ? @honor.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'honor[year]',:class => 's_grid_4 s_grid'} ) %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_honor.honor_category"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.select :honor_category_id, HonorCategory.all.collect {|t| [ t.title, t.id ]}, {:class => "s_grid s_grid_4"} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_honor.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :keywords, size: "20x3", placeholder: t("personal_honor.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.label :language, t("personal_honor.language"), :class => "s_grid s_grid_4" %>
|
||||
<%= f.select :language, Honor::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :note, size: "20x3", placeholder: t("personal_honor.note"), class: "s_grid_12 s_grid s_grid_h_5"%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @honor, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_honor_desktop_personal_honors_path(@personal_book) do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<%= stylesheet_link_tag "/assets/personal_honor/desktop/personal_honor" %>
|
||||
<%= javascript_include_tag "personal_honor/desktop/personal_honors" %>
|
||||
<div id="honors">
|
||||
<div id="content">
|
||||
<div id="header" class="hh2">
|
||||
<div class="dtitle w2 hh2 hp">
|
||||
<span class="thmtxth">Honors</span>
|
||||
</div>
|
||||
<div id="search_app" class="hfn w2 hh1 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" content-type="menu">
|
||||
<ul id='setting_left_nav'>
|
||||
<li><a href="<%= panel_personal_honor_desktop_personal_honors_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
|
||||
<li><a href="<%= new_panel_personal_honor_desktop_personal_honor_path %>" callback-method="addhonor" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
|
||||
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags & Keywords</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Analysis</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Import</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Export</a></li> -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="panel_r" container="true" class="ph pw admbg hp">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-check"></span></div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_selection_options">
|
||||
<li><a class="hp hh1 admtxt" href="all" ajax-remote="false" callback-method="allnone">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="none" ajax-remote="false" callback-method="allnone">None</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">More</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Delete</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Tag</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Tag</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Starred</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">MIT</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Status</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Published</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Pending</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">View</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_view_selection">
|
||||
<li><%= link_to "Journal", panel_personal_honor_desktop_personal_honors_path + "?view=book_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Title", panel_personal_honor_desktop_personal_honors_path + "?view=paper_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "File", panel_personal_honor_desktop_personal_honors_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Keywords", panel_personal_honor_desktop_personal_honors_path + "?view=keywords", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Abstract", panel_personal_honor_desktop_personal_honors_path + "?view=abstract", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1" id='ns'>New Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt remote_url" href="<%= panel_personal_honor_desktop_personal_honors_path %>">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" page-name="journal_p_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
|
||||
<% @honors.each do |w| %>
|
||||
<%= publication_record w, @view_by%>
|
||||
<% end %>
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @honor, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_honor_desktop_personal_honors_path do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
@@ -1,4 +1,54 @@
|
||||
en:
|
||||
|
||||
module_name:
|
||||
personal_honor: Honor
|
||||
personal_honor: Book
|
||||
personal_honor:
|
||||
paper_title : "Paper Title"
|
||||
book_title : "Book Title"
|
||||
award_name : "Award Name"
|
||||
awarding_unit : "Awarding Unit"
|
||||
honor_category : "Honor Category"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
publishers : "Publishers"
|
||||
authors : "Authors"
|
||||
tags : "Tags"
|
||||
year : "Year"
|
||||
language : "Language"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "Vol.No"
|
||||
issue_no : "Issue.No"
|
||||
form_to_start : "From"
|
||||
form_to_end : "To"
|
||||
total_pages : "Total Pages"
|
||||
keywords : "Keywords"
|
||||
abstract : "Abstract"
|
||||
publication_date : "Date of Publication"
|
||||
url : "Reference URL"
|
||||
note : "Note"
|
||||
level_type : "Level Type"
|
||||
author_type : "Author Type"
|
||||
from : "From"
|
||||
to : "To"
|
||||
file : "File"
|
||||
file_name : "File name"
|
||||
description : "File Description"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
|
||||
create_success : "Successfully Create"
|
||||
update_success : "Successfully Update"
|
||||
delete_success : "Successfully Delete"
|
||||
add: "Add"
|
||||
back: "Back"
|
||||
delete: "Delete"
|
||||
edit: "Edit"
|
||||
nothing: "Nothing"
|
||||
show: "Show"
|
||||
sure?: "Are you sure?"
|
||||
update: "Update"
|
||||
yes_: "Yes"
|
||||
no_: "No"
|
||||
cancel : "Cancel"
|
||||
save: "save"
|
||||
hintText: "Type in a search term"
|
||||
noResultsText: "No results"
|
||||
searchingText: "Searching…"
|
||||
@@ -1,4 +1,54 @@
|
||||
zh_tw:
|
||||
|
||||
module_name:
|
||||
personal_honor: 榮譽
|
||||
personal_honor: 期刊著作
|
||||
personal_honor:
|
||||
paper_title : "論文名稱"
|
||||
book_title : "期刊名稱"
|
||||
award_name : "Award Name"
|
||||
awarding_unit : "Awarding Unit"
|
||||
honor_category : "Honor Category"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
publishers : "Publishers"
|
||||
authors : "作者"
|
||||
tags : "領域"
|
||||
year : "年度"
|
||||
language : "語言"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "卷數"
|
||||
issue_no : "期數"
|
||||
form_to_start : "起"
|
||||
form_to_end : "訖"
|
||||
total_pages : "總頁數"
|
||||
keywords : "關鍵字"
|
||||
abstract : "摘要"
|
||||
publication_date : "發表日期"
|
||||
url : "參考連結"
|
||||
note : "記事"
|
||||
level_type : "期刊類別"
|
||||
author_type : "作者類別"
|
||||
from : "起"
|
||||
to : "訖"
|
||||
file : "檔案"
|
||||
file_name : "檔案名稱"
|
||||
description : "描述"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
|
||||
create_success : "新增完成!!"
|
||||
update_success : "更新完成!!"
|
||||
delete_success : "刪除成功!!"
|
||||
add: "新增"
|
||||
back: "返回"
|
||||
delete: "刪除"
|
||||
edit: "編輯"
|
||||
nothing: "無"
|
||||
show: "顯示"
|
||||
sure?: "您肯定嗎?"
|
||||
update: "更新"
|
||||
yes_: "是"
|
||||
no_: "否"
|
||||
cancel : "取消"
|
||||
save: "儲存"
|
||||
hintText: "請輸入搜尋關鍵字"
|
||||
noResultsText: "沒有相關的比對結果"
|
||||
searchingText: "搜尋中…"
|
||||
@@ -2,6 +2,11 @@ Rails.application.routes.draw do
|
||||
|
||||
namespace :panel do
|
||||
namespace :personal_honor do
|
||||
namespace :desktop do
|
||||
match "honor_window" => "personal_honors#honors_window"
|
||||
resources :personal_honors
|
||||
end
|
||||
|
||||
namespace :back_end do
|
||||
|
||||
match 'honor_setting' => "honors#honor_setting" ,:as => :honor_setting
|
||||
|
||||
Vendored
+158
@@ -0,0 +1,158 @@
|
||||
orbitDesktop.prototype.initializePersonalLab = function(target,url,cache){ // this init journal papers
|
||||
this.initializePersonalLab.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");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalLab.list = function(){ // to open list part in journal papers page
|
||||
var journalData;
|
||||
var bindHandlers = function(){ // to bind handlers for list page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
|
||||
var bindSecondaryHandlers = function(){
|
||||
$("#journal_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.initializePersonalLab.labDelete = function(data,dom){
|
||||
var parent = dom.parent().parent();
|
||||
if(data.success){
|
||||
parent.hide("slide",function(){parent.remove();});
|
||||
o.notify(data.msg,"success");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalLab.cancellab = function(){
|
||||
o.highlight_sub_menu_item(0);
|
||||
}
|
||||
|
||||
this.initializePersonalLab.editlab = function(){
|
||||
o.highlight_sub_menu_item(1);
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var preData = function(){
|
||||
$("#writing_journal_author_tokens").select2('data', JSON.parse($("#writing_journal_author_tokens").attr('data-pre')));
|
||||
}
|
||||
uploadFiles();
|
||||
// preData();
|
||||
}
|
||||
|
||||
this.initializePersonalLab.addlab = function(){ // to open add pages in journal papers page
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
// console.log("hi");
|
||||
var bindHandlers = function(){
|
||||
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
uploadFiles();
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.initializePersonalLab.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.initializePersonalLab.coauthor = function(){ // to open add pages in coauthor page
|
||||
var bindHandlers = function(){ // to bind handlers for add page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
}
|
||||
this.initializePersonalLab.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.initializePersonalLab.coauthorRelationEditForm = function(data){
|
||||
if(data.success){
|
||||
o.notify(data.msg,"success");
|
||||
var x = o.layout_data.generate_layout_html(data.newvalue);
|
||||
$("div[container=true] div.overview").html(x.markup);
|
||||
}else{
|
||||
o.notify(data.msg,"alert");
|
||||
}
|
||||
}
|
||||
this.initializePersonalLab.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.initializePersonalLab.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Vendored
+115
@@ -0,0 +1,115 @@
|
||||
/* Books */
|
||||
[page-name="books_list"] .list_t_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_list"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_list"] .list_item_action a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star {
|
||||
color: #faa732;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check {
|
||||
color: #333;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .file_view .list_t_des {
|
||||
overflow: hidden; }
|
||||
[page-name="books_list"] .file_view .file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
[page-name="books_list"] .file_view .file:hover {
|
||||
background-color: #f7f7f7; }
|
||||
[page-name="books_list"] .file_view .file img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px; }
|
||||
[page-name="books_list"] .file_view .file .filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] .datalist_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_books"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_books"] .list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_books"] .list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999; }
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] .list_t_item {
|
||||
height: 110px; }
|
||||
[page-name="books_coauthor"] .list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none; }
|
||||
[page-name="books_coauthor"] .info {
|
||||
font-family: Arial, sans-serif; }
|
||||
[page-name="books_coauthor"] .info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999; }
|
||||
[page-name="books_coauthor"] .info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333; }
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"] .edit_co_author_relation {
|
||||
/*margin-left: -10px;*/ }
|
||||
[page-name="books_coauthor_relation"] .form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif; }
|
||||
Vendored
+123
@@ -0,0 +1,123 @@
|
||||
@import "desktop-helper";
|
||||
|
||||
/* Books */
|
||||
[page-name="books_list"] {
|
||||
.list_t_item .inner { padding-left: 30px; }
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.icon-star-empty { color: #999; font-size: 20px; }
|
||||
.icon-star { color: #faa732; font-size: 20px; }
|
||||
.icon-check-empty { color: #999; font-size: 20px; }
|
||||
.icon-check { color: #333; font-size: 20px; }
|
||||
}
|
||||
|
||||
.file_view {
|
||||
.list_t_des {
|
||||
overflow: hidden;
|
||||
}
|
||||
.file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
@include box-sizing;
|
||||
|
||||
&:hover {
|
||||
background-color: lighten($gray, 10%);
|
||||
}
|
||||
img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px;
|
||||
}
|
||||
.filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
@include box-sizing;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] {
|
||||
|
||||
.datalist_item .inner {
|
||||
padding-left: 30px;
|
||||
}
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
}
|
||||
.list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] {
|
||||
.list_t_item {
|
||||
height: 110px;
|
||||
}
|
||||
.list_item_function {}
|
||||
.list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none;
|
||||
}
|
||||
.info {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999;
|
||||
}
|
||||
.info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"]{
|
||||
.edit_co_author_relation {
|
||||
/*margin-left: -10px;*/
|
||||
}
|
||||
.form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
class Panel::PersonalLab::Desktop::PersonalLabsController < ApplicationController
|
||||
|
||||
def index
|
||||
@labs = Lab.where(create_user_id: current_user.id)
|
||||
@view_by = params[:view]
|
||||
page = params[:page]
|
||||
page ||= 1
|
||||
|
||||
@per_column = 5
|
||||
|
||||
case @view_by
|
||||
when "abstract"
|
||||
@per_column = 1
|
||||
when "file"
|
||||
@per_column = 2
|
||||
end
|
||||
|
||||
if @view_by.nil?
|
||||
@view_by = " "
|
||||
@labs = @labs.asc(:paper_title)
|
||||
else
|
||||
@labs = @labs.asc(@view_by).asc(:paper_title)
|
||||
end
|
||||
@labs = @labs.page(page).per(50)
|
||||
respond_to do |format|
|
||||
format.html { render :layout => false}
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@lab = Lab.new
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def create
|
||||
params[:lab][:create_user_id] = current_user.id
|
||||
@lab = Lab.new(params[:lab])
|
||||
if @lab.save
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @lab.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@lab = Lab.find(params[:id])
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def update
|
||||
params[:lab][:create_user_id] = current_user.id
|
||||
@lab = Lab.new(params[:lab])
|
||||
if @lab.update_attributes(params[:lab])
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @lab.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@lab = Lab.find(params[:id])
|
||||
@lab.destroy
|
||||
render :json => {success: true, msg: t('delete_success')}
|
||||
end
|
||||
|
||||
def lab_window
|
||||
render :layout => false
|
||||
end
|
||||
end
|
||||
Vendored
+96
@@ -0,0 +1,96 @@
|
||||
module Panel::PersonalLab::Desktop::PersonalLabsHelper
|
||||
def publication_record publication, view
|
||||
content_tag :li,
|
||||
"item" => "true",
|
||||
:class => "list_t_item" do
|
||||
marker + \
|
||||
content(publication, view) + \
|
||||
edit_or_delete(publication)
|
||||
end
|
||||
end
|
||||
|
||||
def marker
|
||||
content_tag :div,
|
||||
:class => "list_item_action" do
|
||||
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
|
||||
end
|
||||
|
||||
def content publication, view
|
||||
case view
|
||||
when "lab_title"
|
||||
des = content_tag(:div, publication.lab_title,
|
||||
:class => "list_t_des")
|
||||
when "keywords"
|
||||
des = content_tag(:div, publication.keywords,
|
||||
:class => "list_t_des")
|
||||
when "location"
|
||||
des = content_tag(:div, publication.location,
|
||||
:class => "list_t_des")
|
||||
when "file"
|
||||
des = content_tag(:div, link_publication_file(publication),
|
||||
:class => "list_t_des")
|
||||
else
|
||||
end
|
||||
|
||||
content_tag(:div, publication.lab_title,
|
||||
:class => "list_t_title") + des
|
||||
|
||||
end
|
||||
|
||||
def edit_or_delete publication
|
||||
content_tag :div,
|
||||
:class => "list_item_function" do
|
||||
content_tag(:a, t("edit"),
|
||||
:class => "journal_paper_edit admbg2 admtxt",
|
||||
:href => edit_panel_personal_lab_desktop_personal_lab_path(publication),
|
||||
"callback-method" => "editlab",
|
||||
"ajax-remote" => "get") + \
|
||||
content_tag(:a, t(:delete_),
|
||||
"ajax-remote" => "delete",
|
||||
"confirm-message" => t("sure?"),
|
||||
"callback-method" => "labDelete",
|
||||
:class => "journal_paper_delete admbg2 admtxt",
|
||||
:href => panel_personal_lab_desktop_personal_lab_path(publication))
|
||||
end
|
||||
end
|
||||
|
||||
def link_publication_file publication
|
||||
publication.lab_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, file.title, :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank")
|
||||
}.inject(:+)
|
||||
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 generate_authors_name ids
|
||||
author_name = ids.map{|m|
|
||||
if m == "0"
|
||||
#{:id => 0, :text => current_user.name, :email => current_user.email }
|
||||
{:id => 0, :text => current_user.name }
|
||||
else
|
||||
#{:id => m, :text => ConferenceCoAuthor.find(m).co_author, :email => ConferenceCoAuthor.find(m).email}
|
||||
{:id => m, :text => ConferenceCoAuthor.find(m).co_author}
|
||||
end
|
||||
}
|
||||
author_name.to_json
|
||||
end
|
||||
end
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="fn_g hp">
|
||||
|
||||
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
|
||||
<% if not @lab.new_record? %>
|
||||
<%= submit_tag t("cancel"), :type => "button", "callback-method"=>"cancellab", "ajax-remote" => "get", :href => panel_personal_lab_desktop_personal_labs_path, class: "fn_btn ini_input hp hh1 admbg2 admtxt" %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" content-layout="column" base-width="420">
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :lab_title_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_lab.lab_title"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@lab.lab_title_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :location_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_lab.location"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@lab.location_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :participating_professor_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_lab.participating_professor"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@lab.participating_professor_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :participating_student_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_lab.participating_student"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@lab.participating_student_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_lab.extension_no"), class: "s_grid_4 s_grid") %><%= f.text_field :extension_no, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_lab.research_direction"), class: "s_grid_4 s_grid") %><%= f.text_field :research_direction, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_lab.facility"), class: "s_grid_4 s_grid") %><%= f.text_field :facility, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_project.year"), class: "s_grid_4 s_grid") %>
|
||||
<%= select_year((@lab.year ? @lab.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'lab[year]',:class => 's_grid_4 s_grid'} ) %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :keywords, size: "20x3", placeholder: t("personal_lab.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_lab.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.label :language, t("personal_lab.language"), :class => "s_grid s_grid_4" %>
|
||||
<%= f.select :language, Lab::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :note, size: "20x3", placeholder: t("personal_lab.note"), class: "s_grid_12 s_grid s_grid_h_5"%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<table class="s_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="s_grid_2"><%= t("personal_lab.file")%></th>
|
||||
<th class="s_grid_4"><%= t("personal_lab.file_name")%></th>
|
||||
<th class="s_grid_4"><%= t("personal_lab.description") %></th>
|
||||
<th class="s_grid_2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div id='add_plugin_file' class="info_input plugin_files_block s_action">
|
||||
<%= hidden_field_tag 'plugin_file_field_count', @lab.lab_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>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<% @lab.lab_files.each_with_index do |lab_file, i| %>
|
||||
<%= f.fields_for :lab_files, lab_file do |f| %>
|
||||
<%= render :partial => 'form_file', :object => lab_file, :locals => {:f => f, :i => i} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var get_html = function(old_id,new_id){
|
||||
return ("<%= escape_javascript(add_attribute 'form_file', f, :lab_files) %>").replace(old_id, new_id);
|
||||
}
|
||||
</script>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class="list_item">
|
||||
<td>
|
||||
<div>
|
||||
<% if form_file.new_record? %>
|
||||
<%= f.file_field :file, class: "s_grid_2" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<%= f.text_field :title, :class => 's_grid_4' %>
|
||||
</td>
|
||||
<td>
|
||||
<%= f.fields_for :file_title_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
class: 's_grid_4',
|
||||
value: (form_file.file_title_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<span class="action">
|
||||
<% if form_file.new_record? %>
|
||||
<a class="delete"><i class="icon-remove"></i></a>
|
||||
<% else %>
|
||||
<%= f.hidden_field :id %>
|
||||
<a class="remove_existing_record"><i class="icon-remove"></i></a>
|
||||
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
|
||||
<% end %>
|
||||
<%= form_file.file.file ? ( link_to '', form_file.file.url, {:class => 'icon-eye-open', :target => '_blank', :title => t(:view)} ) : '' %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @lab, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_lab_desktop_personal_labs_path(@lab) do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-check"></span></div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_selection_options">
|
||||
<li><a class="hp hh1 admtxt" href="all" ajax-remote="false" callback-method="allnone">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="none" ajax-remote="false" callback-method="allnone">None</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">More</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Delete</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Tag</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Tag</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Starred</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">MIT</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Status</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Published</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Pending</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">View</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_view_selection">
|
||||
<li><%= link_to "Title", panel_personal_lab_desktop_personal_labs_path + "?view=lab_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "File", panel_personal_lab_desktop_personal_labs_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Keywords", panel_personal_lab_desktop_personal_labs_path + "?view=keywords", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Location", panel_personal_lab_desktop_personal_labs_path + "?view=location", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1" id='ns'>New Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt remote_url" href="<%= panel_personal_lab_desktop_personal_labs_path %>">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" page-name="journal_p_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
|
||||
<% @labs.each do |w| %>
|
||||
<%= publication_record w, @view_by%>
|
||||
<% end %>
|
||||
</div>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<%= stylesheet_link_tag "/assets/personal_lab/desktop/personal_lab" %>
|
||||
<%= javascript_include_tag "personal_lab/desktop/personal_lab" %>
|
||||
<div id="books">
|
||||
<div id="content">
|
||||
<div id="header" class="hh2">
|
||||
<div class="dtitle w2 hh2 hp">
|
||||
<span class="thmtxth">Books</span>
|
||||
</div>
|
||||
<div id="search_app" class="hfn w2 hh1 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" content-type="menu">
|
||||
<ul id='setting_left_nav'>
|
||||
<li><a href="<%= panel_personal_lab_desktop_personal_labs_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
|
||||
<li><a href="<%= new_panel_personal_lab_desktop_personal_lab_path %>" callback-method="addlab" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
|
||||
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags & Keywords</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Analysis</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Import</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Export</a></li> -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="panel_r" container="true" class="ph pw admbg hp">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/desktop/personal_labs/new.html.erb
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @lab, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_lab_desktop_personal_labs_path do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
+55
-2
@@ -1,4 +1,57 @@
|
||||
en:
|
||||
|
||||
module_name:
|
||||
personal_lab: Lab
|
||||
personal_lab: Lab
|
||||
personal_lab:
|
||||
book_title : "Book Title"
|
||||
lab_title : "Lab Title"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
location : "Location"
|
||||
participating_professor : "Participating Professor"
|
||||
participating_student : "Participating Student"
|
||||
extension_no : "Extension Number"
|
||||
research_direction : "Research Direction"
|
||||
facility : "Facility"
|
||||
publishers : "Publishers"
|
||||
authors : "Authors"
|
||||
tags : "Tags"
|
||||
year : "Year"
|
||||
language : "Language"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "Vol.No"
|
||||
issue_no : "Issue.No"
|
||||
form_to_start : "From"
|
||||
form_to_end : "To"
|
||||
total_pages : "Total Pages"
|
||||
keywords : "Keywords"
|
||||
abstract : "Abstract"
|
||||
publication_date : "Date of Publication"
|
||||
url : "Reference URL"
|
||||
note : "Note"
|
||||
level_type : "Level Type"
|
||||
author_type : "Author Type"
|
||||
from : "From"
|
||||
to : "To"
|
||||
file : "File"
|
||||
file_name : "File name"
|
||||
description : "File Description"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
|
||||
create_success : "Successfully Create"
|
||||
update_success : "Successfully Update"
|
||||
delete_success : "Successfully Delete"
|
||||
add: "Add"
|
||||
back: "Back"
|
||||
delete: "Delete"
|
||||
edit: "Edit"
|
||||
nothing: "Nothing"
|
||||
show: "Show"
|
||||
sure?: "Are you sure?"
|
||||
update: "Update"
|
||||
yes_: "Yes"
|
||||
no_: "No"
|
||||
cancel : "Cancel"
|
||||
save: "save"
|
||||
hintText: "Type in a search term"
|
||||
noResultsText: "No results"
|
||||
searchingText: "Searching…"
|
||||
@@ -1,4 +1,57 @@
|
||||
zh_tw:
|
||||
|
||||
module_name:
|
||||
personal_lab: 實驗室
|
||||
personal_lab: Lab
|
||||
personal_lab:
|
||||
book_title : "期刊名稱"
|
||||
lab_title : "Lab Title"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
participating_professor : "Participating Professor"
|
||||
participating_student : "Participating Student"
|
||||
research_direction : "Research Direction"
|
||||
facility : "Facility"
|
||||
extension_no : "Extension Number"
|
||||
location : "Location"
|
||||
publishers : "Publishers"
|
||||
authors : "作者"
|
||||
tags : "領域"
|
||||
year : "年度"
|
||||
language : "語言"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "卷數"
|
||||
issue_no : "期數"
|
||||
form_to_start : "起"
|
||||
form_to_end : "訖"
|
||||
total_pages : "總頁數"
|
||||
keywords : "關鍵字"
|
||||
abstract : "摘要"
|
||||
publication_date : "發表日期"
|
||||
url : "參考連結"
|
||||
note : "記事"
|
||||
level_type : "期刊類別"
|
||||
author_type : "作者類別"
|
||||
from : "起"
|
||||
to : "訖"
|
||||
file : "檔案"
|
||||
file_name : "檔案名稱"
|
||||
description : "描述"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
|
||||
create_success : "新增完成!!"
|
||||
update_success : "更新完成!!"
|
||||
delete_success : "刪除成功!!"
|
||||
add: "新增"
|
||||
back: "返回"
|
||||
delete: "刪除"
|
||||
edit: "編輯"
|
||||
nothing: "無"
|
||||
show: "顯示"
|
||||
sure?: "您肯定嗎?"
|
||||
update: "更新"
|
||||
yes_: "是"
|
||||
no_: "否"
|
||||
cancel : "取消"
|
||||
save: "儲存"
|
||||
hintText: "請輸入搜尋關鍵字"
|
||||
noResultsText: "沒有相關的比對結果"
|
||||
searchingText: "搜尋中…"
|
||||
@@ -2,6 +2,10 @@ Rails.application.routes.draw do
|
||||
|
||||
namespace :panel do
|
||||
namespace :personal_lab do
|
||||
namespace :desktop do
|
||||
match "lab_window" => "personal_labs#lab_window"
|
||||
resources :personal_labs
|
||||
end
|
||||
namespace :back_end do
|
||||
|
||||
match 'lab_setting' => "labs#lab_setting" ,:as => :lab_setting
|
||||
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
orbitDesktop.prototype.initializePersonalPatent = function(target,url,cache){ // this init journal papers
|
||||
this.initializePersonalPatent.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");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalPatent.list = function(){ // to open list part in journal papers page
|
||||
var journalData;
|
||||
var bindHandlers = function(){ // to bind handlers for list page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
|
||||
var bindSecondaryHandlers = function(){
|
||||
$("#journal_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.initializePersonalPatent.patentDelete = function(data,dom){
|
||||
var parent = dom.parent().parent();
|
||||
if(data.success){
|
||||
parent.hide("slide",function(){parent.remove();});
|
||||
o.notify(data.msg,"success");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalPatent.cancelpatent = function(){
|
||||
o.highlight_sub_menu_item(0);
|
||||
}
|
||||
|
||||
this.initializePersonalPatent.editpatent = function(){
|
||||
o.highlight_sub_menu_item(1);
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var preData = function(){
|
||||
$("#writing_journal_author_tokens").select2('data', JSON.parse($("#writing_journal_author_tokens").attr('data-pre')));
|
||||
}
|
||||
uploadFiles();
|
||||
// preData();
|
||||
}
|
||||
|
||||
this.initializePersonalPatent.addpatent = function(){ // to open add pages in journal papers page
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
// console.log("hi");
|
||||
var bindHandlers = function(){
|
||||
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
uploadFiles();
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.initializePersonalPatent.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.initializePersonalPatent.coauthor = function(){ // to open add pages in coauthor page
|
||||
var bindHandlers = function(){ // to bind handlers for add page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
}
|
||||
this.initializePersonalPatent.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.initializePersonalPatent.coauthorRelationEditForm = function(data){
|
||||
if(data.success){
|
||||
o.notify(data.msg,"success");
|
||||
var x = o.layout_data.generate_layout_html(data.newvalue);
|
||||
$("div[container=true] div.overview").html(x.markup);
|
||||
}else{
|
||||
o.notify(data.msg,"alert");
|
||||
}
|
||||
}
|
||||
this.initializePersonalPatent.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.initializePersonalPatent.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
/* Books */
|
||||
[page-name="books_list"] .list_t_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_list"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_list"] .list_item_action a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star {
|
||||
color: #faa732;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check {
|
||||
color: #333;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .file_view .list_t_des {
|
||||
overflow: hidden; }
|
||||
[page-name="books_list"] .file_view .file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
[page-name="books_list"] .file_view .file:hover {
|
||||
background-color: #f7f7f7; }
|
||||
[page-name="books_list"] .file_view .file img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px; }
|
||||
[page-name="books_list"] .file_view .file .filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] .datalist_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_books"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_books"] .list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_books"] .list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999; }
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] .list_t_item {
|
||||
height: 110px; }
|
||||
[page-name="books_coauthor"] .list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none; }
|
||||
[page-name="books_coauthor"] .info {
|
||||
font-family: Arial, sans-serif; }
|
||||
[page-name="books_coauthor"] .info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999; }
|
||||
[page-name="books_coauthor"] .info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333; }
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"] .edit_co_author_relation {
|
||||
/*margin-left: -10px;*/ }
|
||||
[page-name="books_coauthor_relation"] .form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif; }
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
@import "desktop-helper";
|
||||
|
||||
/* Books */
|
||||
[page-name="books_list"] {
|
||||
.list_t_item .inner { padding-left: 30px; }
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.icon-star-empty { color: #999; font-size: 20px; }
|
||||
.icon-star { color: #faa732; font-size: 20px; }
|
||||
.icon-check-empty { color: #999; font-size: 20px; }
|
||||
.icon-check { color: #333; font-size: 20px; }
|
||||
}
|
||||
|
||||
.file_view {
|
||||
.list_t_des {
|
||||
overflow: hidden;
|
||||
}
|
||||
.file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
@include box-sizing;
|
||||
|
||||
&:hover {
|
||||
background-color: lighten($gray, 10%);
|
||||
}
|
||||
img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px;
|
||||
}
|
||||
.filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
@include box-sizing;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] {
|
||||
|
||||
.datalist_item .inner {
|
||||
padding-left: 30px;
|
||||
}
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
}
|
||||
.list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] {
|
||||
.list_t_item {
|
||||
height: 110px;
|
||||
}
|
||||
.list_item_function {}
|
||||
.list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none;
|
||||
}
|
||||
.info {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999;
|
||||
}
|
||||
.info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"]{
|
||||
.edit_co_author_relation {
|
||||
/*margin-left: -10px;*/
|
||||
}
|
||||
.form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
class Panel::PersonalPatent::Desktop::PersonalPatentsController < ApplicationController
|
||||
|
||||
def index
|
||||
@patents = WritingPatent.where(create_user_id: current_user.id)
|
||||
@view_by = params[:view]
|
||||
page = params[:page]
|
||||
page ||= 1
|
||||
|
||||
@per_column = 5
|
||||
|
||||
case @view_by
|
||||
when "abstract"
|
||||
@per_column = 1
|
||||
when "file"
|
||||
@per_column = 2
|
||||
end
|
||||
|
||||
if @view_by.nil?
|
||||
@view_by = " "
|
||||
@patents = @patents.asc(:paper_title)
|
||||
else
|
||||
@patents = @patents.asc(@view_by).asc(:paper_title)
|
||||
end
|
||||
@patents = @patents.page(page).per(50)
|
||||
respond_to do |format|
|
||||
format.html { render :layout => false}
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@patent = WritingPatent.new
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def create
|
||||
params[:writing_patent][:create_user_id] = current_user.id
|
||||
@patent = WritingPatent.new(params[:writing_patent])
|
||||
if @patent.save
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @patent.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@patent = WritingPatent.find(params[:id])
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def update
|
||||
params[:writing_patent][:create_user_id] = current_user.id
|
||||
@patent = WritingPatent.new(params[:writing_patent])
|
||||
if @patent.update_attributes(params[:writing_patent])
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @patent.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@patent = WritingPatent.find(params[:id])
|
||||
@patent.destroy
|
||||
render :json => {success: true, msg: t('delete_success')}
|
||||
end
|
||||
|
||||
def patent_window
|
||||
render :layout => false
|
||||
end
|
||||
end
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
module Panel::PersonalPatent::Desktop::PersonalPatentsHelper
|
||||
def publication_record publication, view
|
||||
content_tag :li,
|
||||
"item" => "true",
|
||||
:class => "list_t_item" do
|
||||
marker + \
|
||||
content(publication, view) + \
|
||||
edit_or_delete(publication)
|
||||
end
|
||||
end
|
||||
|
||||
def marker
|
||||
content_tag :div,
|
||||
:class => "list_item_action" do
|
||||
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
|
||||
end
|
||||
|
||||
def content publication, view
|
||||
case view
|
||||
when "patent_title"
|
||||
des = content_tag(:div, publication.patent_title,
|
||||
:class => "list_t_des")
|
||||
when "keywords"
|
||||
des = content_tag(:div, publication.keywords,
|
||||
:class => "list_t_des")
|
||||
when "abstract"
|
||||
des = content_tag(:div, publication.abstract,
|
||||
:class => "list_t_des")
|
||||
when "file"
|
||||
des = content_tag(:div, link_publication_file(publication),
|
||||
:class => "list_t_des")
|
||||
else
|
||||
end
|
||||
|
||||
content_tag(:div, publication.patent_title,
|
||||
:class => "list_t_title") + des
|
||||
|
||||
end
|
||||
|
||||
def edit_or_delete publication
|
||||
content_tag :div,
|
||||
:class => "list_item_function" do
|
||||
content_tag(:a, t("edit"),
|
||||
:class => "journal_paper_edit admbg2 admtxt",
|
||||
:href => edit_panel_personal_patent_desktop_personal_patent_path(publication),
|
||||
"callback-method" => "editpatent",
|
||||
"ajax-remote" => "get") + \
|
||||
content_tag(:a, t(:delete_),
|
||||
"ajax-remote" => "delete",
|
||||
"confirm-message" => t("sure?"),
|
||||
"callback-method" => "patentDelete",
|
||||
:class => "journal_paper_delete admbg2 admtxt",
|
||||
:href => panel_personal_patent_desktop_personal_patent_path(publication))
|
||||
end
|
||||
end
|
||||
|
||||
def link_publication_file publication
|
||||
publication.writing_patent_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, file.title, :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank")
|
||||
}.inject(:+)
|
||||
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 generate_authors_name ids
|
||||
author_name = ids.map{|m|
|
||||
if m == "0"
|
||||
#{:id => 0, :text => current_user.name, :email => current_user.email }
|
||||
{:id => 0, :text => current_user.name }
|
||||
else
|
||||
#{:id => m, :text => ConferenceCoAuthor.find(m).co_author, :email => ConferenceCoAuthor.find(m).email}
|
||||
{:id => m, :text => ConferenceCoAuthor.find(m).co_author}
|
||||
end
|
||||
}
|
||||
author_name.to_json
|
||||
end
|
||||
end
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="fn_g hp">
|
||||
|
||||
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
|
||||
<% if not @patent.new_record? %>
|
||||
<%= submit_tag t("cancel"), :type => "button", "callback-method"=>"cancelpatent", "ajax-remote" => "get", :href => panel_personal_patent_desktop_personal_patents_path, class: "fn_btn ini_input hp hh1 admbg2 admtxt" %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" content-layout="column" base-width="420">
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :patent_title_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_patent.patent_title"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@patent.patent_title_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_patent.patent_no"), class: "s_grid_4 s_grid") %><%= f.text_field :patent_no, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_patent.patent_country"), class: "s_grid_4 s_grid") %><%= f.text_field :patent_country, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_patent.publication_date"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.date_select :publish_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %>
|
||||
<%= f.date_select :publish_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_patent.patent_category"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.select :writing_patent_category_id, WritingPatentCategory.all.collect {|t| [ t.title, t.id ]}, {:class => "s_grid s_grid_8"} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_project.year"), class: "s_grid_4 s_grid") %>
|
||||
<%= select_year((@patent.year ? @patent.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_patent[year]',:class => 's_grid_4 s_grid'} ) %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_patent.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :keywords, size: "20x3", placeholder: t("personal_patent.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.label :language, t("personal_patent.language"), :class => "s_grid s_grid_4" %>
|
||||
<%= f.select :language, WritingPatent::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :note, size: "20x3", placeholder: t("personal_patent.note"), class: "s_grid_12 s_grid s_grid_h_5"%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<table class="s_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="s_grid_2"><%= t("personal_patent.file")%></th>
|
||||
<th class="s_grid_4"><%= t("personal_patent.file_name")%></th>
|
||||
<th class="s_grid_4"><%= t("personal_patent.description") %></th>
|
||||
<th class="s_grid_2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div id='add_plugin_file' class="info_input plugin_files_block s_action">
|
||||
<%= hidden_field_tag 'plugin_file_field_count', @patent.writing_patent_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>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<% @patent.writing_patent_files.each_with_index do |writing_patent_file, i| %>
|
||||
<%= f.fields_for :writing_patent_files, writing_patent_file do |f| %>
|
||||
<%= render :partial => 'form_file', :object => writing_patent_file, :locals => {:f => f, :i => i} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var get_html = function(old_id,new_id){
|
||||
return ("<%= escape_javascript(add_attribute 'form_file', f, :writing_patent_files) %>").replace(old_id, new_id);
|
||||
}
|
||||
</script>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class="list_item">
|
||||
<td>
|
||||
<div>
|
||||
<% if form_file.new_record? %>
|
||||
<%= f.file_field :file, class: "s_grid_2" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<%= f.text_field :title, :class => 's_grid_4' %>
|
||||
</td>
|
||||
<td>
|
||||
<%= f.fields_for :file_title_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
class: 's_grid_4',
|
||||
value: (form_file.file_title_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<span class="action">
|
||||
<% if form_file.new_record? %>
|
||||
<a class="delete"><i class="icon-remove"></i></a>
|
||||
<% else %>
|
||||
<%= f.hidden_field :id %>
|
||||
<a class="remove_existing_record"><i class="icon-remove"></i></a>
|
||||
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
|
||||
<% end %>
|
||||
<%= form_file.file.file ? ( link_to '', form_file.file.url, {:class => 'icon-eye-open', :target => '_blank', :title => t(:view)} ) : '' %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @patent, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_patent_desktop_personal_patents_path(@patent) do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-check"></span></div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_selection_options">
|
||||
<li><a class="hp hh1 admtxt" href="all" ajax-remote="false" callback-method="allnone">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="none" ajax-remote="false" callback-method="allnone">None</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">More</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Delete</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Tag</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Tag</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Starred</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">MIT</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Status</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Published</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Pending</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">View</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_view_selection">
|
||||
<li><%= link_to "Title", panel_personal_patent_desktop_personal_patents_path + "?view=patent_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "File", panel_personal_patent_desktop_personal_patents_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Keywords", panel_personal_patent_desktop_personal_patents_path + "?view=keywords", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1" id='ns'>New Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt remote_url" href="<%= panel_personal_patent_desktop_personal_patents_path %>">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" page-name="journal_p_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
|
||||
<% @patents.each do |w| %>
|
||||
<%= publication_record w, @view_by%>
|
||||
<% end %>
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @patent, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_patent_desktop_personal_patents_path do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<%= stylesheet_link_tag "/assets/personal_patent/desktop/personal_patent" %>
|
||||
<%= javascript_include_tag "personal_patent/desktop/personal_patent" %>
|
||||
<div id="patent">
|
||||
<div id="content">
|
||||
<div id="header" class="hh2">
|
||||
<div class="dtitle w2 hh2 hp">
|
||||
<span class="thmtxth">Patents</span>
|
||||
</div>
|
||||
<div id="search_app" class="hfn w2 hh1 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" content-type="menu">
|
||||
<ul id='setting_left_nav'>
|
||||
<li><a href="<%= panel_personal_patent_desktop_personal_patents_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
|
||||
<li><a href="<%= new_panel_personal_patent_desktop_personal_patent_path %>" callback-method="addpatent" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
|
||||
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags & Keywords</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Analysis</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Import</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Export</a></li> -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="panel_r" container="true" class="ph pw admbg hp">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,4 +1,54 @@
|
||||
en:
|
||||
|
||||
module_name:
|
||||
personal_patent: Patent
|
||||
personal_patent: Patent
|
||||
personal_patent:
|
||||
patent_title : "Patent Title"
|
||||
book_title : "Book Title"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
patent_no : "Patent Number"
|
||||
patent_country : "Patent Country"
|
||||
patent_category : "Patent Category"
|
||||
publishers : "Publishers"
|
||||
authors : "Authors"
|
||||
tags : "Tags"
|
||||
year : "Year"
|
||||
language : "Language"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "Vol.No"
|
||||
issue_no : "Issue.No"
|
||||
form_to_start : "From"
|
||||
form_to_end : "To"
|
||||
total_pages : "Total Pages"
|
||||
keywords : "Keywords"
|
||||
abstract : "Abstract"
|
||||
publication_date : "Date of Publication"
|
||||
url : "Reference URL"
|
||||
note : "Note"
|
||||
level_type : "Level Type"
|
||||
author_type : "Author Type"
|
||||
from : "From"
|
||||
to : "To"
|
||||
file : "File"
|
||||
file_name : "File name"
|
||||
description : "File Description"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
|
||||
create_success : "Successfully Create"
|
||||
update_success : "Successfully Update"
|
||||
delete_success : "Successfully Delete"
|
||||
add: "Add"
|
||||
back: "Back"
|
||||
delete: "Delete"
|
||||
edit: "Edit"
|
||||
nothing: "Nothing"
|
||||
show: "Show"
|
||||
sure?: "Are you sure?"
|
||||
update: "Update"
|
||||
yes_: "Yes"
|
||||
no_: "No"
|
||||
cancel : "Cancel"
|
||||
save: "save"
|
||||
hintText: "Type in a search term"
|
||||
noResultsText: "No results"
|
||||
searchingText: "Searching…"
|
||||
@@ -1,4 +1,54 @@
|
||||
zh_tw:
|
||||
|
||||
module_name:
|
||||
personal_patent: 專利
|
||||
personal_patent: Patent
|
||||
personal_patent:
|
||||
patent_title : "Patent Title"
|
||||
book_title : "期刊名稱"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
patent_no : "Patent Number"
|
||||
patent_country : "Patent Country"
|
||||
patent_category : "Patent Category"
|
||||
publishers : "Publishers"
|
||||
authors : "作者"
|
||||
tags : "領域"
|
||||
year : "年度"
|
||||
language : "語言"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "卷數"
|
||||
issue_no : "期數"
|
||||
form_to_start : "起"
|
||||
form_to_end : "訖"
|
||||
total_pages : "總頁數"
|
||||
keywords : "關鍵字"
|
||||
abstract : "摘要"
|
||||
publication_date : "發表日期"
|
||||
url : "參考連結"
|
||||
note : "記事"
|
||||
level_type : "期刊類別"
|
||||
author_type : "作者類別"
|
||||
from : "起"
|
||||
to : "訖"
|
||||
file : "檔案"
|
||||
file_name : "檔案名稱"
|
||||
description : "描述"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
|
||||
create_success : "新增完成!!"
|
||||
update_success : "更新完成!!"
|
||||
delete_success : "刪除成功!!"
|
||||
add: "新增"
|
||||
back: "返回"
|
||||
delete: "刪除"
|
||||
edit: "編輯"
|
||||
nothing: "無"
|
||||
show: "顯示"
|
||||
sure?: "您肯定嗎?"
|
||||
update: "更新"
|
||||
yes_: "是"
|
||||
no_: "否"
|
||||
cancel : "取消"
|
||||
save: "儲存"
|
||||
hintText: "請輸入搜尋關鍵字"
|
||||
noResultsText: "沒有相關的比對結果"
|
||||
searchingText: "搜尋中…"
|
||||
@@ -2,6 +2,10 @@ Rails.application.routes.draw do
|
||||
|
||||
namespace :panel do
|
||||
namespace :personal_patent do
|
||||
namespace :desktop do
|
||||
match "patent_window" => "personal_patents#patent_window"
|
||||
resources :personal_patents
|
||||
end
|
||||
namespace :back_end do
|
||||
|
||||
match 'writing_patent_setting' => "writing_patents#writing_patent_setting" ,:as => :writing_patent_setting
|
||||
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
orbitDesktop.prototype.initializePersonalProject = function(target,url,cache){ // this init journal papers
|
||||
this.initializePersonalProject.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");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalProject.list = function(){ // to open list part in journal papers page
|
||||
var journalData;
|
||||
var bindHandlers = function(){ // to bind handlers for list page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
|
||||
var bindSecondaryHandlers = function(){
|
||||
$("#journal_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.initializePersonalProject.projectDelete = function(data,dom){
|
||||
var parent = dom.parent().parent();
|
||||
if(data.success){
|
||||
parent.hide("slide",function(){parent.remove();});
|
||||
o.notify(data.msg,"success");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalProject.cancelproject = function(){
|
||||
o.highlight_sub_menu_item(0);
|
||||
}
|
||||
|
||||
this.initializePersonalProject.editproject = function(){
|
||||
o.highlight_sub_menu_item(1);
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var preData = function(){
|
||||
$("#writing_journal_author_tokens").select2('data', JSON.parse($("#writing_journal_author_tokens").attr('data-pre')));
|
||||
}
|
||||
uploadFiles();
|
||||
// preData();
|
||||
}
|
||||
|
||||
this.initializePersonalProject.addproject = function(){ // to open add pages in journal papers page
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
// console.log("hi");
|
||||
var bindHandlers = function(){
|
||||
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
uploadFiles();
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.initializePersonalProject.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.initializePersonalProject.coauthor = function(){ // to open add pages in coauthor page
|
||||
var bindHandlers = function(){ // to bind handlers for add page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
}
|
||||
this.initializePersonalProject.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.initializePersonalProject.coauthorRelationEditForm = function(data){
|
||||
if(data.success){
|
||||
o.notify(data.msg,"success");
|
||||
var x = o.layout_data.generate_layout_html(data.newvalue);
|
||||
$("div[container=true] div.overview").html(x.markup);
|
||||
}else{
|
||||
o.notify(data.msg,"alert");
|
||||
}
|
||||
}
|
||||
this.initializePersonalProject.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.initializePersonalProject.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
/* Books */
|
||||
[page-name="books_list"] .list_t_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_list"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_list"] .list_item_action a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star {
|
||||
color: #faa732;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check {
|
||||
color: #333;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .file_view .list_t_des {
|
||||
overflow: hidden; }
|
||||
[page-name="books_list"] .file_view .file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
[page-name="books_list"] .file_view .file:hover {
|
||||
background-color: #f7f7f7; }
|
||||
[page-name="books_list"] .file_view .file img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px; }
|
||||
[page-name="books_list"] .file_view .file .filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] .datalist_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_books"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_books"] .list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_books"] .list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999; }
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] .list_t_item {
|
||||
height: 110px; }
|
||||
[page-name="books_coauthor"] .list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none; }
|
||||
[page-name="books_coauthor"] .info {
|
||||
font-family: Arial, sans-serif; }
|
||||
[page-name="books_coauthor"] .info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999; }
|
||||
[page-name="books_coauthor"] .info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333; }
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"] .edit_co_author_relation {
|
||||
/*margin-left: -10px;*/ }
|
||||
[page-name="books_coauthor_relation"] .form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif; }
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
@import "desktop-helper";
|
||||
|
||||
/* Books */
|
||||
[page-name="books_list"] {
|
||||
.list_t_item .inner { padding-left: 30px; }
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.icon-star-empty { color: #999; font-size: 20px; }
|
||||
.icon-star { color: #faa732; font-size: 20px; }
|
||||
.icon-check-empty { color: #999; font-size: 20px; }
|
||||
.icon-check { color: #333; font-size: 20px; }
|
||||
}
|
||||
|
||||
.file_view {
|
||||
.list_t_des {
|
||||
overflow: hidden;
|
||||
}
|
||||
.file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
@include box-sizing;
|
||||
|
||||
&:hover {
|
||||
background-color: lighten($gray, 10%);
|
||||
}
|
||||
img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px;
|
||||
}
|
||||
.filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
@include box-sizing;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] {
|
||||
|
||||
.datalist_item .inner {
|
||||
padding-left: 30px;
|
||||
}
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
}
|
||||
.list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] {
|
||||
.list_t_item {
|
||||
height: 110px;
|
||||
}
|
||||
.list_item_function {}
|
||||
.list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none;
|
||||
}
|
||||
.info {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999;
|
||||
}
|
||||
.info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"]{
|
||||
.edit_co_author_relation {
|
||||
/*margin-left: -10px;*/
|
||||
}
|
||||
.form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
class Panel::PersonalProject::Desktop::PersonalProjectsController < ApplicationController
|
||||
|
||||
def index
|
||||
@projects = Project.where(create_user_id: current_user.id)
|
||||
@view_by = params[:view]
|
||||
page = params[:page]
|
||||
page ||= 1
|
||||
|
||||
@per_column = 5
|
||||
|
||||
case @view_by
|
||||
when "abstract"
|
||||
@per_column = 1
|
||||
when "file"
|
||||
@per_column = 2
|
||||
end
|
||||
|
||||
if @view_by.nil?
|
||||
@view_by = " "
|
||||
@projects = @projects.asc(:paper_title)
|
||||
else
|
||||
@projects = @projects.asc(@view_by).asc(:paper_title)
|
||||
end
|
||||
@projects = @projects.page(page).per(50)
|
||||
respond_to do |format|
|
||||
format.html { render :layout => false}
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@project = Project.new
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def create
|
||||
params[:project][:create_user_id] = current_user.id
|
||||
@project = Project.new(params[:project])
|
||||
if @project.save
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @project.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@project = Project.find(params[:id])
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def update
|
||||
params[:project][:create_user_id] = current_user.id
|
||||
@project = Project.new(params[:project])
|
||||
if @project.update_attributes(params[:project])
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @project.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@personal_book = Project.find(params[:id])
|
||||
@personal_book.destroy
|
||||
render :json => {success: true, msg: t('delete_success')}
|
||||
end
|
||||
|
||||
def project_window
|
||||
render :layout => false
|
||||
end
|
||||
end
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
module Panel::PersonalProject::Desktop::PersonalProjectsHelper
|
||||
def publication_record publication, view
|
||||
content_tag :li,
|
||||
"item" => "true",
|
||||
:class => "list_t_item" do
|
||||
marker + \
|
||||
content(publication, view) + \
|
||||
edit_or_delete(publication)
|
||||
end
|
||||
end
|
||||
|
||||
def marker
|
||||
content_tag :div,
|
||||
:class => "list_item_action" do
|
||||
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
|
||||
end
|
||||
|
||||
def content publication, view
|
||||
case view
|
||||
when "project_title"
|
||||
des = content_tag(:div, publication.project_title,
|
||||
:class => "list_t_des")
|
||||
when "job_title"
|
||||
des = content_tag(:div, publication.job_title,
|
||||
:class => "list_t_des")
|
||||
when "keywords"
|
||||
des = content_tag(:div, publication.keywords,
|
||||
:class => "list_t_des")
|
||||
when "file"
|
||||
des = content_tag(:div, link_publication_file(publication),
|
||||
:class => "list_t_des")
|
||||
else
|
||||
end
|
||||
|
||||
content_tag(:div, publication.project_title,
|
||||
:class => "list_t_title") + des
|
||||
|
||||
end
|
||||
|
||||
def edit_or_delete publication
|
||||
content_tag :div,
|
||||
:class => "list_item_function" do
|
||||
content_tag(:a, t("edit"),
|
||||
:class => "journal_paper_edit admbg2 admtxt",
|
||||
:href => edit_panel_personal_project_desktop_personal_project_path(publication),
|
||||
"callback-method" => "editproject",
|
||||
"ajax-remote" => "get") + \
|
||||
content_tag(:a, t(:delete_),
|
||||
"ajax-remote" => "delete",
|
||||
"confirm-message" => t("sure?"),
|
||||
"callback-method" => "projectDelete",
|
||||
:class => "journal_paper_delete admbg2 admtxt",
|
||||
:href => panel_personal_project_desktop_personal_project_path(publication))
|
||||
end
|
||||
end
|
||||
|
||||
def link_publication_file publication
|
||||
publication.project_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, file.title, :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank")
|
||||
}.inject(:+)
|
||||
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 generate_authors_name ids
|
||||
author_name = ids.map{|m|
|
||||
if m == "0"
|
||||
#{:id => 0, :text => current_user.name, :email => current_user.email }
|
||||
{:id => 0, :text => current_user.name }
|
||||
else
|
||||
#{:id => m, :text => ConferenceCoAuthor.find(m).co_author, :email => ConferenceCoAuthor.find(m).email}
|
||||
{:id => m, :text => ConferenceCoAuthor.find(m).co_author}
|
||||
end
|
||||
}
|
||||
author_name.to_json
|
||||
end
|
||||
end
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="fn_g hp">
|
||||
|
||||
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
|
||||
<% if not @project.new_record? %>
|
||||
<%= submit_tag t("cancel"), :type => "button", "callback-method"=>"cancelproject", "ajax-remote" => "get", :href => panel_personal_project_desktop_personal_projects_path, class: "fn_btn ini_input hp hh1 admbg2 admtxt" %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" content-layout="column" base-width="420">
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :project_title_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_project.project_title"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@project.project_title_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :job_title_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_project.job_title"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@project.job_title_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :participator_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_project.participator"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@project.participator_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :unit_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_project.unit"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@project.unit_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_project.start_date"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.date_select :period_start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %>
|
||||
<%= f.date_select :period_start_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_project.end_date"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.date_select :period_end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %>
|
||||
<%= f.date_select :period_end_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_project.year"), class: "s_grid_4 s_grid") %>
|
||||
<%= select_year((@project.year ? @project.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'lab[year]',:class => 's_grid_4 s_grid'} ) %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_project.project_category"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.select :project_category_id, ProjectCategory.all.collect {|t| [ t.title, t.id ]}, {:class => "s_grid s_grid_8"} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_project.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :keywords, size: "20x3", placeholder: t("personal_project.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.label :language, t("personal_project.language"), :class => "s_grid s_grid_4" %>
|
||||
<%= f.select :language, Project::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :note, size: "20x3", placeholder: t("personal_project.note"), class: "s_grid_12 s_grid s_grid_h_7"%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :abstract, size: "20x22", placeholder: t("personal_project.abstract"), class: "s_grid_12 s_grid s_grid_h_10"%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<table class="s_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="s_grid_2"><%= t("personal_project.file")%></th>
|
||||
<th class="s_grid_4"><%= t("personal_project.file_name")%></th>
|
||||
<th class="s_grid_4"><%= t("personal_project.description") %></th>
|
||||
<th class="s_grid_2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div id='add_plugin_file' class="info_input plugin_files_block s_action">
|
||||
<%= hidden_field_tag 'plugin_file_field_count', @project.project_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>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<% @project.project_files.each_with_index do |project_file, i| %>
|
||||
<%= f.fields_for :project_files, project_file do |f| %>
|
||||
<%= render :partial => 'form_file', :object => project_file, :locals => {:f => f, :i => i} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var get_html = function(old_id,new_id){
|
||||
return ("<%= escape_javascript(add_attribute 'form_file', f, :project_files) %>").replace(old_id, new_id);
|
||||
}
|
||||
</script>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class="list_item">
|
||||
<td>
|
||||
<div>
|
||||
<% if form_file.new_record? %>
|
||||
<%= f.file_field :file, class: "s_grid_2" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<%= f.text_field :title, :class => 's_grid_4' %>
|
||||
</td>
|
||||
<td>
|
||||
<%= f.fields_for :file_title_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
class: 's_grid_4',
|
||||
value: (form_file.file_title_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<span class="action">
|
||||
<% if form_file.new_record? %>
|
||||
<a class="delete"><i class="icon-remove"></i></a>
|
||||
<% else %>
|
||||
<%= f.hidden_field :id %>
|
||||
<a class="remove_existing_record"><i class="icon-remove"></i></a>
|
||||
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
|
||||
<% end %>
|
||||
<%= form_file.file.file ? ( link_to '', form_file.file.url, {:class => 'icon-eye-open', :target => '_blank', :title => t(:view)} ) : '' %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @project, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_project_desktop_personal_projects_path(@project) do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-check"></span></div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_selection_options">
|
||||
<li><a class="hp hh1 admtxt" href="all" ajax-remote="false" callback-method="allnone">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="none" ajax-remote="false" callback-method="allnone">None</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">More</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Delete</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Tag</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Tag</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Starred</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">MIT</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Status</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">All</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Published</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Pending</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">View</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul id="journal_view_selection">
|
||||
<li><%= link_to "Title", panel_personal_project_desktop_personal_projects_path + "?view=project_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Job", panel_personal_project_desktop_personal_projects_path + "?view=job_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "File", panel_personal_project_desktop_personal_projects_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
<li><%= link_to "Keywords", panel_personal_project_desktop_personal_projects_path + "?view=keywords", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1" id='ns'>New Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt remote_url" href="<%= panel_personal_project_desktop_personal_projects_path %>">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" page-name="journal_p_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
|
||||
<% @projects.each do |w| %>
|
||||
<%= publication_record w, @view_by%>
|
||||
<% end %>
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<%= form_for @project, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_project_desktop_personal_projects_path do |f| %>
|
||||
<%= render partial: 'form', locals: {:f => f} %>
|
||||
<%end%>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<%= stylesheet_link_tag "/assets/personal_project/desktop/personal_project" %>
|
||||
<%= javascript_include_tag "personal_project/desktop/personal_project" %>
|
||||
<div id="project">
|
||||
<div id="content">
|
||||
<div id="header" class="hh2">
|
||||
<div class="dtitle w2 hh2 hp">
|
||||
<span class="thmtxth">Projects</span>
|
||||
</div>
|
||||
<div id="search_app" class="hfn w2 hh1 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" content-type="menu">
|
||||
<ul id='setting_left_nav'>
|
||||
<li><a href="<%= panel_personal_project_desktop_personal_projects_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
|
||||
<li><a href="<%= new_panel_personal_project_desktop_personal_project_path %>" callback-method="addproject" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
|
||||
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags & Keywords</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Analysis</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Import</a></li>
|
||||
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Export</a></li> -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="panel_r" container="true" class="ph pw admbg hp">
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,4 +1,56 @@
|
||||
en:
|
||||
|
||||
module_name:
|
||||
personal_project: Project
|
||||
personal_project: "Project"
|
||||
personal_project:
|
||||
project_title : "Project Title"
|
||||
job_title : "Job Title"
|
||||
participator : "Participartor"
|
||||
project_category : "Project Category"
|
||||
end_date : "End Date"
|
||||
start_date : "Start Date"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
unit : "Unit"
|
||||
publishers : "Publishers"
|
||||
authors : "Authors"
|
||||
tags : "Tags"
|
||||
year : "Year"
|
||||
language : "Language"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "Vol.No"
|
||||
issue_no : "Issue.No"
|
||||
form_to_start : "From"
|
||||
form_to_end : "To"
|
||||
total_pages : "Total Pages"
|
||||
keywords : "Keywords"
|
||||
abstract : "Abstract"
|
||||
publication_date : "Date of Publication"
|
||||
url : "Reference URL"
|
||||
note : "Note"
|
||||
level_type : "Level Type"
|
||||
author_type : "Author Type"
|
||||
from : "From"
|
||||
to : "To"
|
||||
file : "File"
|
||||
file_name : "File name"
|
||||
description : "File Description"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
|
||||
create_success : "Successfully Create"
|
||||
update_success : "Successfully Update"
|
||||
delete_success : "Successfully Delete"
|
||||
add: "Add"
|
||||
back: "Back"
|
||||
delete: "Delete"
|
||||
edit: "Edit"
|
||||
nothing: "Nothing"
|
||||
show: "Show"
|
||||
sure?: "Are you sure?"
|
||||
update: "Update"
|
||||
yes_: "Yes"
|
||||
no_: "No"
|
||||
cancel : "Cancel"
|
||||
save: "save"
|
||||
hintText: "Type in a search term"
|
||||
noResultsText: "No results"
|
||||
searchingText: "Searching…"
|
||||
@@ -1,4 +1,56 @@
|
||||
zh_tw:
|
||||
|
||||
module_name:
|
||||
personal_project: 研究計畫
|
||||
personal_project: 期刊著作
|
||||
personal_project:
|
||||
project_title : "Project Title"
|
||||
job_title : "Job Title"
|
||||
participator : "Participartor"
|
||||
extracted_chapters : "Extracted Chapters"
|
||||
project_category : "Project Category"
|
||||
end_date : "End Date"
|
||||
start_date : "Start Date"
|
||||
unit : "Unit"
|
||||
publishers : "Publishers"
|
||||
authors : "作者"
|
||||
tags : "領域"
|
||||
year : "年度"
|
||||
language : "語言"
|
||||
isbn : "ISSN(ISBN)"
|
||||
vol_no : "卷數"
|
||||
issue_no : "期數"
|
||||
form_to_start : "起"
|
||||
form_to_end : "訖"
|
||||
total_pages : "總頁數"
|
||||
keywords : "關鍵字"
|
||||
abstract : "摘要"
|
||||
publication_date : "發表日期"
|
||||
url : "參考連結"
|
||||
note : "記事"
|
||||
level_type : "期刊類別"
|
||||
author_type : "作者類別"
|
||||
from : "起"
|
||||
to : "訖"
|
||||
file : "檔案"
|
||||
file_name : "檔案名稱"
|
||||
description : "描述"
|
||||
pages : "Pages"
|
||||
book_paper_type : "Book Paper Type"
|
||||
|
||||
create_success : "新增完成!!"
|
||||
update_success : "更新完成!!"
|
||||
delete_success : "刪除成功!!"
|
||||
add: "新增"
|
||||
back: "返回"
|
||||
delete: "刪除"
|
||||
edit: "編輯"
|
||||
nothing: "無"
|
||||
show: "顯示"
|
||||
sure?: "您肯定嗎?"
|
||||
update: "更新"
|
||||
yes_: "是"
|
||||
no_: "否"
|
||||
cancel : "取消"
|
||||
save: "儲存"
|
||||
hintText: "請輸入搜尋關鍵字"
|
||||
noResultsText: "沒有相關的比對結果"
|
||||
searchingText: "搜尋中…"
|
||||
@@ -2,6 +2,10 @@ Rails.application.routes.draw do
|
||||
|
||||
namespace :panel do
|
||||
namespace :personal_project do
|
||||
namespace :desktop do
|
||||
match "project_window" => "personal_projects#project_window"
|
||||
resources :personal_projects
|
||||
end
|
||||
namespace :back_end do
|
||||
|
||||
match 'project_setting' => "projects#project_setting" ,:as => :project_setting
|
||||
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
orbitDesktop.prototype.initializePersonalResearch = function(target,url,cache){ // this init journal papers
|
||||
this.initializePersonalResearch.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");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalResearch.list = function(){ // to open list part in journal papers page
|
||||
var journalData;
|
||||
var bindHandlers = function(){ // to bind handlers for list page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
|
||||
var bindSecondaryHandlers = function(){
|
||||
$("#journal_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.initializePersonalResearch.researchDelete = function(data,dom){
|
||||
var parent = dom.parent().parent();
|
||||
if(data.success){
|
||||
parent.hide("slide",function(){parent.remove();});
|
||||
o.notify(data.msg,"success");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializePersonalResearch.cancelresearch = function(){
|
||||
o.highlight_sub_menu_item(0);
|
||||
}
|
||||
|
||||
this.initializePersonalResearch.editresearch = function(){
|
||||
o.highlight_sub_menu_item(1);
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var preData = function(){
|
||||
$("#writing_journal_author_tokens").select2('data', JSON.parse($("#writing_journal_author_tokens").attr('data-pre')));
|
||||
}
|
||||
uploadFiles();
|
||||
// preData();
|
||||
}
|
||||
|
||||
this.initializePersonalResearch.addresearch = function(){ // to open add pages in journal papers page
|
||||
var uploadFiles = function(){
|
||||
$('#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;
|
||||
});
|
||||
$('.action a.remove_existing_record').click(function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
}
|
||||
|
||||
// console.log("hi");
|
||||
var bindHandlers = function(){
|
||||
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
uploadFiles();
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.initializePersonalResearch.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.initializePersonalResearch.coauthor = function(){ // to open add pages in coauthor page
|
||||
var bindHandlers = function(){ // to bind handlers for add page
|
||||
|
||||
}
|
||||
bindHandlers();
|
||||
}
|
||||
this.initializePersonalResearch.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.initializePersonalResearch.coauthorRelationEditForm = function(data){
|
||||
if(data.success){
|
||||
o.notify(data.msg,"success");
|
||||
var x = o.layout_data.generate_layout_html(data.newvalue);
|
||||
$("div[container=true] div.overview").html(x.markup);
|
||||
}else{
|
||||
o.notify(data.msg,"alert");
|
||||
}
|
||||
}
|
||||
this.initializePersonalResearch.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.initializePersonalResearch.allnone = function(d,o){
|
||||
switch(o.attr("href")){
|
||||
case "all":
|
||||
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
|
||||
break;
|
||||
case "none":
|
||||
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
/* Books */
|
||||
[page-name="books_list"] .list_t_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_list"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_list"] .list_item_action a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-star {
|
||||
color: #faa732;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check-empty {
|
||||
color: #999;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .list_item_action .icon-check {
|
||||
color: #333;
|
||||
font-size: 20px; }
|
||||
[page-name="books_list"] .file_view .list_t_des {
|
||||
overflow: hidden; }
|
||||
[page-name="books_list"] .file_view .file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
[page-name="books_list"] .file_view .file:hover {
|
||||
background-color: #f7f7f7; }
|
||||
[page-name="books_list"] .file_view .file img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px; }
|
||||
[page-name="books_list"] .file_view .file .filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
-webkit-box-sizing: border-box;
|
||||
/* webkit */
|
||||
-khtml-box-sizing: border-box;
|
||||
/* konqueror */
|
||||
-moz-box-sizing: border-box;
|
||||
/* firefox */
|
||||
-ms-box-sizing: border-box;
|
||||
/* ie */
|
||||
box-sizing: border-box;
|
||||
/* css3 */ }
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] .datalist_item .inner {
|
||||
padding-left: 30px; }
|
||||
[page-name="books_books"] .list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px; }
|
||||
[page-name="books_books"] .list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px; }
|
||||
[page-name="books_books"] .list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999; }
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] .list_t_item {
|
||||
height: 110px; }
|
||||
[page-name="books_coauthor"] .list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none; }
|
||||
[page-name="books_coauthor"] .info {
|
||||
font-family: Arial, sans-serif; }
|
||||
[page-name="books_coauthor"] .info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999; }
|
||||
[page-name="books_coauthor"] .info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333; }
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"] .edit_co_author_relation {
|
||||
/*margin-left: -10px;*/ }
|
||||
[page-name="books_coauthor_relation"] .form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif; }
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
@import "desktop-helper";
|
||||
|
||||
/* Books */
|
||||
[page-name="books_list"] {
|
||||
.list_t_item .inner { padding-left: 30px; }
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.icon-star-empty { color: #999; font-size: 20px; }
|
||||
.icon-star { color: #faa732; font-size: 20px; }
|
||||
.icon-check-empty { color: #999; font-size: 20px; }
|
||||
.icon-check { color: #333; font-size: 20px; }
|
||||
}
|
||||
|
||||
.file_view {
|
||||
.list_t_des {
|
||||
overflow: hidden;
|
||||
}
|
||||
.file {
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 6px;
|
||||
margin: 1px;
|
||||
position: relative;
|
||||
@include box-sizing;
|
||||
|
||||
&:hover {
|
||||
background-color: lighten($gray, 10%);
|
||||
}
|
||||
img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 6px;
|
||||
}
|
||||
.filetitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding-left: 40px;
|
||||
overflow: hidden;
|
||||
@include box-sizing;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Books list */
|
||||
[page-name="books_books"] {
|
||||
|
||||
.datalist_item .inner {
|
||||
padding-left: 30px;
|
||||
}
|
||||
.list_item_action {
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
}
|
||||
.list_item_action i {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px 1px 6px 1px;
|
||||
}
|
||||
.list_t_desc {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author */
|
||||
[page-name="books_coauthor"] {
|
||||
.list_t_item {
|
||||
height: 110px;
|
||||
}
|
||||
.list_item_function {}
|
||||
.list_item_function a {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
-webkit-text-size-adjust: none;
|
||||
}
|
||||
.info {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.info li {
|
||||
margin-bottom: 8px;
|
||||
color: #999;
|
||||
}
|
||||
.info .name {
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
/* Books Co-Author Relationship*/
|
||||
[page-name="books_coauthor_relation"]{
|
||||
.edit_co_author_relation {
|
||||
/*margin-left: -10px;*/
|
||||
}
|
||||
.form_space {
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
class Panel::PersonalResearch::Desktop::PersonalResearchsController < ApplicationController
|
||||
|
||||
def index
|
||||
@researches = Research.where(create_user_id: current_user.id)
|
||||
@view_by = params[:view]
|
||||
page = params[:page]
|
||||
page ||= 1
|
||||
|
||||
@per_column = 5
|
||||
|
||||
case @view_by
|
||||
when "abstract"
|
||||
@per_column = 1
|
||||
when "file"
|
||||
@per_column = 2
|
||||
end
|
||||
|
||||
if @view_by.nil?
|
||||
@view_by = " "
|
||||
@researches = @researches.asc(:paper_title)
|
||||
else
|
||||
@researches = @researches.asc(@view_by).asc(:paper_title)
|
||||
end
|
||||
@researches = @researches.page(page).per(50)
|
||||
respond_to do |format|
|
||||
format.html { render :layout => false}
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@research = Research.new
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def create
|
||||
params[:research][:create_user_id] = current_user.id
|
||||
@research = Research.new(params[:research])
|
||||
if @research.save
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @research.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@research = Research.find(params[:id])
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def update
|
||||
params[:research][:create_user_id] = current_user.id
|
||||
@research = Research.new(params[:research])
|
||||
if @research.update_attributes(params[:research])
|
||||
render json: {success: true, msg: t('create_success')}.to_json
|
||||
else
|
||||
error_msg = @research.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@research = Research.find(params[:id])
|
||||
@research.destroy
|
||||
render :json => {success: true, msg: t('delete_success')}
|
||||
end
|
||||
|
||||
def research_window
|
||||
render :layout => false
|
||||
end
|
||||
end
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
module Panel::PersonalResearch::Desktop::PersonalResearchsHelper
|
||||
def publication_record publication, view
|
||||
content_tag :li,
|
||||
"item" => "true",
|
||||
:class => "list_t_item" do
|
||||
marker + \
|
||||
content(publication, view) + \
|
||||
edit_or_delete(publication)
|
||||
end
|
||||
end
|
||||
|
||||
def marker
|
||||
content_tag :div,
|
||||
:class => "list_item_action" do
|
||||
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
|
||||
end
|
||||
|
||||
def content publication, view
|
||||
case view
|
||||
when "research_title"
|
||||
des = content_tag(:div, publication.research_title,
|
||||
:class => "list_t_des")
|
||||
when "keywords"
|
||||
des = content_tag(:div, publication.keywords,
|
||||
:class => "list_t_des")
|
||||
when "extracted_chapters"
|
||||
des = content_tag(:div, publication.extracted_chapters,
|
||||
:class => "list_t_des")
|
||||
when "file"
|
||||
des = content_tag(:div, link_publication_file(publication),
|
||||
:class => "list_t_des")
|
||||
else
|
||||
end
|
||||
|
||||
content_tag(:div, publication.research_title,
|
||||
:class => "list_t_title") + des
|
||||
|
||||
end
|
||||
|
||||
def edit_or_delete publication
|
||||
content_tag :div,
|
||||
:class => "list_item_function" do
|
||||
content_tag(:a, t("edit"),
|
||||
:class => "journal_paper_edit admbg2 admtxt",
|
||||
:href => edit_panel_personal_research_desktop_personal_research_path(publication),
|
||||
"callback-method" => "editresearch",
|
||||
"ajax-remote" => "get") + \
|
||||
content_tag(:a, t(:delete_),
|
||||
"ajax-remote" => "delete",
|
||||
"confirm-message" => t("sure?"),
|
||||
"callback-method" => "researchDelete",
|
||||
:class => "journal_paper_delete admbg2 admtxt",
|
||||
:href => panel_personal_research_desktop_personal_research_path(publication))
|
||||
end
|
||||
end
|
||||
|
||||
def link_publication_file publication
|
||||
publication.research_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, file.title, :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank")
|
||||
}.inject(:+)
|
||||
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 generate_authors_name ids
|
||||
author_name = ids.map{|m|
|
||||
if m == "0"
|
||||
#{:id => 0, :text => current_user.name, :email => current_user.email }
|
||||
{:id => 0, :text => current_user.name }
|
||||
else
|
||||
#{:id => m, :text => ConferenceCoAuthor.find(m).co_author, :email => ConferenceCoAuthor.find(m).email}
|
||||
{:id => m, :text => ConferenceCoAuthor.find(m).co_author}
|
||||
end
|
||||
}
|
||||
author_name.to_json
|
||||
end
|
||||
end
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
<div class="toolbar hh1">
|
||||
<div class="fn_g hp">
|
||||
|
||||
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
|
||||
<% if not @research.new_record? %>
|
||||
<%= submit_tag t("cancel"), :type => "button", "callback-method"=>"cancelresearch", "ajax-remote" => "get", :href => panel_personal_research_desktop_personal_researchs_path, class: "fn_btn ini_input hp hh1 admbg2 admtxt" %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1">Share</div>
|
||||
<div class="admbg sdm_o">
|
||||
<ul>
|
||||
<li><a class="hp hh1 admtxt" href="">Full</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Private</a></li>
|
||||
<li><a class="hp hh1 admtxt" href="">Group</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overview" content-layout="column" base-width="420">
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :research_title_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_research.research_title"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@research.research_title_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.fields_for :extracted_chapters_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
size: "20",
|
||||
placeholder: t("personal_research.extracted_chapters"),
|
||||
class: "s_grid_12 s_grid",
|
||||
value: (@research.extracted_chapters_translations[locale.to_s] rescue nil) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_research.publication_date"), class: "s_grid_4 s_grid") %>
|
||||
<%= f.date_select :publish_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %>
|
||||
<%= f.date_select :publish_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_research.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :keywords, size: "20x3", placeholder: t("personal_research.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.label :language, t("personal_research.language"), :class => "s_grid s_grid_4" %>
|
||||
<%= f.select :language, Research::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
|
||||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= f.text_area :note, size: "20x3", placeholder: t("personal_research.note"), class: "s_grid_12 s_grid s_grid_h_3"%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div column="true">
|
||||
<div class="s_form">
|
||||
<ul>
|
||||
<li class="s_grid_row">
|
||||
<table class="s_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="s_grid_2"><%= t("personal_research.file")%></th>
|
||||
<th class="s_grid_4"><%= t("personal_research.file_name")%></th>
|
||||
<th class="s_grid_4"><%= t("personal_research.description") %></th>
|
||||
<th class="s_grid_2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div id='add_plugin_file' class="info_input plugin_files_block s_action">
|
||||
<%= hidden_field_tag 'plugin_file_field_count', @research.research_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>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<% @research.research_files.each_with_index do |research_file, i| %>
|
||||
<%= f.fields_for :research_files, research_file do |f| %>
|
||||
<%= render :partial => 'form_file', :object => research_file, :locals => {:f => f, :i => i} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var get_html = function(old_id,new_id){
|
||||
return ("<%= escape_javascript(add_attribute 'form_file', f, :research_files) %>").replace(old_id, new_id);
|
||||
}
|
||||
</script>
|
||||
Loaded 100 of 121 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user