using refine tiny scroll bar js for personal plugin

This commit is contained in:
Rueshyna 2013-03-04 16:35:09 +08:00
parent 8ade2c5949
commit a6ca308a5e
20 changed files with 511 additions and 422 deletions

View File

@ -141,6 +141,7 @@ GEM
jquery-rails
railties (>= 3.1.0)
json (1.7.7)
libv8 (3.11.8.13)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@ -224,6 +225,7 @@ GEM
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.0.3)
rb-readline (0.4.2)
rdoc (3.12.1)
json (~> 1.4)
redis (3.0.2)
@ -233,6 +235,7 @@ GEM
chinese_pinyin (>= 0.3.0)
redis (>= 2.1.1)
redis-namespace (>= 1.0.2)
ref (1.0.2)
resque (1.23.0)
multi_json (~> 1.0)
redis-namespace (~> 1.0)
@ -313,6 +316,9 @@ GEM
sunspot (= 1.3.3)
sunspot_solr (1.3.3)
terminal-table (1.4.5)
therubyracer (0.11.3)
libv8 (~> 3.11.8.12)
ref
thor (0.17.0)
tilt (1.3.3)
tinymce-rails (3.5.8)
@ -357,6 +363,7 @@ DEPENDENCIES
jquery-rails (= 2.1.4)
jquery-ui-rails
kaminari!
libv8 (~> 3.11.8)
mime-types
mini_magick
mongo_session_store-rails3 (= 3.0.6)
@ -373,6 +380,7 @@ DEPENDENCIES
radius
rails (~> 3.2.9)
rake
rb-readline
redis (>= 2.1.1)
redis-namespace
redis-search
@ -393,6 +401,7 @@ DEPENDENCIES
sunspot-rails-tester
sunspot_mongo
sunspot_solr
therubyracer
tinymce-rails
uglifier
watchr

View File

@ -24,6 +24,9 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio
@paper_types = ConferencePaperType.all
@author_types = ConferenceAuthorType.all
@conference_candidate =
WritingConference.where(create_user_id: current_user.id).map{|j|j.conference_title}.uniq
if (not params[:q].nil?) and (current_user.name.include?params[:q])
@user = [{ :id => 0, :name => current_user.name}] # self account name
else
@ -55,7 +58,7 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio
@writing_conference = WritingConference.new(params[:writing_conference])
if @writing_conference.save
render json: {success: true, msg: t('create.success.paper')}.to_json
render json: {success: true, msg: t('create_success')}.to_json
else
error_msg = @writing_conference.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
@ -67,7 +70,7 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio
@writing_conference= WritingConference.find(params[:id])
if @writing_conference.update_attributes(params[:writing_conference])
render json: {success: true, msg: t('update.success.paper')}.to_json
render json: {success: true, msg: t('update_success')}.to_json
else
error_msg = @writing_conference.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
@ -77,7 +80,7 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio
def destroy
@writing_conference = WritingConference.find(params[:id])
@writing_conference.destroy
render :json => {success: true, msg: t('delete.success.paper')}
render :json => {success: true, msg: t('delete_success')}
end
def conference_type

View File

@ -1,6 +1,7 @@
module Panel::PersonalConference::Desktop::ConferencePagesHelper
def publication_record publication, view
content_tag :li,
"item" => "true",
:class => "list_t_item" do
marker + \
content(publication, view) + \
@ -11,8 +12,14 @@ module Panel::PersonalConference::Desktop::ConferencePagesHelper
def marker
content_tag :div,
:class => "list_item_action"
content_tag(:a, "", :class => "icon-check-empty") + \
content_tag(:a, "", :class => "icon-star-empty")
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
def content publication, view

View File

@ -1,13 +1,11 @@
<ul>
<% @conference_co_author_relations.each_with_index do |conference_co_author_relation,i| %>
<li class="s_grid_row" item="true">
<div class="form_space" id="form_space_<%= i.to_s %>"><%= conference_co_author_relation.relation %></div>
<div class="list_item_function">
<%= link_to 'Edit', edit_panel_personal_conference_desktop_conference_co_author_relation_path(conference_co_author_relation), :class => "bt-edit-type admbg2 admtxt", "content-holder"=>"#form_space_"+i.to_s, "ajax-remote"=>"get" %>
<%= link_to 'Destroy', panel_personal_conference_desktop_conference_co_author_relation_path(conference_co_author_relation), "confirm-message"=>'Are you sure?', "ajax-remote"=>"delete", :class=>"bt-delete admbg2 admtxt" %>
</div>
</li>
<% end %>
</ul>
<ul>
<% @conference_co_author_relations.each_with_index do |conference_co_author_relation,i| %>
<li class="s_grid_row" item="true">
<div class="form_space" id="form_space_<%= i.to_s %>"><%= conference_co_author_relation.relation %></div>
<div class="list_item_function">
<%= link_to t('edit'), edit_panel_personal_conference_desktop_conference_co_author_relation_path(conference_co_author_relation), :class => "bt-edit-type admbg2 admtxt", "content-holder"=>"#form_space_"+i.to_s, "ajax-remote"=>"get" %>
<%= link_to t('delete'), panel_personal_conference_desktop_conference_co_author_relation_path(conference_co_author_relation), "confirm-message"=>t('sure?'), "ajax-remote"=>"delete", :class=>"bt-delete admbg2 admtxt" %>
</div>
</li>
<% end %>
</ul>

View File

