Merge branch 'szzh' into develop

course_group v20141009
sw 11 years ago
commit 6f009df2e7

@ -195,6 +195,8 @@ class AttachmentsController < ApplicationController
end end
elsif !@attachment.container.nil? && @attachment.container.is_a?(Softapplication) elsif !@attachment.container.nil? && @attachment.container.is_a?(Softapplication)
format.html { redirect_to_referer_or softapplications_path(@attachment.container) } format.html { redirect_to_referer_or softapplications_path(@attachment.container) }
elsif !@attachment.container.nil? && @attachment.container.is_a?(Bid)
format.html { redirect_to_referer_or respond_path(@attachment.container) }
else else
if @project.nil? if @project.nil?
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) } format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }

@ -496,11 +496,18 @@ class BidsController < ApplicationController
#@homework_list = @bid.homeworks #@homework_list = @bid.homeworks
#增加作业按评分排序, #增加作业按评分排序,
#@homework_list = @bid.homeworks.eager_load(:rate_averages, :user, :attachments).order('seems_rateable_cached_ratings.avg DESC').order("#{HomeworkAttach.table_name}.created_at ASC") #@homework_list = @bid.homeworks.eager_load(:rate_averages, :user, :attachments).order('seems_rateable_cached_ratings.avg DESC').order("#{HomeworkAttach.table_name}.created_at ASC")
@homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*, all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{@bid.author_id}) AS t_score, (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{@bid.author_id}) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id <> #{@bid.author_id}) AS s_score (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id <> #{@bid.author_id}) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY
(CASE WHEN t_score IS NULL THEN 0 ELSE t_score * #{teacher_proportion} END + CASE WHEN s_score IS NULL THEN 0 ELSE s_score * #{1 - teacher_proportion} END) DESC,created_at ASC") (CASE WHEN t_score IS NULL THEN 0 ELSE t_score * #{teacher_proportion} END + CASE WHEN s_score IS NULL THEN 0 ELSE s_score * #{1 - teacher_proportion} END) DESC,created_at ASC")
limit = 10
feedback_count = all_homework_list.count
@feedback_pages = Paginator.new feedback_count, limit, params['page']
offset ||= @feedback_pages.offset
@homework_list = all_homework_list[offset, limit]
if params[:student_id].present? if params[:student_id].present?
@temp = [] @temp = []
@homework_list.each do |pro| @homework_list.each do |pro|
@ -832,15 +839,25 @@ class BidsController < ApplicationController
} }
end end
else else
render 403 render_403
end end
end end
def update def update
@bid = Bid.find(params[:id]) @bid = Bid.find(params[:id])
@course = @bid.courses.first#Project.find(params[:course_id]) @course = @bid.courses.first#Project.find(params[:course_id])
@bid.name = params[:bid][:name]
@bid.description = params[:bid][:description]
@bid.is_evaluation = params[:bid][:is_evaluation]
@bid.proportion = params[:bid][:proportion]
@bid.reward_type = 3
@bid.deadline = params[:bid][:deadline]
@bid.budget = 0
@bid.author_id = User.current.id
@bid.commit = 0
@bid.homework_type = 1
@bid.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads])) @bid.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads]))
if @bid.update_attributes(params[:bid]) && @bid.save if @bid.save
flash[:notice] = l(:label_update_homework_succeed) flash[:notice] = l(:label_update_homework_succeed)
redirect_to course_homework_path(@course) redirect_to course_homework_path(@course)
else else

@ -258,7 +258,7 @@ class ContestsController < ApplicationController
contests.each do |contest| contests.each do |contest|
contest.projects.each do |project| contest.projects.each do |project|
@uers += project.users @users += project.users
end end
end end
# end # end

