diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 9b8cbd26..e1bf2a71 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -131,6 +131,33 @@ class BidsController < ApplicationController end end + + ##### by huang + def show_project_homework + # flash[:notice] = "" + @membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current)) + @option = [] + @membership.each do |membership| + @option << membership.project + end + # a = [1] + # @project = Project.where("id in []", a) + @user = @bid.author + @bidding_project = @bid.biding_projects + respond_to do |format| + if @bid.reward_type == 3 + format.html { + render :layout => 'base_homework' + } + else + format.html { + render :layout => 'base_bids' + } + end + format.api + end + end + ###添加应标项目 def add project = Project.where('name = ?', params[:bid]).first diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index b998c44d..a1a2575a 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -19,8 +19,9 @@ class BoardsController < ApplicationController layout 'base_projects'#by young default_search_scope :messages before_filter :find_project_by_project_id, :find_board_if_available - before_filter :authorize, :except => [:new, :show, :create] + before_filter :authorize, :except => [:new, :show, :create, :index] accept_rss_auth :index, :show + helper :sort include SortHelper diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index d00535ab..bb711cf8 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -22,7 +22,7 @@ class DocumentsController < ApplicationController before_filter :find_project_by_project_id, :only => [:index, :new, :create] before_filter :find_model_object, :except => [:index, :new, :create] before_filter :find_project_from_association, :except => [:index, :new, :create] - before_filter :authorize #, :except => [:index]#Added by young + before_filter :authorize , :except => [:index]#Added by young helper :attachments diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 6ac0ebd1..76dc567c 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -22,8 +22,14 @@ class ProjectsController < ApplicationController menu_item l(:label_sort_by_time), :only => :index menu_item l(:label_sort_by_active), :only => :index menu_item l(:label_sort_by_influence), :only => :index - #by huang - # layout 'base_course' + + + # layout 'base_courses'# by young + # menu_item :overview + # menu_item l(:label_homework), :only => :homework + # menu_item :files, :only => :files +# + # layout 'base_courses' # menu_item l(:label_homework), :only => homework # menu_item l(:label_course_file), :only => files # menu_item l(:label_settings), :only => settings @@ -351,7 +357,7 @@ class ProjectsController < ApplicationController flash[:notice] = l(:notice_successful_create) if params[:continue] attrs = {:parent_id => @project.parent_id}.reject {|k,v| v.nil?} - redirect_to new_project_path(attrs, :course => '1') + redirect_to new_project_path(attrs, :course => '0') #Added by young elsif params[:course_continue] @@ -532,7 +538,7 @@ class ProjectsController < ApplicationController respond_to do |format| format.html { flash[:notice] = l(:notice_successful_update) - redirect_to settings_project_path(@project) + redirect_to settings_project_path(@project,:course => @project.project_type) } format.api { render_api_ok } end diff --git a/app/helpers/issue_categories_helper.rb b/app/helpers/issue_categories_helper.rb deleted file mode 100644 index 9189025c..00000000 --- a/app/helpers/issue_categories_helper.rb +++ /dev/null @@ -1,21 +0,0 @@ -# encoding: utf-8 -# -# Redmine - project management software -# Copyright (C) 2006-2013 Jean-Philippe Lang -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -module IssueCategoriesHelper -end diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index bd117fee..fdbf1a13 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -54,11 +54,11 @@ <% end %> <%=link_to "#{@project.members.count}", project_member_path(@project) ,:course =>'1'%> - <%=link_to "#{@project.issues.count}", project_issues_path(@project) %> + <%=link_to files_count, project_files_path(@project) %> <%= " 成员" %> - <%= "缺陷" %> + <%= l(:label_course_data) %> @@ -134,7 +134,7 @@
  • <%= link_to(l(:label_overview), project_path(@project))%>
  • <%= link_to(l(:label_homework), {:controller => 'projects', :action => 'homework'})%>
  • <%= link_to(l(:label_course_file), project_files_path(@project))%>
  • -
  • <%= link_to "课程通知", {:controller => 'news', :action => 'index'} %>
  • +
  • <%= link_to "课程通知", {:controller => 'news', :action => 'index', :project_id => @project}%>
  • <%= link_to(l(:label_settings), {:controller => 'projects', :action => 'settings', :id => @project}) %>
  • diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index ecfc17b7..c9ba1047 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -90,7 +90,7 @@ <%= link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar" %> <% end%> <% else %> -

    <%= l(:label_no_bid_project) %>

    +

    <%= l(:label_no_course_project) %>

    <% end %> @@ -106,12 +106,13 @@
    - <% if display_main_menu?(@bid) %> -
    - <%= render_menu :bid_menu %> -
    - <% end %> - + +
    +
    <%= yield %> <%= call_hook :view_layouts_base_content %>
    diff --git a/app/views/projects/_course_form.html.erb b/app/views/projects/_course_form.html.erb index cf7d417c..3632b407 100644 --- a/app/views/projects/_course_form.html.erb +++ b/app/views/projects/_course_form.html.erb @@ -10,12 +10,13 @@ <% unless @project.identifier_frozen? %> <%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %> <% end %>

    - +<% if @project.new_record? %> <%= f.fields_for @course do |m| %>

    <%= m.text_field :time, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %>

    <%= m.text_field :state, :size => 60, :style => "width:488px;margin-left: 10px;" %>

    +<% end %> <% end %>

    <%= f.text_field :project_type, :value => 1 %>

    diff --git a/app/views/projects/_edit.html.erb b/app/views/projects/_edit.html.erb index 852d7c0b..1ec8b1ee 100644 --- a/app/views/projects/_edit.html.erb +++ b/app/views/projects/_edit.html.erb @@ -1,8 +1,10 @@
    <%= labelled_form_for @project do |f| %> - + <% if @project.project_type == 1%> + <%= render :partial => 'course_form', :locals => { :f => f } %> + <% else %> <%= render :partial => 'form', :locals => { :f => f } %> + <% end %> <%= submit_tag l(:button_save) %> - <% end %>
    diff --git a/config/locales/zh.yml b/config/locales/zh.yml index a6833c72..55328c91 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -584,6 +584,8 @@ zh: label_news_added: 新闻已添加 label_settings: 配置 label_overview: 课程动态 + label_question_student: 学生咨询 #huang + label_homework_commit: 提交作业 #huang label_course_file: 资料下载 label_course_news: 课程通知 label_version: 版本 @@ -1399,6 +1401,7 @@ zh: label_bid_project: 项目 label_project_no_follow: 该项目暂未被关注! label_no_bid_project: 暂无参与项目 + label_no_course_project: 暂无已提交的作业! label_bids_reward_method: 奖励方式 : label_bids_reward_what: 输入奖励内容 label_call_bonus: 奖金 diff --git a/config/routes.rb b/config/routes.rb index b79a490d..dd454192 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -435,6 +435,7 @@ RedmineApp::Application.routes.draw do get 'calls/back', :to=> 'bids#back' match 'calls/new_bid', :controller => 'bids', :action => 'new_bid' match 'calls/:id/show_project', :controller => 'bids', :action => 'show_project', :as => 'project_for_bid' + match 'calls/:id/show_project_homework', :controller => 'bids', :action => 'show_project_homework', :as => 'project_for_bid' # by huang match 'calls/:id/add', :controller => 'bids', :action => 'add' match 'words/add_project_respond', :controller => 'words', :action => 'add_project_respond' match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'