Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
8485a59db6
|
@ -496,11 +496,18 @@ class BidsController < ApplicationController
|
|||
#@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 = 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 s_score
|
||||
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")
|
||||
|
||||
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?
|
||||
@temp = []
|
||||
@homework_list.each do |pro|
|
||||
|
@ -832,15 +839,25 @@ class BidsController < ApplicationController
|
|||
}
|
||||
end
|
||||
else
|
||||
render 403
|
||||
render_403
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@bid = Bid.find(params[: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]))
|
||||
if @bid.update_attributes(params[:bid]) && @bid.save
|
||||
if @bid.save
|
||||
flash[:notice] = l(:label_update_homework_succeed)
|
||||
redirect_to course_homework_path(@course)
|
||||
else
|
||||
|
|
|
@ -216,10 +216,15 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
def settings
|
||||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
@issue_category ||= IssueCategory.new
|
||||
@member ||= @course.members.new
|
||||
@trackers = Tracker.sorted.all
|
||||
if User.current.allowed_to?(:as_teacher,@course)
|
||||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
@issue_category ||= IssueCategory.new
|
||||
@member ||= @course.members.new
|
||||
@trackers = Tracker.sorted.all
|
||||
else
|
||||
render_403
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
|
@ -470,23 +475,27 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
def homework
|
||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
@bids = @course.homeworks.order('deadline DESC')
|
||||
@bids = @bids.like(params[:name]) if params[:name].present?
|
||||
@bid_count = @bids.count
|
||||
@bid_pages = Paginator.new @bid_count, @limit, params['page']
|
||||
if @course.is_public != 0 || User.current.member_of_course?(@course)
|
||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
@bids = @course.homeworks.order('deadline DESC')
|
||||
@bids = @bids.like(params[:name]) if params[:name].present?
|
||||
@bid_count = @bids.count
|
||||
@bid_pages = Paginator.new @bid_count, @limit, params['page']
|
||||
|
||||
@offset ||= @bid_pages.reverse_offset
|
||||
unless @offset == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
if limit == 0
|
||||
limit = 10
|
||||
@offset ||= @bid_pages.reverse_offset
|
||||
unless @offset == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
if limit == 0
|
||||
limit = 10
|
||||
end
|
||||
@bids = @bids.offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@bids = @bids.offset(@offset).limit(limit).all.reverse
|
||||
render :layout => 'base_courses'
|
||||
else
|
||||
render_403
|
||||
end
|
||||
render :layout => 'base_courses'
|
||||
end
|
||||
|
||||
# 新建作业
|
||||
|
|
|
@ -97,7 +97,7 @@ module WatchersHelper
|
|||
return '' unless user && user.logged?
|
||||
# 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)
|
||||
text = joined ? l(:label_exit_course) : l(:label_join_course)
|
||||
url_t = join_path(:object_id => course.id)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<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}][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;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%>
|
||||
<%= if attachment.id.nil?
|
||||
|
|
|
@ -1,44 +1,45 @@
|
|||
<!-- fq -->
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
function show(id, id_t, label_reward, label_money, label_credit, label_content) {
|
||||
var text = $('#' + id);
|
||||
var text_t = $('#' + id_t);
|
||||
if (text.val() == 0) {
|
||||
text_t.attr("placeholder", label_reward);
|
||||
}
|
||||
if (text.val() == 1) {
|
||||
text_t.attr("placeholder", label_money);
|
||||
}
|
||||
if (text.val() == 3) {
|
||||
text_t.attr("placeholder", label_credit);
|
||||
}
|
||||
if (text.val() == 2) {
|
||||
text_t.attr("placeholder", label_content);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
function show(id, id_t, label_reward, label_money, label_credit, label_content) {
|
||||
var text = $('#' + id);
|
||||
var text_t = $('#' + id_t);
|
||||
if (text.val() == 0) {
|
||||
text_t.attr("placeholder", label_reward);
|
||||
}
|
||||
if (text.val() == 1) {
|
||||
text_t.attr("placeholder", label_money);
|
||||
}
|
||||
if (text.val() == 3) {
|
||||
text_t.attr("placeholder", label_credit);
|
||||
}
|
||||
if (text.val() == 2) {
|
||||
text_t.attr("placeholder", label_content);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
</script>
|
||||
|
||||
<%= error_messages_for 'bid' %>
|
||||
<!--[form:project]-->
|
||||
<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><%#= f.select :homework_type, homework_type_option %>
|
||||
<p><span id="bid_name_span"></span></p>
|
||||
|
||||
<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><%= 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>
|
||||
<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>
|
|
@ -136,7 +136,8 @@
|
|||
<td>
|
||||
<strong>终评得分:
|
||||
<%# 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"%> ;">
|
||||
<% score = totle_homework_score == "0.00"? "N/A" : totle_homework_score %>
|
||||
<%= score %>
|
||||
|
@ -152,4 +153,11 @@
|
|||
</tr>
|
||||
</table>
|
||||
<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()&®exName())
|
||||
{
|
||||
$("#edit_bid_" + id).submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<h3><%= l(:label_edit_homework) %></h3>
|
||||
|
||||
<%= labelled_form_for @bid do |f| %>
|
||||
<div class="box tabular">
|
||||
<%= render :partial => 'homework_form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= javascript_tag "$('#bid_name').focus();" %>
|
||||
<%#= render :partial => 'homework_form', :locals => { :f => f } %>
|
||||
<%= render :partial => 'homework_form', :locals => { :f => f } %>
|
||||
<input type="button" onclick="submitHomework(<%= @bid.id%>);" value="<%= l(:button_create)%>" class="enterprise">
|
||||
<% end %>
|
||||
</div>
|
|
@ -1,7 +1,7 @@
|
|||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
<div style="margin-left: 20px;">
|
||||
<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>
|
||||
<% if @bid.reward_type.nil? or @bid.reward_type == 1%>
|
||||
<p>
|
||||
|
|
|
@ -40,7 +40,9 @@
|
|||
<td>
|
||||
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"><%= l(:label_class_period) %>
|
||||
<span class="required"> * </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> <strong><%= l(:label_class_hour) %></strong></span>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -53,7 +55,10 @@
|
|||
<td>
|
||||
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"><%= l(:label_class_period) %>
|
||||
<span class="required"> * </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>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -34,9 +34,9 @@
|
|||
<%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
|
||||
</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();") %><%= 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>
|
||||
</p>
|
||||
<p><%= f.select :is_evaluation, is_evaluation_option %>
|
||||
|
|
|
@ -74,11 +74,10 @@
|
|||
<td align="center">
|
||||
<div id="join_in_course">
|
||||
<% 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} %>
|
||||
<%= render :partial => 'courses/set_course_time', :locals => {:course => @course} %>
|
||||
<% else %>
|
||||
|
||||
<%= join_in_course(@course, User.current) %>
|
||||
<% end %>
|
||||
<% unless User.current.member_of_course?(@course) %>
|
||||
|
|
|
@ -24,17 +24,17 @@
|
|||
<script type="text/javascript">
|
||||
function startXMLHttp()
|
||||
{
|
||||
$.ajax({
|
||||
url: '<%= update_score_user_path(:format => 'js') %>',
|
||||
type: 'get',
|
||||
data: 'id=<%= @user.id %>',
|
||||
remote: true
|
||||
}) ;
|
||||
$.ajax({
|
||||
url: '<%= update_score_user_path(:format => 'js') %>',
|
||||
type: 'get',
|
||||
data: 'id=<%= @user.id %>',
|
||||
remote: true
|
||||
}) ;
|
||||
}
|
||||
|
||||
function t()
|
||||
{
|
||||
setInterval("startXMLHttp()",5000);
|
||||
setInterval("startXMLHttp()",5000);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -48,24 +48,30 @@
|
|||
<div id="main">
|
||||
<!--added by huang-->
|
||||
<div class="top-content">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="info_font" style="width: 238px; color: #15bccf"><%= l(:label_user_home) %></td>
|
||||
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
|
||||
<td rowspan="2" width="250px">
|
||||
<div class="top-content-search <%='hidden' if show_search_bar(params) %>">
|
||||
<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
|
||||
<%= text_field_tag 'name', params[:name], :size => 20 %>
|
||||
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px"><%=link_to request.host()+"/users" ,:controller => 'users', :action => 'index' %></td>
|
||||
<!-- modified by bai --> <td><%=link_to "主页", home_path %> > <%=link_to "软件创客", :controller => 'users', :action => 'index' %> > <span><%=link_to @user.name, user_path %></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="info_font" style="width: 238px; color: #15bccf"><%= l(:label_user_home) %></td>
|
||||
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
|
||||
<td rowspan="2" width="250px">
|
||||
<div class="top-content-search <%='hidden' if show_search_bar(params) %>">
|
||||
<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
|
||||
<%= text_field_tag 'name', params[:name], :size => 20 %>
|
||||
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px">
|
||||
<%=link_to request.host()+"/users" ,:controller => 'users', :action => 'index' %>
|
||||
</td>
|
||||
<td>
|
||||
<%=link_to "主页", home_path %> >
|
||||
<%=link_to "软件创客", :controller => 'users', :action => 'index' %> >
|
||||
<span><%=link_to @user.name, user_path %></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!--end-->
|
||||
<!--user page, add by huang-->
|
||||
|
@ -92,11 +98,12 @@
|
|||
<% end %></td>
|
||||
</tr>
|
||||
|
||||
<tr><td class="score">
|
||||
<div id="score_div">
|
||||
<%= render :partial => 'users/user_score', :locals => {:user => @user}%>
|
||||
</div>
|
||||
</td>
|
||||
<tr>
|
||||
<td class="score">
|
||||
<div id="score_div">
|
||||
<%= render :partial => 'users/user_score', :locals => {:user => @user}%>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end -->
|
||||
|
||||
|
@ -104,40 +111,45 @@
|
|||
</tr>
|
||||
</table>
|
||||
<div>
|
||||
<strong class="font_small_watch"><%= link_to l(:label_user_watcher)+"("+User.watched_by(@user.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist"%></strong>
|
||||
<strong class="font_small_watch">
|
||||
<%= link_to l(:label_user_watcher)+"("+User.watched_by(@user.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist"%>
|
||||
</strong>
|
||||
|
||||
<strong class="font_small_watch"><%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@user.watcher_users.count.to_s+")", :controller=>"users", :action=>"user_fanslist" %></strong>
|
||||
|
||||
<!-- <strong class="font_small_watch"><%= link_to l(:label_requirement_focus)+"("+Bid.watched_by(@user).where('reward_type = ?', 1).count.to_s+")" ,:controller=>"users", :action=>"watch_bids"%></strong>--> <!-- added by huang -->
|
||||
<!-- added by bai 个人签名-->
|
||||
<strong class="font_small_watch">
|
||||
<%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@user.watcher_users.count.to_s+")", :controller=>"users", :action=>"user_fanslist" %>
|
||||
</strong>
|
||||
<% if @user.id == User.current.id %>
|
||||
<p>
|
||||
<%= toggle_link l(:label_brief_introduction), 'introduction', {:focus => 'new_form_user_introduction'} %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% unless @user.user_extensions.nil? %>
|
||||
<p style="width: 100%;word-break: break-all;word-wrap: break-word;">
|
||||
<%= @user.user_extensions.brief_introduction %>
|
||||
</p>
|
||||
<p style="width: 100%;word-break: break-all;word-wrap: break-word;">
|
||||
<%= @user.user_extensions.brief_introduction %>
|
||||
</p>
|
||||
<% end %>
|
||||
<div id="introduction" style="display: none">
|
||||
<%= form_for('new_form', :method => :post,
|
||||
:url => {:controller => 'words', :action => 'add_brief_introdution'}) do |f|%>
|
||||
<table border="0" width="100%" align="center" >
|
||||
<tr>
|
||||
<td><%= f.text_area 'user_introduction', :rows => 3,
|
||||
:cols => 65,
|
||||
:placeholder => "#{l(:label_my_brief_introduction)}",
|
||||
:style => "resize: none;",
|
||||
:class => 'noline'%></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" width="200px" align="center">
|
||||
<tr>
|
||||
<td align="right"> <%= submit_tag l(:button_submit), :name => nil ,
|
||||
:class => "bid_btn" %></td>
|
||||
</tr>
|
||||
</table>
|
||||
:url => {:controller => 'words', :action => 'add_brief_introdution'}) do |f|%>
|
||||
<table border="0" width="100%" align="center" >
|
||||
<tr>
|
||||
<td>
|
||||
<%= f.text_area 'user_introduction', :rows => 3,
|
||||
:cols => 65,
|
||||
:placeholder => "#{l(:label_my_brief_introduction)}",
|
||||
:style => "resize: none;",
|
||||
:class => 'noline'%>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" width="200px" align="center">
|
||||
<tr>
|
||||
<td align="right">
|
||||
<%= submit_tag l(:button_submit), :name => nil ,
|
||||
:class => "bid_btn" %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
<!-- end -->
|
||||
|
@ -148,55 +160,64 @@
|
|||
<div class="inf_user_context">
|
||||
<table style="font-family:'微软雅黑'" width="240">
|
||||
<tr>
|
||||
<td style="padding-left: 5px" width="70px"><%= l(:label_user_joinin) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= format_time(@user.created_on) %></td>
|
||||
<td style="padding-left: 5px" width="70px">
|
||||
<%= l(:label_user_joinin) %>:
|
||||
</td>
|
||||
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
|
||||
<%= format_time(@user.created_on) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 5px"><%= l(:label_user_login) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px"><%= format_time(@user.last_login_on) %></td>
|
||||
<td style="padding-left: 5px">
|
||||
<%= l(:label_user_login) %>:
|
||||
</td>
|
||||
<td class="font_lighter_sidebar" style="padding-left: 0px">
|
||||
<%= format_time(@user.last_login_on) %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!--
|
||||
<tr>
|
||||
<td valign="top" style="padding-left: 5px;"><%#= l(:label_user_mail) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px; word-wrap: break-word; word-break: break-all"><%#= mail_to(h(@user.mail), nil, :encode => 'javascript') %></td>
|
||||
</tr>
|
||||
-->
|
||||
<!-- added by bai 在个人主页里显示“工作单位”“地区”"教师的职称"-->
|
||||
<!-- modified by linchun 在个人主页里显示“加入时间”,“最后登录”,“邮件地址”后面添加冒号-->
|
||||
<!-- modified by zjc 高校添加超链接 -->
|
||||
<% unless @user.user_extensions.nil? %>
|
||||
<% unless @user.user_extensions.identity == 2 %>
|
||||
<tr>
|
||||
<td style="padding-left: 5px" width="70px"><%= l(:field_occupation) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
|
||||
<% unless @user.user_extensions.school.nil? %>
|
||||
<a href="http://course.trustie.net/?school_id=<%= @user.user_extensions.school.id%>"><%= @user.user_extensions.school.name %></a>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% unless @user.user_extensions.identity == 2 %>
|
||||
<tr>
|
||||
<td style="padding-left: 5px" width="70px"><%= l(:field_occupation) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
|
||||
<% unless @user.user_extensions.school.nil? %>
|
||||
<a href="http://course.trustie.net/?school_id=<%= @user.user_extensions.school.id%>"><%= @user.user_extensions.school.name %></a>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td style="padding-left: 5px" width="76px"><%= l(:label_location) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= @user.user_extensions.location %><%= @user.user_extensions.location_city %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<% if @user.user_extensions.identity == 0 %>
|
||||
<td style="padding-left: 5px" width="76px">
|
||||
<%= l(:label_technical_title) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= @user.user_extensions.technical_title %></td>
|
||||
<td style="padding-left: 5px" width="76px">
|
||||
<%= l(:label_technical_title) %>:
|
||||
</td>
|
||||
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
|
||||
<%= @user.user_extensions.technical_title %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% if( (@user.user_extensions.identity == 1) && (is_watching?(@user) ) )%>
|
||||
<tr>
|
||||
<td style="padding-left: 8px" width="70px"><%= l(:label_bidding_user_studentcode)%>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= @user.user_extensions.student_id %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px" width="70px">
|
||||
<%= l(:label_bidding_user_studentcode)%>:
|
||||
</td>
|
||||
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
|
||||
<%= @user.user_extensions.student_id %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else%>
|
||||
<tr>
|
||||
<td style="padding-left: 8px" width="70px"><%= l(:field_occupation) %>:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px" width="70px"><%= l(:label_location) %>:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px" width="70px"><%= l(:field_occupation) %>:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px" width="70px"><%= l(:label_location) %>:</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<!-- end -->
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<!--Modified by nie-->
|
||||
<div class="user_underline"></div>
|
||||
|
@ -251,9 +272,9 @@
|
|||
<div id="content" style="padding-top: 0px;">
|
||||
<div class="tabs_new">
|
||||
<% if @user.user_extensions.identity == 2 %>
|
||||
<%= render_menu :user_enterprise_menu %>
|
||||
<%= render_menu :user_enterprise_menu %>
|
||||
<% else %>
|
||||
<%= render_menu :user_menu %>
|
||||
<%= render_menu :user_menu %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -96,11 +96,11 @@
|
|||
</p>
|
||||
</div>
|
||||
<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 %>
|
||||
<%= 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 %>
|
||||
<%= 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 %>
|
||||
</div>
|
||||
<div class="memo-content">
|
||||
|
|
|
@ -64,12 +64,12 @@
|
|||
<span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;">
|
||||
<%= label_tips %>
|
||||
</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) %>
|
||||
<%= 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;">
|
||||
<%= labelled_form_for @news, :url => course_news_index_path(@course),
|
||||
:html => {:id => 'news-form', :multipart => true} do |f| %>
|
||||
|
|
|
@ -2120,7 +2120,7 @@ zh:
|
|||
label_bug: 漏洞
|
||||
|
||||
label_school_no_course: 该学校未开设任何课程,您可以查看其他学校课程
|
||||
label_school_less_course: 该学校开设课程较少,您可以查看其他学校课程
|
||||
label_school_less_course: 您也可以查看其他学校课程
|
||||
|
||||
label_file_not_found: 对不起,该文件现在不能下载
|
||||
label_goto_homepage: 返回主页
|
||||
|
@ -2143,3 +2143,5 @@ zh:
|
|||
lable_bar_active: 贴吧动态
|
||||
lable_student_list_visable: 学生列表是否公开
|
||||
lable_sure_exit_project: 是否确认退出该项目
|
||||
lable_input_class: 在此输入课时
|
||||
lable_input_class_vilidate: 学时只能为整数
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddOpenStudentToCourse < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :courses, :open_student, :integer, :default => 0
|
||||
end
|
||||
end
|
|
@ -0,0 +1,12 @@
|
|||
class UpdateBidsProportion < ActiveRecord::Migration
|
||||
def up
|
||||
Bid.where("proportion is null").each do |bid|
|
||||
bid.proportion = 60
|
||||
bid.save
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
|
||||
end
|
||||
end
|
25
db/schema.rb
25
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20140916005319) do
|
||||
ActiveRecord::Schema.define(:version => 20141009010934) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -350,6 +350,7 @@ ActiveRecord::Schema.define(:version => 20140916005319) do
|
|||
t.integer "rgt"
|
||||
t.integer "is_public", :limit => 1, :default => 1
|
||||
t.integer "inherit_members", :limit => 1, :default => 1
|
||||
t.integer "open_student", :default => 0
|
||||
end
|
||||
|
||||
create_table "custom_fields", :force => true do |t|
|
||||
|
@ -437,9 +438,9 @@ ActiveRecord::Schema.define(:version => 20140916005319) do
|
|||
t.string "web_title"
|
||||
t.string "title"
|
||||
t.text "description"
|
||||
t.string "page_type"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "page_type"
|
||||
t.integer "sort_type"
|
||||
t.integer "image_width", :default => 107
|
||||
t.integer "image_height", :default => 63
|
||||
|
@ -878,18 +879,18 @@ ActiveRecord::Schema.define(:version => 20140916005319) do
|
|||
create_table "relative_memos", :force => true do |t|
|
||||
t.integer "osp_id"
|
||||
t.integer "parent_id"
|
||||
t.string "subject", :null => false
|
||||
t.text "content", :null => false
|
||||
t.string "subject", :null => false
|
||||
t.text "content", :limit => 16777215, :null => false
|
||||
t.integer "author_id"
|
||||
t.integer "replies_count", :default => 0
|
||||
t.integer "replies_count", :default => 0
|
||||
t.integer "last_reply_id"
|
||||
t.boolean "lock", :default => false
|
||||
t.boolean "sticky", :default => false
|
||||
t.boolean "is_quote", :default => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "viewed_count_crawl", :default => 0
|
||||
t.integer "viewed_count_local", :default => 0
|
||||
t.boolean "lock", :default => false
|
||||
t.boolean "sticky", :default => false
|
||||
t.boolean "is_quote", :default => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "viewed_count_crawl", :default => 0
|
||||
t.integer "viewed_count_local", :default => 0
|
||||
t.string "url"
|
||||
t.string "username"
|
||||
t.string "userhomeurl"
|
||||
|
|
|
@ -22,7 +22,7 @@ function addFile(inputEl, file, eagerUpload) {
|
|||
|
||||
fileSpan.append(
|
||||
$('<input>', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name),
|
||||
$('<input>', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 255, 'placeholder': $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload),
|
||||
$('<input>', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload),
|
||||
$('<span >公开:</span>').attr({ 'class': 'ispublic-label' }) ,
|
||||
$('<input>', { 'type': 'checkbox', 'class': 'is_public_checkbox','value':1, 'name': 'attachments[' + attachmentId + '][is_public]', checked:'checked' } ).toggle(!eagerUpload),
|
||||
$('<a> </a>').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload),
|
||||
|
|
Loading…
Reference in New Issue