@ -175,7 +175,7 @@ class CoursesController < ApplicationController
## 有角色参数的才是课程,没有的就是项目 ## 有角色参数的才是课程,没有的就是项目
@render_file = 'member_list' @render_file = 'member_list'
@teachers= searchTeacherAndAssistant(@course) @teachers= searchTeacherAndAssistant(@course)
@canShowCode = isCourseTeacher(User.current.id,@course) @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
case params[:role] case params[:role]
when '1' when '1'
@subPage_title = l :label_teacher_list @subPage_title = l :label_teacher_list
@ -216,10 +216,15 @@ class CoursesController < ApplicationController
end end
def settings def settings
@issue_custom_fields = IssueCustomField.sorted.all if User.current.allowed_to?(:as_teacher,@course)
@issue_category ||= IssueCategory.new @issue_custom_fields = IssueCustomField.sorted.all
@member ||= @course.members.new @issue_category ||= IssueCategory.new
@trackers = Tracker.sorted.all @member ||= @course.members.new
@trackers = Tracker.sorted.all
else
render_403
end
end end
def create def create
@ -470,23 +475,27 @@ class CoursesController < ApplicationController
end end
def homework def homework
@offset, @limit = api_offset_and_limit({:limit => 10}) if @course.is_public != 0 || User.current.member_of_course?(@course)
@bids = @course.homeworks.order('deadline DESC') @offset, @limit = api_offset_and_limit({:limit => 10})
@bids = @bids.like(params[:name]) if params[:name].present? @bids = @course.homeworks.order('deadline DESC')
@bid_count = @bids.count @bids = @bids.like(params[:name]) if params[:name].present?
@bid_pages = Paginator.new @bid_count, @limit, params['page'] @bid_count = @bids.count
@bid_pages = Paginator.new @bid_count, @limit, params['page']
@offset ||= @bid_pages.reverse_offset
unless @offset == 0 @offset ||= @bid_pages.reverse_offset
@bids = @bids.offset(@offset).limit(@limit).all.reverse unless @offset == 0
else @bids = @bids.offset(@offset).limit(@limit).all.reverse
limit = @bid_count % @limit else
if limit == 0 limit = @bid_count % @limit
limit = 10 if limit == 0
limit = 10
end
@bids = @bids.offset(@offset).limit(limit).all.reverse
end end
@bids = @bids.offset(@offset).limit(limit).all.reverse render :layout => 'base_courses'
else
render_403
end end
render :layout => 'base_courses'
end end
# 新建作业 # 新建作业

@ -148,6 +148,7 @@ class MemosController < ApplicationController
@memo.update_column(:sticky, params[:memo][:sticky]) && @memo.update_column(:sticky, params[:memo][:sticky]) &&
@memo.update_column(:lock, params[:memo][:lock])) @memo.update_column(:lock, params[:memo][:lock]))
@memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads])) @memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads]))
@memo.save
# @memo.root.update_attribute(:updated_at, @memo.updated_at) # @memo.root.update_attribute(:updated_at, @memo.updated_at)
format.html {redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}"} format.html {redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}"}
else else

@ -97,7 +97,7 @@ module WatchersHelper
return '' unless user && user.logged? return '' unless user && user.logged?
# modify by nwb # modify by nwb
# 主讲教师不允许退出课程 # 主讲教师不允许退出课程
return '' if user.id == course.tea_id return '' if user.id == course.tea_id || course.is_public == 0
joined = user.member_of_course?(course) joined = user.member_of_course?(course)
text = joined ? l(:label_exit_course) : l(:label_join_course) text = joined ? l(:label_exit_course) : l(:label_join_course)
url_t = join_path(:object_id => course.id) url_t = join_path(:object_id => course.id)

@ -137,7 +137,7 @@ module WelcomeHelper
#获取课程列表 #获取课程列表
# add by nwb # add by nwb
def find_miracle_course(sum=10, max_rate=7, school_id) def find_miracle_course(sum=10, max_rate=7, school_id)
if User.current.user_extensions.school.nil? and school_id.nil? if User.current.user_extensions.nil? && User.current.user_extensions.school.nil? and school_id.nil?
Course.active.visible. Course.active.visible.
joins(:memberships). joins(:memberships).
group('members.course_id'). group('members.course_id').

