bilingual fixed for all the plugins in desktop

This commit is contained in:
Harry Bomrah 2013-08-09 16:57:42 +08:00 committed by saurabhbhatia
parent 771ec0b8f6
commit 9c7558847a
20 changed files with 450 additions and 640 deletions

View File

@ -42,63 +42,42 @@ orbitDesktop.prototype.initializePersonalBook = function(target,url,cache){ // t
o.highlight_sub_menu_item(0);
}
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 languageSelect = function(){
$(".language_select a").click(function(event) {
$("li[data-language]").hide();
$("li[data-language="+$(this).data("lang")+"]").show();
return false;
});
}
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();
languageSelect();
}
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();
languageSelect();
}

View File

@ -8,14 +8,12 @@
<% end %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Share</div>
<div class="admbg sdm_o">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<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>
<% @site_valid_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>
@ -27,24 +25,46 @@
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %> >
<%= 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"),
placeholder: t("personal_book.paper_title")+ "("+I18nVariable.from_locale(locale)+")",
value: (@personal_book.paper_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %> >
<%= f.fields_for :book_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_book.book_title"),
placeholder: t("personal_book.book_title") + "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@personal_book.book_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %> >
<%= f.fields_for :extracted_chapters_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_book.extracted_chapters")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@personal_book.extracted_chapters_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %> >
<%= f.fields_for :publishers_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_book.publishers")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@personal_book.publishers_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<% end %>
<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"} %>
@ -59,24 +79,7 @@
<% 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",

View File

@ -42,60 +42,42 @@ orbitDesktop.prototype.initializeConferencePapers = function(target,url,cache){
o.highlight_sub_menu_item(0);
}
this.initializeConferencePapers.editpaper = 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_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;
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();
});
$('.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_conference_author_tokens").select2('data', JSON.parse($("#writing_conference_author_tokens").attr('data-pre')));
}
uploadFiles();
// preData();
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();
});
}
this.initializeConferencePapers.addpaper = function(){ // to open add pages in conference 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_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();
});
var languageSelect = function(){
$(".language_select a").click(function(event) {
$("li[data-language]").hide();
$("li[data-language="+$(this).data("lang")+"]").show();
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 bindHandlers = function(){
}
bindHandlers();
this.initializeConferencePapers.editpaper = function(){
o.highlight_sub_menu_item(1);
uploadFiles();
languageSelect();
}
this.initializeConferencePapers.addpaper = function(){ // to open add pages in journal papers page
uploadFiles();
languageSelect();
}
this.initializeConferencePapers.conference = function(){ // to open add pages in conference papers page

View File

@ -6,15 +6,13 @@
<%= submit_tag t("cancel"), :type => "button", "callback-method"=>"cancelpaper", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_pages_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">
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<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>
<% @site_valid_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>
@ -35,25 +33,28 @@
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :paper_title_translations do |f| %>
<%= f.text_area locale,
class: "s_grid_12 s_grid_h_2 s_grid",
size: "20x2",
placeholder: t("personal_conference.paper_title"),
placeholder: t("personal_conference.paper_title")+ "("+I18nVariable.from_locale(locale)+")",
value: (@writing_conference.paper_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :conference_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_conference.conference_title"),
placeholder: t("personal_conference.conference_title")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@writing_conference.conference_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<% end %>
<li class="s_grid_row">
<div>
<%= label_tag("", t("personal_conference.paper_type"), class: 's_grid s_grid_4') %>

View File

@ -42,63 +42,42 @@ orbitDesktop.prototype.initializePersonalDiploma = function(target,url,cache){ /
o.highlight_sub_menu_item(0);
}
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 languageSelect = function(){
$(".language_select a").click(function(event) {
$("li[data-language]").hide();
$("li[data-language="+$(this).data("lang")+"]").show();
return false;
});
}
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();
languageSelect();
}
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();
languageSelect();
}

View File

@ -7,15 +7,13 @@
<% end %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Share</div>
<div class="admbg sdm_o">
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<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>
<% @site_valid_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>
@ -37,42 +35,46 @@
<%= 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">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :school_name_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_diploma.school_name"),
placeholder: t("personal_diploma.school_name")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@diploma.school_name_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :country_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_diploma.country"),
placeholder: t("personal_diploma.country")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@diploma.country_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :department_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_diploma.department"),
placeholder: t("personal_diploma.department")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@diploma.department_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :degree_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_diploma.degree"),
placeholder: t("personal_diploma.degree")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@diploma.degree_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<% end %>
<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>

View File

@ -42,63 +42,42 @@ orbitDesktop.prototype.initializePersonalExperience = function(target,url,cache)
o.highlight_sub_menu_item(0);
}
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 languageSelect = function(){
$(".language_select a").click(function(event) {
$("li[data-language]").hide();
$("li[data-language="+$(this).data("lang")+"]").show();
return false;
});
}
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();
languageSelect();
}
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();
languageSelect();
}

View File

@ -7,15 +7,13 @@
<% end %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Share</div>
<div class="admbg sdm_o">
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<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>
<% @site_valid_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>
@ -27,33 +25,37 @@
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :organizationt_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_experience.organizationt_title"),
placeholder: t("personal_experience.organizationt_title")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@experience.organizationt_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :department_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_experience.department"),
placeholder: t("personal_experience.department")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@experience.department_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :job_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_experience.job_title"),
placeholder: t("personal_experience.job_title")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@experience.job_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<% end %>
<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"} %>

View File

