From d3c6c0ca99d9e13b29c0194006902269cc28f857 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 6 Jun 2016 14:29:33 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=9C=AA=E7=99=BB=E5=BD=95=E6=97=B6=E5=9B=9E=E5=A4=8D=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sub_document_comments_controller.rb | 2 +- .../_show_sub_document.html.erb | 25 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/app/controllers/sub_document_comments_controller.rb b/app/controllers/sub_document_comments_controller.rb index d6b335006..80c14f004 100644 --- a/app/controllers/sub_document_comments_controller.rb +++ b/app/controllers/sub_document_comments_controller.rb @@ -1,7 +1,7 @@ class SubDocumentCommentsController < ApplicationController before_filter :find_subdomain_and_subfield, :only => [:new, :create, :show, :index, :destroy, :edit] before_filter :find_subfield_content, :only => [:show, :index] - before_filter :authorize_allowed, :only => [:create] + before_filter :authorize_allowed, :only => [:create, :add_reply] helper :attachments,:organizations layout 'base_sub_domain' diff --git a/app/views/sub_document_comments/_show_sub_document.html.erb b/app/views/sub_document_comments/_show_sub_document.html.erb index 135a48268..2eec92209 100644 --- a/app/views/sub_document_comments/_show_sub_document.html.erb +++ b/app/views/sub_document_comments/_show_sub_document.html.erb @@ -123,17 +123,20 @@ <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current.id) %>
-
- <%= form_for('new_form', :url => add_reply_org_subfield_sub_domain_sub_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %> - -
- - - -
-

- <% end %> -
+ <% if User.current.logged? %> +
+ <%= form_for('new_form', :url => add_reply_org_subfield_sub_domain_sub_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %> + +
+ + +
+

+ <% end %> +
+ <% else %> + <%= render :partial => "users/show_unlogged" %> + <% end %>
From a44cb47a269eb252fe7fbf941cbb5a689631bb98 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 6 Jun 2016 14:41:18 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9C=AA=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=9B=9E=E5=A4=8D=E6=A1=86=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_show_unlogged.html.erb | 1 + public/stylesheets/org.css | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/views/users/_show_unlogged.html.erb b/app/views/users/_show_unlogged.html.erb index e69de29bb..48cf73f15 100644 --- a/app/views/users/_show_unlogged.html.erb +++ b/app/views/users/_show_unlogged.html.erb @@ -0,0 +1 @@ +
登录 后可添加回复
\ No newline at end of file diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 3e3f59f18..459d050e1 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -178,3 +178,6 @@ a.teacher-select {font-size:13px; color:#fff; padding:3px 18px; background-color a.teacher-select:hover {background-color:#297fb8;} a.follow-button {font-size:13px; color:#272727; padding:3px 5px; background-color:#f2efef;} a.follow-button:hover {background-color:#c1c1c1;} + +/*组织未登录提示*/ +.visitor-box {width:620px; height:33px; line-height:33px; text-align:center; vertical-align: middle; border:1px solid #ccc; background-color: #fff;} From 4ea12a6dc581dd3facddcc9211973aa38f712cb2 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 6 Jun 2016 14:55:13 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8C=BF=E5=90=8D?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20160606064856_delete_anonymous_org.rb | 8 ++++++++ db/schema.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20160606064856_delete_anonymous_org.rb diff --git a/db/migrate/20160606064856_delete_anonymous_org.rb b/db/migrate/20160606064856_delete_anonymous_org.rb new file mode 100644 index 000000000..c1bc895cb --- /dev/null +++ b/db/migrate/20160606064856_delete_anonymous_org.rb @@ -0,0 +1,8 @@ +class DeleteAnonymousOrg < ActiveRecord::Migration + def up + OrgDocumentComment.where(:organization_id => 23, :creator_id => 2).delete_all + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 05a6f4e22..504849d39 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160601073753) do +ActiveRecord::Schema.define(:version => 20160606064856) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false From df8df117a8538968df8f269448abd5aa837ecfb3 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 6 Jun 2016 15:02:11 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8C=BF=E5=90=8D?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E9=97=AE=E9=A2=98=EF=BC=88?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=99=A8=E5=92=8Cview=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_show_unlogged.html.erb | 4 +++- public/stylesheets/users.css | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/users/_show_unlogged.html.erb b/app/views/users/_show_unlogged.html.erb index 48cf73f15..258ebe7af 100644 --- a/app/views/users/_show_unlogged.html.erb +++ b/app/views/users/_show_unlogged.html.erb @@ -1 +1,3 @@ -
登录 后可添加回复
\ No newline at end of file +
+ <%= link_to "登录", signin_path, :class => "linkBlue", :target => "_blank" %>后可添加回复 +
\ No newline at end of file diff --git a/public/stylesheets/users.css b/public/stylesheets/users.css index 6fa7ec6a0..eaefb8d1b 100644 --- a/public/stylesheets/users.css +++ b/public/stylesheets/users.css @@ -1,4 +1,7 @@ #RSide{ min-height:1px;} + + + /* 左侧信息*/ .users_info{background:#fff; padding:10px; width:230px; padding-right:0px; margin-bottom:10px; } .pic_head{ width:214px; height:214px; border:1px solid #cbcbcb; padding:2px; position:relative;} From bfa447c19589f558cab90eb3c6b5d576d75cd011 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 6 Jun 2016 15:11:07 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=9C=AA=E7=99=BB=E5=BD=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E4=B8=8Banonymos=E6=94=B9=E4=B8=BA=E6=9C=AA=E7=99=BB?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3aa7d8a4a..46fdb02f3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1080,7 +1080,7 @@ module ApplicationHelper elsif @user title << @user.try(:realname) else - title << User.current.try(:realname) + title << (User.current.id == 2 ? "未登录" : User.current.try(:realname)) end if first_page.nil? || first_page.web_title.nil? title << Setting.app_title unless Setting.app_title == title.last