Merge branch 'Homework' into develop
This commit is contained in:
commit
01350442fb
|
@ -511,7 +511,7 @@ class BidsController < ApplicationController
|
|||
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM(SELECT homework_attaches.*,
|
||||
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN #{teachers}) AS t_score,
|
||||
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN #{teachers}) AS s_score,
|
||||
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = 3123) AS m_score
|
||||
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id}) AS m_score
|
||||
FROM homework_attaches
|
||||
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
|
||||
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY s_score DESC) AS table1
|
||||
|
@ -806,6 +806,7 @@ class BidsController < ApplicationController
|
|||
@bid.description = params[:bid][:description]
|
||||
@bid.is_evaluation = params[:bid][:is_evaluation]
|
||||
@bid.proportion = params[:bid][:proportion]
|
||||
@bid.evaluation_num = params[:bid][:evaluation_num]
|
||||
@bid.reward_type = 3
|
||||
# @bid.budget = params[:bid][:budget]
|
||||
@bid.deadline = params[:bid][:deadline]
|
||||
|
@ -822,7 +823,7 @@ class BidsController < ApplicationController
|
|||
flash[:notice] = l(:label_bid_succeed)
|
||||
end
|
||||
end
|
||||
redirect_to course_for_bid_path(@bid)
|
||||
redirect_to course_homework_url(params[:course_id])
|
||||
else
|
||||
@bid.safe_attributes = params[:bid]
|
||||
@homework = @bid
|
||||
|
@ -861,6 +862,7 @@ class BidsController < ApplicationController
|
|||
@bid.description = params[:bid][:description]
|
||||
@bid.is_evaluation = params[:bid][:is_evaluation]
|
||||
@bid.proportion = params[:bid][:proportion]
|
||||
@bid.evaluation_num = params[:bid][:evaluation_num]
|
||||
@bid.reward_type = 3
|
||||
@bid.deadline = params[:bid][:deadline]
|
||||
@bid.budget = 0
|
||||
|
@ -1006,28 +1008,18 @@ class BidsController < ApplicationController
|
|||
@bid = Bid.find(params[:id])
|
||||
if(@bid.comment_status == 0)
|
||||
homeworks = @bid.homeworks
|
||||
if(homeworks && homeworks.count >= 4)
|
||||
@bid.update_column('comment_status', 1)
|
||||
users = homeworks.map { |h| h.user }
|
||||
|
||||
@start_index = rand(homeworks.size)
|
||||
while users[0] == homeworks[@start_index].user
|
||||
@start_index = rand(homeworks.size)
|
||||
end
|
||||
|
||||
3.times do |i|
|
||||
homework_start_index = @start_index + i
|
||||
users.each_with_index do |user, index|
|
||||
actual_index = homework_start_index + index
|
||||
actual_index = (actual_index < homeworks.size ? actual_index : actual_index - homeworks.size)
|
||||
if user != homeworks[actual_index]
|
||||
@homework_evaluation = HomeworkEvaluation.new(user_id: user.id, homework_attach_id: homeworks[actual_index].id)
|
||||
@homework_evaluation.save
|
||||
end
|
||||
if(homeworks && homeworks.size >= 2)
|
||||
homeworks.each_with_index do |homework, index|
|
||||
user = homework.user
|
||||
n = @bid.evaluation_num
|
||||
n = n < homeworks.size ? n : homeworks.size - 1
|
||||
assigned_homeworks = get_assigned_homeworks(homeworks, n, index)
|
||||
assigned_homeworks.each do |h|
|
||||
@homework_evaluation = HomeworkEvaluation.new(user_id: user.id, homework_attach_id: h.id)
|
||||
@homework_evaluation.save
|
||||
end
|
||||
end
|
||||
# 修改状态为 '启动匿评'
|
||||
#@bid.update_column('comment_status', 1)
|
||||
@bid.update_column('comment_status', 1)
|
||||
@statue = 1
|
||||
else
|
||||
@statue = 2
|
||||
|
@ -1052,6 +1044,11 @@ class BidsController < ApplicationController
|
|||
end
|
||||
|
||||
private
|
||||
|
||||
def get_assigned_homeworks(homeworks, n, index)
|
||||
homeworks += homeworks
|
||||
homeworks[index + 1 .. index + n]
|
||||
end
|
||||
|
||||
def find_bid
|
||||
if params[:id]
|
||||
|
|
|
@ -672,10 +672,10 @@ class CoursesController < ApplicationController
|
|||
page = 1 + offset / @limit
|
||||
end
|
||||
|
||||
@feedback_count = @jours.count
|
||||
@feedback_pages = Paginator.new @feedback_count, @limit, page
|
||||
@offset ||= @feedback_pages.offset
|
||||
@jour = @jours[@offset, @limit]
|
||||
#@feedback_count = @jours.count
|
||||
#@feedback_pages = Paginator.new @feedback_count, @limit, page
|
||||
#@offset ||= @feedback_pages.offset
|
||||
@jour = paginateHelper @jours,10
|
||||
@state = false
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_courses'}
|
||||
|
|
|
@ -103,7 +103,7 @@ class HomeworkAttachController < ApplicationController
|
|||
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM(SELECT homework_attaches.*,
|
||||
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN #{teachers}) AS t_score,
|
||||
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN #{teachers}) AS s_score,
|
||||
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = 3123) AS m_score
|
||||
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id}) AS m_score
|
||||
FROM homework_attaches
|
||||
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
|
||||
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY s_score DESC) AS table1
|
||||
|
@ -227,7 +227,7 @@ class HomeworkAttachController < ApplicationController
|
|||
def create
|
||||
bid = Bid.find params[:bid_id]
|
||||
if User.current.admin? || User.current.member_of_course?(bid.courses.first) # modify by nwb
|
||||
if bid.homeworks.where("user_id = ?",User.current).count == 0
|
||||
if bid.homeworks.where("user_id = ?",User.current).empty?
|
||||
user_id = params[:user_id]
|
||||
bid_id = params[:bid_id]
|
||||
if params[:homework_attach]
|
||||
|
|
|
@ -424,10 +424,10 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
|
||||
|
||||
@feedback_count = @jours.count
|
||||
@feedback_pages = Paginator.new @feedback_count, @limit, @page
|
||||
@offset ||= @feedback_pages.offset
|
||||
@jour = @jours[@offset, @limit]
|
||||
#@feedback_count = @jours.count
|
||||
#@feedback_pages = Paginator.new @feedback_count, @limit, @page
|
||||
#@offset ||= @feedback_pages.offset
|
||||
@jour = paginateHelper @jours,10
|
||||
@state = false
|
||||
@base_courses_tag = @project.project_type
|
||||
|
||||
|
|
|
@ -280,11 +280,11 @@ class UsersController < ApplicationController
|
|||
fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false)
|
||||
end
|
||||
|
||||
@limit = 10
|
||||
@feedback_count = @jours.count
|
||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||
@offset ||= @feedback_pages.offset
|
||||
@jour = @jours[@offset, @limit]
|
||||
#@limit = 10
|
||||
#@feedback_count = @jours.count
|
||||
#@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||
#@offset ||= @feedback_pages.offset
|
||||
@jour = paginateHelper @jours,10
|
||||
@state = false
|
||||
end
|
||||
# end
|
||||
|
|
|
@ -27,11 +27,7 @@ class WordsController < ApplicationController
|
|||
end
|
||||
end
|
||||
@jours = @user.journals_for_messages.where('m_parent_id IS NULL').reverse
|
||||
@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
|
||||
|
||||
respond_to do |format|
|
||||
# format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}}
|
||||
|
|
|
@ -37,9 +37,9 @@
|
|||
<span id="<%=bid.id %>_anonymous_comment">
|
||||
<% case bid.comment_status %>
|
||||
<% when 0 %>
|
||||
<%= link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n是否确定开启匿评?" %>
|
||||
<%= link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n是否确定开启匿评?", disable_with: '加载中...' %>
|
||||
<% when 1 %>
|
||||
<%= link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true, :confirm => "关闭匿评后学生将不能对作业进行评分\n是否确定关闭匿评?" %>
|
||||
<%= link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true, :confirm => "关闭匿评后学生将不能对作业进行评分,且学生作业列表将会被公开\n是否确定关闭匿评?" %>
|
||||
<% when 2 %>
|
||||
匿评结束
|
||||
<% end %>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;", :readonly => true, :onchange => "regexDeadLine();") %>
|
||||
<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:100px;", :readonly => true, :onchange => "regexDeadLine();") %>
|
||||
<%= calendar_for('bid_deadline')%>
|
||||
<span id="bid_deadline_span">
|
||||
</span>
|
||||
|
@ -43,6 +43,10 @@
|
|||
<p>
|
||||
<%= f.select :proportion, proportion_option %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%>
|
||||
<span id="bid_evaluation_num_span">匿评分配数量不宜太大,否则会影响开启匿评速度</span>
|
||||
</p>
|
||||
<p>
|
||||
<%= hidden_field_tag 'course_id', @course.id %>
|
||||
</p>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script type="text/javascript">
|
||||
function regexName()
|
||||
{
|
||||
var name = $("#bid_name").val();
|
||||
var name = $.trim($("#bid_name").val());
|
||||
|
||||
if(name=="")
|
||||
{
|
||||
|
@ -18,7 +18,7 @@
|
|||
}
|
||||
function regexDeadLine()
|
||||
{
|
||||
var deadline = $("#bid_deadline").val();
|
||||
var deadline = $.trim($("#bid_deadline").val());
|
||||
var regex = /^\d{4}-\d{2}-\d{2}$/;
|
||||
if(deadline=="")
|
||||
{
|
||||
|
@ -39,10 +39,42 @@
|
|||
return false;
|
||||
}
|
||||
}
|
||||
function regexEvaluationNum()
|
||||
{
|
||||
var evaluation_num = $.trim($("#bid_evaluation_num").val());
|
||||
var regex = /^\d+$/;
|
||||
if(evaluation_num=="")
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量不能为空");
|
||||
$("#bid_evaluation_num_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else if(regex.test(evaluation_num))
|
||||
{
|
||||
if(evaluation_num > 0)
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("填写正确");
|
||||
$("#bid_evaluation_num_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
|
||||
$("#bid_evaluation_num_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
|
||||
$("#bid_evaluation_num_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function submitHomework(id)
|
||||
{
|
||||
if(regexDeadLine()&®exName())
|
||||
if(regexDeadLine()&®exName()&®exEvaluationNum())
|
||||
{
|
||||
$("#edit_bid_" + id).submit();
|
||||
}
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<% if @statue == 1%>
|
||||
alert('启动成功');
|
||||
$("#<%= @bid.id %>_start_anonymous_comment").html('<%= link_to "关闭匿评", stop_anonymous_comment_bid_path(@bid), remote: true %>');
|
||||
$("#<%= @bid.id %>_start_anonymous_comment").remove();
|
||||
$("#<%= @bid.id %>_anonymous_comment").append('<%= link_to "关闭匿评", stop_anonymous_comment_bid_path(@bid), remote: true, id:"#{@bid.id}_stop_anonymous_comment" %>');
|
||||
$("#<%= @bid.id%>_stop_anonymous_comment").attr("data-confirm","关闭匿评后学生将不能对作业进行评分,且学生作业列表将会被公开\n是否确定关闭匿评?");
|
||||
<% elsif @statue == 2 %>
|
||||
alert('启动失败\n作业总数大于4份时才能启动匿评');
|
||||
alert('启动失败\n作业总数大于等于2份时才能启动匿评');
|
||||
<% elsif @statue == 3%>
|
||||
alert("已开启匿评,请务重复开启");
|
||||
<% end %>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<div class="dis">
|
||||
<div class="msg_box" id='leave-message'>
|
||||
<h4>留言内容</h4>
|
||||
<%= render :partial => 'new', :locals => {:contest => @contest, :sta => @state} %>
|
||||
|
@ -9,4 +10,5 @@
|
|||
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
|
||||
</div>
|
||||
|
||||
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true%></ul>
|
||||
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul>
|
||||
</div>
|
|
@ -1,3 +1,4 @@
|
|||
<div class="dis">
|
||||
<div class="msg_box" id='leave-message'>
|
||||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
|
||||
|
@ -26,4 +27,5 @@
|
|||
<div id="history">
|
||||
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
|
||||
</div>
|
||||
|
||||
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul>
|
||||
</div>
|
|
@ -37,7 +37,7 @@
|
|||
</p>
|
||||
<% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %>
|
||||
<p>
|
||||
<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();", :readonly => true) %>
|
||||
<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:100px;",:value => "#{time}", :onchange => "regexDeadLine();", :readonly => true) %>
|
||||
<%= calendar_for('bid_deadline')%>
|
||||
<span id="bid_deadline_span">
|
||||
</span>
|
||||
|
@ -48,6 +48,10 @@
|
|||
<p>
|
||||
<%= f.select :proportion, proportion_option %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%>
|
||||
<span id="bid_evaluation_num_span">匿评分配数量不宜太大,否则会影响开启匿评速度</span>
|
||||
</p>
|
||||
<p>
|
||||
<%= hidden_field_tag 'course_id', @course.id %>
|
||||
</p>
|
||||
|
|
|
@ -43,10 +43,4 @@ function checkMaxLength() {
|
|||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="pagination" style="float:left;">
|
||||
<ul>
|
||||
<%= pagination_links_full @feedback_pages %>
|
||||
</ul>
|
||||
</div>
|
||||
<% html_title(l(:label_course_feedback)) -%>
|
|
@ -1,7 +1,7 @@
|
|||
<script type="text/javascript">
|
||||
function regexName()
|
||||
{
|
||||
var name = $("#bid_name").val();
|
||||
var name = $.trim($("#bid_name").val());
|
||||
|
||||
if(name=="")
|
||||
{
|
||||
|
@ -18,7 +18,7 @@
|
|||
}
|
||||
function regexDeadLine()
|
||||
{
|
||||
var deadline = $("#bid_deadline").val();
|
||||
var deadline = $.trim($("#bid_deadline").val());
|
||||
var regex = /^\d{4}-\d{2}-\d{2}$/;
|
||||
if(deadline=="")
|
||||
{
|
||||
|
@ -39,10 +39,42 @@
|
|||
return false;
|
||||
}
|
||||
}
|
||||
function regexEvaluationNum()
|
||||
{
|
||||
var evaluation_num = $.trim($("#bid_evaluation_num").val());
|
||||
var regex = /^\d+$/;
|
||||
if(evaluation_num=="")
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量不能为空");
|
||||
$("#bid_evaluation_num_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else if(regex.test(evaluation_num))
|
||||
{
|
||||
if(evaluation_num > 0)
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("填写正确");
|
||||
$("#bid_evaluation_num_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
|
||||
$("#bid_evaluation_num_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
|
||||
$("#bid_evaluation_num_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function submitHomework()
|
||||
{
|
||||
if(regexDeadLine()&®exName())
|
||||
if(regexDeadLine()&®exName()&®exEvaluationNum())
|
||||
{
|
||||
$("#new_bid").submit();
|
||||
}
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
<span style="color:#a6a6a6; margin-right:20px; margin-left:10px;"><%= format_time(jour.created_on) %></span>
|
||||
<span style="font-weight:bold; color:#a6a6a6; ">
|
||||
<% if show_score %>
|
||||
<%= l(:label_work_rating) %>:
|
||||
<span style="float:left">
|
||||
<%= l(:label_work_rating) %>:
|
||||
</span>
|
||||
<%= render :partial => 'show_score', locals: {:stars => get_homework_score(jour.user,@homework ) } %>
|
||||
<% end %>
|
||||
</span>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<% if is_comprehensive_evaluation == 3 || User.current == homework.user%>
|
||||
<%= l(:label_work_rating) %>:
|
||||
<%= render :partial => 'show_score', locals: {:stars => totle_score} %>
|
||||
<!-- <#%= l(:label_work_rating) %>:
|
||||
<%#= render :partial => 'show_score', locals: {:stars => totle_score} %> -->
|
||||
<% elsif is_comprehensive_evaluation == 2 %>
|
||||
<%= l(:label_work_rating) %>:
|
||||
<% if has_evaluation %>
|
||||
<%= render :partial => 'show_score', locals: {:stars => totle_score} %>
|
||||
|
||||
<% else %>
|
||||
<%= l(:label_work_rating) %>:
|
||||
<%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -107,9 +107,9 @@
|
|||
<span id="<%=@bid.id %>_anonymous_comment">
|
||||
<% case @bid.comment_status %>
|
||||
<% when 0 %>
|
||||
<%= link_to '启动匿评', start_anonymous_comment_bid_path(@bid), id: "#{@bid.id}_start_anonymous_comment", remote: true, :confirm => "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n是否确定开启匿评?" %>
|
||||
<%= link_to '启动匿评', start_anonymous_comment_bid_path(@bid), id: "#{@bid.id}_start_anonymous_comment", remote: true, :confirm => "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n是否确定开启匿评?", disable_with: '加载中...' %>
|
||||
<% when 1 %>
|
||||
<%= link_to '关闭匿评', stop_anonymous_comment_bid_path(@bid), id: "#{@bid.id}_stop_anonymous_comment", remote: true, :confirm => "关闭匿评后学生将不能对作业进行评分\n是否确定关闭匿评?" %>
|
||||
<%= link_to '关闭匿评', stop_anonymous_comment_bid_path(@bid), id: "#{@bid.id}_stop_anonymous_comment", remote: true, :confirm => "关闭匿评后学生将不能对作业进行评分,且学生作业列表将会被公开\n是否确定关闭匿评?" %>
|
||||
<% when 2 %>
|
||||
匿评结束
|
||||
<% end %>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<div class="dis">
|
||||
<div class="msg_box" id='leave-message'>
|
||||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
|
||||
|
@ -24,6 +25,7 @@
|
|||
|
||||
</div>
|
||||
<div id="history">
|
||||
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
|
||||
<%= render :partial => 'history',:locals => { :journals => @jour, :state => false} %>
|
||||
</div>
|
||||
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
|
||||
<div class="ping_ctt">
|
||||
<div id="tbc_01" class="ping_dis">
|
||||
<% if journals.size > 0 %>
|
||||
<% for journal in journals %>
|
||||
<div class="ping_C" id='word_li_<%= journal.id.to_s %>'>
|
||||
<div class="ping_dispic"><a target="_blank" href="#"><%= image_tag(url_to_avatar(journal.user)) %></a></div>
|
||||
<div class="ping_discon" style="width: 85%;">
|
||||
<div class="ping_distop">
|
||||
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
|
||||
<span><%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%></span><span style="color:#a6a6a6; margin-right:40px; margin-left:30px;"><%= format_time(journal.created_on) %></span>
|
||||
<div class="cl"></div>
|
||||
<p><%= textilizable journal.notes%></p>
|
||||
</div>
|
||||
<div class="ping_disfoot">
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
<span style="float: right">
|
||||
<% if journal.user == User.current|| User.current.admin? %>
|
||||
<%= link_to(l(:label_bid_respond_delete),
|
||||
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
|
||||
:class => "delete", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
<% if reply_allow %>
|
||||
<%= link_to l(:label_bid_respond_quote),'',
|
||||
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"} %>
|
||||
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="font_lighter" style="float: right">
|
||||
<%= l(:label_bids_published) %>
|
||||
<%= time_tag(journal.created_on).html_safe %>
|
||||
<%= l(:label_bids_published_ago) %>
|
||||
</span>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
<% if reply_allow %>
|
||||
<div id='<%= ids %>' class="respond-form">
|
||||
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal,:show_name => true} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="clear: both;"></div>
|
||||
<div>
|
||||
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<div class="dis">
|
||||
<div class="msg_box" id='leave-message'>
|
||||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
|
||||
<h3><%= l(:label_user_response) %>(<span id="jour_count"><%= @obj_count%></span>)</h3>
|
||||
|
||||
<%= render :partial => 'words/new', :locals => {:user => @user, :sta => @state} %>
|
||||
|
||||
</div>
|
||||
<div id="history">
|
||||
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
|
||||
</div>
|
||||
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul>
|
||||
</div>
|
|
@ -1,18 +1,7 @@
|
|||
<div style="margin-top: 30px">
|
||||
<div id='leave-message'>
|
||||
<%= render :partial => 'words/new', :locals => {:user => @user, :sta => @state} %>
|
||||
</div>
|
||||
<div style="border-bottom: 1px dashed rgb(204, 204, 204);font-size: 14px; font-family: '微软雅黑'; padding-bottom: 10px; font-weight: bold; color:#807a76">
|
||||
<%= l(:label_newfeedback_message) %>(<%= @feedback_count%>)
|
||||
</div>
|
||||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
<%= stylesheet_link_tag 'css', :media => 'all' %>
|
||||
|
||||
<div id="message" style="font-size: 14px;">
|
||||
<%= render :partial => 'words/message', :locals => {:jour => @jour, :state => @state, :user => @user, :feedback_pages => @feedback_pages} %>
|
||||
</div>
|
||||
<div class="pagination" style="float:left;">
|
||||
<ul>
|
||||
<%= pagination_links_full @feedback_pages %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial => 'user_jours',
|
||||
:locals => { :journals => @jour, :state => false}
|
||||
%>
|
||||
<% html_title(l(:label_responses)) -%>
|
|
@ -64,12 +64,12 @@ function checkMaxLength() {
|
|||
<div style="clear: both;"></div>
|
||||
<div id='<%= ids %>' class="respond-form">
|
||||
<% if reply_allow %>
|
||||
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
|
||||
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal,:show_name => show_name} %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
<div>
|
||||
<%= render :partial => "words/journal_reply", :locals => {:journal => journal } %>
|
||||
<%= render :partial => "words/journal_reply", :locals => {:journal => journal,:show_name => show_name } %>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
$('#message').html('<%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages})) %>');
|
||||
//$('#message').html('<#%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages,:show_name => true})) %>');
|
||||
$('#history').html('<%= escape_javascript(render(:partial => 'users/history',:locals => { :journals => @jour, :state => false})) %>')
|
||||
$('#jour_count').html('<%= @obj_count%>')
|
||||
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
|
||||
$('#new_form_user_message').val("");
|
||||
$('#new_form_reference_user_id').val("");
|
|
@ -1459,7 +1459,7 @@ zh:
|
|||
label_newtype_contest: 发布竞赛
|
||||
|
||||
label_user_information: "与我相关"
|
||||
label_bid_succeed: "需求发布成功"
|
||||
label_bid_succeed: "作业创建成功"
|
||||
label_wrong_budget: 错误的金额格式
|
||||
label_wrong_date: 时间格式错误,请输入正确的时间 yyyy-mm-dd
|
||||
label_bidding_succeed: 应标成功
|
||||
|
@ -2183,4 +2183,5 @@ zh:
|
|||
label_teacher_comments: 教师评论
|
||||
label_anonymous_comments: 匿评
|
||||
label_anonymous: 匿名
|
||||
label_submit_comments: 提交评论
|
||||
label_submit_comments: 提交评论
|
||||
field_evaluation_num: 匿评分配数量
|
|
@ -0,0 +1,5 @@
|
|||
class AddEvaluationNumToBid < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :bids, :evaluation_num, :integer, default: 3
|
||||
end
|
||||
end
|
18
db/schema.rb
18
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20141102054414) do
|
||||
ActiveRecord::Schema.define(:version => 20141105012624) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -109,6 +109,7 @@ ActiveRecord::Schema.define(:version => 20141102054414) do
|
|||
t.integer "is_evaluation"
|
||||
t.integer "proportion", :default => 60
|
||||
t.integer "comment_status", :default => 0
|
||||
t.integer "evaluation_num", :default => 3
|
||||
end
|
||||
|
||||
create_table "boards", :force => true do |t|
|
||||
|
@ -178,13 +179,6 @@ ActiveRecord::Schema.define(:version => 20141102054414) do
|
|||
|
||||
add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true
|
||||
|
||||
create_table "class_members", :force => true do |t|
|
||||
t.integer "member_id"
|
||||
t.integer "course_class_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "code_review_assignments", :force => true do |t|
|
||||
t.integer "issue_id"
|
||||
t.integer "change_id"
|
||||
|
@ -317,14 +311,6 @@ ActiveRecord::Schema.define(:version => 20141102054414) do
|
|||
t.integer "container_id", :default => 0
|
||||
end
|
||||
|
||||
create_table "course_classes", :force => true do |t|
|
||||
t.string "name"
|
||||
t.text "explain"
|
||||
t.integer "course_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "course_infos", :force => true do |t|
|
||||
t.integer "course_id"
|
||||
t.integer "user_id"
|
||||
|
|
|
@ -82,7 +82,7 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;}
|
|||
.ping_star{ width:160px; color:#333; font-weight:bold; margin-bottom:5px;}
|
||||
.ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png) -2px 0 no-repeat; margin-right:3px;}
|
||||
.ping_star span a:hover{background:url(images/star.png) -24px 0 no-repeat;}
|
||||
.ping_con textarea{ width:455px; height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;}
|
||||
.ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;}
|
||||
a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;}
|
||||
a.ping_sub1{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;}
|
||||
a:hover.ping_sub{ background:#14a8b9;}
|
||||
|
@ -92,7 +92,7 @@ a:hover.ping_sub{ background:#14a8b9;}
|
|||
.recall_head img{ height:30px; width:30px;}
|
||||
.recall_head a:hover{border:1px solid #15bccf;}
|
||||
.recall_head img:hover{border:1px solid #15bccf;}
|
||||
.recall_con{ float:left;color:#777777; width:90%; margin-left:10px; }
|
||||
.recall_con{ float:left;color:#777777; margin-left:10px; }
|
||||
.recall_con a{ color:#15bccf; }
|
||||
|
||||
.ping_list{ margin-top:15px;}
|
||||
|
@ -110,7 +110,7 @@ a:hover.ping_sub{ background:#14a8b9;}
|
|||
.ping_C{border-bottom:1px dashed #CCC; padding:5px;}
|
||||
.ping_dispic a{ display:block; height:46px; width:46px; border:1px solid #CCC; padding:1px; float:left;}
|
||||
.ping_dispic img{ height:46px; width:46px;}
|
||||
.ping_discon{ float:left; width:372px; margin-left:15px;}
|
||||
.ping_discon{ float:left; width:350px; margin-left:15px;}
|
||||
.ping_distop span{ float:left;}
|
||||
.ping_distop p{ color:#5f5f5f;}
|
||||
.ping_disfoot a{ float:right; color:#15bccf; margin-left:5px;}
|
||||
|
|
Loading…
Reference in New Issue