@ -1,6 +1,6 @@
class Softapplication < ActiveRecord::Base class Softapplication < ActiveRecord::Base
attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers, :deposit_project_url, :deposit_project attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers, :deposit_project_url, :deposit_project
acts_as_attachable acts_as_attachable :view_permission => :view_files
seems_rateable :allow_update => true, :dimensions => :quality seems_rateable :allow_update => true, :dimensions => :quality

@ -3,14 +3,17 @@
<% container.attachments.each_with_index do |attachment, i| %> <% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment"> <span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
if attachment.id.nil? <span class="ispublic-label"><%= l(:field_is_public)%>:</span>
else <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%>
<%= if attachment.id.nil?
#待补充代码
else
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
end end
%> %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span> </span>
<% end %> <% end %>

@ -1,44 +1,45 @@
<!-- fq --> <!-- fq -->
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
function show(id, id_t, label_reward, label_money, label_credit, label_content) { function show(id, id_t, label_reward, label_money, label_credit, label_content) {
var text = $('#' + id); var text = $('#' + id);
var text_t = $('#' + id_t); var text_t = $('#' + id_t);
if (text.val() == 0) { if (text.val() == 0) {
text_t.attr("placeholder", label_reward); text_t.attr("placeholder", label_reward);
} }
if (text.val() == 1) { if (text.val() == 1) {
text_t.attr("placeholder", label_money); text_t.attr("placeholder", label_money);
} }
if (text.val() == 3) { if (text.val() == 3) {
text_t.attr("placeholder", label_credit); text_t.attr("placeholder", label_credit);
} }
if (text.val() == 2) { if (text.val() == 2) {
text_t.attr("placeholder", label_content); text_t.attr("placeholder", label_content);
} }
return content; return content;
} }
</script> </script>
<%= error_messages_for 'bid' %> <%= error_messages_for 'bid' %>
<!--[form:project]-->
<p><%= l(:label_homeworks_form_new_description) %></p> <p><%= l(:label_homeworks_form_new_description) %></p>
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT %></p> <p>
<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :onblur => "regexName();" %>
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %></p>
<!-- <p><%#= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '3'>#{l(:label_bids_credit)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
:onChange => "show('bid_reward_type', 'bid_budget', '"+l(:label_bids_reward_what)+"','"+l(:label_bids_new_money)+"','"+l(:label_bids_new_credit)+"','"+l(:label_bids_new_content)+"')" %>
<%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
</p> -->
<p><%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;" %><%= calendar_for('bid_deadline')%>
</p> </p>
<!-- <p><span id="bid_name_span"></span></p>
<p><%#= f.select :homework_type, homework_type_option %>
<p><%= 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;", :onchange => "regexDeadLine();") %>
<%= calendar_for('bid_deadline')%>
<span id="bid_deadline_span">
</span>
</p> </p>
-->
<p><%= f.select :is_evaluation, is_evaluation_option %> <p><%= f.select :is_evaluation, is_evaluation_option %>
<p><%= hidden_field_tag 'course_id', @project_id %> </p>
<p><%= f.select :proportion, proportion_option %>
</p>
<p><%= hidden_field_tag 'course_id', @course.id %>
</p> </p>
<fieldset><legend><%= l(:label_attachment_plural) %></legend> <fieldset><legend><%= l(:label_attachment_plural) %></legend>
<div class="tabDiv"><%= render :partial => 'attachments/form', :locals => {:container => @bid} %></div> <p><%= render :partial => 'attachments/form', :locals => {:container => @homework} %></p>
</fieldset> </fieldset>

