增加课程留言与项目反馈功能,修改了点击课程作业时tab页显示问题

This commit is contained in:
fanqiang 2013-11-07 11:02:32 +08:00
parent 019ab89899
commit 9996386fe4
9 changed files with 44 additions and 4 deletions

View File

@ -26,6 +26,7 @@ class ProjectsController < ApplicationController
menu_item l(:label_sort_by_influence), :only => :index menu_item l(:label_sort_by_influence), :only => :index
menu_item l(:label_homework), :only => :homework 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_file), :only => :index
menu_item l(:label_course_news), :only => :index menu_item l(:label_course_news), :only => :index
# end # end
@ -440,6 +441,11 @@ class ProjectsController < ApplicationController
@offset ||= @feedback_pages.offset @offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit] @jour = @jours[@offset, @limit]
@state = false @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 end
def project_respond def project_respond

View File

@ -123,6 +123,13 @@ class WordsController < ApplicationController
# redirect_to signin_path # redirect_to signin_path
end 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 def add_brief_introdution
user = User.current user = User.current
message = params[:new_form][:user_introduction] message = params[:new_form][:user_introduction]

View File

@ -160,6 +160,11 @@ class Project < ActiveRecord::Base
project = Project.find('trustie') project = Project.find('trustie')
project.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => 0) project.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => 0)
end 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 # end
def initialize(attributes=nil, *args) def initialize(attributes=nil, *args)

View File

@ -209,7 +209,7 @@
<%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview)%> <%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview)%>
</li> </li>
<li> <li>
<%= 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')%>
</li> </li>
<li> <li>
<%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%> <%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%>
@ -217,6 +217,9 @@
<li> <li>
<%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news)%> <%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news)%>
</li> </li>
<li>
<%= link_to l(:label_course_feedback), project_feedback_path(@project), :class => link_class('Feedback')%>
</li>
<!-- <li><%= link_to(l(:label_course_repository), {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => nil, :path => nil, :rev => nil, :course => 1 })%></li> --> <!-- <li><%= link_to(l(:label_course_repository), {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => nil, :path => nil, :rev => nil, :course => 1 })%></li> -->
<% 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))%> <% 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))%>

View File

@ -157,13 +157,12 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<% if @project.identifier == 'trustie' %>
<td align="left" width="190px" valign="left"><%=image_tag("/images/sidebar/tool_tag.png", weight:"15px", height:"15px") %> <td align="left" width="190px" valign="left"><%=image_tag("/images/sidebar/tool_tag.png", weight:"15px", height:"15px") %>
<%= link_to l(:label_project_tool_response) ,project_feedback_path(@project) %> <%= link_to l(:label_project_tool_response) ,project_feedback_path(@project) %>
</td> </td>
<% else %>
<% end %>
</tr> </tr>
</table> </table>
</div> </div>

View File

@ -1,6 +1,22 @@
<!-- fq --> <!-- fq -->
<h3><%= l(:label_user_response) %></h3> <h3><%= l(:label_user_response) %></h3>
<%= render_flash_messages %> <%= render_flash_messages %>
<%= form_for('new_form', :method => :post,
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
<table border="0" width="525px" align="center" >
<tr>
<td><%= f.text_area 'project_message', :rows => 3, :cols => 65, :placeholder => "#{l(:label_welcome_my_respond)}", :style => "resize: none;", :class => 'noline'%></td>
</tr>
</table>
<table border="0" width="525px" align="center">
<tr>
<td align="right"> <%= submit_tag l(:button_submit), :name => nil , :class => "bid_btn" %></td>
</tr>
</table>
<% end %>
<% if @jour.size >0 %> <% if @jour.size >0 %>
<% for journal in @jour%> <% for journal in @jour%>

View File

@ -1331,6 +1331,7 @@ en:
label_no_current_fans: the user has no fans now label_no_current_fans: the user has no fans now
label_no_current_watchers: the user hasn't watched others label_no_current_watchers: the user hasn't watched others
label_project_tool_response: Response label_project_tool_response: Response
label_course_feedback: Feedback
label_tags_search_result: Search Results label_tags_search_result: Search Results
label_active_call: call label_active_call: call
label_tags_call: Calls label_tags_call: Calls

View File

@ -1451,6 +1451,7 @@ zh:
label_no_current_fans: 该用户暂无粉丝 label_no_current_fans: 该用户暂无粉丝
label_no_current_watchers: 该用户暂未关注其他用户 label_no_current_watchers: 该用户暂未关注其他用户
label_project_tool_response: 用户反馈 label_project_tool_response: 用户反馈
label_course_feedback: 留言
label_tags_search_result: 搜索结果 label_tags_search_result: 搜索结果
label_active_call: 需求 label_active_call: 需求
label_active_homework: 作业 label_active_homework: 作业

View File

@ -451,6 +451,8 @@ RedmineApp::Application.routes.draw do
match 'calls/:id/add', :controller => 'bids', :action => 'add' match 'calls/:id/add', :controller => 'bids', :action => 'add'
match 'calls/:id/add_homework', :controller => 'bids', :action => 'add_homework' match 'calls/:id/add_homework', :controller => 'bids', :action => 'add_homework'
match 'words/add_project_respond', :controller => 'words', :action => 'add_project_respond' 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 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
match 'calls/create_bid', :to => 'bids#create_bid' match 'calls/create_bid', :to => 'bids#create_bid'
match 'contest/create_contest', :to => 'bids#create_contest' #huang match 'contest/create_contest', :to => 'bids#create_contest' #huang