@ -42,63 +42,42 @@ orbitDesktop.prototype.initializePersonalHonor = function(target,url,cache){ //
o.highlight_sub_menu_item(0);
}
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 languageSelect = function(){
$(".language_select a").click(function(event) {
$("li[data-language]").hide();
$("li[data-language="+$(this).data("lang")+"]").show();
return false;
});
}
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();
languageSelect();
}
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();
languageSelect();
}

View File

@ -8,14 +8,12 @@
<% end %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Share</div>
<div class="admbg sdm_o">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<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>
<% @site_valid_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>

View File

@ -42,63 +42,42 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
o.highlight_sub_menu_item(0);
}
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 languageSelect = function(){
$(".language_select a").click(function(event) {
$("li[data-language]").hide();
$("li[data-language="+$(this).data("lang")+"]").show();
return false;
});
}
this.initializeJournalPapers.editpaper = 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();
languageSelect();
}
this.initializeJournalPapers.addpaper = 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();
languageSelect();
}
this.initializeJournalPapers.journal = function(){ // to open add pages in journal papers page

View File

@ -8,14 +8,12 @@
<% end %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Share</div>
<div class="admbg sdm_o">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<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>
<% @site_valid_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>
@ -36,25 +34,29 @@
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= 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_journal.paper_title"),
placeholder: t("personal_journal.paper_title")+ "("+I18nVariable.from_locale(locale)+")",
value: (@writing_journal.paper_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :journal_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_journal.journal_title"),
placeholder: t("personal_journal.journal_title")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@writing_journal.journal_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<% end %>
<li class="s_grid_row">
<%= label_tag("", t("personal_journal.level_type"), :class => 's_grid s_grid_4') %>
<div class="s_select_g s_grid s_grid_8 s_grid_h_2">

View File

@ -42,63 +42,44 @@ orbitDesktop.prototype.initializePersonalLab = function(target,url,cache){ // th
o.highlight_sub_menu_item(0);
}
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 languageSelect = function(){
$(".language_select a").click(function(event) {
$("li[data-language]").hide();
$("li[data-language="+$(this).data("lang")+"]").show();
return false;
});
}
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();
languageSelect();
}
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();
languageSelect();
}

View File

@ -8,14 +8,12 @@
<% end %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Share</div>
<div class="admbg sdm_o">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<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>
<% @site_valid_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>
@ -27,42 +25,46 @@
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :lab_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_lab.lab_title"),
placeholder: t("personal_lab.lab_title")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@lab.lab_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :location_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_lab.location"),
placeholder: t("personal_lab.location")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@lab.location_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :participating_professor_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_lab.participating_professor"),
placeholder: t("personal_lab.participating_professor")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@lab.participating_professor_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :participating_student_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_lab.participating_student"),
placeholder: t("personal_lab.participating_student")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@lab.participating_student_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<% end %>
<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>

View File

@ -42,66 +42,44 @@ orbitDesktop.prototype.initializePersonalPatent = function(target,url,cache){ //
o.highlight_sub_menu_item(0);
}
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 languageSelect = function(){
$(".language_select a").click(function(event) {
$("li[data-language]").hide();
$("li[data-language="+$(this).data("lang")+"]").show();
return false;
});
}
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();
languageSelect();
}
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();
languageSelect();
}
this.initializePersonalPatent.coAuthorformCallback = function(data){
if(data.success){
o.notify(data.msg,"success");

View File

@ -8,14 +8,12 @@
<% end %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Share</div>
<div class="admbg sdm_o">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<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>
<% @site_valid_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>
@ -27,15 +25,19 @@
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :patent_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_patent.patent_title"),
placeholder: t("personal_patent.patent_title")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@patent.patent_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<% end %>
<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>

View File

@ -42,63 +42,42 @@ orbitDesktop.prototype.initializePersonalProject = function(target,url,cache){ /
o.highlight_sub_menu_item(0);
}
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 languageSelect = function(){
$(".language_select a").click(function(event) {
$("li[data-language]").hide();
$("li[data-language="+$(this).data("lang")+"]").show();
return false;
});
}
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();
languageSelect();
}
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();
languageSelect();
}

View File

@ -8,14 +8,12 @@
<% end %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Share</div>
<div class="admbg sdm_o">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<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>
<% @site_valid_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>
@ -27,42 +25,46 @@
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :project_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_project.project_title"),
placeholder: t("personal_project.project_title")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@project.project_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :job_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_project.job_title"),
placeholder: t("personal_project.job_title")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@project.job_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :participator_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_project.participator"),
placeholder: t("personal_project.participator")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@project.participator_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :unit_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_project.unit"),
placeholder: t("personal_project.unit")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@project.unit_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<% end %>
<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'} %>

View File

@ -42,63 +42,42 @@ orbitDesktop.prototype.initializePersonalResearch = function(target,url,cache){
o.highlight_sub_menu_item(0);
}
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 languageSelect = function(){
$(".language_select a").click(function(event) {
$("li[data-language]").hide();
$("li[data-language="+$(this).data("lang")+"]").show();
return false;
});
}
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();
languageSelect();
}
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();
languageSelect();
}

View File

@ -7,15 +7,13 @@
<% end %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Share</div>
<div class="admbg sdm_o">
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<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>
<% @site_valid_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>
@ -27,24 +25,28 @@
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :research_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_research.research_title"),
placeholder: t("personal_research.research_title")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@research.research_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :extracted_chapters_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_research.extracted_chapters"),
placeholder: t("personal_research.extracted_chapters")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@research.extracted_chapters_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<% end %>
<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'} %>