@ -15,7 +15,7 @@
<div id="co_author_relation_table" class="tinycanvas vp">
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview" content-layout="datalist" per-column="4" base-width="300">
<div class="overview" content-layout="datalist" per-column="5" base-width="300">
<%= render :partial => 'show_form'%>
</div>
</div>

View File

@ -7,27 +7,23 @@
<div id="co_author" class="tinycanvas vp">
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
<div class="overview" content-layout="datalist" per-column="4" base-width="300">
<% @conference_co_authors.each_with_index do |co_author,i| %>
<% if ( i % 4 ) == 0 %>
<div class="g_col">
<ul>
<% end %>
<li class="list_t_item">
<li class="list_t_item" item="true">
<ul class="info">
<li><div class="name"><%= co_author.co_author %></div></li>
<li><div class="email"><i class="icon-envelope"></i> <%= co_author.email %></div></li>
<li><div class="relations"><i class="icon-user"></i> <%= @conference_co_author_relations.find(co_author.conference_co_author_relations_id).relation unless co_author.conference_co_author_relations_id.nil?%></div></li>
</ul>
<div class="list_item_function">
<%= link_to 'Edit', edit_panel_personal_conference_desktop_conference_co_author_path(co_author), :class => "bt-edit admbg2 admtxt", "ajax-remote"=>"get" %>
<%= link_to 'Destroy', panel_personal_conference_desktop_conference_co_author_path(co_author), "ajax-remote"=>"delete", "confirm-message"=>'Are you sure?', "callback-method"=>"paperDelete", :class=>"bt-delete admbg2 admtxt" %>
<%= link_to t('edit'), edit_panel_personal_conference_desktop_conference_co_author_path(co_author), :class => "bt-edit admbg2 admtxt", "ajax-remote"=>"get" %>
<%= link_to t('delete'), panel_personal_conference_desktop_conference_co_author_path(co_author), "ajax-remote"=>"delete", "confirm-message"=>t('sure?'), "callback-method"=>"paperDelete", :class=>"bt-delete admbg2 admtxt" %>
</div>
</li>
<% if ( i % 4 ) == 3 %>
</ul>
</div>
<% end %>
<% end %>
</div>
</div>

View File

