From 546ffde4983333f1c4a1f8086cfef3f90bfcd329 Mon Sep 17 00:00:00 2001 From: whimlex Date: Mon, 20 Jul 2015 09:09:04 +0800 Subject: [PATCH 01/18] commit --- db/schema.rb | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 78dfb5eee..70a3fb2c1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,12 +11,14 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150702073308) do +ActiveRecord::Schema.define(:version => 20150715162300) do create_table "activities", :force => true do |t| - t.integer "act_id", :null => false - t.string "act_type", :null => false - t.integer "user_id", :null => false + t.integer "act_id", :null => false + t.string "act_type", :null => false + t.integer "user_id", :null => false + t.integer "activity_container_id" + t.string "activity_container_type", :default => "" end add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type" @@ -721,16 +723,6 @@ ActiveRecord::Schema.define(:version => 20150702073308) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_details_copy", :force => true do |t| - t.integer "journal_id", :default => 0, :null => false - t.string "property", :limit => 30, :default => "", :null => false - t.string "prop_key", :limit => 30, :default => "", :null => false - t.text "old_value" - t.text "value" - end - - add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" @@ -1340,7 +1332,7 @@ ActiveRecord::Schema.define(:version => 20150702073308) do end create_table "user_extensions", :force => true do |t| - t.integer "user_id", :null => false + t.integer "user_id", :null => false t.date "birthday" t.string "brief_introduction" t.integer "gender" @@ -1348,8 +1340,8 @@ ActiveRecord::Schema.define(:version => 20150702073308) do t.string "occupation" t.integer "work_experience" t.integer "zip_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "technical_title" t.integer "identity" t.string "student_id" @@ -1357,6 +1349,7 @@ ActiveRecord::Schema.define(:version => 20150702073308) do t.string "student_realname" t.string "location_city" t.integer "school_id" + t.string "description", :default => "" end create_table "user_grades", :force => true do |t| @@ -1462,6 +1455,17 @@ ActiveRecord::Schema.define(:version => 20150702073308) do add_index "versions", ["project_id"], :name => "versions_project_id" add_index "versions", ["sharing"], :name => "index_versions_on_sharing" + create_table "visitors", :force => true do |t| + t.integer "user_id" + t.integer "master_id" + t.datetime "updated_on" + t.datetime "created_on" + end + + add_index "visitors", ["master_id"], :name => "index_visitors_master_id" + add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" + add_index "visitors", ["user_id"], :name => "index_visitors_user_id" + create_table "watchers", :force => true do |t| t.string "watchable_type", :default => "", :null => false t.integer "watchable_id", :default => 0, :null => false From e6bb599a6c3a030fbd41256c49a18b6af51013bb Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 9 Oct 2015 11:34:39 +0800 Subject: [PATCH 02/18] =?UTF-8?q?TAG=E6=89=B9=E9=87=8F=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 6b03cff1e..c08f8a3e6 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -244,13 +244,16 @@ class TagsController < ApplicationController @taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,@taggable_id,@taggable_type) unless @taggable_id.blank? @obj = get_object(@taggable_id,params[:taggableType]) unless @taggable_id.blank? if @taggable_id.blank? #如果没有传tag_id,那么直接更新tag_name就好了。但是要防止 重命名后的tag存在。 - #看重命名后的tag是否存在。如果存在的话,只需要更改taggings里边的id, - if @rename_tag - @taggings = ActsAsTaggableOn::Tagging.where(" `taggings`.`tag_id` = #{ @tag_id} AND `taggings`.`taggable_type` = 'Attachment' ")#find_by_tag_id_and_taggable_type(@tag_id,@taggable_type) - @taggings.each { |t| t.update_attributes({:tag_id=> @rename_tag.id}) if t.tag_id != @rename_tag.id } - ActsAsTaggableOn::Tag.find(@tag_id).update_attributes(:name=>@rename_tag_name)#并且将该tag改名 - else #如果不存在,那么就直接更新该tag名称为新的名称 - (ActsAsTaggableOn::Tag.find_by_name(@tag_name)).update_attributes(:name=>@rename_tag_name) + if @course_id + course = Course.find @course_id + course.attachments.each do |attachment| + taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,attachment.id,attachment.class) + if taggings + taggings.delete + attachment.tag_list.add(@rename_tag_name.split(",")) + attachment.save + end + end end else if(@rename_tag.nil?) #这次命名的是新的tag From 829e94c56318b27f1d4b19980264ade17f57a3fd Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 9 Oct 2015 14:02:02 +0800 Subject: [PATCH 03/18] =?UTF-8?q?enter=E5=8F=AF=E4=BF=AE=E6=94=B9tag=20nam?= =?UTF-8?q?e=E5=B9=B6=E4=B8=94=E5=8F=AA=E4=BF=AE=E6=94=B9=E4=B8=80?= =?UTF-8?q?=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 14 +++--- app/views/files/index.html.erb | 79 ++++++++++++++++++++---------- 2 files changed, 61 insertions(+), 32 deletions(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index c08f8a3e6..cb61177f5 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -246,12 +246,14 @@ class TagsController < ApplicationController if @taggable_id.blank? #如果没有传tag_id,那么直接更新tag_name就好了。但是要防止 重命名后的tag存在。 if @course_id course = Course.find @course_id - course.attachments.each do |attachment| - taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,attachment.id,attachment.class) - if taggings - taggings.delete - attachment.tag_list.add(@rename_tag_name.split(",")) - attachment.save + if course + course.attachments.each do |attachment| + taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,attachment.id,attachment.class) + if taggings + taggings.delete + attachment.tag_list.add(@rename_tag_name.split(",")) + attachment.save + end end end end diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 6b1fdb2e9..656baaf63 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -246,36 +246,63 @@ tagId = id; taggableType = type; width = parseInt(domEle.css('width').replace('px','')) >=100 ? parseInt(domEle.css('width').replace('px','')) : 100 - domEle.html(''); + domEle.html(''); domEle.parent().css("border","1px solid #ffffff"); $("#renameTagName").focus(); } //监听所有的单击事件 - $(document.body).click(function(e){ - isdb = false; //这是单击 - node = document.elementFromPoint(e.clientX, e.clientY); - if(node.tagName == "INPUT"){ //如果是输入框的聚焦,那么就不要进行下去了 - isdb = true; //为了防止在编辑的时候又去单击其他tag去过滤。导致tag过滤不可用 - return; - } - if($("#renameTagName")[0] != undefined ){//存在renameTagName,则处于编辑状态 - if($("#renameTagName").val().trim() == tagName){ //如果值一样,则恢复原来的状态 - ele.parent().css("border",""); - ele.parent().html(tagNameHtml); - - }else{ //否则就要更新tag名称了 -// if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){ 去掉询问 - $.post( - '<%= update_tag_name_path %>', - {"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%= @course.id%>} - ) -// }else{ -// ele.parent().css("border",""); -// ele.parent().html(tagNameHtml); -// } - } - } - }); + $(function(){ + $("#renameTagName").live("blur",function(){ + updateTagName(); + }).live("keypress",function(e){ + if (e.keyCode == '13') { + updateTagName(); + } + }); + }); + + //执行修改TAGName方法 + function updateTagName(){ + if(isdb){ + isdb = false; + if($("#renameTagName").val() == tagName){ //如果值一样,则恢复原来的状态 + ele.parent().css("border",""); + ele.parent().html(tagNameHtml); + + } + else{ + $.post( + '<%= update_tag_name_path %>', + {"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%= @course.id%>} + ); + } + } + } +// $(document.body).click(function(e){ +// isdb = false; //这是单击 +// node = document.elementFromPoint(e.clientX, e.clientY); +// if(node.tagName == "INPUT"){ //如果是输入框的聚焦,那么就不要进行下去了 +// isdb = true; //为了防止在编辑的时候又去单击其他tag去过滤。导致tag过滤不可用 +// return; +// } +// if($("#renameTagName")[0] != undefined ){//存在renameTagName,则处于编辑状态 +// if($("#renameTagName").val().trim() == tagName){ //如果值一样,则恢复原来的状态 +// ele.parent().css("border",""); +// ele.parent().html(tagNameHtml); +// +// }else{ //否则就要更新tag名称了 +//// if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){ 去掉询问 +// $.post( +// '<%= update_tag_name_path %>', +// {"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%= @course.id%>} +// ) +//// }else{ +//// ele.parent().css("border",""); +//// ele.parent().html(tagNameHtml); +//// } +// } +// } +// }); <%end %> From 357a5d4139f759a81b5e01605a4a92adaddc2f56 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 9 Oct 2015 14:08:12 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=82=B9=E8=B5=9E?= =?UTF-8?q?=E4=BA=BA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_show_topics.html.erb | 1 + public/stylesheets/new_user.css | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/forums/_show_topics.html.erb b/app/views/forums/_show_topics.html.erb index d6e3f607b..bb8a91b69 100644 --- a/app/views/forums/_show_topics.html.erb +++ b/app/views/forums/_show_topics.html.erb @@ -21,6 +21,7 @@
<%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %> + <%= get_praise_num(topic)%>
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 5d31c3984..180e8b6ca 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -802,7 +802,8 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} -.postDetailReply { margin-top:28px; color:#888888; float:right;} +.postDetailReply { margin-top:28px; color:#888888; float:right;display: inline} +.disablePostLikeIcon {background:url(images/post_image_list.png) 0px -42px no-repeat ;float:right; padding-left:18px; padding-right: 5px; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;} a.postReplyIcon {background:url(images/post_image_list.png) -40px 2px no-repeat; width:18px; height:18px; float:left; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;} a.postReplyIcon:hover {background:url(images/post_image_list.png) -40px -29px no-repeat; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;} .postDetailInput {width:713px; height:28px; border:1px solid #d9d9d9; outline:none !important;} From b04e20ed7d0fe500b2101fc104297b6b72379edd Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 9 Oct 2015 14:25:40 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F=E8=81=9A?= =?UTF-8?q?=E7=84=A6=E5=92=8C=E4=B8=8D=E8=81=9A=E7=84=A6=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=20=E7=9A=84=E9=9A=90=E8=97=8F=E5=92=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/rails_kindeditor/helper.rb | 8 ++++++-- public/assets/kindeditor/kindeditor.js | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb index f30ee2236..73924c835 100644 --- a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb +++ b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb @@ -9,7 +9,9 @@ module RailsKindeditor output << text_area_tag(name, content, input_html) output << javascript_tag(js_replace(id, options.merge(window_onload: 'true', :autoHeightMode=>true, - afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})' + afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight");$(this.toolbar.div).hide();})', + afterFocus:'eval(function(){$(this.toolbar.div).show(); })', + afterBlur:'eval(function(){if(this.edit.html().trim() == "" ){$(this.toolbar.div).hide();}})' ))) end @@ -21,7 +23,9 @@ module RailsKindeditor output_buffer << build_text_area_tag(name, method, self, options, input_html) output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true', :autoHeightMode=>true, - afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})' + afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight");$(this.toolbar.div).hide();})', + afterFocus:' eval(function(){$(this.toolbar.div).show(); })', + afterBlur:'eval(function(){if(this.edit.html().trim() == ""){$(this.toolbar.div).hide();}})' ))) end diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 448585376..3ad625604 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -3931,7 +3931,9 @@ _extend(KToolbar, KWidget, { pdiv = $("#define",container); }else if(!$("#full",container).is(':hidden')){ pdiv = $("#full",container); - } + }else{ //都隐藏的情况下 + pdiv = $("#define",container); + } return (this._itemMap[name] = K('span.ke-icon-' + name, pdiv).parent()); }, select : function(name) { @@ -4728,13 +4730,19 @@ function _bindTabEvent() { function _bindFocusEvent() { var self = this; K(self.edit.textarea[0], self.edit.win).focus(function(e) { - if (self.afterFocus) { + if(typeof self.afterFocus == 'string'){ + self.afterFocus = eval(self.afterFocus); + } + if ( typeof self.afterFocus == 'function') { self.afterFocus.call(self, e); } }).blur(function(e) { - if (self.afterBlur) { - self.afterBlur.call(self, e); - } + if(typeof self.afterBlur == 'string'){ + self.afterBlur = eval(self.afterBlur); + } + if ( typeof self.afterBlur == 'function') { + self.afterBlur.call(self, e); + } }); } function _removeBookmarkTag(html) { From 5f8d21f1cb45de9f4f0ec8580d673d92663d84d3 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 9 Oct 2015 14:26:27 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=8E=BB=E6=8E=89=20?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F=E8=81=9A=E7=84=A6=E5=92=8C=E4=B8=8D?= =?UTF-8?q?=E8=81=9A=E7=84=A6=E7=9A=84=E6=97=B6=E5=80=99=20=E7=9A=84?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E5=92=8C=E6=98=BE=E7=A4=BA=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/rails_kindeditor/helper.rb | 8 ++------ public/assets/kindeditor/kindeditor.js | 18 +++++------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb index 73924c835..f30ee2236 100644 --- a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb +++ b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb @@ -9,9 +9,7 @@ module RailsKindeditor output << text_area_tag(name, content, input_html) output << javascript_tag(js_replace(id, options.merge(window_onload: 'true', :autoHeightMode=>true, - afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight");$(this.toolbar.div).hide();})', - afterFocus:'eval(function(){$(this.toolbar.div).show(); })', - afterBlur:'eval(function(){if(this.edit.html().trim() == "" ){$(this.toolbar.div).hide();}})' + afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})' ))) end @@ -23,9 +21,7 @@ module RailsKindeditor output_buffer << build_text_area_tag(name, method, self, options, input_html) output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true', :autoHeightMode=>true, - afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight");$(this.toolbar.div).hide();})', - afterFocus:' eval(function(){$(this.toolbar.div).show(); })', - afterBlur:'eval(function(){if(this.edit.html().trim() == ""){$(this.toolbar.div).hide();}})' + afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})' ))) end diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 3ad625604..448585376 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -3931,9 +3931,7 @@ _extend(KToolbar, KWidget, { pdiv = $("#define",container); }else if(!$("#full",container).is(':hidden')){ pdiv = $("#full",container); - }else{ //都隐藏的情况下 - pdiv = $("#define",container); - } + } return (this._itemMap[name] = K('span.ke-icon-' + name, pdiv).parent()); }, select : function(name) { @@ -4730,19 +4728,13 @@ function _bindTabEvent() { function _bindFocusEvent() { var self = this; K(self.edit.textarea[0], self.edit.win).focus(function(e) { - if(typeof self.afterFocus == 'string'){ - self.afterFocus = eval(self.afterFocus); - } - if ( typeof self.afterFocus == 'function') { + if (self.afterFocus) { self.afterFocus.call(self, e); } }).blur(function(e) { - if(typeof self.afterBlur == 'string'){ - self.afterBlur = eval(self.afterBlur); - } - if ( typeof self.afterBlur == 'function') { - self.afterBlur.call(self, e); - } + if (self.afterBlur) { + self.afterBlur.call(self, e); + } }); } function _removeBookmarkTag(html) { From 724abee12ad4e924444bd65a65c0792cd3e2846c Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 9 Oct 2015 15:49:50 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E7=BC=A9=E8=BF=9B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/prettify.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/stylesheets/prettify.css b/public/stylesheets/prettify.css index 4ae3a5e0d..0e6a00928 100644 --- a/public/stylesheets/prettify.css +++ b/public/stylesheets/prettify.css @@ -44,12 +44,12 @@ pre li,ul,ol { /* Specify class=linenums on a pre to get line numbering */ ol.linenums { margin-top: 0; margin-bottom: 0;line-height: 15px;margin-left: 0px !important; } /* IE indents via margin-left */ -.list_style ol li { - list-style-type: decimal; - margin-left: 10px !important; -} +/*.list_style ol li {*/ + /*list-style-type: decimal;*/ + /*margin-left: 10px !important;*/ +/*}*/ .linenums li { - margin-left: 0px !important; + margin-left: 5px !important; } li.L0, li.L1, From 2518305959e7cb74cf3be288ef1bc192b7459df3 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 9 Oct 2015 16:12:02 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E4=BF=AE=E6=94=B9=EF=BC=9B=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8F=90=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 12 ++++-------- app/views/admin/projects.html.erb | 10 +++++++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index a8a302045..90974b376 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -659,14 +659,10 @@ class ProjectsController < ApplicationController # Delete @project def destroy @project_to_destroy = @project - if api_request? || params[:confirm] - @project_to_destroy.destroy - respond_to do |format| - format.html { redirect_to admin_projects_url } - format.api { render_api_ok } - end - else - render :layout => "base_projects" + @project_to_destroy.destroy + respond_to do |format| + format.html { redirect_to admin_projects_url } + format.api { render_api_ok } end # hide project in layout @project = nil diff --git a/app/views/admin/projects.html.erb b/app/views/admin/projects.html.erb index f5b7955bf..3f6ee36f0 100644 --- a/app/views/admin/projects.html.erb +++ b/app/views/admin/projects.html.erb @@ -65,7 +65,7 @@ <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock') unless project.archived? %> <%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if project.archived? && (project.parent.nil? || !project.parent.archived?) %> <%= link_to(l(:button_copy), { :controller => 'projects', :action => 'copy', :id => project }, :class => 'icon icon-copy') %> - <%= link_to(l(:button_delete), project_path(project), :method => :delete, :class => 'icon icon-del') %> + <%= link_to(l(:button_delete), project_path(project), :method => :delete, :class => 'icon icon-del', :onClick=>"delcfm()" ) %> <% end %> @@ -74,3 +74,11 @@ <% html_title(l(:label_project_plural)) -%> + + \ No newline at end of file From 171d30e11261cf697b6768b20caa1e59d2e46076 Mon Sep 17 00:00:00 2001 From: whimlex Date: Sat, 10 Oct 2015 09:02:09 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E9=A1=B9=E7=9B=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 2c429a93f..02d1940a6 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -10,7 +10,7 @@ <% else %> <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> <% end %> TO - <%= link_to activity.project.name.to_s+" | 项目缺陷", project_issues_path(activity.project), :class => "newsBlue ml15"%> + <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %> From 467a6c4fbaf5def1d1b13d70446d76f04c02f1fc Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 10 Oct 2015 09:54:13 +0800 Subject: [PATCH 10/18] =?UTF-8?q?=E9=A1=B9=E7=9B=AEtag=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_course_list.html.erb | 3 ++- app/views/files/_project_file_list.html.erb | 3 ++- app/views/tags/_tag_list.html.erb | 4 ++-- app/views/tags/_tag_new.html.erb | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index e31eea960..bad93f4ae 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -55,7 +55,8 @@
- <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> + + <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name,:container_type=>'1'} %> <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
diff --git a/app/views/files/_project_file_list.html.erb b/app/views/files/_project_file_list.html.erb index 9f9e86cff..6e2623c4b 100644 --- a/app/views/files/_project_file_list.html.erb +++ b/app/views/files/_project_file_list.html.erb @@ -44,7 +44,8 @@
- <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %> + + <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:container_type=>'2'} %> <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
diff --git a/app/views/tags/_tag_list.html.erb b/app/views/tags/_tag_list.html.erb index bc4a5b54e..3b46480c2 100644 --- a/app/views/tags/_tag_list.html.erb +++ b/app/views/tags/_tag_list.html.erb @@ -2,8 +2,8 @@ <% if @tags.size > 0 %> <% @tags.each do |tag| %> - <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> - <%= tag %> + <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> + <%= tag %> <% case object_flag %> <% when '10' %> diff --git a/app/views/tags/_tag_new.html.erb b/app/views/tags/_tag_new.html.erb index bbedaff78..e416776e6 100644 --- a/app/views/tags/_tag_new.html.erb +++ b/app/views/tags/_tag_new.html.erb @@ -22,7 +22,7 @@ <% elsif object_flag == '6' %>
<% tag_name ||= ""%> - <%= render :partial => "tags/tag_list",:locals => {:obj => obj,:object_flag => object_flag,:select_tag_name => tag_name} %> + <%= render :partial => "tags/tag_list",:locals => {:obj => obj,:object_flag => object_flag,:select_tag_name => tag_name,:container_type=>container_type} %>
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index e044f9d51..27bb66bbb 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -545,6 +545,8 @@ blockquote { .member_search_btn{ background:#15bccf; color:#fff; text-align: center; width:40px; height:22px;border:1px solid #15bccf; padding-top:2px; cursor:pointer;} .member_search_btn:hover{ background:#0da1b2; border:1px solid #0da1b2;} a.member_btn{ padding:5px; background:#15bccf; color:#fff;} +a.project_member_btn{ padding:1px 5px; background:#15bccf; color:#fff;} +a.project_member_btn_right{ padding:2px 5px; background:#15bccf; color:#fff;} a:hover.member_btn{ background:#329cbd;} .pro_table{ text-align:center; color:#333; margin-bottom:20px;} .pro_table tr td{ height:30px;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index dc2fecbba..90651f362 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -114,6 +114,7 @@ h4{ font-size:14px; color:#3b3b3b;} .mb10{ margin-bottom:10px !important;} .mb20{ margin-bottom:20px;} .pl15{ padding-left:15px;} +.pt5{ padding-top:5px;} .w20{ width:20px;} .w40{width: 40px;} .w45{ width: 45px;} From 1de6e24bfbc4956d680316ae5675ab550456fa83 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 10 Oct 2015 10:04:32 +0800 Subject: [PATCH 12/18] =?UTF-8?q?tag=E6=95=B0=E7=9B=AE=E7=9A=84=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=B9=E5=BC=8F=E7=9A=84=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_tag_yun.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb index f60a5fb9e..bdf581baa 100644 --- a/app/views/files/_tag_yun.html.erb +++ b/app/views/files/_tag_yun.html.erb @@ -6,12 +6,12 @@ <% tag_list.each do |k,v|%> <% if tag_name && tag_name == k%> - <%= k%>×<%= v%> + <%= k%>(<%= v%>) <% else%> <%= k%>×<%= v%> + ondblclick="rename_tag($(this),'<%= k %>','',<%= 6 %>);"><%= k%>(<%= v%>)
<% end%> <% end%> <% end%> \ No newline at end of file From 11abbca1cf1dc3eb51b94b167ac285ef66f5d62f Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 10 Oct 2015 10:16:50 +0800 Subject: [PATCH 13/18] =?UTF-8?q?tag=5Flist=E4=BB=A3=E7=A0=81=E7=9A=84?= =?UTF-8?q?=E5=85=AC=E7=94=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_course_list.html.erb | 2 +- app/views/files/_project_file_list.html.erb | 2 +- app/views/tags/_tag_list.html.erb | 4 ++-- app/views/tags/_tag_new.html.erb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index bad93f4ae..9e88cb2fd 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -56,7 +56,7 @@
- <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name,:container_type=>'1'} %> + <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
diff --git a/app/views/files/_project_file_list.html.erb b/app/views/files/_project_file_list.html.erb index 6e2623c4b..6dc5b6753 100644 --- a/app/views/files/_project_file_list.html.erb +++ b/app/views/files/_project_file_list.html.erb @@ -45,7 +45,7 @@
- <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:container_type=>'2'} %> + <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %> <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
diff --git a/app/views/tags/_tag_list.html.erb b/app/views/tags/_tag_list.html.erb index 3b46480c2..14b6a0597 100644 --- a/app/views/tags/_tag_list.html.erb +++ b/app/views/tags/_tag_list.html.erb @@ -2,8 +2,8 @@ <% if @tags.size > 0 %> <% @tags.each do |tag| %> - <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> - <%= tag %> + <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> + <%= tag %> <% case object_flag %> <% when '10' %> diff --git a/app/views/tags/_tag_new.html.erb b/app/views/tags/_tag_new.html.erb index e416776e6..bbedaff78 100644 --- a/app/views/tags/_tag_new.html.erb +++ b/app/views/tags/_tag_new.html.erb @@ -22,7 +22,7 @@ <% elsif object_flag == '6' %>
<% tag_name ||= ""%> - <%= render :partial => "tags/tag_list",:locals => {:obj => obj,:object_flag => object_flag,:select_tag_name => tag_name,:container_type=>container_type} %> + <%= render :partial => "tags/tag_list",:locals => {:obj => obj,:object_flag => object_flag,:select_tag_name => tag_name} %>