diff --git a/app/assets/javascripts/desktop/journal_pages.js.erb b/app/assets/javascripts/desktop/journal_pages.js.erb
index 4af5715c..a3880acc 100644
--- a/app/assets/javascripts/desktop/journal_pages.js.erb
+++ b/app/assets/javascripts/desktop/journal_pages.js.erb
@@ -116,7 +116,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
li;
$.each(journalData,function(i,journal){
$.each(journal.papers,function(j,paper){
- li = $('
'+journal.title+'
'+paper.title+'
Edit Delete');
+ li = $(''+journal.title+'
'+paper.title+'
');
column.find("ul").append(li);
if(counter%5==0){
$("#journal_p div#paper_list div.overview").append(column);
@@ -145,7 +145,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
var img = $('');
li.append(img);
})
- li.append('Edit Delete');
+ li.append('');
column.find("ul").append(li);
if(counter%5==0){
$("#journal_p div#paper_list div.overview").append(column);
@@ -164,7 +164,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
li;
$.each(journalData,function(i,journal){
$.each(journal.papers,function(j,paper){
- li = $(''+paper.title+'
'+paper.keywords+'
Edit Delete');
+ li = $(''+paper.title+'
'+paper.keywords+'
');
column.find("ul").append(li);
if(counter%5==0){
$("#journal_p div#paper_list div.overview").append(column);
@@ -184,7 +184,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
li;
$.each(journalData,function(i,journal){
$.each(journal.papers,function(j,paper){
- li = $(''+paper.title+'
Edit Delete');
+ li = $(''+paper.title+'
');
column.find("ul").append(li);
if(counter%5==0){
$("#journal_p div#paper_list div.overview").append(column);
@@ -203,7 +203,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
li;
$.each(journalData,function(i,journal){
$.each(journal.papers,function(j,paper){
- li = $(''+paper.title+'
'+paper.abstract+'
Edit Delete');
+ li = $(''+paper.title+'
'+paper.abstract+'
');
column.find("ul").append(li);
$("#journal_p div#paper_list div.overview").append(column);
column = $('');
@@ -238,10 +238,9 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
this.initializeJournalPapers.journal = function(){ // to open add pages in journal papers page
var bindHandlers = function(){ // to bind handlers for add page
o.simple_drop_down();
-
o.tinyscrollbar_ext({
main: '.tinycanvas',
- fill: '.s_grid_con'
+ fill: '.g_col'
})
}
bindHandlers();
@@ -261,9 +260,9 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
o.tinyscrollbar_ext({
main: '.tinycanvas',
- fill: '.s_grid_con'
+ fill: '.g_col'
})
- $("a.bt-edit").click(function(){
+ $("div[container=true]").unbind(".editcoauthor").on("click.editcoauthor", "a.bt-edit", function(){
$.ajax({
url : $(this).attr("href"),
type : "get",
@@ -281,7 +280,25 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
})
return false;
})
+ $("div[container=true]").unbind(".editype").on("click.edittype", "a.bt-edit-type", function(){
+ var parent = $(this).parent().parent();
+ parent.find('.list_item_function').hide();
+ $.ajax({
+ url : $(this).attr("href"),
+ type : "get",
+ success : function(data){
+ var prev_data = parent.find(".form_space").html();
+ parent.find(".form_space").html(data);
+ $(".bt-cancel-type").click(function(){
+ parent.find(".form_space").html(prev_data);
+ parent.find('.list_item_function').show();
+ });
+ }
+ })
+ return false;
+ })
$("div[container=true]").unbind(".delete").on("click.delete","a.bt-delete",function(){
+
var delurl = $(this).attr("href");
var parent = $(this).parent().parent();
o.confirm({
@@ -346,7 +363,15 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
this.initializeJournalPapers.coauthorRelationForm = function(data){
if(data.success){
o.notify(data.msg,"success");
- $("#co_author_relation_table tbody").prepend(data.newvalue);
+ $("#co_author_relation_table").html(data.newvalue);
+ }else{
+ o.notify(data.msg,"alert");
+ }
+ }
+ this.initializeJournalPapers.coauthorRelationEditForm = function(data){
+ if(data.success){
+ o.notify(data.msg,"success");
+ $("#co_author_relation_table").html(data.newvalue);
}else{
o.notify(data.msg,"alert");
}
diff --git a/app/assets/javascripts/orbitdesktopAPI.js b/app/assets/javascripts/orbitdesktopAPI.js
index 57065c4d..66308860 100644
--- a/app/assets/javascripts/orbitdesktopAPI.js
+++ b/app/assets/javascripts/orbitdesktopAPI.js
@@ -26,7 +26,7 @@ var orbitDesktopAPI = function(){
break;
}
$notify.find("img#note_img").attr("src",o.notifyImgPath+img);
- $notify.find(".note_message").text(msg);
+ $notify.find(".note_message").html(msg);
n_height = $notify.outerHeight();
if(!time)time=5000; else time=time*1000;
$notify
diff --git a/app/assets/stylesheets/desktopmain.css b/app/assets/stylesheets/desktopmain.css
index 8f591e1f..48fd709c 100644
--- a/app/assets/stylesheets/desktopmain.css
+++ b/app/assets/stylesheets/desktopmain.css
@@ -26,7 +26,7 @@ time, mark, audio, video {
#container input, #container textarea, #container select, #container input:focus, #container textarea:focus {
border-radius: 0;
box-shadow: none;
- font: inherit;
+ font-family: inherit;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
@@ -126,10 +126,13 @@ a:focus { outline: none; }
.ini_input {
margin: 0;
padding: 0;
- border: none;
+ border: 0;
}
.ini_input:focus { outline: none; }
-#search_app { position: relative; background-color: #fff; }
+#search_app {
+ position: relative;
+ background-color: #fff;
+}
#search_app .form {
position: absolute;
left: 0;
@@ -139,6 +142,7 @@ a:focus { outline: none; }
height: 28px;
line-height: 28px;
background: none;
+ border: 0;
}
#search_app .submit {
position: absolute;
@@ -289,7 +293,7 @@ a:focus { outline: none; }
position: relative;
z-index: 9;
}
-.toolbar .sdm, .toolbar .fn_g { display: inline-block; }
+.toolbar .sdm, .toolbar .fn_g { display: inline-block; vertical-align: top; }
.toolbar .sdm_o { top: 36px; background-color: #f0f0f0; }
.toolbar button {
border: none;
@@ -300,7 +304,10 @@ a:focus { outline: none; }
font-size: 15px;
vertical-align: top;
}
-
+.toolbar .fn_btn {
+ display: inline-block;
+ vertical-align: top;
+}
/* Setting Page */
.theme_list {}
@@ -344,6 +351,7 @@ a:focus { outline: none; }
font-size: 15px;
line-height: 36px;
text-align: center;
+ border: 0;
}
/* theme color opacity */
@@ -452,7 +460,7 @@ a:focus { outline: none; }
height: 100%;
left: 0;
top: 0;
- z-index: 9;
+ z-index: 10;
}
#orbitdiag .tile { background-color: #000; }
.diag_holder { background-color: #000; }
@@ -535,7 +543,7 @@ a:focus { outline: none; }
.s_form input[type=text], .s_form input[type=password], .s_form textarea{
outline: solid 3px #f6f6f6;
border: solid 1px #eee;
- font-size: 18px;
+ font-size: 15px;
font-family: Arial !important;
margin: 0;
padding: 6px;
@@ -578,14 +586,14 @@ a:focus { outline: none; }
height: 30px;
line-height: 30px;
right: 5px;
- top: 4px;
+ top: 5px;
display: block;
background-color: #fff;
}
.s_form.s_grid_con { width: 416px; }
.s_form .s_grid_row { width: 410px; }
.s_form .s_grid_row .s_grid:first-child { margin-left: 0; }
-.s_form input[type=text].s_grid, .s_form input[type=passowrd].s_grid, .s_form textarea.s_grid, .s_form label.s_grid { float: none; display: inline-block; margin-left: 10px; }
+.s_form input[type=text].s_grid, .s_form input[type=passowrd].s_grid, .s_form textarea.s_grid, .s_form label.s_grid, .s_form select.s_grid { /*float: none; display: inline-block;*/ margin-left: 10px; }
.s_form input[type=text].s_grid_1, .s_form input[type=passowrd].s_grid_1, .s_form textarea.s_grid_1 { width: 46px; }
.s_form input[type=text].s_grid_2, .s_form input[type=passowrd].s_grid_2, .s_form textarea.s_grid_2 { width: 116px; }
.s_form input[type=text].s_grid_3, .s_form input[type=passowrd].s_grid_3, .s_form textarea.s_grid_3 { width: 186px; }
@@ -598,7 +606,30 @@ a:focus { outline: none; }
.s_form select.s_grid_4 { width: 270px; }
.s_form select.s_grid_5 { width: 340px; }
.s_form select.s_grid_6 { width: 410px; }
-
+.s_form label.s_grid { line-height: 34px; }
+.s_form select.s_grid {
+ height: 26px;
+ margin-top: 4px;
+ margin-bottom: 4px;
+}
+.s_form textarea.full_height {
+ height: 436px;
+}
+.s_form .s_table {
+ width: 100%;
+}
+.s_form .s_table th, .s_form .s_table td {
+ padding: 6px 0;
+}
+.s_form .s_table th {
+ text-align: left;
+}
+.s_form .s_table td {
+ vertical-align: middle;
+}
+.s_form .s_table thead th {
+ border-bottom: solid 1px #eee;
+}
#group_wrapper {}
@@ -616,7 +647,7 @@ a:focus { outline: none; }
.list_t_title {
font-size: 15px;
font-family: Arial;
- margin-bottom: 10px;
+ margin-bottom: 6px;
color: #333;
}
.list_t_des {
@@ -624,7 +655,7 @@ a:focus { outline: none; }
line-height: 1.5em;
color: #999;
font-family: Arial, sans-serif;
- margin-bottom: 10px;
+ margin-bottom: 4px;
}
/* Connection Page */
@@ -684,6 +715,12 @@ a:focus { outline: none; }
float: left;
margin-left: -30px;
}
+#paper_list .list_item_function a {
+ display: inline-block;
+ padding: 4px;
+ font-family: Arial, sans-serif;
+ font-size: 11px;
+}
.list_item_action a {
display: block;
width: 20px;
@@ -708,6 +745,110 @@ a:focus { outline: none; }
#paper_add .f_w { width: 336px; }
#paper_add label { margin-right: 0; }
+/* Journal Journal list */
+#journal_list .g_col {
+ width: 416px;
+}
+#journal_list .g_col {
+ float: left;
+ height: 456px;
+ margin-left: 12px;
+ padding-left: 12px;
+ border-left: solid 1px #EEE;
+}
+#journal_list .g_col:first-child {
+ margin-left: 0;
+ padding-left: 0;
+ border: none;
+}
+#journal_list .g_col .list_t_item {
+ padding-left: 30px;
+ height: 86px;
+}
+#journal_list .list_item_action {
+ font-size: 12px;
+ float: left;
+ margin-left: -30px;
+}
+#journal_list .list_item_action i {
+ color: #999;
+ font-size: 20px;
+ display: block;
+ width: 20px;
+ height: 20px;
+ line-height: 20px;
+ margin: 1px 1px 6px 1px;
+}
+
+/* Journal Co-Author */
+#co_author {}
+#co_author .list_t_item {
+ height: 110px;
+}
+#co_author .list_item_function {}
+#co_author .list_item_function a {
+ display: inline-block;
+ padding: 4px;
+ font-family: Arial, sans-serif;
+ font-size: 11px;
+}
+#co_author .g_col:first-child {
+ margin-left: 0;
+ padding-left: 10px;
+ border: none;
+}
+#co_author .g_col {
+ width: 300px;
+ height: 456px;
+ margin-left: 12px;
+ padding-left: 12px;
+ border-left: solid 1px #EEE;
+}
+#co_author .info {
+ font-family: Arial, sans-serif;
+}
+#co_author .info li {
+ margin-bottom: 8px;
+ color: #999;
+}
+#co_author .info .name {
+ font-size: 18px;
+ line-height: 24px;
+ color: #333;
+}
+/* Journal Co-Author Relationship*/
+#co_author_relation_table .s_grid_con {
+ float: left;
+ width: 346px;
+ height: 456px;
+ margin-left: 12px;
+ padding-left: 12px;
+ border-left: solid 1px #EEE;
+}
+#co_author_relation_table .s_grid_con:first-child {
+ margin-left: 0;
+ padding-left: 0;
+ border: 0;
+}
+#co_author_relation_table .s_grid_row {
+ width: auto;
+ height: 64px;
+}
+#co_author_relation_table .edit_co_author_relation {
+ margin-left: -10px;
+}
+#co_author_relation_table .list_item_function a {
+ display: inline-block;
+ padding: 4px;
+ font-family: Arial, sans-serif;
+ font-size: 11px;
+}
+#co_author_relation_table .form_space {
+ margin-bottom: 10px;
+ font-size: 15px;
+ font-family: Arial, sans-serif;
+}
+
/* App */
.app_frame {
margin: 48px 96px 48px 156px;
diff --git a/app/assets/stylesheets/orbit-bar.css.erb b/app/assets/stylesheets/orbit-bar.css.erb
index 38441260..154f1158 100644
--- a/app/assets/stylesheets/orbit-bar.css.erb
+++ b/app/assets/stylesheets/orbit-bar.css.erb
@@ -143,6 +143,7 @@
display: inline-block;
line-height: 22px;
padding: 0 10px;
+ vertical-align: top;
}
#orbit-bar .nav img.member-img {
display: inline-block;
diff --git a/app/controllers/admin/infos_controller.rb b/app/controllers/admin/infos_controller.rb
index c08d1386..e79fba7b 100644
--- a/app/controllers/admin/infos_controller.rb
+++ b/app/controllers/admin/infos_controller.rb
@@ -8,6 +8,9 @@ class Admin::InfosController < ApplicationController
def index
@attributes = Info.all.entries
+
+ @roles = Role.excludes('disabled' => true)
+
render :template => 'admin/attributes/index'
end
@@ -22,7 +25,7 @@ class Admin::InfosController < ApplicationController
def edit
@attribute = Info.find(params[:id])
- @attribute_fields_upper_object = [@attribute]
+ # @attribute_fields_upper_object = [@attribute]
render :template => 'admin/attributes/edit'
end
@@ -49,10 +52,20 @@ class Admin::InfosController < ApplicationController
end
def add_attribute_field
+
attribute = Info.find(params[:info_id]) rescue nil
@attribute_field_counter = attribute.attribute_fields.count
@attribute_field = attribute.attribute_fields.build
@attribute_field.save
+
+ @attribute_field[:af_count] = @attribute_field_counter
+
+ @attribute = Info.find(params[:info_id])
+
+ respond_to do |format|
+ format.js { render 'admin/attributes/add_attribute_field' }
+ end
+
end
protected
diff --git a/app/controllers/desktop/co_author_relations_controller.rb b/app/controllers/desktop/co_author_relations_controller.rb
index f35391dd..bc3eb451 100644
--- a/app/controllers/desktop/co_author_relations_controller.rb
+++ b/app/controllers/desktop/co_author_relations_controller.rb
@@ -8,18 +8,38 @@ class Desktop::CoAuthorRelationsController < ApplicationController
end
end
+ def edit
+ @co_author_relation = CoAuthorRelation.find(params[:id])
+ respond_to do |format|
+ format.html { render :layout => false}
+ end
+ end
+
def new
- @new_relation = CoAuthorRelation.new
+ @co_author_relation = CoAuthorRelation.new
end
def create
- @new_relation = CoAuthorRelation.new(params[:co_author_relation])
+ @co_author_relation = CoAuthorRelation.new(params[:co_author_relation])
+ @co_author_relations = CoAuthorRelation.all
- if @new_relation.save
- newv = render_to_string :partial=>"show_form", :object=>@new_relation
- render json: {success:true, msg: "New Relation successfully saved!","newvalue"=>newv}.to_json
+ if @co_author_relation.save
+ newv = render_to_string partial: "show_form", object: @co_author_relations
+ render json: {success: true, msg: "New Relation successfully saved!", newvalue: newvm}.to_json
else
- error_msg = @new_relation.errors.full_messages.join("
")
+ error_msg = @co_author_relation.errors.full_messages.join("
")
+ render json: {success: false, msg: error_msg}.to_json
+ end
+ end
+
+ def update
+ @co_author_relation = CoAuthorRelation.find(params[:id])
+ if @co_author_relation.update_attributes(params[:co_author_relation])
+ @co_author_relations = CoAuthorRelation.all
+ newv = render_to_string partial: "show_form", object: @co_author_relations
+ render json: {success: true, msg: "New Relation successfully updated!", newvalue: newv}.to_json
+ else
+ error_msg = @co_author.errors.full_messages.join("
")
render json: {success: false, msg: error_msg}.to_json
end
end
@@ -27,7 +47,17 @@ class Desktop::CoAuthorRelationsController < ApplicationController
def destroy
@co_author_relation = CoAuthorRelation.find(params[:id])
@co_author_relation.destroy
+ reset_co_author_relation
render :json => {success: true, msg: "deleted successfully!"}
end
+
+ private
+
+ def reset_co_author_relation
+ co_author = CoAuthor.where(co_author_relations_id: @co_author_relation.id)
+ co_author.map do |c|
+ c.update_attributes(co_author_relations_id: nil)
+ end
+ end
end
diff --git a/app/controllers/desktop/co_authors_controller.rb b/app/controllers/desktop/co_authors_controller.rb
index c027a162..6d7b41d6 100644
--- a/app/controllers/desktop/co_authors_controller.rb
+++ b/app/controllers/desktop/co_authors_controller.rb
@@ -1,6 +1,8 @@
class Desktop::CoAuthorsController < ApplicationController
def index
- @co_authors = CoAuthor.where(name_id: current_user.id)
+ nils, not_nils = CoAuthor.where(name_id: current_user.id)\
+ .asc(:co_author).partition{|p| p.email.nil?}
+ @co_authors = not_nils + nils
@co_author_relations = CoAuthorRelation.all
respond_to do |format|
@@ -8,15 +10,6 @@ class Desktop::CoAuthorsController < ApplicationController
end
end
- def show
- @co_author = CoAuthor.find(params[:id])
-
- respond_to do |format|
- format.html { redirect_to desktop_co_authors_url, :layout => false }
- format.json { render json: @co_author }
- end
- end
-
def new
@co_author = CoAuthor.new
@co_author_relations = CoAuthorRelation.all
diff --git a/app/controllers/desktop/journal_lists_controller.rb b/app/controllers/desktop/journal_lists_controller.rb
index 8605b47d..2667a5a7 100644
--- a/app/controllers/desktop/journal_lists_controller.rb
+++ b/app/controllers/desktop/journal_lists_controller.rb
@@ -1,5 +1,4 @@
class Desktop::JournalListsController < ApplicationController
-
def index
level_types = JournalLevelType.all
all_journal_lists = WritingJournal.where(create_user_id: current_user.id)
@@ -7,8 +6,7 @@ class Desktop::JournalListsController < ApplicationController
[ j.journal_title,
j.journal_level_type_ids.map do |type|
level_types.find(type).title
- end.join(",")
- ].join(" -- ")
+ end]
end
@journal_lists = all_journal_lists.uniq
diff --git a/app/controllers/desktop/journal_pages_controller.rb b/app/controllers/desktop/journal_pages_controller.rb
index 5775be0a..8a2312b8 100644
--- a/app/controllers/desktop/journal_pages_controller.rb
+++ b/app/controllers/desktop/journal_pages_controller.rb
@@ -1,6 +1,4 @@
class Desktop::JournalPagesController < ApplicationController
- #before_filter :check_for_cancel, :only => [:create, :update]
-
def index
@writing_journal = WritingJournal.where(create_user_id: current_user.id)
@level_types = JournalLevelType.all
@@ -10,9 +8,6 @@ class Desktop::JournalPagesController < ApplicationController
end
end
- def show
- end
-
def new
@writing_journal = WritingJournal.new
@level_types = JournalLevelType.all
@@ -109,10 +104,4 @@ class Desktop::JournalPagesController < ApplicationController
render json: JSON.pretty_generate(data)
end
- private
-
- def check_for_cancel
- if params[:commit] == "Cancel"
- end
- end
end
diff --git a/app/models/desktop/section.rb b/app/models/desktop/section.rb
index f9035c69..1a4c0c4d 100644
--- a/app/models/desktop/section.rb
+++ b/app/models/desktop/section.rb
@@ -11,7 +11,6 @@ class Section
def initialize_group
self.groups.build
- self.groups.build
end
-end
\ No newline at end of file
+end
diff --git a/app/models/user/attribute_field.rb b/app/models/user/attribute_field.rb
index c0aabb9c..d486ccd0 100644
--- a/app/models/user/attribute_field.rb
+++ b/app/models/user/attribute_field.rb
@@ -4,6 +4,7 @@ class AttributeField
include ::AttributeFieldsHelper
field :key
+ field :af_count
field :markup ,:default=>"text_field"
field :option_list ,:type => Hash,:default => {}
field :markup_options,:type => Hash
diff --git a/app/views/admin/attributes/add_attribute_field.js.erb b/app/views/admin/attributes/add_attribute_field.js.erb
new file mode 100644
index 00000000..dd3d7198
--- /dev/null
+++ b/app/views/admin/attributes/add_attribute_field.js.erb
@@ -0,0 +1 @@
+$('<%= j render :partial => 'shared/attribute_field/attribute_field', :collection => [@attribute_field] %>').appendTo('#attribute_field_list').hide().fadeIn();
diff --git a/app/views/admin/attributes/edit.html.erb b/app/views/admin/attributes/edit.html.erb
index 6c980863..301bf18b 100644
--- a/app/views/admin/attributes/edit.html.erb
+++ b/app/views/admin/attributes/edit.html.erb
@@ -18,13 +18,14 @@
-
- <% @attribute_fields_upper_object.each do |attribute|%>
-
-
<%= attribute.title+ t(:attributes)%>
- <%= render :partial=>"shared/attribute_field/attribute_field",:collection=>attribute.attribute_fields%>
-
- <% end %>
+
+
+
<%= @attribute.title+ t(:attributes)%>
+
+ <%= render :partial=>"shared/attribute_field/attribute_field",:collection=>@attribute.attribute_fields%>
+
+
+