留言修改

This commit is contained in:
z9hang 2014-11-01 15:06:03 +08:00
parent 356ed9b116
commit 79b7373446
10 changed files with 17 additions and 43 deletions

View File

@ -454,6 +454,7 @@ class BidsController < ApplicationController
# 显示作业课程
# add by nwb
def show_courseEx
if (User.current.logged? && (User.current.member_of_course?(@bid.courses.first) || User.current.admin?))
# flash[:notice] = ""
@membership = User.current.coursememberships.all(:conditions => Course.visible_condition(User.current))
@ -510,7 +511,7 @@ class BidsController < ApplicationController
#end
@homework_list = paginateHelper all_homework_list,10
@jours_count = @bid.journals_for_messages.where('m_parent_id IS NULL').count
if params[:student_id].present?
@temp = []
@homework_list.each do |pro|
@ -637,13 +638,8 @@ class BidsController < ApplicationController
end
@user = @bid.author
@jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@limit = 10
@feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit]
@jour = paginateHelper @jours,10
@bid.set_commit(@feedback_count)
respond_to do |format|
format.js
#format.api { render_api_ok }

View File

@ -72,11 +72,7 @@ class HomeworkAttachController < ApplicationController
def get_homework_jours
#@user = @bid.author
@jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@limit = 10
@feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit]
@jour = paginateHelper @jours,10
@state = false
respond_to do |format|
format.js

View File

@ -42,7 +42,7 @@ class Mailer < ActionMailer::Base
@url = case journals_for_message.jour.class.to_s.to_sym # 判断留言的对象所属类型
when :Bid
respond_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
course_for_bid_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Project
return -1 if journals_for_message.jour.project_type == Project::ProjectType_project
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")

View File

@ -11,7 +11,7 @@
<tr>
<td colspan="2" valign="top"><strong><%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %></strong>
<span class="font_lighter"><%= l(:label_user_create_project_homework) %></span>
<span><%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></span>
<span><%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %></span>
<span style="float: right">
<% if(User.current.logged? && (!Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %>
<%# 提交作业按钮 %>
@ -55,7 +55,7 @@
<% else %>
<%= l(:label_x_homework_project, :count => temp.count) %>(<strong><%= link_to temp.count, course_for_bid_path(bid.id) %></strong>)
<% end %></span>
<span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span>
<span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= bid.commit %></strong>)</span>
<span style="float: right">
<% if betweentime(bid.deadline) < 0 %>
<span style="color: red; float: right"><%= l(:label_commit_limit)%></span>

View File

@ -20,7 +20,7 @@
</li>
<li id="tb_4" class="normaltab">
<%= link_to "留言", get_homework_jours_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
(<span class="c_red f_12">23</span>)
(<span id="jours_count" class="c_red f_12"><%= @jours_count %></span>)
</li>
<li >
<%= link_to "作品打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "tb_all" unless @bid.homeworks.empty? %>
@ -39,7 +39,7 @@
</li>
<li id="tb_4" class="normaltab">
<%= link_to "留言", get_homework_jours_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
(<span class="c_red f_12">23</span>)
(<span id="jours_count" class="c_red f_12"><%= @jours_count %></span>)
</li>
</ul>
<% end %>

View File

@ -1,4 +1,6 @@
$('#history').html('<%= escape_javascript(render(:partial => 'homework_attach/history', :locals => {:bid => @bid, :journals => @jour, :state => true})) %>');
//$('#tbc_01').html('<#%= escape_javascript(render(:partial => 'homework_attach/homework_jours',:locals => { :bid => @bid, :journals => @jour, :state => false} )) %>');
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
$('#jours_count').html("<%= @jours.count %>");
$('#bid_message_message').val("");
$('#bid_message_reference_user_id').val("");

View File

@ -7,7 +7,8 @@
</div>
<div id="history">
<%= render :partial => 'history',:locals => { :bid => @bid, :journals => @jour, :state => false} %>
<%= render :partial => 'homework_attach/history',:locals => { :bid => @bid, :journals => @jour, :state => false} %>
</div>
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true%></ul>

View File

@ -52,7 +52,7 @@
<%= link_to(course.name.to_s, homework_course_path(course)) if course %>
</span>
>
<%= link_to(@bid.name, respond_path(@bid)) %>
<%= link_to(@bid.name, course_for_bid_path(@bid)) %>
</p>
</td>
</tr>
@ -87,8 +87,7 @@
<tr>
<td style=" word-wrap: break-word; word-break: break-all;font-size: 16px;text-align: center">
<span style=" color:#ed8924">
<!-- modified by zjc 添加超链接 -->
<strong><%=link_to(@bid.name, respond_path(@bid)) %></strong>
<strong><%=link_to(@bid.name, course_for_bid_path(@bid)) %></strong>
</span>
</td>
</tr>
@ -197,26 +196,6 @@
<!-- end -->
</div>
<div id="content">
<div class="tabs_new">
<ul>
<li>
<%= link_to l(:label_question_student), {:controller => 'bids', :action => 'show'}, :class => link_class(:respond) %>
</li>
<% if User.current.member_of_course? course %>
<li>
<% if User.current.logged? && course && (!Member.where('user_id = ? and course_id = ?', User.current.id, course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, course.id).first.roles&Role.where('id = ? or id = ? or id =?', 5, 10, 7)).size >0) %>
<%= link_to l(:label_homework_commit), course_for_bid_path, :class => link_class(:course) %>
<% else %>
<%= link_to l(:label_homework_info), course_for_bid_path, :class => link_class(:course) %>
<% end %>
</li>
<% end %>
<!-- <li><%#= link_to l(:label_homework_statistics), {:controller => 'bids', :action => 'homework_statistics'}, :class => link_class(:homework_statistics) %></li> -->
<!-- <li><%#= link_to l(:label_homework_respond), {:controller => 'bids', :action => 'homework_respond'}, :class => link_class(:homework_respond) %></li>-->
</ul>
</div>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>

View File

@ -745,7 +745,7 @@ RedmineApp::Application.routes.draw do
# added by young
match 'calls', :to => 'bids#index'
match 'calls/:id', :to => 'bids#show', :as => 'respond'
#match 'calls/:id', :to => 'bids#show', :as => 'respond'
# modified by longjun
# bids#contests is not exist
# match 'contest', :to => 'bids#contests', :as => 'contest' #modified @20140403