checked back and cancel button of personal plugin and fixed journal co author save and update bug

This commit is contained in:
Rueshyna 2013-03-05 12:14:10 +08:00
parent b5abbc9ef0
commit 430981a534
19 changed files with 173 additions and 128 deletions

View File

@ -1,58 +1,102 @@
orbitDesktop.prototype.initializeConference = function(target,url,cache){ orbitDesktop.prototype.initializeConferencePapers = function(target,url,cache){ // this init conference papers
this.initializeConferencePapers.formCallback = function(data){
this.initializeConference.list = function(){ if(data.success){
var bindHandlers = function(){ o.notify(data.msg,"success");
o.tinyscrollbar_ext({ o.sub_menu_item($("div[content-type=menu] a").eq(0));
main : ".tinycanvas", }else{
fill : ".list_t" o.notify(data.msg,"alert");
})
} }
bindHandlers();
} }
this.initializeConference.addconference = function(){ this.initializeConferencePapers.list = function(){ // to open list part in conference papers page
var bindHandlers = function(){ var conferenceData;
var bindHandlers = function(){ // to bind handlers for list page
o.simple_drop_down(); o.simple_drop_down();
o.tinyscrollbar_ext({
main: '.tinycanvas',
fill: '.s_grid_con'
})
} }
bindHandlers(); var bindSecondaryHandlers = function(){
$("#conference_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.initializeConference.conference = function(){ this.initializeConferencePapers.paperDelete = function(data,dom){
var bindHandlers = function(){ var parent = dom.parent().parent();
if(data.success){
parent.hide("slide",function(){parent.remove();});
o.notify(data.msg,"success");
}
}
this.initializeConferencePapers.addpaper = function(){ // to open add pages in conference papers page
var bindHandlers = function(){ // to bind handlers for add page
o.simple_drop_down(); o.simple_drop_down();
$('#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 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;
});
o.tinyscrollbar_ext({ $('.action a.remove_existing_record').click(function(){
main: '.tinycanvas', $(this).next('.should_destroy').attr('value', 1);
fill: '.s_grid_con' $("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
}) });
} }
bindHandlers(); bindHandlers();
} }
this.initializeConference.coauthor = function(){
var bindHandlers = function(){ this.initializeConferencePapers.conference = function(){ // to open add pages in conference papers page
var bindHandlers = function(){ // to bind handlers for add page
o.simple_drop_down(); o.simple_drop_down();
o.tinyscrollbar_ext({
main: '.tinycanvas',
fill: '.s_grid_con'
})
} }
bindHandlers(); bindHandlers();
} }
this.initializeConference.list();
this.initializeConferencePapers.coAuthorformCallback = 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.initializeConferencePapers.coauthor = function(){ // to open add pages in coauthor page
var bindHandlers = function(){ // to bind handlers for add page
o.simple_drop_down();
}
bindHandlers();
} }
this.initializeConferencePapers.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.initializeConferencePapers.coauthorRelationEditForm = function(data){
if(data.success){
o.notify(data.msg,"success");
$("#co_author_relation_table").html(data.newvalue);
}else{
o.notify(data.msg,"alert");
}
}
};

View File

@ -25,7 +25,7 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorRelationsController
if @conference_co_author_relation.save if @conference_co_author_relation.save
newv = render_to_string partial: "show_form", object: @conference_co_author_relations newv = render_to_string partial: "show_form", object: @conference_co_author_relations
render json: {success: true, msg: "New Relation successfully saved!", newvalue: newv}.to_json render json: {success: true, msg: t("create_success") , newvalue: newv}.to_json
else else
error_msg = @conference_co_author_relation.errors.full_messages.join("<br />") error_msg = @conference_co_author_relation.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json render json: {success: false, msg: error_msg}.to_json
@ -37,7 +37,7 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorRelationsController
if @conference_co_author_relation.update_attributes(params[:conference_co_author_relation]) if @conference_co_author_relation.update_attributes(params[:conference_co_author_relation])
@conference_co_author_relations = ConferenceCoAuthorRelation.all @conference_co_author_relations = ConferenceCoAuthorRelation.all
newv = render_to_string partial: "show_form", object: @conference_co_author_relations newv = render_to_string partial: "show_form", object: @conference_co_author_relations
render json: {success: true, msg: "New Relation successfully updated!", newvalue: newv}.to_json render json: {success: true, msg: t("update_success"), newvalue: newv}.to_json
else else
error_msg = @conference_co_author.errors.full_messages.join("<br />") error_msg = @conference_co_author.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json render json: {success: false, msg: error_msg}.to_json
@ -49,7 +49,7 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorRelationsController
@conference_co_author_relation.destroy @conference_co_author_relation.destroy
reset_co_author_relation reset_co_author_relation
render :json => {success: true, msg: "deleted successfully!"} render :json => {success: true, msg: t("delete_success")}
end end
private private

View File

@ -32,7 +32,7 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorsController < Applic
@conference_co_author.name_id= current_user.id @conference_co_author.name_id= current_user.id
if @conference_co_author.save if @conference_co_author.save
render json: {success:true, msg: t('create.sucess.co_author')}.to_json render json: {success:true, msg: t('create_success')}.to_json
else else
error_msg = @conference_co_author.errors.full_messages.join("<br />") error_msg = @conference_co_author.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json render json: {success: false, msg: error_msg}.to_json
@ -42,8 +42,8 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorsController < Applic
def update def update
@conference_co_author = ConferenceCoAuthor.find(params[:id]) @conference_co_author = ConferenceCoAuthor.find(params[:id])
if @conference_co_author.update_attributes(params[:co_author]) if @conference_co_author.update_attributes(params[:conference_co_author])
render json: {success:true, msg: t('update.sucess.co_author')}.to_json render json: {success:true, msg: t('update_success')}.to_json
else else
error_msg = @conference_co_author.errors.full_messages.join("<br />") error_msg = @conference_co_author.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json render json: {success: false, msg: error_msg}.to_json
@ -54,6 +54,6 @@ class Panel::PersonalConference::Desktop::ConferenceCoAuthorsController < Applic
@conference_co_author = ConferenceCoAuthor.find(params[:id]) @conference_co_author = ConferenceCoAuthor.find(params[:id])
@conference_co_author.destroy @conference_co_author.destroy
render :json => {success: true, msg: "Co-author deleted successfully!"} render :json => {success: true, msg: "delete_success"}
end end
end end

View File

@ -1,14 +1,14 @@
<div class="toolbar hh2"> <div class="toolbar hh2">
<div class="fn_g hp"> <div class="fn_g hp">
<div class="hh2 sdm"> <div class="hh2 sdm">
<div class="sdm_t hp hh2 thmc2 thmtxt">Create</div> <div class="sdm_t hp hh2 thmc2 thmtxt"><%=t("add") %></div>
<div class="admbg sdm_o"> <div class="admbg sdm_o">
<ul> <ul>
<li class="vp hp s_form" style="width:282px;"><%= render 'new' %></li> <li class="vp hp s_form" style="width:282px;"><%= render 'new' %></li>
</ul> </ul>
</div> </div>
</div> </div>
<%= submit_tag "Back", :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_co_authors_path, class: "bt-cancel fn_btn ini_input hp hh2 thmtxt" %> <%= submit_tag t("back"), :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_co_authors_path, class: "bt-cancel fn_btn ini_input hp hh2 thmtxt" %>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<div class="toolbar hh2"> <div class="toolbar hh2">
<div class="fn_g hp"> <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", class: "fn_btn ini_input hp hh2 thmc2 thmtxt" %>
<%= submit_tag "Cancel", :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_co_authors_path, class: "bt-cancel fn_btn ini_input hp hh2 thmtxt" %> <%= submit_tag t("back"), :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_co_authors_path, class: "fn_btn ini_input hp hh2 thmtxt" %>
</div> </div>
</div> </div>
<div id="new_co_author" class="s_grid_con s_form vp"> <div id="new_co_author" class="s_grid_con s_form vp">

View File

@ -7,7 +7,7 @@
<div id="co_author" class="tinycanvas vp"> <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="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport"> <div class="viewport">
<div class="overview" content-layout="datalist" per-column="4" base-width="300"> <div class="overview" content-layout="datalist" per-column="4" base-width="400">
<% @conference_co_authors.each_with_index do |co_author,i| %> <% @conference_co_authors.each_with_index do |co_author,i| %>
<div class="g_col"> <div class="g_col">
<ul> <ul>

View File

@ -1,6 +1,6 @@
<div class="toolbar hh2"> <div class="toolbar hh2">
<div class="fn_g hp"> <div class="fn_g hp">
<%= f.submit t("save"), name: "commit", value: "Save", class: "fn_btn ini_input hp hh2 thmc2 thmtxt" %> <%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh2 thmc2 thmtxt" %>
<% if not @writing_conference.new_record? %> <% if not @writing_conference.new_record? %>
<%= submit_tag t("cancel"), :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_pages_path, class: "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 %> <% end %>
@ -22,7 +22,14 @@
</div> </div>
</div> </div>
<div id="paper_add" class="tinycanvas vp"> <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="scrollbar sb_h vp">
<div class="track">
<div class="thumb thmc2">
<div class="end">
</div>
</div>
</div>
</div>
<div class="viewport"> <div class="viewport">
<div class="overview" content-layout="column" base-width="450"> <div class="overview" content-layout="column" base-width="450">
<div column="true"> <div column="true">
@ -93,7 +100,7 @@
<%= 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"%> <%= 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> </li>
</div> </ul>
</div> </div>
<div column="true"> <div column="true">
<div class="s_form"> <div class="s_form">
@ -186,7 +193,7 @@
</tbody> </tbody>
</table> </table>
</li> </li>
</div> </ul>
</div> </div>
<div column="true"> <div column="true">
<div class="s_form"> <div class="s_form">
@ -198,7 +205,8 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<%= stylesheet_link_tag "token-input-facebook" %> <%= stylesheet_link_tag "token-input-facebook" %>
<%= javascript_include_tag :defaults, "jquery.tokeninput" %> <%= javascript_include_tag :defaults, "jquery.tokeninput" %>

View File

@ -2,7 +2,7 @@
<div class="hh2 hp sdm"> <div class="hh2 hp sdm">
<div class="sdm_t hh2"><span class="icon-check"></span></div> <div class="sdm_t hh2"><span class="icon-check"></span></div>
<div class="admbg sdm_o"> <div class="admbg sdm_o">
<ul id="journal_selection_options"> <ul id="conference_selection_options">
<li><a class="hp hh2 admtxt" href="all">All</a></li> <li><a class="hp hh2 admtxt" href="all">All</a></li>
<li><a class="hp hh2 admtxt" href="none">None</a></li> <li><a class="hp hh2 admtxt" href="none">None</a></li>
</ul> </ul>

View File

@ -1,4 +1,4 @@
<%= form_for @writing_conference, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_conference_desktop_conference_pages_path do |f| %> <%= form_for @writing_conference, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_conference_desktop_conference_pages_path do |f| %>
<%= render partial: 'panel/personal_conference/desktop/conference_pages/form', locals: {:f => f} %> <%= render partial: 'form', locals: {:f => f} %>
<%end%> <%end%>

View File

@ -13,8 +13,8 @@
<div id="panel_l" class="ph"> <div id="panel_l" class="ph">
<div class="s_menu sm_v" content-type="menu"> <div class="s_menu sm_v" content-type="menu">
<ul id='setting_left_nav'> <ul id='setting_left_nav'>
<li><a href="<%= panel_personal_conference_desktop_conference_pages_path %>" load="true" callback-method="list" class="hh2 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li> <li><a href="<%= panel_personal_conference_desktop_conference_pages_path %>" load="true" callback-method="list" class="hh2 w2 hp thmc1 thmtxt xx" onclick='return false;'>List</a></li>
<li><a href="<%= new_panel_personal_conference_desktop_conference_page_path %>" callback-method="addconference" custom-load="add" class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li> <li><a href="<%= new_panel_personal_conference_desktop_conference_page_path %>" callback-method="addpaper" custom-load="add" class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= panel_personal_conference_desktop_conference_type_path %>" callback-method="conference" class="admtxt hh2 w2 hp" onclick='return false;'>Conference</a></li> <li><a href="<%= panel_personal_conference_desktop_conference_type_path %>" callback-method="conference" class="admtxt hh2 w2 hp" onclick='return false;'>Conference</a></li>
<li><a href="<%= panel_personal_conference_desktop_conference_co_authors_path %>" callback-method="coauthor" class="admtxt hh2 w2 hp" onclick='return false;'>Co-Authors</a></li> <li><a href="<%= panel_personal_conference_desktop_conference_co_authors_path %>" callback-method="coauthor" class="admtxt hh2 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li> <li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>

View File

@ -12,18 +12,6 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
var journalData; var journalData;
var bindHandlers = function(){ // to bind handlers for list page var bindHandlers = function(){ // to bind handlers for list page
o.simple_drop_down(); o.simple_drop_down();
// $("#journal_selection_options a").click(function(){
// switch($(this).attr("href")){
// case "all":
// $(".list_item_action > .icon-check-empty").switchClass("icon-check-empty","icon-check",0);
// break;
// case "none":
// $(".list_item_action > .icon-check").switchClass("icon-check","icon-check-empty",0);
// break;
// }
// return false;
// })
} }
var bindSecondaryHandlers = function(){ var bindSecondaryHandlers = function(){

View File

@ -25,7 +25,7 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorRelationsController < Appl
if @journal_co_author_relation.save if @journal_co_author_relation.save
newv = render_to_string partial: "show_form", object: @journal_co_author_relations newv = render_to_string partial: "show_form", object: @journal_co_author_relations
render json: {success: true, msg: "New Relation successfully saved!", newvalue: newv}.to_json render json: {success: true, msg: "create_success", newvalue: newv}.to_json
else else
error_msg = @journal_co_author_relation.errors.full_messages.join("<br />") error_msg = @journal_co_author_relation.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json render json: {success: false, msg: error_msg}.to_json
@ -37,7 +37,7 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorRelationsController < Appl
if @journal_co_author_relation.update_attributes(params[:journal_co_author_relation]) if @journal_co_author_relation.update_attributes(params[:journal_co_author_relation])
@journal_co_author_relations = JournalCoAuthorRelation.all @journal_co_author_relations = JournalCoAuthorRelation.all
newv = render_to_string partial: "show_form", object: @journal_co_author_relations newv = render_to_string partial: "show_form", object: @journal_co_author_relations
render json: {success: true, msg: "New Relation successfully updated!", newvalue: newv}.to_json render json: {success: true, msg: "update_success", newvalue: newv}.to_json
else else
error_msg = @journal_co_author.errors.full_messages.join("<br />") error_msg = @journal_co_author.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json render json: {success: false, msg: error_msg}.to_json
@ -49,7 +49,7 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorRelationsController < Appl
@journal_co_author_relation.destroy @journal_co_author_relation.destroy
reset_co_author_relation reset_co_author_relation
render :json => {success: true, msg: "deleted successfully!"} render :json => {success: true, msg: "delete_success"}
end end
private private

View File

@ -28,11 +28,11 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorsController < ApplicationC
end end
def create def create
@journal_co_author = JournalCoAuthor.new(params[:co_author]) @journal_co_author = JournalCoAuthor.new(params[:journal_co_author])
@journal_co_author.name_id= current_user.id @journal_co_author.name_id= current_user.id
if @journal_co_author.save if @journal_co_author.save
render json: {success:true, msg: t('create.sucess.co_author')}.to_json render json: {success:true, msg: t('create_success')}.to_json
else else
error_msg = @journal_co_author.errors.full_messages.join("<br />") error_msg = @journal_co_author.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json render json: {success: false, msg: error_msg}.to_json
@ -42,8 +42,8 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorsController < ApplicationC
def update def update
@journal_co_author = JournalCoAuthor.find(params[:id]) @journal_co_author = JournalCoAuthor.find(params[:id])
if @journal_co_author.update_attributes(params[:co_author]) if @journal_co_author.update_attributes(params[:journal_co_author])
render json: {success:true, msg: t('update.sucess.co_author')}.to_json render json: {success:true, msg: t('update_success')}.to_json
else else
error_msg = @journal_co_author.errors.full_messages.join("<br />") error_msg = @journal_co_author.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json render json: {success: false, msg: error_msg}.to_json
@ -54,6 +54,6 @@ class Panel::PersonalJournal::Desktop::JournalCoAuthorsController < ApplicationC
@journal_co_author = JournalCoAuthor.find(params[:id]) @journal_co_author = JournalCoAuthor.find(params[:id])
@journal_co_author.destroy @journal_co_author.destroy
render :json => {success: true, msg: "Co-author deleted successfully!"} render :json => {success: true, msg: "delete_success"}
end end
end end

View File

@ -5,7 +5,7 @@
value: (@journal_co_author_relation.co_author_relation_translations[locale] rescue nil) %> value: (@journal_co_author_relation.co_author_relation_translations[locale] rescue nil) %>
<#% end %> <#% end %>
--> -->
<%= f.submit "Save", class: "ini_input hp hh2 thmtxt thmc2", style: "margin-left: 10px;" %> <%= f.submit t("save"), class: "ini_input hp hh2 thmtxt thmc2", style: "margin-left: 10px;" %>
<% if not @journal_co_author_relation.new_record? %> <% if not @journal_co_author_relation.new_record? %>
<%= submit_tag "Cancel", :type => "button", class: "bt-cancel-type ini_input hp hh2 thmtxt" %> <%= submit_tag t("back"), :type => "button", class: "bt-cancel-type ini_input hp hh2 thmtxt" %>
<% end %> <% end %>

View File

@ -1,14 +1,14 @@
<div class="toolbar hh2"> <div class="toolbar hh2">
<div class="fn_g hp"> <div class="fn_g hp">
<div class="hh2 sdm"> <div class="hh2 sdm">
<div class="sdm_t hp hh2 thmc2 thmtxt">Create</div> <div class="sdm_t hp hh2 thmc2 thmtxt"><%= t("add") %></div>
<div class="admbg sdm_o"> <div class="admbg sdm_o">
<ul> <ul>
<li class="vp hp s_form" style="width:282px;"><%= render 'new' %></li> <li class="vp hp s_form" style="width:282px;"><%= render 'new' %></li>
</ul> </ul>
</div> </div>
</div> </div>
<%= submit_tag "Back", :type => "button", "ajax-remote" => "get", :href => panel_personal_journal_desktop_journal_co_authors_path, class: "fn_btn ini_input hp hh2 thmtxt" %> <%= submit_tag t("back"), :type => "button", "ajax-remote" => "get", :href => panel_personal_journal_desktop_journal_co_authors_path, class: "fn_btn ini_input hp hh2 thmtxt" %>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<div class="toolbar hh2"> <div class="toolbar hh2">
<div class="fn_g hp"> <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", class: "fn_btn ini_input hp hh2 thmc2 thmtxt" %>
<%= submit_tag "Cancel", :type => "button", "ajax-remote" => "get", :href => panel_personal_journal_desktop_journal_co_authors_path, class: "fn_btn ini_input hp hh2 thmtxt" %> <%= submit_tag t("back"), :type => "button", "ajax-remote" => "get", :href => panel_personal_journal_desktop_journal_co_authors_path, class: "fn_btn ini_input hp hh2 thmtxt" %>
</div> </div>
</div> </div>
<div id="new_co_author" class="s_grid_con s_form vp"> <div id="new_co_author" class="s_grid_con s_form vp">
@ -23,7 +23,7 @@
</li> </li>
<li class="s_grid_row"> <li class="s_grid_row">
<%= f.label :type, class: "s_grid s_grid_2"%> <%= f.label :type, class: "s_grid s_grid_2"%>
<select name="co_author[co_author_relations_id]" id="" class="s_grid s_grid_4"> <select name="journal_co_author[co_author_relations_id]" id="" class="s_grid s_grid_4">
<%= options_for_select( <%= options_for_select(
@journal_co_author_relations.map do |relation| @journal_co_author_relations.map do |relation|
[relation.relation, relation.id] [relation.relation, relation.id]

View File

@ -1,6 +1,6 @@
<div class="toolbar hh2"> <div class="toolbar hh2">
<div class="fn_g hp"> <div class="fn_g hp">
<%= f.submit t("save"), name: "commit", value: "Save", class: "fn_btn ini_input hp hh2 thmc2 thmtxt" %> <%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh2 thmc2 thmtxt" %>
<% if not @writing_journal.new_record? %> <% if not @writing_journal.new_record? %>
<%= submit_tag t("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 %> <% end %>
@ -22,7 +22,13 @@
</div> </div>
</div> </div>
<div id="paper_add" class="tinycanvas vp"> <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="scrollbar sb_h vp">
<div class="track">
<div class="thumb thmc2">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport"> <div class="viewport">
<div class="overview" content-layout="column" base-width="450"> <div class="overview" content-layout="column" base-width="450">
<div column="true"> <div column="true">
@ -91,19 +97,19 @@
<div class="s_form"> <div class="s_form">
<ul> <ul>
<li class="s_grid_row"> <li class="s_grid_row">
<%= f.label :author_tokens, t("personal_journal.authors") %><br /> <%= f.label :author_tokens, t("personal_journal.authors") %><br />
<%= f.text_area :author_tokens, <%= f.text_area :author_tokens,
class: "s_grid_6 s_grid", class: "s_grid_6 s_grid",
size: "20x2", size: "20x2",
placeholder: t("personal_journal.authors"), placeholder: t("personal_journal.authors"),
"data-pre" => generate_authors_name(@writing_journal.journal_co_author_ids) %> "data-pre" => generate_authors_name(@writing_journal.journal_co_author_ids) %>
<%#= f.fields_for :authors_translations do |f| %> <%#= f.fields_for :authors_translations do |f| %>
<%#= f.text_area locale, <%#= f.text_area locale,
class: "s_grid_6 s_grid", class: "s_grid_6 s_grid",
size: "20x2", size: "20x2",
placeholder: t("personal_journal.authors"), placeholder: t("personal_journal.authors"),
"autocomplete-list" => "coauthor_autocomplete_list", "autocomplete-list" => "coauthor_autocomplete_list",
value: (@writing_journal.authors_translations[locale.to_s] rescue nil) %> value: (@writing_journal.authors_translations[locale.to_s] rescue nil) %>
<%# end %> <%# end %>
<span class="icon-plus input_append"></span> <span class="icon-plus input_append"></span>
</li> </li>
@ -115,20 +121,18 @@
@author_types.map do |author_type| @author_types.map do |author_type|
[author_type.title, author_type.id] [author_type.title, author_type.id]
end end
) )%>
%> </select>
</select>
<select name="writing_journal[journal_paper_type_ids][]" id="" class="s_grid s_grid_2"> <select name="writing_journal[journal_paper_type_ids][]" id="" class="s_grid s_grid_2">
<%= options_for_select( <%= options_for_select(
[t("personal_journal.level_type")] + [t("personal_journal.level_type")] +
@paper_types.map do |paper_type| @paper_types.map do |paper_type|
[paper_type.title, paper_type.id] [paper_type.title, paper_type.id]
end end
) )%>
%> </select>
</select> </li>
</li>
<li class="s_grid_row"> <li class="s_grid_row">
<%= label_tag("", t("personal_journal.publication_date"), class: "s_grid_3 s_grid") %> <%= 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'} %> <%= 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'} %>
@ -147,12 +151,11 @@
<%= f.select :language, <%= f.select :language,
WritingJournal::LANGUAGE_TYPES, WritingJournal::LANGUAGE_TYPES,
class: "s_grid s_grid_4" %> class: "s_grid s_grid_4" %>
</select> </li>
</li>
<li class="s_grid_row"> <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> <input class="s_grid s_grid_6" type="text" placeholder=<%= t("personal_journal.tags") %>><span class="icon-plus input_append">
<span class="icon-plus input_append"></span> <span class="icon-plus input_append"></span>
</li> </li>
<li class="s_grid_row"> <li class="s_grid_row">
<select name="" id="" class="s_grid s_grid_3"> <select name="" id="" class="s_grid s_grid_3">
@ -165,9 +168,9 @@
<li class="s_grid_row"> <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"%> <%= 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> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div column="true"> <div column="true">
<div class="s_form"> <div class="s_form">
<ul> <ul>
@ -199,8 +202,9 @@
</tbody> </tbody>
</table> </table>
</li> </li>
</div> </ul>
</div> </div>
</div>
<div column="true"> <div column="true">
<div class="s_form"> <div class="s_form">
<ul> <ul>
@ -222,13 +226,14 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
orbitDesktop.prototype.initializeJournalPapers.journal_title_autocomplete_list = <%= @journal_candidate.to_json.html_safe %>; 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>
<script> <script>
var get_html = function(old_id,new_id){ var get_html = function(old_id,new_id){
return ("<%= escape_javascript(add_attribute 'form_file', f, :writing_journal_files) %>").replace(old_id, new_id); return ("<%= escape_javascript(add_attribute 'form_file', f, :writing_journal_files) %>").replace(old_id, new_id);
} }
</script> </script>

View File

@ -1,3 +1,3 @@
<%= form_for @writing_journal, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_journal_desktop_journal_pages_path do |f| %> <%= form_for @writing_journal, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_journal_desktop_journal_pages_path do |f| %>
<%= render partial: 'panel/personal_journal/desktop/journal_pages/form', locals: {:f => f} %> <%= render partial: 'form', locals: {:f => f} %>
<%end%> <%end%>

View File

@ -13,7 +13,7 @@
<div id="panel_l" class="ph"> <div id="panel_l" class="ph">
<div class="s_menu sm_v" content-type="menu"> <div class="s_menu sm_v" content-type="menu">
<ul id='setting_left_nav'> <ul id='setting_left_nav'>
<li><a href="<%= panel_personal_journal_desktop_journal_pages_path %>" callback-method="list" load="true" class="hh2 w2 hp thmc1 thmtxt xx" onclick='return false;'>List</a></li> <li><a href="<%= panel_personal_journal_desktop_journal_pages_path %>" load="true" callback-method="list" class="hh2 w2 hp thmc1 thmtxt xx" onclick='return false;'>List</a></li>
<li><a href="<%= new_panel_personal_journal_desktop_journal_page_path %>" callback-method="addpaper" custom-load="addpaper" class="admtxt hh2 w2 hp xx" onclick='return false;'>Add/Edit</a></li> <li><a href="<%= new_panel_personal_journal_desktop_journal_page_path %>" callback-method="addpaper" custom-load="addpaper" class="admtxt hh2 w2 hp xx" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= panel_personal_journal_desktop_journal_type_path %>" callback-method="journal" class="admtxt hh2 w2 hp" onclick='return false;'>Journals</a></li> <li><a href="<%= panel_personal_journal_desktop_journal_type_path %>" callback-method="journal" class="admtxt hh2 w2 hp" onclick='return false;'>Journals</a></li>
<li><a href="<%= panel_personal_journal_desktop_journal_co_authors_path %>" class="admtxt hh2 w2 hp" callback-method="coauthor" custom-load="coauthor" onclick='return false;'>Co-Authors</a></li> <li><a href="<%= panel_personal_journal_desktop_journal_co_authors_path %>" class="admtxt hh2 w2 hp" callback-method="coauthor" custom-load="coauthor" onclick='return false;'>Co-Authors</a></li>