@ -136,7 +136,8 @@
<td> <td>
<strong>终评得分:&nbsp; <strong>终评得分:&nbsp;
<%# totle_homework_score = score_for_homework(homework) %> <%# totle_homework_score = score_for_homework(homework) %>
<% totle_homework_score = format("%.2f",(homework.t_score.nil? ? 0.00 : homework.t_score) * (@bid.proportion * 1.0 / 100) + (homework.s_score.nil? ? 0.00 : homework.s_score) * (1 - @bid.proportion * 1.0 / 100)) %> <% totle_homework_score = format("%.2f",(homework.t_score.nil? ? 0.00 : homework.t_score) * ((@bid.proportion.nil? ? 60 : @bid.proportion) * 1.0 / 100) +
(homework.s_score.nil? ? 0.00 : homework.s_score) * (1 - (@bid.proportion.nil? ? 60 : @bid.proportion) * 1.0 / 100)) %>
<span style="color:<%= totle_homework_score == "0.00"? "#727272" : "#EC6300"%> ;"> <span style="color:<%= totle_homework_score == "0.00"? "#727272" : "#EC6300"%> ;">
<% score = totle_homework_score == "0.00"? "N/A" : totle_homework_score %> <% score = totle_homework_score == "0.00"? "N/A" : totle_homework_score %>
<%= score %> <%= score %>
@ -152,4 +153,11 @@
</tr> </tr>
</table> </table>
<div class="line_under"></div> <div class="line_under"></div>
<% end %> <% end %>
<!--分页-->
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
</ul>
</div>

@ -1,9 +1,60 @@
<h3>修改作业</h3> <script type="text/javascript">
function regexName()
{
var name = $("#bid_name").val();
if(name=="")
{
$("#bid_name_span").text("名称不能为空");
$("#bid_name_span").css('color','#ff0000');
return false;
}
else
{
$("#bid_name_span").text("填写正确");
$("#bid_name_span").css('color','#008000');
return true;
}
}
function regexDeadLine()
{
var deadline = $("#bid_deadline").val();
var regex = /^\d{4}-\d{2}-\d{2}$/;
if(deadline=="")
{
$("#bid_deadline_span").text("截止日期不能为空");
$("#bid_deadline_span").css('color','#ff0000');
return false;
}
else if(regex.test(deadline))
{
$("#bid_deadline_span").text("填写正确");
$("#bid_deadline_span").css('color','#008000');
return true;
}
else
{
$("#bid_deadline_span").text("截止日期格式错误");
$("#bid_deadline_span").css('color','#ff0000');
return false;
}
}
function submitHomework(id)
{
if(regexDeadLine()&&regexName())
{
$("#edit_bid_" + id).submit();
}
}
</script>
<h3><%= l(:label_edit_homework) %></h3>
<%= labelled_form_for @bid do |f| %> <%= labelled_form_for @bid do |f| %>
<div class="box tabular"> <div class="box tabular">
<%= render :partial => 'homework_form', :locals => { :f => f } %> <%#= render :partial => 'homework_form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %> <%= render :partial => 'homework_form', :locals => { :f => f } %>
<%= javascript_tag "$('#bid_name').focus();" %> <input type="button" onclick="submitHomework(<%= @bid.id%>);" value="<%= l(:button_create)%>" class="enterprise">
<% end %> <% end %>
</div> </div>

@ -1,7 +1,7 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% reply_allow = JournalsForMessage.create_by_user? User.current %>
<div style="margin-left: 20px;"> <div style="margin-left: 20px;">
<span class="portrait"><%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%></span> <span class="portrait"><%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%></span>
<span class="body"> <span class="body" style="word-break: break-all;word-wrap: break-word;">
<h3><%= link_to(@bid.author.lastname+@bid.author.firstname, user_path(@bid.author))%><%= link_to(@bid.name,respond_path(@bid)) %></h3> <h3><%= link_to(@bid.author.lastname+@bid.author.firstname, user_path(@bid.author))%><%= link_to(@bid.name,respond_path(@bid)) %></h3>
<% if @bid.reward_type.nil? or @bid.reward_type == 1%> <% if @bid.reward_type.nil? or @bid.reward_type == 1%>
<p> <p>
@ -16,7 +16,7 @@
<div class="bid_description"> <div class="bid_description">
<%= textilizable(@bid, :description) %> <%= textilizable(@bid, :description) %>
<% if @bid.attachments.any?%> <% if @bid.attachments.any?%>
<% options = {:author => true} %> <% options = {:author => true,:deletable => (@bid.author.id == User.current.id || User.current.admin? ? true : false)} %>
<%= render :partial => 'attachments/links', :locals => {:attachments => @bid.attachments, :options => options} %> <%= render :partial => 'attachments/links', :locals => {:attachments => @bid.attachments, :options => options} %>
<% end %> <% end %>
</div> </div>

