fix issue#353

This commit is contained in:
yanxd 2013-11-13 09:56:38 +08:00
parent 0ddd259fea
commit 88b9f943fc
4 changed files with 18 additions and 6 deletions

View File

@ -554,11 +554,13 @@ class RepositoriesController < ApplicationController
graph.burn
end
def check_hidden_repo
project = Project.find_by_id(params[:id])
project = Project.find(params[:id])
if !User.current.member_of?(project)
if project.hidden_repo
render_403
end
end
rescue ActiveRecord::RecordNotFound
render_404
end
end

View File

@ -31,11 +31,19 @@
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></td>
<td><table width="580px" border="0">
<tr>
<% if @bid.reward_type == 3 %>
<td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong> <span class="font_lighter"><%= l(:label_question_requirement) %></span></td>
<% else %>
<td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong> <span class="font_lighter"><%= l(:label_respond_requirement) %></span></td>
<% end %>
<% label = '';
case @bid.reward_type
when 1
label = l(:label_respond_requirement)
when 2
label = l(:label_contest_requirement)
when 3
label = l(:label_question_requirement)
else
end
%>
<td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong> <span class="font_lighter"><%= label %></span></td>
</tr>
<tr>

View File

@ -1519,6 +1519,7 @@ en:
label_contest_list: Contests list
label_newtype_contest: Release contest
label_question_requirement: introduce a question
label_contest_requirement: has commented this contest
button_bidding_homework: To take part in contest
label_bids_form_contest_new_description: Enterprise or college can release a contest here.
label_contest_name: Input the name of the contest

View File

@ -1361,6 +1361,7 @@ zh:
label_my_respond: 问题交流请踩这里^-^
label_my_question: 请在此处留下您的意见或者问题~ # modified by bai
label_respond_requirement: 对需求进行了反馈
label_contest_requirement: 对竞赛进行了反馈
label_question_requirement: 对作业提出了问题!
label_deadline: 投资时限yyyy-mm-dd
label_requirement_name: 在此输入需求名称