From 88b9f943fcf1ed19e576cd271144d36f2db5f3c6 Mon Sep 17 00:00:00 2001 From: yanxd Date: Wed, 13 Nov 2013 09:56:38 +0800 Subject: [PATCH] fix issue#353 --- app/controllers/repositories_controller.rb | 4 +++- app/views/bids/_history.html.erb | 18 +++++++++++++----- config/locales/en.yml | 1 + config/locales/zh.yml | 1 + 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index cb6d770fb..aa160acfd 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -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 diff --git a/app/views/bids/_history.html.erb b/app/views/bids/_history.html.erb index 082286e27..2f627fa1d 100644 --- a/app/views/bids/_history.html.erb +++ b/app/views/bids/_history.html.erb @@ -31,11 +31,19 @@ <%= image_tag(url_to_avatar(journal.user), :class => "avatar") %> - <% if @bid.reward_type == 3 %> - - <% else %> - - <% 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 + %> + diff --git a/config/locales/en.yml b/config/locales/en.yml index 18ead1dad..11ad0d5f9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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 diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 695dc04af..342a2e9d6 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -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: 在此输入需求名称
<%=link_to journal.user, user_path(journal.user)%> <%= l(:label_question_requirement) %> <%=link_to journal.user, user_path(journal.user)%> <%= l(:label_respond_requirement) %> <%=link_to journal.user, user_path(journal.user)%> <%= label %>