diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb
index 8e9e6bbb9..17b68c3f6 100644
--- a/app/helpers/tags_helper.rb
+++ b/app/helpers/tags_helper.rb
@@ -12,6 +12,8 @@ module TagsHelper
@obj = Issue.find_by_id(obj_id)
when '4'
@obj = Bid.find_by_id(obj_id)
+ when '5'
+ @obj = Forum.find_by_id(obj_id)
when '6'
@obj = Attachment.find_by_id(obj_id)
when '7'
@@ -44,6 +46,8 @@ module TagsHelper
if user.id == obj_id
@result = true
end
+ when '5'
+ @result = is_forum_manager?(user.id,obj_id)
when '7'
if user.id == obj_id
@result = true
@@ -56,6 +60,17 @@ module TagsHelper
end
+# 判断用户是否是贴吧的管理员
+# add by chenmin
+def is_forum_manager?(user_id,forum_id)
+ @result = false
+ @user_id = Forum.find(forum_id).creator_id;
+ if @user_id == user.id
+ @result = true
+ end
+ return @result
+end
+
def tagname_val
("#tag_name_name").value
end
\ No newline at end of file
diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb
index 3002cb769..1327f13e9 100644
--- a/app/views/boards/_project_show.html.erb
+++ b/app/views/boards/_project_show.html.erb
@@ -53,7 +53,7 @@
<% end %>
-
+
<% if @topics.any? %>
<% unless @course.nil?%>
<%= l(:label_class_period) %> *
- <%= text_field_tag :class_period, @course.class_period, :placeholder => "在此输入课时" %> <%= l(:label_class_hour)%>
+ <%= text_field_tag :class_period, @course.class_period, :placeholder => "在此输入课时",:maxlength=>5 %> <%= l(:label_class_hour)%>
|
<% else %>
<%= l(:label_class_period) %> *
- <%= text_field_tag :class_period, nil, :placeholder => "在此输入课时" %><%= l(:label_class_hour)%>
+ <%= text_field_tag :class_period, nil, :placeholder => "在此输入课时",:maxlength=>5 %><%= l(:label_class_hour)%>
|
<% end %>
diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb
index 0c0c21b91..bb879e213 100644
--- a/app/views/messages/_project_show.html.erb
+++ b/app/views/messages/_project_show.html.erb
@@ -93,7 +93,7 @@
<%= link_to @topic.author, user_path(@topic.author) %>
-
+
<% if @project %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project) %>
diff --git a/app/views/tags/_tag_name.html.erb b/app/views/tags/_tag_name.html.erb
index 5713e9a2e..adee55564 100644
--- a/app/views/tags/_tag_name.html.erb
+++ b/app/views/tags/_tag_name.html.erb
@@ -70,7 +70,14 @@
:taggable_id => obj.id, :taggable_type => object_flag %>
<% end %>
+ <% when '5' %>
+ <% if Forum.find(params[:id]) %>
+ <% if Forum.find(params[:id]).creator_id == User.current.id %>
+ <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
+ :taggable_id => obj.id, :taggable_type => object_flag %>
+ <% end %>
+ <% end %>
<% when '6' %>
<%# if (User.current.logged? &&
User.current.admin?