修改tag显示页面

This commit is contained in:
huangjingquan 2013-08-13 16:31:52 +08:00
parent 7287e151d0
commit 00f606a203
4 changed files with 28 additions and 102 deletions

View File

@ -1,41 +0,0 @@
<div id="tags">
<%= tag('img', {:src => "/images/sidebar/tags.png"}, false, false) %>
<strong><label><%= l(:label_tag) %>:</label></strong>
<!-- 1代表是user类型 2代表是project类型 3代表是issue类型 -->
<!-- 3 代表的是issue 当是issue是 处理方式与前2个对象不同 -->
<% if object_flag == '3' %>
<%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form-issue', {:focus => 'name-issue'} %>
<div id="tags_show_issue">
<%= render :partial => "layouts/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
<div id="put-tag-form-issue" style="display: none">
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
:update => "tags_show",
:complete => '$("#put-tag-form-issue").hide();' do |f| %>
<%= f.text_field :name ,:id => "name-issue",:size=>"30" %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<%= f.submit "add"%>
<%= link_to_function l(:button_cancel), '$("#put-tag-form-issue").hide();'%>
<% end %>
</div>
</div>
<% else %>
<%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form', {:focus => 'name'} %>
<div id="tags_show">
<%= render :partial => "layouts/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
<div id="put-tag-form" style="display: none">
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
:update => "tags_show",
:complete => '$("#put-tag-form").hide();' do |f| %>
<%= f.text_field :name ,:id => "name",:size=>"28"%>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<%= f.submit "add"%>
<%= link_to_function l(:button_cancel), '$("#put-tag-form").hide();'%>
<% end %>
</div>
</div>
<% end %>

View File

@ -1,55 +0,0 @@
<style type="text/css">
.click {
background: green
}
.unclick {
background: blue
}
#tag {
background-color: #dbe4ee;
border-radius: 5px 5px 5px 5px;
color: #3a587d !important;
padding: 0px 4px;
margin: 3px;
display: inline-block;
font-size: 11px;
text-decoration: none;
cursor: pointer;
}
</style>
<!-- 1代表是user类型 2代表是project类型 3代表是issue类型 4代表需求-->
<% @tags = obj.reload.tag_list %>
<% if non_list_all and (@tags.size > 0) %>
<!-- 这里是显示的非主页的tag 所以当tag数量较多时 不必全部显示 用“更多”代替 -->
<% if @tags.size > Setting.show_tags_length.to_i then %>
<% i = 0 %>
<% until i>Setting.show_tags_length.to_i do %>
<div id="tag" class="click unclick">
<%= link_to @tags[i], :controller => "tags",:action => "index",:q => @tags[i],:object_flag => object_flag,:obj_id => obj.id %>
</div>
<% i += 1%>
<% end %>
<%= link_to l(:label_more_tags),:action => "show",:id => obj.id %>
<% else %>
<% @tags.each do |tag| %>
<div id="tag" class="click unclick">
<%= link_to tag,:controller => "tags",:action => "index",:q=>tag,:object_flag => object_flag,:obj_id => obj.id
%>
</div>
<% end %>
<% end %>
<% else %>
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
<% if @tags.size > 0 %>
<% @tags.each do |tag| %>
<div id="tag" class="click unclick">
<%= link_to tag,:controller => "tags",:action => "index",:q=>tag ,:object_flag => object_flag,:obj_id => obj.id %>
</div>
<% end %>
<% end %>
<% end %>

View File

@ -1,14 +1,22 @@
<div id="tags">
<% if User.current.logged? %>
<%= image_tag("/images/sidebar/tags.png") %>
<% end %>
<strong><label><%= l(:label_tag) %>:</label></strong>
<div>
<span><%= image_tag("/images/sidebar/tags.png") %></span>
<span class="font_title_tag"><%= l(:label_tag) %>:</span>
<!-- 1代表是user类型 2代表是project类型 3代表是issue类型 -->
<!-- 3 代表的是issue 当是issue是 处理方式与前2个对象不同 -->
<% if object_flag == '3' %>
<% if object_flag == '3' %>
<% if User.current.logged? %>
<%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form-issue', {:focus => 'name-issue'} %>
<span> <%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form-issue', {:focus => 'name-issue'} %></span>
<% end %>
</div>
<div id="tags_show_issue">
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
@ -26,9 +34,13 @@
</div>
<% else %>
<% if User.current.logged? %>
<%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form', {:focus => 'name'} %>
<span><%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form', {:focus => 'name'} %></span>
<% end %>
</div>
<div id="tags_show">
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
@ -45,3 +57,4 @@
</div>
</div>
<% end %>
<% end %>

View File

@ -117,6 +117,15 @@ ul.tool li{list-style-type:none;
font-weight: bold;
}
.font_title_tag{
font-family:微软雅黑;
font-weight:bold;
padding-top:3px;
padding-bottom:3px;
font-size:16px;
/*color:#05a8bb;*/
}
.font_title_left{
font-family:微软雅黑;
font-weight:bold;