brief added to desktop for all plugins

This commit is contained in:
Harry Bomrah 2013-09-25 18:11:02 +08:00 committed by saurabhbhatia
parent 42dcf0a2d2
commit 6ac600fb5c
75 changed files with 1055 additions and 25 deletions

View File

@ -0,0 +1,10 @@
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
(function(a){CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;"undefined"!=typeof a&&(a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},ckeditor:function(g,d){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g))var k=d,d=g,g=k;var i=[],d=d||{};this.each(function(){var b=
a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,j=new a.Deferred;i.push(j.promise());if(c&&!f)g&&g.apply(c,[this]),j.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),j.resolve()):setTimeout(arguments.callee,100)},0)},null,null,9999);else{if(d.autoUpdateElement||"undefined"==typeof d.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)d.autoUpdateElementJquery=!0;d.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",
!0);c=a(this).is("textarea")?CKEDITOR.replace(h,d):CKEDITOR.inline(h,d);b.data("ckeditorInstance",c);c.on("instanceReady",function(d){var e=d.editor;setTimeout(function(){if(e.element){d.removeListener();e.on("dataReady",function(){b.trigger("dataReady.ckeditor",[e])});e.on("setData",function(a){b.trigger("setData.ckeditor",[e,a.data])});e.on("getData",function(a){b.trigger("getData.ckeditor",[e,a.data])},999);e.on("destroy",function(){b.trigger("destroy.ckeditor",[e])});e.on("save",function(){a(h.form).submit();
return!1},null,null,20);if(e.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){e.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",c)})}e.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[e]);g&&g.apply(e,[h]);j.resolve()}else setTimeout(arguments.callee,
100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,i).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}}),CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(d){if(arguments.length){var k=this,i=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(d,function(){f.resolve()});i.push(f.promise());
return!0}return g.call(b,d)});if(i.length){var b=new a.Deferred;a.when.apply(this,i).done(function(){b.resolveWith(k)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}})))})(window.jQuery);

View File

@ -19,3 +19,6 @@
//= require select2
//= require jquery.isotope.min.js
//= require orbit_js_1.0.1-front-end
//= require ckeditor/init
//= require ckeditor/jquery-ckeditor

View File

