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/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
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 %>
diff --git a/app/views/users/_show_unlogged.html.erb b/app/views/users/_show_unlogged.html.erb
index e69de29bb..258ebe7af 100644
--- a/app/views/users/_show_unlogged.html.erb
+++ b/app/views/users/_show_unlogged.html.erb
@@ -0,0 +1,3 @@
+
+ <%= link_to "登录", signin_path, :class => "linkBlue", :target => "_blank" %>后可添加回复
+
\ No newline at end of file
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
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;}
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;}