This commit is contained in:
ouyangxuhua 2015-08-01 15:52:02 +08:00
commit bc779a3d8f
5 changed files with 44 additions and 2 deletions

View File

@ -235,14 +235,14 @@
<div class="cl"></div>
</div>
<div class="cl"></div>
<!--<div class="cl"></div>-->
<!-- tag模块 -->
<div class="project_Label">
<h4 class="mb5"><%= l(:label_tag)%>:</h4>
<div class="tag_h">
<div id="tags">
<%= render :partial => 'tags/project_tag', :locals => {:obj => @user,:object_flag => "1"}%>
<%= render :partial => 'tags/user_tag', :locals => {:obj => @user,:object_flag => "1"}%>
</div>
</div>
<div class="cl"></div>

View File

@ -0,0 +1,30 @@
<% @tags = obj.reload.tag_list %>
<% if non_list_all && @tags.size > 0 %>
<% else %>
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
<% if @tags.size > 0 %>
<% @tags.each do |tag| %>
<span class="re_tag f_l " id="tag">
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %>
<span class="del">
<%= link_to('x', remove_tag_path(:tag_name => tag,:taggable_id => obj.id, :taggable_type => object_flag), :remote => true, :confirm => l(:text_are_you_sure) ) if User.current.eql?(obj) %>
</span>
</span>
<% end %>
<% end %>
<% end %>
<% if User.current.logged?%>
<a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag03').slideToggle();"><%= l(:label_add_tag)%></a>
<span id="add_tag03" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= form_for "tag_for_save",:remote => true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %>
<%= f.text_field :name ,:id => "tags_name3",:size=>"20",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class =>"isTxt w90 f_l" %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<input type="button" class="submit f_l" onclick="$('#tags_name3').parent().submit();" />
<% end %>
</span>
<% end%>

View File

@ -0,0 +1,5 @@
<div id="tags">
<div id="tags_show">
<%= render :partial => "tags/tag_user_new_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
</div>

View File

@ -2,6 +2,9 @@
<% if @object_flag == '3'%>
$('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>');
<% elsif @object_flag == '1'%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_user_new_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>');
<% elsif @object_flag == '2'%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project_new_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>');

View File

@ -4,6 +4,10 @@ $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_n
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
//$('#put-tag-form-issue').hide();
$('#name-issue').val("");
<% elsif @obj_flag == '1'%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_user_new_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
$('#tags_name3').val("");
<% elsif @obj_flag == '2'%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project_new_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');