修复tag的bug

This commit is contained in:
baiyu 2013-08-12 23:06:50 +08:00
parent 0c89ef0360
commit 51249e26f3
8 changed files with 19 additions and 12 deletions

View File

@ -24,13 +24,17 @@ class TagsController < ApplicationController
@users_results = get_users_by_tag($selected_tags) @users_results = get_users_by_tag($selected_tags)
@obj_id = params[:obj_id] @obj_id = params[:obj_id]
case params[:object_flag] @obj_flag = params[:object_flag]
case @obj_flag
when '1' then when '1' then
@obj = User.find_by_id(@obj_id) @obj = User.find_by_id(@obj_id)
when '2' then when '2' then
@obj = Project.find_by_id(@obj_id) @obj = Project.find_by_id(@obj_id)
when '3' then when '3' then
@obj = Issue.find_by_id(@obj_id) @obj = Issue.find_by_id(@obj_id)
when '4'
@obj = Bid.find_by_id(@obj_id)
else else
@obj = nil @obj = nil
end end

View File

@ -73,8 +73,7 @@
<li id="issue-<%= issue.id %>" class="hascontextmenu-1 <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>"> <li id="issue-<%= issue.id %>" class="hascontextmenu-1 <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %> <% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %>
<%= render :partial => "/praise_tread/praise_tread", <!-- 在这里添加赞和踩-->
:locals => {:obj => issue,:user_id =>User.current.id}%>
<% if issue.tracker.name == 'Bug' %> <% if issue.tracker.name == 'Bug' %>
<%= image_tag("/images/task.png", :class => "img-tag-issues") %> <%= image_tag("/images/task.png", :class => "img-tag-issues") %>

View File

@ -27,9 +27,8 @@
<%= render_issue_subject_with_tree(@issue) %> <%= render_issue_subject_with_tree(@issue) %>
</div> </div>
<!-- 顶和踩 --> <!-- 顶和踩 在这里添加 -->
<%= render :partial => "/praise_tread/praise_tread",
:locals => {:obj => @issue,:user_id =>User.current.id}%>
<p class="author"> <p class="author">
<%= authoring @issue.created_on, @issue.author %>. <%= authoring @issue.created_on, @issue.author %>.

View File

@ -36,7 +36,7 @@
<%= textilizable @project.name %> <%= textilizable @project.name %>
</div> </div>
<div> <div>
<% if @project.watched_by?(User.current) %> <% unless User.current.member_of? @project %>
<%= watcher_link(@project, User.current) %> <%= watcher_link(@project, User.current) %>
<% end %> <% end %>
</div></td> </div></td>

View File

@ -4,6 +4,6 @@ $('#related_tags').html('<%= j(render :partial => "related_tags",
:locals => {:related_tags => $related_tags })%>') :locals => {:related_tags => $related_tags })%>')
$('#show_results').html('<%= j(render :partial => "tag_search_results",:locals => {:issues_results => @issues_results, $('#show_results').html('<%= j(render :partial => "tag_search_results",:locals => {:issues_results => @issues_results,
:projects_results => @projects_results,:users_results => @users_results })%>') :projects_results => @projects_results,:users_results => @users_results,:show_flag => @show_flag })%>')

View File

@ -4,5 +4,5 @@ $('#related_tags').html('<%= j(render :partial => "related_tags",
:locals => {:related_tags => $related_tags })%>') :locals => {:related_tags => $related_tags })%>')
$('#show_results').html('<%= j(render :partial => "tag_search_results",:locals => {:issues_results => @issues_results, $('#show_results').html('<%= j(render :partial => "tag_search_results",:locals => {:issues_results => @issues_results,
:projects_results => @projects_results,:users_results => @users_results })%>') :projects_results => @projects_results,:users_results => @users_results,:show_flag => @show_flag })%>')

View File

@ -24,7 +24,7 @@
</div> </div>
<div id="show_results"> <div id="show_results">
<%= render :partial => "tag_search_results",:locals => {:issues_results => @issues_results, <%= render :partial => "tag_search_results",:locals => {:issues_results => @issues_results,
:projects_results => @projects_results,:users_results => @users_results }%> :projects_results => @projects_results,:users_results => @users_results ,:show_flag => @obj_flag}%>
</div> </div>
</div> </div>

View File

@ -0,0 +1,5 @@
class AddUserIdToShares < ActiveRecord::Migration
def change
add_column :shares, :user_id, :integer
end
end