diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 7642749b9..adc68c253 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -26,6 +26,7 @@ class ProjectsController < ApplicationController menu_item l(:label_sort_by_influence), :only => :index menu_item l(:label_homework), :only => :homework + menu_item l(:label_course_feedback), :only => :feedback menu_item l(:label_course_file), :only => :index menu_item l(:label_course_news), :only => :index # end @@ -440,6 +441,11 @@ class ProjectsController < ApplicationController @offset ||= @feedback_pages.offset @jour = @jours[@offset, @limit] @state = false + @base_courses_tag = @project.project_type + respond_to do |format| + format.html{render :layout => 'base_courses' if @base_courses_tag==1} + format.api + end end def project_respond diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 0a81d6ab6..e58b1d672 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -123,6 +123,13 @@ class WordsController < ApplicationController # redirect_to signin_path end + def leave_project_message + user = User.current + message = params[:new_form][:project_message] + Project.add_new_jour(user, message, params[:id]) + redirect_to project_feedback_path(params[:id]) + end + def add_brief_introdution user = User.current message = params[:new_form][:user_introduction] diff --git a/app/models/project.rb b/app/models/project.rb index 23f3e9558..eec60cdde 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -160,6 +160,11 @@ class Project < ActiveRecord::Base project = Project.find('trustie') project.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => 0) end + + def self.add_new_jour(user, notes, id) + project = Project.find(id) + project.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => 0) + end # end def initialize(attributes=nil, *args) diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 8ba3c118b..763802c4a 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -209,7 +209,7 @@ <%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview)%>
  • - <%= link_to l(:label_homework), {:controller => 'projects', :action => 'homework'}, :class => link_class('Homework')%> + <%= link_to l(:label_homework), {:controller => 'projects', :action => 'homework'}, :class => link_class('Task')%>
  • <%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%> @@ -217,6 +217,9 @@
  • <%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news)%>
  • +
  • + <%= link_to l(:label_course_feedback), project_feedback_path(@project), :class => link_class('Feedback')%> +
  • <% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0))%> diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 55e70d1b7..0677c9b30 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -157,13 +157,12 @@ - <% if @project.identifier == 'trustie' %> + <%=image_tag("/images/sidebar/tool_tag.png", weight:"15px", height:"15px") %> <%= link_to l(:label_project_tool_response) ,project_feedback_path(@project) %> - <% else %> - <% end %> + diff --git a/app/views/projects/feedback.html.erb b/app/views/projects/feedback.html.erb index 4a261b14e..92ae37dde 100644 --- a/app/views/projects/feedback.html.erb +++ b/app/views/projects/feedback.html.erb @@ -1,6 +1,22 @@

    <%= l(:label_user_response) %>

    <%= render_flash_messages %> + +<%= form_for('new_form', :method => :post, + :url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%> + + + + + +
    <%= f.text_area 'project_message', :rows => 3, :cols => 65, :placeholder => "#{l(:label_welcome_my_respond)}", :style => "resize: none;", :class => 'noline'%>
    + + + + +
    <%= submit_tag l(:button_submit), :name => nil , :class => "bid_btn" %>
    + <% end %> + <% if @jour.size >0 %> <% for journal in @jour%> diff --git a/config/locales/en.yml b/config/locales/en.yml index 635b5dae2..691d7ae14 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1331,6 +1331,7 @@ en: label_no_current_fans: the user has no fans now label_no_current_watchers: the user hasn't watched others label_project_tool_response: Response + label_course_feedback: Feedback label_tags_search_result: Search Results label_active_call: call label_tags_call: Calls diff --git a/config/locales/zh.yml b/config/locales/zh.yml index bdd823ccb..6ce3c6b5e 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1451,6 +1451,7 @@ zh: label_no_current_fans: 该用户暂无粉丝 label_no_current_watchers: 该用户暂未关注其他用户 label_project_tool_response: 用户反馈 + label_course_feedback: 留言 label_tags_search_result: 搜索结果 label_active_call: 需求 label_active_homework: 作业 diff --git a/config/routes.rb b/config/routes.rb index b505c3e66..7277dd1b3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -451,6 +451,8 @@ RedmineApp::Application.routes.draw do match 'calls/:id/add', :controller => 'bids', :action => 'add' match 'calls/:id/add_homework', :controller => 'bids', :action => 'add_homework' match 'words/add_project_respond', :controller => 'words', :action => 'add_project_respond' + match 'words/:id/leave_project_message', :controller => 'words', :action => 'leave_project_message' + match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback' match 'calls/create_bid', :to => 'bids#create_bid' match 'contest/create_contest', :to => 'bids#create_contest' #huang