@ -20,6 +20,7 @@
//for forms
//form-type = "ajax_form" will turn form to ajax submit
//notification = string will display after the form is succesfully submitted
//response-type = "json"|"script"|"xml|html" default is json
//for layout tinyscrollbar
//content-layout="datalist|column|simple" datalist is for data list from database.. column is usually for forms and some other pages.. simple is without any columns, the page will be displayed as it is.. base width will be considered the default width for tinyscrollbar
@ -247,16 +248,12 @@ var orbitDesktop = function(dom){
$("body").on("submit","form[form-type=ajax_form]",function(){
var callback_method = $(this).attr("callback-method"),
dt = null,
dt = ($(this).attr("response-type") == null ? "json" : $(this).attr("response-type")),
notification = $(this).attr("notification");
dt = $(this).attr("response-type");
if(dt == null){
dt = "json";
}
var options = {
dataType : dt,
resetForm : true,
success:function(responseText, statusText, xhr, $form){
resetForm : false,
success: function(responseText, statusText, xhr, $form){
if(typeof callback_method != "undefined"){
if(callback_method != ""){
window.o[o.data_method][callback_method](responseText,statusText,xhr,$form);
@ -265,7 +262,7 @@ var orbitDesktop = function(dom){
if(typeof notification == "string")
o.notify(notification,"success");
},
error:function(){
error: function(){
o.notify("Please try again later!","imp");
}
}
@ -451,7 +448,7 @@ var orbitDesktop = function(dom){
var ist = function(){
$('#holder').css('height', $('#container').height() - 72);
$('.tinycanvas').css('height', $('#panel_r').height() - 36);
$('.tinycanvas').css('height', $('#holder').height() - 36);
var dom = $("*[isotope=true]").isotope({
layoutMode: 'fitColumns',
onLayout: function($elems, instance){
@ -698,6 +695,15 @@ var orbitDesktop = function(dom){
}
})
o.highlight_sub_menu_item(dom);
} else {
o.lastlink = dom.attr("href");
$.ajax({
url : dom.attr("href"),
type : "get",
success : function(data){
o.layout_data(data);
}
})
}
if(dom.length == 0)
o.layout_data(data);
@ -1868,6 +1874,13 @@ var orbitDesktop = function(dom){
}
}
}
this.enablelanguageSelect = function(){
$(".language_select a").click(function(event) {
$("*[data-language]").hide();
$("*[data-language="+$(this).data("lang")+"]").show();
return false;
});
}
this.minimizeBarManager = function(){
var minimizedApps = [],
minimizeBar = $("#minimizebar");

View File

@ -10,6 +10,7 @@ class DesktopController< ApplicationController
def index
@desktop = current_user.desktop
@currentusername = current_user.name
@currentname = current_user.first_name + current_user.last_name
@title = "Desktop - " + @currentusername
@section = @desktop.sections.first
end

View File

@ -100,6 +100,6 @@
o.notify("We turn off the animation (javascript) for you, but still you can turn it on",10);
}
}
o.notify("Welcome "+o.currentUsername+"!!","alert",3);
o.notify("Welcome <%= @currentname %>!!","alert",3);
</script>

View File

@ -84,7 +84,13 @@ orbitDesktop.prototype.initializePersonalBook = function(target,url,cache){ // t
uploadFiles();
languageSelect();
}
this.initializePersonalBook.brief = function(){
o.enablelanguageSelect();
$("textarea.editor").ckeditor({
height: 300,
width: $(".overview").width() - 20
});
}
this.initializePersonalBook.coAuthorformCallback = function(data){
if(data.success){

View File

@ -0,0 +1,32 @@
class Panel::PersonalBook::Desktop::PluginIntrosController < ApplicationController
def index
@intro = PersonalBookIntro.where(:user_id => current_user.id.to_s).first
if @intro.blank?
@intro = PersonalBookIntro.new
render "new", :layout => false
else
render "edit", :layout => false
end
end
def create
@intro = PersonalBookIntro.new(params[:personal_book_intro])
@intro.user_id = current_user.id
if @intro.save
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
def update
@intro = PersonalBookIntro.find(params[:id])
if @intro.update_attributes(params[:personal_book_intro])
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
end

View File

@ -17,6 +17,7 @@
<ul id='setting_left_nav'>
<li><a href="<%= panel_personal_book_desktop_personal_books_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
<li><a href="<%= new_panel_personal_book_desktop_personal_book_path %>" callback-method="addbook" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= panel_personal_book_desktop_plugin_intros_path %>" class="admtxt hh1 w2 hp" callback-method="brief" onclick='return false;'>Brief Info</a></li>
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>

View File

@ -0,0 +1,54 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<ul>
<% @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>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="simple">
<ul class="s_form">
<li class="s_grid_row">
<%= label_tag("", "Frontend Page", :class => 's_grid s_grid_4') %>
<div class="s_select_g s_grid s_grid_8 s_grid_h_2">
<ul>
<li>
<%= f.check_box :brief_intro,
id: "field-0" %>
<label for="field-0"> Brief Intro </label>
</li>
<li>
<%= f.check_box :complete_list,
id: "field-1" %>
<label for="field-1"> Complete List </label>
</li>
</ul>
</div>
</li>
<% @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 %>>
<%= label_tag("", I18nVariable.from_locale(locale), :class => 's_grid s_grid_4') %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :text_translations do |f| %>
<%= f.text_area locale, :class=>"editor", rows: 5, :value => (@intro.text_translations[locale] rescue nil) %>
<% end %>
</li>
<% end %>
</ul>
</div>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form","notification"=>"Brief Intro Updated"}, url: panel_personal_book_desktop_plugin_intro_path(@intro) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form", "notification"=>"Brief Intro Saved"}, url: panel_personal_book_desktop_plugin_intros_path do |f| %>
<%= render partial: 'form', locals: {f: f} %>
<% end %>

View File

@ -5,6 +5,7 @@ Rails.application.routes.draw do
namespace :desktop do
match 'books_window' => "personal_books#books_window"
resources :personal_books
resources :plugin_intros
end
namespace :back_end do
@ -29,6 +30,7 @@ Rails.application.routes.draw do
resources :book_paper_types
resources :book_author_types
resources :tags
end
namespace :front_end do
resources :writing_books

View File

@ -84,6 +84,13 @@ orbitDesktop.prototype.initializeConferencePapers = function(target,url,cache){
uploadFiles();
languageSelect();
}
this.initializeConferencePapers.brief = function(){
o.enablelanguageSelect();
$("textarea.editor").ckeditor({
height: 300,
width: $(".overview").width() - 20
});
}
this.initializeConferencePapers.conference = function(){ // to open add pages in conference papers page
var bindHandlers = function(){ // to bind handlers for add page

View File

@ -0,0 +1,32 @@
class Panel::PersonalConference::Desktop::PluginIntrosController < ApplicationController
def index
@intro = PersonalConferenceIntro.where(:user_id => current_user.id.to_s).first
if @intro.blank?
@intro = PersonalConferenceIntro.new
render "new", :layout => false
else
render "edit", :layout => false
end
end
def create
@intro = PersonalConferenceIntro.new(params[:personal_conference_intro])
@intro.user_id = current_user.id
if @intro.save
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
def update
@intro = PersonalConferenceIntro.find(params[:id])
if @intro.update_attributes(params[:personal_conference_intro])
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
end

View File

@ -23,6 +23,7 @@
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Analysis</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Import</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Export</a></li>
<li><a href="<%= panel_personal_conference_desktop_plugin_intros_path %>" class="admtxt hh1 w2 hp" callback-method="brief" onclick='return false;'>Brief Info</a></li>
</ul>
</div>
</div>

View File

@ -0,0 +1,54 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<ul>
<% @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>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="simple">
<ul class="s_form">
<li class="s_grid_row">
<%= label_tag("", "Frontend Page", :class => 's_grid s_grid_4') %>
<div class="s_select_g s_grid s_grid_8 s_grid_h_2">
<ul>
<li>
<%= f.check_box :brief_intro,
id: "field-0" %>
<label for="field-0"> Brief Intro </label>
</li>
<li>
<%= f.check_box :complete_list,
id: "field-1" %>
<label for="field-1"> Complete List </label>
</li>
</ul>
</div>
</li>
<% @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 %>>
<%= label_tag("", I18nVariable.from_locale(locale), :class => 's_grid s_grid_4') %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :text_translations do |f| %>
<%= f.text_area locale, :class=>"editor", rows: 5, :value => (@intro.text_translations[locale] rescue nil) %>
<% end %>
</li>
<% end %>
</ul>
</div>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form","notification"=>"Brief Intro Updated"}, url: panel_personal_conference_desktop_plugin_intro_path(@intro) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form", "notification"=>"Brief Intro Saved"}, url: panel_personal_conference_desktop_plugin_intros_path do |f| %>
<%= render partial: 'form', locals: {f: f} %>
<% end %>

View File

@ -8,6 +8,7 @@ Rails.application.routes.draw do
resources :conference_pages, except: :show
resources :conference_co_authors, except: :show
resources :conference_co_author_relations, except: :show
resources :plugin_intros
end
namespace :back_end do
match 'writing_conference_setting' => "writing_conferences#writing_conference_setting" ,:as => :writing_conference_setting

View File

@ -84,7 +84,13 @@ orbitDesktop.prototype.initializePersonalDiploma = function(target,url,cache){ /
uploadFiles();
languageSelect();
}
this.initializePersonalDiploma.brief = function(){
o.enablelanguageSelect();
$("textarea.editor").ckeditor({
height: 300,
width: $(".overview").width() - 20
});
}
this.initializePersonalDiploma.coAuthorformCallback = function(data){
if(data.success){

View File

@ -0,0 +1,32 @@
class Panel::PersonalDiploma::Desktop::PluginIntrosController < ApplicationController
def index
@intro = PersonalDiplomaIntro.where(:user_id => current_user.id.to_s).first
if @intro.blank?
@intro = PersonalDiplomaIntro.new
render "new", :layout => false
else
render "edit", :layout => false
end
end
def create
@intro = PersonalDiplomaIntro.new(params[:personal_diploma_intro])
@intro.user_id = current_user.id
if @intro.save
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
def update
@intro = PersonalDiplomaIntro.find(params[:id])
if @intro.update_attributes(params[:personal_diploma_intro])
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
end

View File

@ -17,6 +17,7 @@
<ul id='setting_left_nav'>
<li><a href="<%= panel_personal_diploma_desktop_personal_diplomas_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
<li><a href="<%= new_panel_personal_diploma_desktop_personal_diploma_path %>" callback-method="adddiploma" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= panel_personal_diploma_desktop_plugin_intros_path %>" class="admtxt hh1 w2 hp" callback-method="brief" onclick='return false;'>Brief Info</a></li>
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>

View File

@ -0,0 +1,54 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<ul>
<% @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>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="simple">
<ul class="s_form">
<li class="s_grid_row">
<%= label_tag("", "Frontend Page", :class => 's_grid s_grid_4') %>
<div class="s_select_g s_grid s_grid_8 s_grid_h_2">
<ul>
<li>
<%= f.check_box :brief_intro,
id: "field-0" %>
<label for="field-0"> Brief Intro </label>
</li>
<li>
<%= f.check_box :complete_list,
id: "field-1" %>
<label for="field-1"> Complete List </label>
</li>
</ul>
</div>
</li>
<% @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 %>>
<%= label_tag("", I18nVariable.from_locale(locale), :class => 's_grid s_grid_4') %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :text_translations do |f| %>
<%= f.text_area locale, :class=>"editor", rows: 5, :value => (@intro.text_translations[locale] rescue nil) %>
<% end %>
</li>
<% end %>
</ul>
</div>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form","notification"=>"Brief Intro Updated"}, url: panel_personal_diploma_desktop_plugin_intro_path(@intro) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form", "notification"=>"Brief Intro Saved"}, url: panel_personal_diploma_desktop_plugin_intros_path do |f| %>
<%= render partial: 'form', locals: {f: f} %>
<% end %>

View File

@ -5,6 +5,7 @@ Rails.application.routes.draw do
namespace :desktop do
match "diploma_window" => "personal_diplomas#diploma_window"
resources :personal_diplomas
resources :plugin_intros
end
namespace :back_end do

View File

@ -84,7 +84,13 @@ orbitDesktop.prototype.initializePersonalExperience = function(target,url,cache)
uploadFiles();
languageSelect();
}
this.initializePersonalExperience.brief = function(){
o.enablelanguageSelect();
$("textarea.editor").ckeditor({
height: 300,
width: $(".overview").width() - 20
});
}
this.initializePersonalExperience.coAuthorformCallback = function(data){
if(data.success){

View File

@ -0,0 +1,32 @@
class Panel::PersonalExperience::Desktop::PluginIntrosController < ApplicationController
def index
@intro = PersonalExperienceIntro.where(:user_id => current_user.id.to_s).first
if @intro.blank?
@intro = PersonalExperienceIntro.new
render "new", :layout => false
else
render "edit", :layout => false
end
end
def create
@intro = PersonalExperienceIntro.new(params[:personal_experience_intro])
@intro.user_id = current_user.id
if @intro.save
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
def update
@intro = PersonalExperienceIntro.find(params[:id])
if @intro.update_attributes(params[:personal_experience_intro])
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
end

View File

@ -17,6 +17,7 @@
<ul id='setting_left_nav'>
<li><a href="<%= panel_personal_experience_desktop_personal_experiences_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
<li><a href="<%= new_panel_personal_experience_desktop_personal_experience_path %>" callback-method="addexperience" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= panel_personal_experience_desktop_plugin_intros_path %>" class="admtxt hh1 w2 hp" callback-method="brief" onclick='return false;'>Brief Info</a></li>
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>

View File

@ -0,0 +1,54 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<ul>
<% @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>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="simple">
<ul class="s_form">
<li class="s_grid_row">
<%= label_tag("", "Frontend Page", :class => 's_grid s_grid_4') %>
<div class="s_select_g s_grid s_grid_8 s_grid_h_2">
<ul>
<li>
<%= f.check_box :brief_intro,
id: "field-0" %>
<label for="field-0"> Brief Intro </label>
</li>
<li>
<%= f.check_box :complete_list,
id: "field-1" %>
<label for="field-1"> Complete List </label>
</li>
</ul>
</div>
</li>
<% @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 %>>
<%= label_tag("", I18nVariable.from_locale(locale), :class => 's_grid s_grid_4') %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :text_translations do |f| %>
<%= f.text_area locale, :class=>"editor", rows: 5, :value => (@intro.text_translations[locale] rescue nil) %>
<% end %>
</li>
<% end %>
</ul>
</div>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form","notification"=>"Brief Intro Updated"}, url: panel_personal_experience_desktop_plugin_intro_path(@intro) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form", "notification"=>"Brief Intro Saved"}, url: panel_personal_experience_desktop_plugin_intros_path do |f| %>
<%= render partial: 'form', locals: {f: f} %>
<% end %>

View File

@ -5,6 +5,7 @@ Rails.application.routes.draw do
namespace :desktop do
match "experience_window" => "personal_experiences#experience_window"
resources :personal_experiences
resources :plugin_intros
end
namespace :back_end do

View File

@ -84,7 +84,14 @@ orbitDesktop.prototype.initializePersonalHonor = function(target,url,cache){ //
uploadFiles();
languageSelect();
}
this.initializePersonalHonor.brief = function(){
o.enablelanguageSelect();
$("textarea.editor").ckeditor({
height: 300,
width: $(".overview").width() - 20
});
}
this.initializePersonalHonor.coAuthorformCallback = function(data){
if(data.success){

View File

@ -0,0 +1,32 @@
class Panel::PersonalHonor::Desktop::PluginIntrosController < ApplicationController
def index
@intro = PersonalHonorIntro.where(:user_id => current_user.id.to_s).first
if @intro.blank?
@intro = PersonalHonorIntro.new
render "new", :layout => false
else
render "edit", :layout => false
end
end
def create
@intro = PersonalHonorIntro.new(params[:personal_honor_intro])
@intro.user_id = current_user.id
if @intro.save
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
def update
@intro = PersonalHonorIntro.find(params[:id])
if @intro.update_attributes(params[:personal_honor_intro])
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
end

View File

@ -17,6 +17,7 @@
<ul id='setting_left_nav'>
<li><a href="<%= panel_personal_honor_desktop_personal_honors_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
<li><a href="<%= new_panel_personal_honor_desktop_personal_honor_path %>" callback-method="addhonor" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= panel_personal_honor_desktop_plugin_intros_path %>" class="admtxt hh1 w2 hp" callback-method="brief" onclick='return false;'>Brief Info</a></li>
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>

View File

@ -0,0 +1,54 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<ul>
<% @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>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="simple">
<ul class="s_form">
<li class="s_grid_row">
<%= label_tag("", "Frontend Page", :class => 's_grid s_grid_4') %>
<div class="s_select_g s_grid s_grid_8 s_grid_h_2">
<ul>
<li>
<%= f.check_box :brief_intro,
id: "field-0" %>
<label for="field-0"> Brief Intro </label>
</li>
<li>
<%= f.check_box :complete_list,
id: "field-1" %>
<label for="field-1"> Complete List </label>
</li>
</ul>
</div>
</li>
<% @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 %>>
<%= label_tag("", I18nVariable.from_locale(locale), :class => 's_grid s_grid_4') %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :text_translations do |f| %>
<%= f.text_area locale, :class=>"editor", rows: 5, :value => (@intro.text_translations[locale] rescue nil) %>
<% end %>
</li>
<% end %>
</ul>
</div>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form","notification"=>"Brief Intro Updated"}, url: panel_personal_honor_desktop_plugin_intro_path(@intro) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form", "notification"=>"Brief Intro Saved"}, url: panel_personal_honor_desktop_plugin_intros_path do |f| %>
<%= render partial: 'form', locals: {f: f} %>
<% end %>

View File

@ -5,6 +5,7 @@ Rails.application.routes.draw do
namespace :desktop do
match "honor_window" => "personal_honors#honors_window"
resources :personal_honors
resources :plugin_intros
end
namespace :back_end do

View File

@ -66,23 +66,25 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
});
}
var languageSelect = function(){
$(".language_select a").click(function(event) {
$("*[data-language]").hide();
$("*[data-language="+$(this).data("lang")+"]").show();
return false;
});
}
this.initializeJournalPapers.editpaper = function(){
o.highlight_sub_menu_item(1);
uploadFiles();
languageSelect();
o.enablelanguageSelect();
}
this.initializeJournalPapers.addpaper = function(){ // to open add pages in journal papers page
uploadFiles();
languageSelect();
o.enablelanguageSelect();
}
this.initializeJournalPapers.brief = function(){
o.enablelanguageSelect();
$("textarea.editor").ckeditor({
height: 300,
width: $(".overview").width() - 20
});
}
this.initializeJournalPapers.journal = function(){ // to open add pages in journal papers page

View File

@ -0,0 +1,32 @@
class Panel::PersonalJournal::Desktop::PluginIntrosController < ApplicationController
def index
@intro = PersonalJournalIntro.where(:user_id => current_user.id.to_s).first
if @intro.blank?
@intro = PersonalJournalIntro.new
render "new", :layout => false
else
render "edit", :layout => false
end
end
def create
@intro = PersonalJournalIntro.new(params[:personal_journal_intro])
@intro.user_id = current_user.id
if @intro.save
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
def update
@intro = PersonalJournalIntro.find(params[:id])
if @intro.update_attributes(params[:personal_journal_intro])
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
end

View File

@ -23,6 +23,7 @@
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Analysis</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Import</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Export</a></li>
<li><a href="<%= panel_personal_journal_desktop_plugin_intros_path %>" class="admtxt hh1 w2 hp" callback-method="brief" onclick='return false;'>Brief Info</a></li>
</ul>
</div>
</div>

View File

@ -0,0 +1,54 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<ul>
<% @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>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="simple">
<ul class="s_form">
<li class="s_grid_row">
<%= label_tag("", "Frontend Page", :class => 's_grid s_grid_4') %>
<div class="s_select_g s_grid s_grid_8 s_grid_h_2">
<ul>
<li>
<%= f.check_box :brief_intro,
id: "field-0" %>
<label for="field-0"> Brief Intro </label>
</li>
<li>
<%= f.check_box :complete_list,
id: "field-1" %>
<label for="field-1"> Complete List </label>
</li>
</ul>
</div>
</li>
<% @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 %>>
<%= label_tag("", I18nVariable.from_locale(locale), :class => 's_grid s_grid_4') %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :text_translations do |f| %>
<%= f.text_area locale, :class=>"editor", rows: 5, :value => (@intro.text_translations[locale] rescue nil) %>
<% end %>
</li>
<% end %>
</ul>
</div>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form","notification"=>"Brief Intro Updated"}, url: panel_personal_journal_desktop_plugin_intro_path(@intro) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form", "notification"=>"Brief Intro Saved"}, url: panel_personal_journal_desktop_plugin_intros_path do |f| %>
<%= render partial: 'form', locals: {f: f} %>
<% end %>

View File

@ -8,6 +8,7 @@ Rails.application.routes.draw do
resources :journal_pages, except: :show
resources :journal_co_authors, except: :show
resources :journal_co_author_relations, except: :show
resources :plugin_intros
end
namespace :back_end do

View File

@ -86,7 +86,13 @@ orbitDesktop.prototype.initializePersonalLab = function(target,url,cache){ // th
uploadFiles();
languageSelect();
}
this.initializePersonalLab.brief = function(){
o.enablelanguageSelect();
$("textarea.editor").ckeditor({
height: 300,
width: $(".overview").width() - 20
});
}
this.initializePersonalLab.coAuthorformCallback = function(data){
if(data.success){

View File

@ -0,0 +1,32 @@
class Panel::PersonalLab::Desktop::PluginIntrosController < ApplicationController
def index
@intro = PersonalLabIntro.where(:user_id => current_user.id.to_s).first
if @intro.blank?
@intro = PersonalLabIntro.new
render "new", :layout => false
else
render "edit", :layout => false
end
end
def create
@intro = PersonalLabIntro.new(params[:personal_lab_intro])
@intro.user_id = current_user.id
if @intro.save
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
def update
@intro = PersonalLabIntro.find(params[:id])
if @intro.update_attributes(params[:personal_lab_intro])
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
end

View File

@ -17,6 +17,7 @@
<ul id='setting_left_nav'>
<li><a href="<%= panel_personal_lab_desktop_personal_labs_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
<li><a href="<%= new_panel_personal_lab_desktop_personal_lab_path %>" callback-method="addlab" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= panel_personal_lab_desktop_plugin_intros_path %>" class="admtxt hh1 w2 hp" callback-method="brief" onclick='return false;'>Brief Info</a></li>
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>

View File

@ -0,0 +1,54 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<ul>
<% @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>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="simple">
<ul class="s_form">
<li class="s_grid_row">
<%= label_tag("", "Frontend Page", :class => 's_grid s_grid_4') %>
<div class="s_select_g s_grid s_grid_8 s_grid_h_2">
<ul>
<li>
<%= f.check_box :brief_intro,
id: "field-0" %>
<label for="field-0"> Brief Intro </label>
</li>
<li>
<%= f.check_box :complete_list,
id: "field-1" %>
<label for="field-1"> Complete List </label>
</li>
</ul>
</div>
</li>
<% @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 %>>
<%= label_tag("", I18nVariable.from_locale(locale), :class => 's_grid s_grid_4') %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :text_translations do |f| %>
<%= f.text_area locale, :class=>"editor", rows: 5, :value => (@intro.text_translations[locale] rescue nil) %>
<% end %>
</li>
<% end %>
</ul>
</div>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form","notification"=>"Brief Intro Updated"}, url: panel_personal_lab_desktop_plugin_intro_path(@intro) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form", "notification"=>"Brief Intro Saved"}, url: panel_personal_lab_desktop_plugin_intros_path do |f| %>
<%= render partial: 'form', locals: {f: f} %>
<% end %>

View File

@ -5,6 +5,7 @@ Rails.application.routes.draw do
namespace :desktop do
match "lab_window" => "personal_labs#lab_window"
resources :personal_labs
resources :plugin_intros
end
namespace :back_end do

View File

@ -85,6 +85,14 @@ orbitDesktop.prototype.initializePersonalPatent = function(target,url,cache){ //
languageSelect();
}
this.initializePersonalPatent.brief = function(){
o.enablelanguageSelect();
$("textarea.editor").ckeditor({
height: 300,
width: $(".overview").width() - 20
});
}
this.initializePersonalPatent.coAuthorformCallback = function(data){
if(data.success){
o.notify(data.msg,"success");

View File

@ -0,0 +1,32 @@
class Panel::PersonalPatent::Desktop::PluginIntrosController < ApplicationController
def index
@intro = PersonalPatentIntro.where(:user_id => current_user.id.to_s).first
if @intro.blank?
@intro = PersonalPatentIntro.new
render "new", :layout => false
else
render "edit", :layout => false
end
end
def create
@intro = PersonalPatentIntro.new(params[:personal_patent_intro])
@intro.user_id = current_user.id
if @intro.save
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
def update
@intro = PersonalPatentIntro.find(params[:id])
if @intro.update_attributes(params[:personal_patent_intro])
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
end

View File

@ -17,6 +17,7 @@
<ul id='setting_left_nav'>
<li><a href="<%= panel_personal_patent_desktop_personal_patents_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
<li><a href="<%= new_panel_personal_patent_desktop_personal_patent_path %>" callback-method="addpatent" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= panel_personal_patent_desktop_plugin_intros_path %>" class="admtxt hh1 w2 hp" callback-method="brief" onclick='return false;'>Brief Info</a></li>
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>

View File

@ -0,0 +1,54 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<ul>
<% @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>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="simple">
<ul class="s_form">
<li class="s_grid_row">
<%= label_tag("", "Frontend Page", :class => 's_grid s_grid_4') %>
<div class="s_select_g s_grid s_grid_8 s_grid_h_2">
<ul>
<li>
<%= f.check_box :brief_intro,
id: "field-0" %>
<label for="field-0"> Brief Intro </label>
</li>
<li>
<%= f.check_box :complete_list,
id: "field-1" %>
<label for="field-1"> Complete List </label>
</li>
</ul>
</div>
</li>
<% @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 %>>
<%= label_tag("", I18nVariable.from_locale(locale), :class => 's_grid s_grid_4') %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :text_translations do |f| %>
<%= f.text_area locale, :class=>"editor", rows: 5, :value => (@intro.text_translations[locale] rescue nil) %>
<% end %>
</li>
<% end %>
</ul>
</div>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form","notification"=>"Brief Intro Updated"}, url: panel_personal_patent_desktop_plugin_intro_path(@intro) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form", "notification"=>"Brief Intro Saved"}, url: panel_personal_patent_desktop_plugin_intros_path do |f| %>
<%= render partial: 'form', locals: {f: f} %>
<% end %>

View File

@ -5,6 +5,7 @@ Rails.application.routes.draw do
namespace :desktop do
match "patent_window" => "personal_patents#patent_window"
resources :personal_patents
resources :plugin_intros
end
namespace :back_end do

View File

@ -84,7 +84,13 @@ orbitDesktop.prototype.initializePersonalProject = function(target,url,cache){ /
uploadFiles();
languageSelect();
}
this.initializePersonalProject.brief = function(){
o.enablelanguageSelect();
$("textarea.editor").ckeditor({
height: 300,
width: $(".overview").width() - 20
});
}
this.initializePersonalProject.coAuthorformCallback = function(data){
if(data.success){

View File

@ -0,0 +1,32 @@
class Panel::PersonalProject::Desktop::PluginIntrosController < ApplicationController
def index
@intro = PersonalProjectIntro.where(:user_id => current_user.id.to_s).first
if @intro.blank?
@intro = PersonalProjectIntro.new
render "new", :layout => false
else
render "edit", :layout => false
end
end
def create
@intro = PersonalProjectIntro.new(params[:personal_project_intro])
@intro.user_id = current_user.id
if @intro.save
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
def update
@intro = PersonalProjectIntro.find(params[:id])
if @intro.update_attributes(params[:personal_project_intro])
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
end

View File

@ -17,6 +17,7 @@
<ul id='setting_left_nav'>
<li><a href="<%= panel_personal_project_desktop_personal_projects_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
<li><a href="<%= new_panel_personal_project_desktop_personal_project_path %>" callback-method="addproject" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= panel_personal_project_desktop_plugin_intros_path %>" class="admtxt hh1 w2 hp" callback-method="brief" onclick='return false;'>Brief Info</a></li>
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>

View File

@ -0,0 +1,54 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<ul>
<% @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>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="simple">
<ul class="s_form">
<li class="s_grid_row">
<%= label_tag("", "Frontend Page", :class => 's_grid s_grid_4') %>
<div class="s_select_g s_grid s_grid_8 s_grid_h_2">
<ul>
<li>
<%= f.check_box :brief_intro,
id: "field-0" %>
<label for="field-0"> Brief Intro </label>
</li>
<li>
<%= f.check_box :complete_list,
id: "field-1" %>
<label for="field-1"> Complete List </label>
</li>
</ul>
</div>
</li>
<% @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 %>>
<%= label_tag("", I18nVariable.from_locale(locale), :class => 's_grid s_grid_4') %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :text_translations do |f| %>
<%= f.text_area locale, :class=>"editor", rows: 5, :value => (@intro.text_translations[locale] rescue nil) %>
<% end %>
</li>
<% end %>
</ul>
</div>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form","notification"=>"Brief Intro Updated"}, url: panel_personal_project_desktop_plugin_intro_path(@intro) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form", "notification"=>"Brief Intro Saved"}, url: panel_personal_project_desktop_plugin_intros_path do |f| %>
<%= render partial: 'form', locals: {f: f} %>
<% end %>

View File

@ -5,6 +5,7 @@ Rails.application.routes.draw do
namespace :desktop do
match "project_window" => "personal_projects#project_window"
resources :personal_projects
resources :plugin_intros
end
namespace :back_end do

View File

@ -85,6 +85,14 @@ orbitDesktop.prototype.initializePersonalResearch = function(target,url,cache){
languageSelect();
}
this.initializePersonalResearch.brief = function(){
o.enablelanguageSelect();
$("textarea.editor").ckeditor({
height: 300,
width: $(".overview").width() - 20
});
}
this.initializePersonalResearch.coAuthorformCallback = function(data){
if(data.success){

View File

@ -0,0 +1,32 @@
class Panel::PersonalResearch::Desktop::PluginIntrosController < ApplicationController
def index
@intro = PersonalResearchIntro.where(:user_id => current_user.id.to_s).first
if @intro.blank?
@intro = PersonalResearchIntro.new
render "new", :layout => false
else
render "edit", :layout => false
end
end
def create
@intro = PersonalResearchIntro.new(params[:personal_research_intro])
@intro.user_id = current_user.id
if @intro.save
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
def update
@intro = PersonalResearchIntro.find(params[:id])
if @intro.update_attributes(params[:personal_research_intro])
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
end

View File

@ -17,6 +17,7 @@
<ul id='setting_left_nav'>
<li><a href="<%= panel_personal_research_desktop_personal_researchs_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
<li><a href="<%= new_panel_personal_research_desktop_personal_research_path %>" callback-method="addresearch" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= panel_personal_research_desktop_plugin_intros_path %>" class="admtxt hh1 w2 hp" callback-method="brief" onclick='return false;'>Brief Info</a></li>
<!-- <li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>

View File

@ -0,0 +1,54 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<ul>
<% @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>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="simple">
<ul class="s_form">
<li class="s_grid_row">
<%= label_tag("", "Frontend Page", :class => 's_grid s_grid_4') %>
<div class="s_select_g s_grid s_grid_8 s_grid_h_2">
<ul>
<li>
<%= f.check_box :brief_intro,
id: "field-0" %>
<label for="field-0"> Brief Intro </label>
</li>
<li>
<%= f.check_box :complete_list,
id: "field-1" %>
<label for="field-1"> Complete List </label>
</li>
</ul>
</div>
</li>
<% @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 %>>
<%= label_tag("", I18nVariable.from_locale(locale), :class => 's_grid s_grid_4') %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :text_translations do |f| %>
<%= f.text_area locale, :class=>"editor", rows: 5, :value => (@intro.text_translations[locale] rescue nil) %>
<% end %>
</li>
<% end %>
</ul>
</div>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form","notification"=>"Brief Intro Updated"}, url: panel_personal_research_desktop_plugin_intro_path(@intro) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form", "notification"=>"Brief Intro Saved"}, url: panel_personal_research_desktop_plugin_intros_path do |f| %>
<%= render partial: 'form', locals: {f: f} %>
<% end %>

View File

@ -5,6 +5,7 @@ Rails.application.routes.draw do
namespace :desktop do
match "research_window" => "personal_researchs#research_window"
resources :personal_researchs
resources :plugin_intros
end
namespace :back_end do