@ -1,9 +1,8 @@
<div class="toolbar hh2">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", value: "Save", class: "fn_btn ini_input hp hh2 thmc2 thmtxt" %>
<!-- class: bt-cancle can't be remove -->
<% if not @writing_conference.new_record? %>
<%= submit_tag t("cancel"), :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_pages_path, class: "bt-cancel ini_input hp hh2 thmadm thmtxt" %>
<%= submit_tag t("cancel"), :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_pages_path, class: "ini_input hp hh2 thmadm thmtxt" %>
<% end %>
</div>
<div class="hh2 hp sdm">
@ -25,219 +24,220 @@
<div id="paper_add" class="tinycanvas vp">
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
<div class="s_grid_con s_form">
<ul>
<li class="s_grid_row">
<%= f.fields_for :paper_title_translations do |f| %>
<%= f.text_area locale,
class: "s_grid_6 s_grid",
size: "20x2",
placeholder: t("personal_conference.paper_title"),
value: (@writing_conference.paper_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<%= f.fields_for :conference_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_conference.conference_title"),
class: "s_grid_6 s_grid",
# "autocomplete-list" => "conference_title_autocomplete_list",
value: (@writing_conference.conference_title_translations[locale.to_s] rescue nil) %>
<% end %>
<span class="icon-plus input_append"></span>
</li>
<li class="s_grid_row">
<div>
<%= label_tag("", t("personal_conference.paper_type")) %>
<ul>
<% @paper_types.each_with_index do |paper_type, i| %>
<li class="s_grid_row">
<%= radio_button_tag "writing_conference[conference_paper_type_ids][]",
paper_type.id,
@writing_conference.conference_paper_type_ids.include?(paper_type.id),
id: "field-#{i}"
%><%= label_tag("field-#{i}", paper_type.title) %>
</li>
<% end %>
</ul>
</div>
</li>
<li class="s_grid_row">
<%= f.text_field :keywords, size: "20", placeholder: t("personal_conference.keywords"), class: "s_grid_6 s_grid"%>
</li>
<li class="s_grid_row">
<div>
<%= label_tag("", t("personal_conference.conference_time")) %>
<ul>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.period_start_date"), class: "s_grid_1 s_grid") %>
<%= f.date_select :period_start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.period_end_date"), class: "s_grid_1 s_grid") %>
<%= f.date_select :period_end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %>
</li>
</ul>
</div>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.sponsor"), class: "s_grid_2 s_grid") %><%= f.text_field :sponsor, size: "20", placeholder: "Sponsor", class: "s_grid_4 s_grid"%>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.location"), class: "s_grid_2 s_grid") %><%= f.text_field :location, size: "20", placeholder: "Location", class: "s_grid_4 s_grid"%>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.url"), class: "s_grid_2 s_grid") %><%= f.text_field :url, size: "20", placeholder: "www.sample.com", class: "s_grid_4 s_grid"%>
</li>
</div>
<div class="s_grid_con s_form">
<div class="overview" content-layout="column" base-width="450">
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.label :author_tokens, t("personal_conference.authors") %><br />
<%= f.text_area :author_tokens,
class: "s_grid_6 s_grid",
size: "20x2",
placeholder: t("personal_conference.authors"),
"data-pre" => generate_authors_name(@writing_conference.conference_co_author_ids) %>
<%#= f.fields_for :authors_translations do |f| %>
<%#= f.text_area locale,
<%= f.fields_for :paper_title_translations do |f| %>
<%= f.text_area locale,
class: "s_grid_6 s_grid",
size: "20x2",
placeholder: t("personal_conference.paper_title"),
value: (@writing_conference.paper_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<%= f.fields_for :conference_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_conference.conference_title"),
class: "s_grid_6 s_grid",
# "autocomplete-list" => "conference_title_autocomplete_list",
value: (@writing_conference.conference_title_translations[locale.to_s] rescue nil) %>
<% end %>
<span class="icon-plus input_append"></span>
</li>
<li class="s_grid_row">
<div>
<%= label_tag("", t("personal_conference.paper_type")) %>
<ul>
<% @paper_types.each_with_index do |paper_type, i| %>
<li class="s_grid_row">
<%= radio_button_tag "writing_conference[conference_paper_type_ids][]",
paper_type.id,
@writing_conference.conference_paper_type_ids.include?(paper_type.id),
id: "field-#{i}"
%><%= label_tag("field-#{i}", paper_type.title) %>
</li>
<% end %>
</ul>
</div>
</li>
<li class="s_grid_row">
<%= f.text_field :keywords, size: "20", placeholder: t("personal_conference.keywords"), class: "s_grid_6 s_grid"%>
</li>
<li class="s_grid_row">
<div>
<%= label_tag("", t("personal_conference.conference_time")) %>
<ul>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.period_start_date"), class: "s_grid_1 s_grid") %>
<%= f.date_select :period_start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.period_end_date"), class: "s_grid_1 s_grid") %>
<%= f.date_select :period_end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %>
</li>
</ul>
</div>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.sponsor"), class: "s_grid_2 s_grid") %><%= f.text_field :sponsor, size: "20", placeholder: "Sponsor", class: "s_grid_4 s_grid"%>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.location"), class: "s_grid_2 s_grid") %><%= f.text_field :location, size: "20", placeholder: "Location", class: "s_grid_4 s_grid"%>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.url"), class: "s_grid_2 s_grid") %><%= f.text_field :url, size: "20", placeholder: "www.sample.com", class: "s_grid_4 s_grid"%>
</li>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.label :author_tokens, t("personal_conference.authors") %><br />
<%= f.text_area :author_tokens,
class: "s_grid_6 s_grid",
size: "20x2",
placeholder: t("personal_conference.authors"),
# "autocomplete-list" => "coauthor_autocomplete_list",
"data-pre" => generate_authors_name(@writing_conference.conference_co_author_ids) %>
<%#= f.fields_for :authors_translations do |f| %>
<%#= f.text_area locale,
class: "s_grid_6 s_grid",
size: "20x2",
placeholder: t("personal_conference.authors"),
# "autocomplete-list" => "coauthor_autocomplete_list",
value: (@writing_conference.authors_translations[locale.to_s] rescue nil) %>
<%# end %>
<span class="icon-plus input_append"></span>
</li>
<%# end %>
<span class="icon-plus input_append"></span>
</li>
<li class="s_grid_row">
<select name="writing_conference[conference_author_type_ids][]" id="" class="s_grid s_grid_6">
<%= options_for_select(
[t("personal_conference.author_type")] +
@author_types.map do |author_type|
[author_type.title, author_type.id]
end
)
%>
</select>
</li>
<li class="s_grid_row">
<select name="" id="" class="s_grid s_grid_6">
<option value="">Status</option>
<option value="">Published</option>
<option value="">Pending</option>
<option value="">Writing</option>
</select>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.publication_date"), class: "s_grid_3 s_grid") %>
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %>
</li>
<li class="s_grid_row">
<%= f.label :year, t("personal_conference.year"), :class => "s_grid_2 s_grid" %>
<%= select_year((@writing_conference.year ? @writing_conference.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_conference[year]', :class => "s_grid_4 s_grid"} ) %>
</li>
<li class="s_grid_row"><input class="s_grid s_grid_6" type="text" placeholder=<%= t("personal_conference.tags") %>><span class="icon-plus input_append"></li>
<li class="s_grid_row">
<select name="writing_conference[conference_author_type_ids][]" id="" class="s_grid s_grid_6">
<%= options_for_select(
[t("personal_conference.author_type")] +
@author_types.map do |author_type|
[author_type.title, author_type.id]
end
)
%>
</select>
</li>
<li class="s_grid_row">
<select name="" id="" class="s_grid s_grid_6">
<option value="">Status</option>
<option value="">Published</option>
<option value="">Pending</option>
<option value="">Writing</option>
</select>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.publication_date"), class: "s_grid_3 s_grid") %>
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %>
</li>
<li class="s_grid_row">
<%= f.label :year, t("personal_conference.year"), :class => "s_grid_2 s_grid" %>
<%= select_year((@writing_conference.year ? @writing_conference.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_conference[year]', :class => "s_grid_4 s_grid"} ) %>
</li>
<li class="s_grid_row"><input class="s_grid s_grid_6" type="text" placeholder=<%= t("personal_conference.tags") %>><span class="icon-plus input_append"></li>
<li class="s_grid_row">
<%= f.text_area :abstract, size: "20x22", placeholder: t("personal_conference.abstract"), class: "s_grid_6 s_grid full_height"%>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="s_grid_con s_form">
<ul>
<li class="s_grid_row">
<table class="s_table">
<thead>
<tr>
<th class="s_grid_2"><%= t("personal_conference.file")%></th>
<th class="s_grid_3"><%= t("personal_conference.file_name")%></th>
<th class="s_grid_1"><%= t("personal_conference.description") %></th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="3">
<div id='add_plugin_file' class="info_input plugin_files_block s_action">
<%= hidden_field_tag 'plugin_file_field_count', @writing_conference.writing_conference_files.count %>
<a class="add setting_btn thmc1 thmtxt w1 hh2 hp" href=""><i class="icon-plus icon-white"></i> add</a>
</div>
</td>
</tr>
</tfoot>
<tbody>
<% @writing_conference.writing_conference_files.each_with_index do |writing_conference_file, i| %>
<%= f.fields_for :writing_conference_files, writing_conference_file do |f| %>
<%= render :partial => 'form_file', :object => writing_conference_file, :locals => {:f => f, :i => i} %>
<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_conference.file")%></th>
<th class="s_grid_3"><%= t("personal_conference.file_name")%></th>
<th class="s_grid_1"><%= t("personal_conference.description") %></th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="3">
<div id='add_plugin_file' class="info_input plugin_files_block s_action">
<%= hidden_field_tag 'plugin_file_field_count', @writing_conference.writing_conference_files.count %>
<a class="add setting_btn thmc1 thmtxt w1 hh2 hp" href=""><i class="icon-plus icon-white"></i> add</a>
</div>
</td>
</tr>
</tfoot>
<tbody>
<% @writing_conference.writing_conference_files.each_with_index do |writing_conference_file, i| %>
<%= f.fields_for :writing_conference_files, writing_conference_file do |f| %>
<%= render :partial => 'form_file', :object => writing_conference_file, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
<% end %>
</tbody>
</table>
</li>
</div>
<div class="s_grid_con s_form">
<li class="s_grid_row">
<ul>
<%= f.text_area :note, size: "20x22", placeholder: t("personal_conference.note"), class: "s_grid_6 s_grid full_height"%>
</ul>
</li>
</tbody>
</table>
</li>
</div>
</div>
<div column="true">
<div class="s_form">
<li class="s_grid_row">
<ul>
<%= f.text_area :note, size: "20x22", placeholder: t("personal_conference.note"), class: "s_grid_6 s_grid full_height"%>
</ul>
</li>
</div>
</div>
</div>
</div>
</div>
<%= stylesheet_link_tag "token-input-facebook" %>
<%= javascript_include_tag :defaults, "jquery.tokeninput" %>
<%= stylesheet_link_tag "token-input-facebook" %>
<%= javascript_include_tag :defaults, "jquery.tokeninput" %>
<script>
$(function() {
$("#writing_conference_author_tokens").tokenInput("/panel/personal_conference/desktop/conference_pages/new.json", {
crossDomain: false,
prePopulate: $("#writing_conference_author_tokens").data("pre"),
theme: "facebook",
hintText: "<%=t("hintText")%>",
noResultsText: "<%=t("noResultsText")%>",
searchingText: "<%=t("searchingText")%>"
});
});
</script>
<script>
$(function() {
$("#writing_conference_author_tokens").tokenInput("/panel/personal_conference/desktop/conference_pages/new.json", {
crossDomain: false,
prePopulate: $("#writing_conference_author_tokens").data("pre"),
theme: "facebook",
hintText: "<%=t("hintText")%>",
noResultsText: "<%=t("noResultsText")%>",
searchingText: "<%=t("searchingText")%>"
});
});
</script>
<script type="text/javascript">
orbitDesktop.prototype.initializeJournalPapers.conference_title_autocomplete_list = <%= @conference_candidate.to_json.html_safe %>;
orbitDesktop.prototype.initializeJournalPapers.coauthor_autocomplete_list = <%= @co_author_candidate.to_json.html_safe %>;
</script>
<script type="text/javascript">
orbitDesktop.prototype.initializeJournalPapers.conference_title_autocomplete_list = <%= @conference_candidate.to_json.html_safe %>;
// orbitDesktop.prototype.initializeJournalPapers.coauthor_autocomplete_list = <%= @co_author_candidate.to_json.html_safe %>;
</script>
<script>
$('#add_plugin_file a.add').click(function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_writing_conference_files", "g");
$(this).prev().attr('value', parseInt(new_id) + 1);
var newfield = $(("<%= escape_javascript(add_attribute 'form_file', f, :writing_conference_files) %>").replace(old_id, new_id));
$(this).parents('table').append(newfield);
newfield.find('.action a.delete').click(function(){
newfield.remove();
});
return false;
});
<script>
$('#add_plugin_file a.add').click(function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_writing_conference_files", "g");
$(this).prev().attr('value', parseInt(new_id) + 1);
var newfield = $(("<%= escape_javascript(add_attribute 'form_file', f, :writing_conference_files) %>").replace(old_id, new_id));
$(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();
});
$('.action a.remove_existing_record').click(function(){
$(this).next('.should_destroy').attr('value', 1);
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
});
</script>
</script>

View File

@ -16,13 +16,11 @@
<div id="conference_list" class="tinycanvas vp">
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
<div class="overview" content-layout="datalist" per-column="5" base-width="300">
<% @conference_lists.each_with_index do |conference_list,i| %>
<% if ( i % 5 ) == 0 %>
<div class="g_col">
<ul>
<% end %>
<li class="list_t_item">
<li class="list_t_item" item="true">
<div class="list_item_action">
<i class="icon-file"></i>
</div>
@ -30,10 +28,8 @@
<div class="list_t_title"><%= title %></div>
<div class="list_t_desc"><%= level.join(",") %></div>
</li>
<% if ( i % 5 ) == 4 %>
</ul>
</div>
<% end %>
<% end %>
</div>
</div>

View File

@ -28,11 +28,13 @@ en:
file_name : "File Name"
description : "File Description"
create_success : "Successfully Create"
update_success : "Successfully Update"
delete_success : "Successfully Delete"
add: "Add"
back: "Back"
delete: "Delete"
edit: "Edit"
no_: "No"
nothing: "Nothing"
show: "Show"
sure?: "Are you sure?"

View File

@ -28,11 +28,12 @@ zh_tw:
file_name : "檔案名稱"
description : "描述"
create_success : "新增完成!!"
update_success : "更新完成!!"
add: "新增"
back: "返回"
delete: "刪除"
edit: "編輯"
no_: "No"
nothing: "無"
show: "顯示"
sure?: "您肯定嗎?"

View File

@ -22,13 +22,24 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr
@level_types = JournalLevelType.all
@author_types = JournalAuthorType.all
@paper_types= JournalPaperType.all
@journal_co_author_candidate =
JournalCoAuthor.where(name_id: current_user.id).map{|c|c.co_author}
#@journal_co_author_candidate =
# JournalCoAuthor.where(name_id: current_user.id).map{|c|c.co_author}
@journal_candidate =
WritingJournal.where(create_user_id: current_user.id).map{|j|j.journal_title}.uniq
if (not params[:q].nil?) and (current_user.name.include?params[:q])
@user = [{ :id => 0, :name => current_user.name}] # self account name
else
@user = []
end
@co_authors = JournalCoAuthor.where(name_id: current_user.id, :co_author => /#{params[:q]}/)
@co_authors = [{ :id => params[:q], :name => params[:q] }] + # search string
@user + # self account name
@co_authors.map{|m| { :id => m.id, :name => m.co_author } } # match pattern
respond_to do |format|
format.html { render :layout => false}
format.json { render :json => @co_authors.to_json }
end
end
@ -48,7 +59,7 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr
@writing_journal = WritingJournal.new(params[:writing_journal])
if @writing_journal.save
render json: {success: true, msg: t('create.success.paper')}.to_json
render json: {success: true, msg: t('create_success')}.to_json
else
error_msg = @writing_journal.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
@ -60,31 +71,23 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr
@writing_journal= WritingJournal.find(params[:id])
if @writing_journal.update_attributes(params[:writing_journal])
render json: {success: true, msg: t('update.success.paper')}.to_json
render json: {success: true, msg: t('update_success')}.to_json
else
error_msg = @writing_journal.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
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 destroy
@writing_journal = WritingJournal.find(params[:id])
@writing_journal.destroy
render :json => {success: true, msg: t('delete.success.paper')}
render :json => {success: true, msg: t('delete_success')}
end
def journal_type
level_types = JournalLevelType.all
all_journal_lists = WritingJournal.where(create_user_id: current_user.id)
all_journal_lists = all_journal_lists.asc(:journal_title)
all_journal_lists = all_journal_lists.map do |j|
[ j.journal_title,
j.journal_level_type_ids.map do |type|

View File

@ -6,15 +6,20 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper
marker + \
content(publication, view) + \
edit_or_delete(publication)
end
end
def marker
content_tag :div,
:class => "list_item_action"
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")
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
def content publication, view
@ -73,4 +78,16 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper
file_type = ""
end
end
def generate_authors_name ids
author_name = ids.map{|m|
if m == "0"
{:id => 0, :name => current_user.name}
else
{:id => m, :name => ConferenceCoAuthor.find(m).co_author}
end
}
author_name.to_json
end
end

View File

@ -8,6 +8,7 @@ class JournalCoAuthor
field :email
belongs_to :journal_co_author_relations
has_and_belongs_to_many :writing_journals
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/
validates :email, format: { with: VALID_EMAIL_REGEX },

View File

@ -12,6 +12,7 @@ class WritingJournal
has_and_belongs_to_many :tags, :class_name => "PersonalJournalTag"
has_and_belongs_to_many :journal_author_types
has_and_belongs_to_many :journal_level_types
has_and_belongs_to_many :journal_co_authors
has_many :writing_journal_files, :autosave => true, :dependent => :destroy
belongs_to :journal_paper_type
@ -35,25 +36,44 @@ class WritingJournal
accepts_nested_attributes_for :writing_journal_files, :allow_destroy => true
after_save :save_writing_journal_files
before_validation :add_http
before_save :save_co_author
#before_save :save_co_author
validates :paper_title, :at_least_one => true
validates :url, :format => /^(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?/i, :unless => Proc.new{self.url.blank?}
def save_co_author
authors_list = authors.split(",").map{|n| n.strip.gsub(/\s+/," ")}.reject{|n| n.empty? }
if new_record?
current_user = create_user_id
else
current_user = update_user_id
end
attr_reader :author_tokens
authors_db = JournalCoAuthor.where(:name_id => current_user).map(&:co_author)
authors_list.delete(User.find(current_user).name)
authors_list = authors_list.delete_if{|author| authors_db.include?author}
authors_list.each do |author|
JournalCoAuthor.new(:co_author => author, :name_id => current_user).save
end
def author_tokens=(ids)
authors_ids = ids.split(",").map{|id|
begin
JournalCoAuthor.find(m).id
rescue
if id != "0"
new_co_author = JournalCoAuthor.new(:co_author => id, :name_id => create_user_id)
new_co_author.save
new_co_author.id
else
id
end
end
}
self.journal_co_author_ids = authors_ids
end
# old method
#def save_co_author
# authors_list = authors.split(",").map{|n| n.strip.gsub(/\s+/," ")}.reject{|n| n.empty? }
# if new_record?
# current_user = create_user_id
# else
# current_user = update_user_id
# end
# authors_db = JournalCoAuthor.where(:name_id => current_user).map(&:co_author)
# authors_list.delete(User.find(current_user).name)
# authors_list = authors_list.delete_if{|author| authors_db.include?author}
# authors_list.each do |author|
# JournalCoAuthor.new(:co_author => author, :name_id => current_user).save
# end
#end
def self.search( category_id = nil )
if category_id.to_s.size > 0

View File

@ -1,11 +1,11 @@
<ul>
<% @journal_co_author_relations.each_with_index do |journal_co_author_relation,i| %>
<li class="s_grid_row" item="true">
<div class="form_space" id="form_space_<%= i.to_s %>"><%= journal_co_author_relation.relation %></div>
<div class="list_item_function">
<%= link_to 'Edit', edit_panel_personal_journal_desktop_journal_co_author_relation_path(journal_co_author_relation), :class => "bt-edit-type admbg2 admtxt", "content-holder"=>"#form_space_"+i.to_s, "ajax-remote"=>"get" %>
<%= link_to 'Destroy', panel_personal_journal_desktop_journal_co_author_relation_path(journal_co_author_relation), "confirm-message"=>'Are you sure?', "ajax-remote"=>"delete", :class=>"bt-delete admbg2 admtxt" %>
</div>
</li>
<% end %>
<% @journal_co_author_relations.each_with_index do |journal_co_author_relation,i| %>
<li class="s_grid_row" item="true">
<div class="form_space" id="form_space_<%= i.to_s %>"><%= journal_co_author_relation.relation %></div>
<div class="list_item_function">
<%= link_to t('edit'), edit_panel_personal_journal_desktop_journal_co_author_relation_path(journal_co_author_relation), :class => "bt-edit-type admbg2 admtxt", "content-holder"=>"#form_space_"+i.to_s, "ajax-remote"=>"get" %>
<%= link_to t('delete'), panel_personal_journal_desktop_journal_co_author_relation_path(journal_co_author_relation), "confirm-message"=>t('sure?'), "ajax-remote"=>"delete", :class=>"bt-delete admbg2 admtxt" %>
</div>
</li>
<% end %>
</ul>

View File

@ -8,9 +8,9 @@
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview" content-layout="datalist" per-column="4" base-width="300">
<ul>
<ul>
<% @journal_co_authors.each_with_index do |co_author,i| %>
<li class="list_t_item" item="true">
<ul class="info">
<li><div class="name"><%= co_author.co_author %></div></li>
@ -18,11 +18,10 @@
<li><div class="relations"><i class="icon-user"></i> <%= @journal_co_author_relations.find(co_author.journal_co_author_relations_id).relation unless co_author.journal_co_author_relations_id.nil?%></div></li>
</ul>
<div class="list_item_function">
<%= link_to 'Edit', edit_panel_personal_journal_desktop_journal_co_author_path(co_author), :class => "bt-edit admbg2 admtxt", "ajax-remote"=>"get" %>
<%= link_to 'Destroy', panel_personal_journal_desktop_journal_co_author_path(co_author), "ajax-remote"=>"delete", "confirm-message"=>'Are you sure?', "callback-method"=>"paperDelete", :class=>"bt-delete admbg2 admtxt" %>
<%= link_to t('edit'), edit_panel_personal_journal_desktop_journal_co_author_path(co_author), :class => "bt-edit admbg2 admtxt", "ajax-remote"=>"get" %>
<%= link_to t('delete'), panel_personal_journal_desktop_journal_co_author_path(co_author), "ajax-remote"=>"delete", "confirm-message"=>t('sure?'), "callback-method"=>"paperDelete", :class=>"bt-delete admbg2 admtxt" %>
</div>
</li>
</li>
<% end %>
</ul>
</div>

View File

@ -1,8 +1,8 @@
<div class="toolbar hh2">
<div class="fn_g hp">
<%= f.submit "Save", name: "commit", value: "Save", class: "fn_btn ini_input hp hh2 thmc2 thmtxt" %>
<%= f.submit t("save"), name: "commit", value: "Save", class: "fn_btn ini_input hp hh2 thmc2 thmtxt" %>
<% if not @writing_journal.new_record? %>
<%= submit_tag "Cancel", :type => "button", "ajax-remote" => "get", :href => panel_personal_journal_desktop_journal_pages_path, class: "ini_input hp hh2 thmadm thmtxt" %>
<%= submit_tag t("cancel"), :type => "button", "ajax-remote" => "get", :href => panel_personal_journal_desktop_journal_pages_path, class: "ini_input hp hh2 thmadm thmtxt" %>
<% end %>
</div>
<div class="hh2 hp sdm">
@ -25,10 +25,10 @@
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview" content-layout="column" base-width="450">
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<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_6 s_grid",
@ -36,8 +36,8 @@
placeholder: t("personal_journal.paper_title"),
value: (@writing_journal.paper_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
</li>
<li class="s_grid_row">
<%= f.fields_for :journal_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
@ -47,122 +47,128 @@
value: (@writing_journal.journal_title_translations[locale.to_s] rescue nil) %>
<% end %>
<span class="icon-plus input_append"></span>
</li>
<li class="s_grid_row">
<div class="check_box_g">
<%= label_tag("", t("personal_journal.level_type")) %>
<ul>
<% @level_types.each_with_index do |level_type, i| %>
<li>
<%= check_box_tag "writing_journal[journal_level_type_ids][]",
level_type.id,
@writing_journal.journal_level_type_ids.include?(level_type.id),
id: "field-#{i}"
%><%= label_tag("field-#{i}", level_type.title) %>
</li>
<% end %>
</ul>
</div>
</li>
</li>
<li class="s_grid_row">
<div class="check_box_g">
<%= label_tag("", t("personal_journal.level_type")) %>
<ul>
<% @level_types.each_with_index do |level_type, i| %>
<li>
<%= check_box_tag "writing_journal[journal_level_type_ids][]",
level_type.id,
@writing_journal.journal_level_type_ids.include?(level_type.id),
id: "field-#{i}"
%><%= label_tag("field-#{i}", level_type.title) %>
</li>
<% end %>
</ul>
</div>
</li>
<li class="s_grid_row">
<li class="s_grid_row">
<%= label_tag("", t("personal_journal.isbn"), class: "s_grid_2 s_grid") %><%= f.text_field :isbn, size: "20", placeholder: "829872987", class: "s_grid_4 s_grid"%>
</li>
</li>
<li class="s_grid_row">
<li class="s_grid_row">
<%= label_tag("", t("personal_journal.vol_no"), class: "s_grid_2 s_grid") %><%= f.text_field :vol_no, size: "20", placeholder: "829872987", class: "s_grid_4 s_grid"%>
</li>
</li>
<li class="s_grid_row">
<li class="s_grid_row">
<%= label_tag("", t("personal_journal.issue_no"), class: "s_grid_2 s_grid") %><%= f.text_field :issue_no, size: "20", placeholder:"829872987", class: "s_grid_4 s_grid"%>
</li>
</li>
<li class="s_grid_row">
<li class="s_grid_row">
<%= label_tag("", t("personal_journal.total_pages"), class: "s_grid_2 s_grid") %><%= f.text_field :total_pages, size: "20", placeholder:"20", class: "s_grid_4 s_grid"%>
</li>
</li>
<li class="s_grid_row">
<li class="s_grid_row">
<%= label_tag("", t("personal_journal.total_pages"), class: "s_grid_2 s_grid") %><%= label_tag("", t("personal_journal.from"), class: "s_grid_1 s_grid") %><%= f.text_field :form_to_start, size: "10", placeholder: "1", class: "s_grid_1 s_grid"%><%= label_tag("", t("personal_journal.to"), class: "s_grid_1 s_grid") %><%= f.text_field :form_to_end, size: "10", placeholder: "20", class: "s_grid_1 s_grid"%>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.fields_for :authors_translations do |f| %>
<%= f.text_area locale,
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.label :author_tokens, t("personal_journal.authors") %><br />
<%= f.text_area :author_tokens,
class: "s_grid_6 s_grid",
size: "20x2",
placeholder: t("personal_journal.authors"),
"data-pre" => generate_authors_name(@writing_journal.journal_co_author_ids) %>
<%#= f.fields_for :authors_translations do |f| %>
<%#= f.text_area locale,
class: "s_grid_6 s_grid",
size: "20x2",
placeholder: t("personal_journal.authors"),
"autocomplete-list" => "coauthor_autocomplete_list",
value: (@writing_journal.authors_translations[locale.to_s] rescue nil) %>
<% end %>
<%# end %>
<span class="icon-plus input_append"></span>
</li>
<li class="s_grid_row">
</li>
<li class="s_grid_row">
<select name="writing_journal[journal_author_type_ids][]" id="" class="s_grid s_grid_4">
<%= options_for_select(
[t("personal_journal.author_type")] +
@author_types.map do |author_type|
[author_type.title, author_type.id]
end
)
%>
</select>
<select name="writing_journal[journal_author_type_ids][]" id="" class="s_grid s_grid_4">
<%= options_for_select(
[t("personal_journal.author_type")] +
@author_types.map do |author_type|
[author_type.title, author_type.id]
end
)
%>
</select>
<select name="writing_journal[journal_paper_type_ids][]" id="" class="s_grid s_grid_2">
<%= options_for_select(
[t("personal_journal.level_type")] +
@paper_types.map do |paper_type|
[paper_type.title, paper_type.id]
end
)
%>
</select>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_journal.publication_date"), class: "s_grid_3 s_grid") %>
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %>
</li>
<li class="s_grid_row">
<%= f.text_field :keywords, size: "20", placeholder: t("personal_journal.keywords"), class: "s_grid_6 s_grid"%>
</li>
<select name="writing_journal[journal_paper_type_ids][]" id="" class="s_grid s_grid_2">
<%= options_for_select(
[t("personal_journal.level_type")] +
@paper_types.map do |paper_type|
[paper_type.title, paper_type.id]
end
)
%>
</select>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_journal.publication_date"), class: "s_grid_3 s_grid") %>
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %>
</li>
<li class="s_grid_row">
<%= f.text_field :keywords, size: "20", placeholder: t("personal_journal.keywords"), class: "s_grid_6 s_grid"%>
</li>
<li class="s_grid_row">
<%= f.label :year, t("personal_journal.year"), :class => "s_grid_2 s_grid" %>
<%= select_year((@writing_journal.year ? @writing_journal.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_journal[year]', :class => "s_grid_4 s_grid"} ) %>
</li>
<li class="s_grid_row">
<%= f.label :year, t("personal_journal.year"), :class => "s_grid_2 s_grid" %>
<%= select_year((@writing_journal.year ? @writing_journal.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_journal[year]', :class => "s_grid_4 s_grid"} ) %>
</li>
<li class="s_grid_row">
<%= f.label :language, t("personal_journal.language"),:class => "s_grid_2 s_grid" %>
<%= f.select :language,
WritingJournal::LANGUAGE_TYPES,
class: "s_grid s_grid_4" %>
</select>
</li>
<li class="s_grid_row">
<%= f.label :language, t("personal_journal.language"),:class => "s_grid_2 s_grid" %>
<%= f.select :language,
WritingJournal::LANGUAGE_TYPES,
class: "s_grid s_grid_4" %>
</select>
</li>
<li class="s_grid_row">
<li class="s_grid_row"><input class="s_grid s_grid_6" type="text" placeholder=<%= t("personal_journal.tags") %>><span class="icon-plus input_append"></li>
<span class="icon-plus input_append"></span>
</li>
<li class="s_grid_row">
<select name="" id="" class="s_grid s_grid_3">
<option value="">Status</option>
<option value="">Published</option>
<option value="">Pending</option>
<option value="">Writing</option>
</select>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_journal.url"), class: "s_grid_2 s_grid") %><%= f.text_field :url, size: "20", placeholder: "www.sample.com", class: "s_grid_4 s_grid"%>
</li>
</ul>
</div>
<li class="s_grid_row">
<li class="s_grid_row"><input class="s_grid s_grid_6" type="text" placeholder=<%= t("personal_journal.tags") %>><span class="icon-plus input_append"></li>
<span class="icon-plus input_append"></span>
</li>
<li class="s_grid_row">
<select name="" id="" class="s_grid s_grid_3">
<option value="">Status</option>
<option value="">Published</option>
<option value="">Pending</option>
<option value="">Writing</option>
</select>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_journal.url"), class: "s_grid_2 s_grid") %><%= f.text_field :url, size: "20", placeholder: "www.sample.com", class: "s_grid_4 s_grid"%>
</li>
</ul>
</div>
</div>
<div column="true">
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
@ -193,39 +199,36 @@
</tbody>
</table>
</li>
</div>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.text_area :note, size: "20x22", placeholder: t("personal_journal.note"), class: "s_grid_6 s_grid full_height"%>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.text_area :abstract, size: "20x22", placeholder: t("personal_journal.abstract"), class: "s_grid_6 s_grid full_height"%>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
orbitDesktop.prototype.initializeJournalPapers.journal_title_autocomplete_list = <%= @journal_candidate.to_json.html_safe %>;
orbitDesktop.prototype.initializeJournalPapers.coauthor_autocomplete_list = <%= @co_author_candidate.to_json.html_safe %>;
// orbitDesktop.prototype.initializeJournalPapers.coauthor_autocomplete_list = <%= @co_author_candidate.to_json.html_safe %>;
</script>
<script>
var get_html = function(old_id,new_id){
return ("<%= escape_javascript(add_attribute 'form_file', f, :writing_journal_files) %>").replace(old_id, new_id)
}
</script>

View File

@ -17,24 +17,20 @@
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview" content-layout="datalist" base-width="300" per-column="5">
<% @journal_lists.each_with_index do |journal_list,i| %>
<% if ( i % 5 ) == 0 %>
<div class="g_col">
<ul>
<% end %>
<li class="list_t_item">
<div class="list_item_action">
<i class="icon-file"></i>
</div>
<% title, level = journal_list %>
<div class="list_t_title"><%= title %></div>
<div class="list_t_desc"><%= level.join(",") %></div>
</li>
<% if ( i % 5 ) == 4 %>
</ul>
<% @journal_lists.each_with_index do |journal_list,i| %>
<div class="g_col">
<ul>
<li class="list_t_item" item="true">
<div class="list_item_action">
<i class="icon-file"></i>
</div>
<% end %>
<% end %>
<% title, level = journal_list %>
<div class="list_t_title"><%= title %></div>
<div class="list_t_desc"><%= level.join(",") %></div>
</li>
</ul>
</div>
<% end %>
</div>
</div>
</div>

View File

@ -24,6 +24,25 @@ en:
file : "File"
file_name : "File name"
description : "File Description"
add : "Add"
edit : "Edit"
delete : "Destory"
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…"
error_msg:
time_series_illegal: "must be before end time"

View File

@ -26,6 +26,25 @@ zh_tw:
file : "檔案"
file_name : "檔案名稱"
description : "描述"
add : "新增"
edit : "編輯"
delete : "刪除"
create_success : "新增完成!!"
update_success : "更新完成!!"
delete_success : "刪除成功!!"
add: "新增"
back: "返回"
delete: "刪除"
edit: "編輯"
nothing: "無"
show: "顯示"
sure?: "您肯定嗎?"
update: "更新"
yes_: "是"
no_: "否"
cancel : "取消"
save: "儲存"
hintText: "請輸入搜尋關鍵字"
noResultsText: "沒有相關的比對結果"
searchingText: "搜尋中…"
error_msg:
time_series_illegal: "啟始時間必須早於結束時間"