@ -40,7 +40,9 @@
<td> <td>
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"><%= l(:label_class_period) %> <span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"><%= l(:label_class_period) %>
<span class="required"> *&nbsp;&nbsp;</span></span> <span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px;"><%= text_field_tag :class_period, @course.class_period, :placeholder => "在此输入课时", :maxlength => 5 %></span> <span class="info" style="width: 10px;">
<%= text_field_tag :class_period, @course.class_period, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %>
</span>
<span>&nbsp;<strong><%= l(:label_class_hour) %></strong></span> <span>&nbsp;<strong><%= l(:label_class_hour) %></strong></span>
</td> </td>
</tr> </tr>
@ -53,7 +55,10 @@
<td> <td>
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"><%= l(:label_class_period) %> <span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"><%= l(:label_class_period) %>
<span class="required"> *&nbsp;&nbsp;</span></span> <span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px;"><%= text_field_tag :class_period, nil, :placeholder => "在此输入课时", :maxlength => 5 %></span><strong><%= l(:label_class_hour) %></strong> <span class="info" style="width: 10px;">
<%= text_field_tag :class_period, nil, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %>
</span>
<strong><%= l(:label_class_hour) %></strong>
</td> </td>
</tr> </tr>
</table> </table>

@ -34,9 +34,9 @@
<%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %> <%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
</p> --> </p> -->
<% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %> <% 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();") %><%= calendar_for('bid_deadline')%> <p><%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();") %>
<%= calendar_for('bid_deadline')%>
<span id="bid_deadline_span"> <span id="bid_deadline_span">
</span> </span>
</p> </p>
<p><%= f.select :is_evaluation, is_evaluation_option %> <p><%= f.select :is_evaluation, is_evaluation_option %>

@ -13,7 +13,7 @@
<% end %> <% end %>
<!--teacher's code disapeared moified by huang--> <!--teacher's code disapeared moified by huang-->
<%if @canShowCode%> <% if @canShowCode %>
<%= content_tag "p", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :class => "nomargin avatar_name" %> <%= content_tag "p", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :class => "nomargin avatar_name" %>
<% end %> <% end %>
<div class ="clear avatar_name"> &nbsp; <div class ="clear avatar_name"> &nbsp;

@ -34,7 +34,7 @@
<div id="account"> <div id="account">
<%= render_menu :account_menu -%> <%= render_menu :account_menu -%>
</div> </div>
<% if User.current.logged? -%> <% if User.current.logged? -%>
<div id="loggedas"> <div id="loggedas">
<ul style="padding:0 0; margin:0 0;display:inline;"> <ul style="padding:0 0; margin:0 0;display:inline;">
<li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;" class="loggedas_li"> <li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;" class="loggedas_li">

@ -74,11 +74,10 @@
<td align="center"> <td align="center">
<div id="join_in_course"> <div id="join_in_course">
<% if User.current.logged? %> <% if User.current.logged? %>
<% if @course.teacher.id == User.current.id %> <% if User.current.allowed_to?(:as_teacher,@course) %>
<%= link_to l(:label_course_modify_settings), {:controller => 'courses', :action => 'settings', :id => @course} %> <%= link_to l(:label_course_modify_settings), {:controller => 'courses', :action => 'settings', :id => @course} %>
<%= render :partial => 'courses/set_course_time', :locals => {:course => @course} %> <%= render :partial => 'courses/set_course_time', :locals => {:course => @course} %>
<% else %> <% else %>
<%= join_in_course(@course, User.current) %> <%= join_in_course(@course, User.current) %>
<% end %> <% end %>
<% unless User.current.member_of_course?(@course) %> <% unless User.current.member_of_course?(@course) %>

