<%#begin
- 1 代表是user类型
+ 1 代表是user类型
2 代表是project类型
3 代表是issue类型
4 代表是bid类型
@@ -44,14 +44,14 @@
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
+
<%= render :partial => "courses/course_resources_html", :locals => {:obj => obj ,:object_flag => object_flag } %>
<% else %>
diff --git a/app/views/tags/_tag_name.html.erb b/app/views/tags/_tag_name.html.erb
index 3efbfcc1a..d1b3060f9 100644
--- a/app/views/tags/_tag_name.html.erb
+++ b/app/views/tags/_tag_name.html.erb
@@ -9,108 +9,103 @@
<% @tags = obj.reload.tag_list %>
-
<% if non_list_all and (@tags.size > 0) %>
<% if @tags.size > Setting.show_tags_length.to_i then %>
<% i = 0 %>
-
<% until i>Setting.show_tags_length.to_i do %>
<%= link_to @tags[i], :controller => "tags", :action => "index", :q => @tags[i], :object_flag => object_flag, :obj_id => obj.id %>
<% i += 1 %>
<% end %>
-
<%= more_tags(obj.id,object_flag)%>
-
<% else %>
-
<% @tags.each do |tag| %>
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
<% end %>
-
<% end %>
-
<% else %>
<% 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 %>
-
- <% case object_flag %>
- <% when '1' %>
-
- <% if User.current.eql?(obj) %>
- <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
- :taggable_id => obj.id, :taggable_type => object_flag %>
- <% end %>
-
- <% when '2' %>
-
- <% if (ProjectInfo.find_by_project_id(obj.id)).try(:user_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 %>
-
- <% when '3' %>
-
- <% if (ProjectInfo.find_by_project_id(obj.project_id)).try(:user_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 %>
-
- <% when '4' %>
- <% if obj.author_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 %>
- <% when '5' %>
- <% test = Forum.find(obj.id) %>
- <% if test && test.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 %>
- <% when '6' %>
- <%# if (User.current.logged? &&
- User.current.admin?
- # && (@project && User.current.member_of?(@project))
- )
- %>
- <% if obj.author_id == User.current.id || User.current.admin?%>
- <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
- :taggable_id => obj.id, :taggable_type => object_flag %>
- <% end %>
- <% when '7' %>
- <% if obj.author_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 %>
- <% when '9' %>
-
- <% if (CourseInfos.find_by_course_id(obj.id)).try(:user_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 %>
-
-
-
-
+
+ <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
+
+ <% case object_flag %>
+ <% when '1' %>
+ <% if User.current.eql?(obj) %>
+
+ <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
+ :taggable_id => obj.id, :taggable_type => object_flag %>
+
+ <% end %>
+ <% when '2' %>
+ <% if (ProjectInfo.find_by_project_id(obj.id)).try(:user_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 %>
+ <% when '3' %>
+ <% if (ProjectInfo.find_by_project_id(obj.project_id)).try(:user_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 %>
+ <% when '4' %>
+ <% if obj.author_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 %>
+ <% when '5' %>
+ <% test = Forum.find(obj.id) %>
+ <% if test && test.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 %>
+ <% when '6' %>
+ <%# if (User.current.logged? &&
+ User.current.admin?
+ # && (@project && User.current.member_of?(@project))
+ )
+ %>
+ <% if obj.author_id == User.current.id || User.current.admin?%>
+
+ <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
+ :taggable_id => obj.id, :taggable_type => object_flag %>
+
+ <% end %>
+ <% when '7' %>
+ <% if obj.author_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 %>
+ <% when '9' %>
+ <% if (CourseInfos.find_by_course_id(obj.id)).try(:user_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 %>
+
<% end %>
<% else %>
- <%= l(:label_tags_no) %>
-
+
+ <%= l(:label_tags_no) %>
+
<% end %>
-
<% end %>
\ No newline at end of file