@ -179,9 +179,9 @@
<div class="user_underline"></div> <div class="user_underline"></div>
<div class="font_title_left"> <div class="font_title_left">
<strong><%= l(:label_x_followers, :count => @contest.watcher_users.count) %></strong> <strong><%= l(:label_x_followers, :count => @contest.watcher_users.count) %></strong>
<!-- <% if show_more_fans?(@contest) %> <% if show_more_fans?(@contest) %>
<span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), :controller => 'contests', :action => 'show_contest_user'%></span> <span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), show_contest_user_contest_path(@contest) %></span>
<% end %> --> <% end %>
</div> </div>
<div class="left_wf"> <div class="left_wf">
<table> <table>

File diff suppressed because it is too large Load Diff

@ -26,8 +26,11 @@
</p> </p>
<p><%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %></p> <p><%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %></p>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> <script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
<p>
<%= l(:label_attachment_plural) %><br />
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
</p>
<br/> <br/>
<%= f.submit :value => l(:button_change) %>&nbsp;&nbsp;<%= link_to l(:button_back), back_url ,:class => "button-canel",:style => "color: #ffffff;"%> <%= f.submit :value => l(:button_change) %>&nbsp;&nbsp;<%= link_to l(:button_back), back_url ,:class => "button-canel",:style => "color: #ffffff;"%>
</div> </div>
<% end %> <% end %>
</div>

@ -96,11 +96,11 @@
</p> </p>
</div> </div>
<div class="memo-section" style="width: 100%;word-break: break-all;word-wrap: break-word;"> <div class="memo-section" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>" style="width: 83%;word-break: break-all;"> <div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>" style="width: 53%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
<% if @project %> <% if @project %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(29, omission: '...'), project_boards_path(@topic.project),title: @topic.subject.to_s %> <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project),title: @topic.subject.to_s %>
<% elsif @course %> <% elsif @course %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(29,omission:'...'), course_boards_path(@topic.course),title: @topic.subject.to_s %> <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, course_boards_path(@topic.course),title: @topic.subject.to_s %>
<% end %> <% end %>
</div> </div>
<div class="memo-content"> <div class="memo-content">

@ -64,12 +64,12 @@
<span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;"> <span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;">
<%= label_tips %> <%= label_tips %>
</span> </span>
<%= link_to(btn_tips,
new_course_news_path(@course),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
<% if @course && User.current.allowed_to?(:manage_news, @course) %> <% if @course && User.current.allowed_to?(:manage_news, @course) %>
<%= link_to(btn_tips, new_course_news_path(@course),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
<div id="add-news" class="add_frame" style="display:none;"> <div id="add-news" class="add_frame" style="display:none;">
<%= labelled_form_for @news, :url => course_news_index_path(@course), <%= labelled_form_for @news, :url => course_news_index_path(@course),
:html => {:id => 'news-form', :multipart => true} do |f| %> :html => {:id => 'news-form', :multipart => true} do |f| %>

@ -2120,7 +2120,7 @@ zh:
label_bug: 漏洞 label_bug: 漏洞
label_school_no_course: 该学校未开设任何课程,您可以查看其他学校课程 label_school_no_course: 该学校未开设任何课程,您可以查看其他学校课程
label_school_less_course: 该学校开设课程较少,您可以查看其他学校课程 label_school_less_course: 可以查看其他学校课程
label_file_not_found: 对不起,该文件现在不能下载 label_file_not_found: 对不起,该文件现在不能下载
label_goto_homepage: 返回主页 label_goto_homepage: 返回主页
@ -2143,3 +2143,5 @@ zh:
lable_bar_active: 贴吧动态 lable_bar_active: 贴吧动态
lable_student_list_visable: 学生列表是否公开 lable_student_list_visable: 学生列表是否公开
lable_sure_exit_project: 是否确认退出该项目 lable_sure_exit_project: 是否确认退出该项目
lable_input_class: 在此输入课时
lable_input_class_vilidate: 学时只能为整数

@ -132,6 +132,7 @@ RedmineApp::Application.routes.draw do
match 'add_softapplication' , :via => [:get, :post] match 'add_softapplication' , :via => [:get, :post]
match 'create' , :via => :post match 'create' , :via => :post
match 'settings' , :via => [:get, :post] match 'settings' , :via => [:get, :post]
match 'show_contest_user'
end end
end end

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save