This commit is contained in:
z9hang 2014-07-04 10:10:41 +08:00
commit d525220aca
38 changed files with 452 additions and 264 deletions

View File

@ -498,10 +498,10 @@ class BidsController < ApplicationController
#增加作业按评分排序, #增加作业按评分排序,
#@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.*, @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.courses.first.teacher.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.courses.first.teacher.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 * 0.6 END + CASE WHEN s_score IS NULL THEN 0 ELSE s_score * 0.4 END) DESC,created_at ASC") (CASE WHEN t_score IS NULL THEN 0 ELSE t_score * #{@bid.proportion * 1.0 / 100} END + CASE WHEN s_score IS NULL THEN 0 ELSE s_score * #{1 - @bid.proportion * 1.0 / 100} END) DESC,created_at ASC")
if params[:student_id].present? if params[:student_id].present?
@temp = [] @temp = []
@homework_list.each do |pro| @homework_list.each do |pro|
@ -788,6 +788,7 @@ class BidsController < ApplicationController
@bid.name = params[:bid][:name] @bid.name = params[:bid][:name]
@bid.description = params[:bid][:description] @bid.description = params[:bid][:description]
@bid.is_evaluation = params[:bid][:is_evaluation] @bid.is_evaluation = params[:bid][:is_evaluation]
@bid.proportion = params[:bid][:proportion]
@bid.reward_type = 3 @bid.reward_type = 3
# @bid.budget = params[:bid][:budget] # @bid.budget = params[:bid][:budget]
@bid.deadline = params[:bid][:deadline] @bid.deadline = params[:bid][:deadline]

View File

@ -490,6 +490,7 @@ class CoursesController < ApplicationController
# 新建作业 # 新建作业
def new_homework def new_homework
@homework = Bid.new @homework = Bid.new
@homework.proportion
@homework.safe_attributes = params[:bid] @homework.safe_attributes = params[:bid]
if (User.current.logged? && User.current.member_of_course?(Course.find params[:id] )) if (User.current.logged? && User.current.member_of_course?(Course.find params[:id] ))
render :layout => 'base_courses' render :layout => 'base_courses'

View File

@ -64,14 +64,17 @@ class TagsController < ApplicationController
@forum_tags_num, @attachments_tags_num, @open_source_projects_num = get_tags_size @forum_tags_num, @attachments_tags_num, @open_source_projects_num = get_tags_size
# 获取搜索结果 # 获取搜索结果
@obj,@obj_pages,@results_count,@users_results, @obj,
@obj_pages,
@results_count,
@users_results,
@projects_results, @projects_results,
@@courses_results,
@issues_results, @issues_results,
@bids_results, @bids_results,
@forums_results, @forums_results,
@attachments_results, attachments_results,
@contests_tags, @contests_results,
@courses_results,
@open_source_projects_results= refresh_results(@obj_id,@obj_flag,@selected_tags) @open_source_projects_results= refresh_results(@obj_id,@obj_flag,@selected_tags)
# 这里是做tag推荐用的 用来生产推荐的tags # 这里是做tag推荐用的 用来生产推荐的tags
@ -97,14 +100,18 @@ class TagsController < ApplicationController
$related_tags.delete(@tag) $related_tags.delete(@tag)
# 获取搜索结果 # 获取搜索结果
@obj,@obj_pages,@results_count,@users_results, @obj,
@obj_pages,
@results_count,
@users_results,
@projects_results, @projects_results,
@@courses_results,
@issues_results, @issues_results,
@bids_results, @bids_results,
@forums_results, @forums_results,
@attachments_results, attachments_results,
@contests_results = refresh_results(@obj_id,@show_flag) @contests_results,
@courses_results,
@open_source_projects_results= refresh_results(@obj_id,@show_flag)
end end
# 删除已选tag # 删除已选tag
@ -116,14 +123,18 @@ class TagsController < ApplicationController
$selected_tags.delete(@tag) $selected_tags.delete(@tag)
# 获取搜索结果 # 获取搜索结果
@obj,@obj_pages,@results_count,@users_results, @obj,
@obj_pages,
@results_count,
@users_results,
@projects_results, @projects_results,
@@courses_results,
@issues_results, @issues_results,
@bids_results, @bids_results,
@forums_results, @forums_results,
@attachments_results, attachments_results,
@contests_results = refresh_results(@obj_id,@show_flag) @contests_results,
@courses_results,
@open_source_projects_results= refresh_results(@obj_id,@show_flag)
end end
def show_all def show_all

View File

@ -30,6 +30,11 @@ class WelcomeController < ApplicationController
end end
def course def course
if params[:school_id]
@school_id = params[:school_id]
elsif User.current.logged? && User.current.user_extensions.school
@school_id = User.current.user_extensions.school.id
end
@logoLink ||= logolink() @logoLink ||= logolink()
end end
@ -75,8 +80,7 @@ class WelcomeController < ApplicationController
redirect_to projects_search_path(:name => search_condition, redirect_to projects_search_path(:name => search_condition,
:project_type => Project::ProjectType_project) :project_type => Project::ProjectType_project)
when :courses when :courses
redirect_to projects_search_path(:name => search_condition, redirect_to courses_search_path(:name => search_condition)
:project_type => Project::ProjectType_course)
when :users when :users
redirect_to users_search_path(:name => search_condition) redirect_to users_search_path(:name => search_condition)
when :users_teacher when :users_teacher

View File

@ -473,7 +473,11 @@ module ApplicationHelper
def principals_check_box_tags_ex(name, principals) def principals_check_box_tags_ex(name, principals)
s = '' s = ''
principals.each do |principal| principals.each do |principal|
if principal.has_attribute?(:userInfo)
s << "<label>#{ check_box_tag name, principal.id, false, :id => nil } #{h principal.userInfo }</label>\n" s << "<label>#{ check_box_tag name, principal.id, false, :id => nil } #{h principal.userInfo }</label>\n"
else
s << "<label>#{ check_box_tag name, principal.id, false, :id => nil } #{h principal}</label>\n"
end
end end
s.html_safe s.html_safe
end end

View File

@ -83,6 +83,19 @@ module CoursesHelper
type << option2 type << option2
end end
def proportion_option
type = []
i = 0
while i <= 100
option = []
option << i.to_s + "%"
option << i
type << option
i = i + 10
end
type
end
alias teacherCountOrigin teacherCount alias teacherCountOrigin teacherCount
def teacherCount project def teacherCount project
@ -308,7 +321,7 @@ module CoursesHelper
#最终评分 = 学生评分的平均分 * 0.4 +教师评分 * 0.6 #最终评分 = 学生评分的平均分 * 0.4 +教师评分 * 0.6
def score_for_homework homework def score_for_homework homework
if homework.bid.is_evaluation == 1 || homework.bid.is_evaluation == nil if homework.bid.is_evaluation == 1 || homework.bid.is_evaluation == nil
return format("%.2f",(teacher_score_for_homework(homework).to_f * 0.6 + student_score_for_homework(homework).to_f * 0.4)) return format("%.2f",(homework.bid.proportion * 1.0 / 100) * (teacher_score_for_homework(homework).to_f) + (1 - homework.bid.proportion * 1.0 / 100) * (student_score_for_homework(homework).to_f))
else else
return teacher_score_for_homework homework return teacher_score_for_homework homework
end end
@ -332,7 +345,7 @@ module CoursesHelper
return format("%.2f",teacher_stars == nil ? 0 : teacher_stars.stars) return format("%.2f",teacher_stars == nil ? 0 : teacher_stars.stars)
end end
#获取指定作业的得分 #获取指定项目的得分
def project_score project def project_score project
issue_count = project.issues.count issue_count = project.issues.count
issue_journal_count = project.issue_changes.count issue_journal_count = project.issue_changes.count
@ -370,4 +383,9 @@ module CoursesHelper
end end
return homework_users return homework_users
end end
def get_courses_by_tag(tag_name)
Course.tagged_with(tag_name).order('updated_at desc')
end
end end

View File

@ -67,6 +67,30 @@ module WatchersHelper
link_to text, url, :remote => true, :method => method, :class => css link_to text, url, :remote => true, :method => method, :class => css
end end
# add by nwb
# 关注课程
def new_course_watcher_link(objects, user, options=[])
return '' unless user && user.logged?
objects = Array.wrap(objects)
watched = objects.any? {|object| object.watched_by?(user)}
@watch_flag = (objects.first.instance_of?(User) or objects.first.instance_of?(Project) or (objects.first.instance_of?(Contest)))
css = @watch_flag ? ([watcher_css(objects), watched ? 'icon ' : 'icon '].join(' ') << options[0].to_s) :
([watcher_css(objects), watched ? 'icon icon-fav ' : 'icon icon-fav-off '].join(' ') << options[0].to_s)
text = @watch_flag ?
(watched ? l(:button_unfollow) : l(:button_follow)) : (watched ? l(:button_unwatch) : l(:button_watch))
url = watch_path(
:object_type => objects.first.class.to_s.underscore,
:object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort)
)
method = watched ? 'delete' : 'post'
link_to text, url, :remote => true, :method => method, :class => css
end
# added by fq, modify nyan # added by fq, modify nyan
# Somebody may use option params # Somebody may use option params
def join_in_course(course, user, options=[]) def join_in_course(course, user, options=[])

View File

@ -83,7 +83,8 @@ module WelcomeHelper
# # => 前7个项目为新课程后面三个是参与人数最多的 # # => 前7个项目为新课程后面三个是参与人数最多的
# #
# Returns project&courses array # Returns project&courses array
def find_miracle_course(sum=10, max_rate=7, school_id) # 原来的取课程逻辑
def find_miracle_course_base(sum=10, max_rate=7, school_id)
if User.current.user_extensions.school.nil? and school_id.nil? if User.current.user_extensions.school.nil? and school_id.nil?
Project.active.visible.course_entities. Project.active.visible.course_entities.
@ -133,6 +134,52 @@ module WelcomeHelper
# (c1.take(max)+c2).take(sum) # (c1.take(max)+c2).take(sum)
end end
#获取课程列表
# add by nwb
def find_miracle_course(sum=10, max_rate=7, school_id)
if User.current.user_extensions.school.nil? and school_id.nil?
Course.active.visible.
joins(:memberships).
group('members.course_id').
reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum
else
if school_id.nil?
Course.active.visible.
joins(:memberships).
where("#{Course.table_name}.school_id = ?", User.current.user_extensions.school.id).
group('members.course_id').
reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum
else
if school_id == "0"
Course.active.visible.
joins(:memberships).
group('members.course_id').
reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum
else
Course.active.visible.
joins(:memberships).
where("#{Course.table_name}.school_id = ?", school_id).
group('members.course_id').
reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum
end
end
end
# else
# Project.active.visible.course_entities.
# joins(:course_extra).
# joins(:memberships).
# where("#{Course.table_name}.school_id = ?", school_id).
# group('members.project_id').
# reorder("courses.time DESC, COUNT(members.project_id) DESC").take sum
# end
# max = sum*(max_rate.to_f/10)
# c1 = find_new_course(sum).to_a.dup
# c2 = find_all_hot_course(sum).to_a.dup
# c2 = c2 - c1
# (c1.take(max)+c2).take(sum)
end
#查找所有学校按每个学校开设课程数量降序排序 #查找所有学校按每个学校开设课程数量降序排序
#page 分页查询开始条数的编号,从0开始 #page 分页查询开始条数的编号,从0开始
#limit 分页查询的数量 #limit 分页查询的数量
@ -182,11 +229,18 @@ module WelcomeHelper
sort_course_by_hot limit sort_course_by_hot limit
end end
# modif by nwb
def find_all_new_hot_course limit = 9 ,school_id = 0 def find_all_new_hot_course limit = 9 ,school_id = 0
#sort_project_by_hot_rails 1, 'course_ac_para DESC', limit #sort_project_by_hot_rails 1, 'course_ac_para DESC', limit
time_now = Time.new.strftime("%Y"); time_now = Time.new.strftime("%Y");
Project.visible.joins(:project_status).where("#{Project.table_name}.project_type = ? and #{Project.table_name}.created_on like '%#{time_now}%' and #{Project.table_name}.identifier not in if school_id
(select extra from courses where school_id = ?)", 1,school_id).order("course_ac_para DESC").limit(limit).all courses = Course.visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id <>
?", school_id).order("course_ac_para DESC").limit(limit).all
else
courses = Course.visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id is not NULL
").order("course_ac_para DESC").limit(limit).all
end
courses
end end
def find_all_hot_bid def find_all_hot_bid

View File

@ -27,6 +27,7 @@ class Course < ActiveRecord::Base
has_many :boards, :dependent => :destroy, :order => "position ASC" has_many :boards, :dependent => :destroy, :order => "position ASC"
#has_many :course_journals_for_messages, :class_name => 'CourseJournalsForMessage', :as => :jour, :dependent => :destroy #has_many :course_journals_for_messages, :class_name => 'CourseJournalsForMessage', :as => :jour, :dependent => :destroy
has_many :news, :dependent => :destroy, :include => :author has_many :news, :dependent => :destroy, :include => :author
has_one :course_status, :class_name => "CourseStatus", :dependent => :destroy
acts_as_taggable acts_as_taggable
acts_as_nested_set :order => 'name', :dependent => :destroy acts_as_nested_set :order => 'name', :dependent => :destroy

View File

@ -113,6 +113,7 @@ class Project < ActiveRecord::Base
validates_presence_of :name, :identifier validates_presence_of :name, :identifier
validates_uniqueness_of :identifier validates_uniqueness_of :identifier
validates_uniqueness_of :name
validates_associated :repository, :wiki validates_associated :repository, :wiki
# validates_length_of :description, :maximum => 255 # validates_length_of :description, :maximum => 255
validates_length_of :name, :maximum => 255 validates_length_of :name, :maximum => 255

View File

@ -38,7 +38,7 @@ class Repository < ActiveRecord::Base
validates_length_of :password, :maximum => 255, :allow_nil => true validates_length_of :password, :maximum => 255, :allow_nil => true
validates_length_of :identifier, :maximum => IDENTIFIER_MAX_LENGTH, :allow_blank => true validates_length_of :identifier, :maximum => IDENTIFIER_MAX_LENGTH, :allow_blank => true
validates_presence_of :identifier, :unless => Proc.new { |r| r.is_default? || r.set_as_default? } validates_presence_of :identifier#, :unless => Proc.new { |r| r.is_default? || r.set_as_default? }
validates_uniqueness_of :identifier, :scope => :project_id, :allow_blank => true validates_uniqueness_of :identifier, :scope => :project_id, :allow_blank => true
validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph) validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph)
# donwcase letters, digits, dashes, underscores but not digits only # donwcase letters, digits, dashes, underscores but not digits only

View File

@ -34,6 +34,8 @@
</p> </p>
<p><%= f.select :is_evaluation, is_evaluation_option %> <p><%= f.select :is_evaluation, is_evaluation_option %>
</p> </p>
<p><%= f.select :proportion, proportion_option %>
</p>
<p><%= hidden_field_tag 'course_id', @course.id %> <p><%= hidden_field_tag 'course_id', @course.id %>
</p> </p>
<fieldset><legend><%= l(:label_attachment_plural) %></legend> <fieldset><legend><%= l(:label_attachment_plural) %></legend>

View File

@ -19,7 +19,9 @@
<strong> <%= h(e.event_title) if @course.nil? || (e.course != nil && @course.id != e.course.id) %></strong> <strong> <%= h(e.event_title) if @course.nil? || (e.course != nil && @course.id != e.course.id) %></strong>
<span class="font_lighter"> <span class="font_lighter">
<% if @canShowRealName %> <% if @canShowRealName %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>(<%= link_to_user(e.event_author,@canShowRealName) if e.respond_to?(:event_author) %>) <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
(<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %>
)
<% else %> <% else %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
<% end %> <% end %>
@ -37,12 +39,17 @@
</p></td> </p></td>
</tr> </tr>
<tr> <tr>
<td align="left"><span class="font_lighter"> <%= l :label_activity_time %>&nbsp; <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %></span></td> <td align="left"><span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %></span>
</td>
<% if e.event_type == "issue" %> <% if e.event_type == "issue" %>
<td align="right"><span> <%= link_to l(:label_find_all_comments), issue_path(e) %> </span><span class="font_lighter"><%= l(:label_comments_count, :count => e.journals.count)%></span></td> <td align="right">
<span> <%= link_to l(:label_find_all_comments), issue_path(e) %> </span><span class="font_lighter"><%= l(:label_comments_count, :count => e.journals.count) %></span>
</td>
<% end %> <% end %>
</tr> </tr>
</table></td> </table>
</td>
</tr> </tr>
</table> </table>
</div> </div>
@ -50,36 +57,12 @@
<% end %> <% end %>
</div> </div>
<!-- Added by Longjun 在最后一页显示创建信息 -->
<% if format_date(day) == format_date(@date_to - @days) %>
<h1>Test</h1>
<div >
<table width="660">
<tr>
<td><%= image_tag(url_to_avatar(@user), :class => "avatar") %></td>
<td colspan="2">
<table width="580">
<tr>
<td > <%= link_to (h @user.try(:name)), user_path(@user) if @user %> <%= l(:label_user_create_project) %> <%= link_to @course.name %><strong> !</strong></td>
</tr>
<tr>
<td class="font_lighter" style="float: right"><%= l :label_update_time %>: <%= format_time(@course.created_on) %>
</table></td>
</tr>
</table>
</div>
<% end %>
<% end -%> <% end -%>
<div class="pagination">
<ul>
<%= pagination_links_full @events_pages%>
</ul>
</div>
</div> </div>
<% else %> <% end %>
<div class="font_description"> <div class="font_description">
<table width="660"> <table width="660">
<tr> <tr>
@ -92,18 +75,29 @@
#判断是否显示真名 #判断是否显示真名
if @canShowRealName if @canShowRealName
%> %>
<%= link_to (h @user.try(:name)), user_path(@user) if @user %>(<%= link_to (h @user.try(:realname)), user_path(@user) if @user %>) <%= link_to (h @user.try(:name)), user_path(@user) if @user %>
(<%= link_to (h @user.try(:realname)), user_path(@user) if @user %>)
<% else %> <% else %>
<%= link_to (h @user.try(:name)), user_path(@user) if @user %> <%= link_to (h @user.try(:name)), user_path(@user) if @user %>
<% end %> <% end %>
<%= l(:label_user_create_project) %> <%= link_to @course.name %><strong> !</strong></td> <%= l(:label_user_create_project) %> <%= link_to @course.name %>
<strong> !</strong></td>
</tr> </tr>
<tr> <tr>
<td class="font_lighter" style="float: right"><%= l :label_update_time %>: <%= format_time(@course.created_at) %> <td class="font_lighter" style="float: right"><%= l :label_update_time %>
</table></td> : <%= format_time(@course.created_at) %>
</table>
</td>
</tr> </tr>
</table> </table>
</div> </div>
<% end %>
<div class="pagination">
<ul>
<%= pagination_links_full @events_pages %>
</ul>
</div>

View File

@ -5,7 +5,9 @@
<% end %> <% end %>
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;" %></p> <p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;" %></p>
<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;" %></p><!--by young--> <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;" %>
</p><!--by young-->
<p><%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH %> <p><%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH %>
<% unless @project.identifier_frozen? %> <% unless @project.identifier_frozen? %>
<em class="info"><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %></em> <em class="info"><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %></em>
@ -24,44 +26,44 @@
<%= call_hook(:view_projects_form, :project => @project, :form => f) %> <%= call_hook(:view_projects_form, :project => @project, :form => f) %>
<!-- <% if @project.new_record? %> <!-- <%# if @project.new_record? %>
<fieldset class="box tabular"><legend><%= l(:label_module_plural) %></legend> <fieldset class="box tabular"><legend><%#= l(:label_module_plural) %></legend>
<% Redmine::AccessControl.available_project_modules.each do |m| %> <%# Redmine::AccessControl.available_project_modules.each do |m| %>
<label class="floating"> <label class="floating">
<%= check_box_tag 'project[enabled_module_names][]', m, @project.module_enabled?(m), :id => "project_enabled_module_names_#{m}" %> <%#= check_box_tag 'project[enabled_module_names][]', m, @project.module_enabled?(m), :id => "project_enabled_module_names_#{m}" %>
<%= l_or_humanize(m, :prefix => "project_module_") %> <%#= l_or_humanize(m, :prefix => "project_module_") %>
</label> </label>
<% end %> <%# end %>
<%= hidden_field_tag 'project[enabled_module_names][]', '' %> <%#= hidden_field_tag 'project[enabled_module_names][]', '' %>
<%= javascript_tag 'observeProjectModules()' %> <%#= javascript_tag 'observeProjectModules()' %>
</fieldset> </fieldset>
<% end %> <%# end %>
<% if @project.new_record? || @project.module_enabled?('issue_tracking') %> <%# if @project.new_record? || @project.module_enabled?('issue_tracking') %>
<% unless @trackers.empty? %> <%# unless @trackers.empty? %>
<fieldset class="box tabular" id="project_trackers"><legend><%=l(:label_tracker_plural)%></legend> <fieldset class="box tabular" id="project_trackers"><legend><%#=l(:label_tracker_plural)%></legend>
<% @trackers.each do |tracker| %> <%# @trackers.each do |tracker| %>
<label class="floating"> <label class="floating">
<%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.include?(tracker) %> <%#= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.include?(tracker) %>
<%=h tracker %> <%#=h tracker %>
</label> </label>
<% end %> <%# end %>
<%= hidden_field_tag 'project[tracker_ids][]', '' %> <%#= hidden_field_tag 'project[tracker_ids][]', '' %>
</fieldset> </fieldset>
<% end %> <%# end %>
<% unless @issue_custom_fields.empty? %> <%# unless @issue_custom_fields.empty? %>
<fieldset class="box tabular" id="project_issue_custom_fields"><legend><%=l(:label_custom_field_plural)%></legend> <fieldset class="box tabular" id="project_issue_custom_fields"><legend><%#=l(:label_custom_field_plural)%></legend>
<% @issue_custom_fields.each do |custom_field| %> <%# @issue_custom_fields.each do |custom_field| %>
<label class="floating"> <label class="floating">
<%= check_box_tag 'project[issue_custom_field_ids][]', custom_field.id, (@project.all_issue_custom_fields.include? custom_field), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %> <%#= check_box_tag 'project[issue_custom_field_ids][]', custom_field.id, (@project.all_issue_custom_fields.include? custom_field), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %>
<%=h custom_field.name %> <%#=h custom_field.name %>
</label> </label>
<% end %> <%# end %>
<%= hidden_field_tag 'project[issue_custom_field_ids][]', '' %> <%#= hidden_field_tag 'project[issue_custom_field_ids][]', '' %>
</fieldset> </fieldset>
<% end %> <%# end %>
<% end %> --> <%# end %> -->
<!--[eoform:project]--> <!--[eoform:project]-->
<% unless @project.identifier_frozen? %> <% unless @project.identifier_frozen? %>

View File

@ -49,36 +49,13 @@
<% end %> <% end %>
</div> </div>
<!-- Added by Longjun 在最后一页显示创建信息 -->
<% if format_date(day) == format_date(@date_to - @days) %>
<h1>Test</h1>
<div >
<table width="660">
<tr>
<td><%= image_tag(url_to_avatar(@user), :class => "avatar") %></td>
<td colspan="2">
<table width="580">
<tr>
<td > <%= link_to (h @user.try(:name)), user_path(@user) if @user %> <%= l(:label_user_create_project) %> <%= link_to @project.name %><strong> !</strong></td>
</tr>
<tr>
<td class="font_lighter" style="float: right"><%= l :label_update_time %>: <%= format_time(@project.created_on) %>
</table></td>
</tr>
</table>
</div>
<% end %>
<% end -%> <% end -%>
<div class="pagination">
<ul>
<%= pagination_links_full @events_pages%>
</ul>
</div>
</div> </div>
<% else %> <%end%>
<div class="font_description"> <div class="font_description">
<table width="660"> <table width="660">
<tr> <tr>
@ -103,6 +80,13 @@
</tr> </tr>
</table> </table>
</div> </div>
<% end %>
<div class="pagination">
<ul>
<%= pagination_links_full @events_pages%>
</ul>
</div>

View File

@ -43,9 +43,9 @@
<script type="text/javascript"> <script type="text/javascript">
function test(id){ function test(id){
location.href = encodeURI('/course/'+id);
location.href = encodeURI('http://course.trustie.net<%=port%>?school_id='+id);
} }
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
function ssearch(){ function ssearch(){
@ -69,8 +69,9 @@
<div> <div>
<p> <p>
<a href="http://course.trustie.net<%=port%>?school_id=0">全部学校</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="http://course.trustie.net<%=port%>">我的学校</a> <%= link_to "全部学校",school_index_path %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to '我的学校',school_course_list_path(User.current.user_extensions.school) %>
</p> </p>
<ul> <ul>
<li style="width: 40%; float: left">请选择省份: <li style="width: 40%; float: left">请选择省份:

View File

@ -1,5 +1,5 @@
<div id="issues"> <div id="issues">
<% if attachments_results.size < 0 %> <% if attachments_results.try(:size).to_i < 0 %>
<% else %> <% else %>
<hr /> <hr />
<% attachments_results.each do |file| %> <% attachments_results.each do |file| %>

View File

@ -1,5 +1,5 @@
<div id="issues"> <div id="issues">
<% if bids_results.size > 0 %> <% if bids_results.try(:size).to_i > 0 %>
<hr /> <hr />
<% bids_results.each do |bid| %> <% bids_results.each do |bid| %>
<p class="font_description2"> <p class="font_description2">

View File

@ -1,5 +1,5 @@
<div id="issues"> <div id="issues">
<% if contests_results.size > 0 %> <% if contests_results.try(:size).to_i > 0 %>
<hr /> <hr />
<% contests_results.each do |contest| %> <% contests_results.each do |contest| %>
<p class="font_description2"> <p class="font_description2">

View File

@ -0,0 +1,14 @@
<div id="issues">
<% if courses_results.try(:size).to_i > 0 %>
<hr />
<% courses_results.each do |course| %>
<p class="font_description2">
<strong><%= l(:label_course) %>:<%= link_to "#{course.name}",course_path(course) %></strong>
<br />
<strong><%= l(:label_new_course_description) %>:</strong><%= course.description %>
<%= course.updated_at %>
</p>
<div class="line_under"></div>
<% end %>
<% end %>
</div>

View File

@ -1,5 +1,5 @@
<div id="issues"> <div id="issues">
<% if forums_results.size > 0 %> <% if forums_results.try(:size).to_i > 0 %>
<hr /> <hr />
<% forums_results.each do |forum| %> <% forums_results.each do |forum| %>
<p class="font_description2"> <p class="font_description2">

View File

@ -1,5 +1,5 @@
<div id="issues"> <div id="issues">
<% if issues_results.size > 0 %> <% if issues_results.try(:size).to_i > 0 %>
<hr /> <hr />
<% issues_results.each do |issue| %> <% issues_results.each do |issue| %>
<p class="font_description2"> <p class="font_description2">

View File

@ -1,5 +1,5 @@
<div id="projects"> <div id="projects">
<% if projects_results.size > 0 %> <% if projects_results.try(:size).to_i > 0 %>
<hr /> <hr />
<% projects_results.each do |prj| %> <% projects_results.each do |prj| %>
<div> <div>

View File

@ -1,5 +1,5 @@
<div id="projects"> <div id="projects">
<% if projects_results.size > 0 %> <% if projects_results.try(:size).to_i > 0 %>
<hr /> <hr />
<% projects_results.each do |prj| %> <% projects_results.each do |prj| %>
<div> <div>

View File

@ -1,5 +1,5 @@
<div id="users"> <div id="users">
<% if users_results.size > 0 %> <% if users_results.try(:size).to_i > 0 %>
<hr /> <hr />
<% users_results.each do |user| %> <% users_results.each do |user| %>
<p class="font_description2"> <p class="font_description2">

View File

@ -26,6 +26,9 @@
<strong><%#= l(:label_attachment)%> <strong><%#= l(:label_attachment)%>
开源项目:(<%= @results_count %>)</strong> 开源项目:(<%= @results_count %>)</strong>
<%= render :partial => "show_open_source_projects",:locals => {:projects_results => open_source_projects_results}%> <%= render :partial => "show_open_source_projects",:locals => {:projects_results => open_source_projects_results}%>
<% when show_flag == '9'%>
<strong><%= l(:label_course)%>(<%= @results_count %>)</strong>
<%= render :partial => "show_courses",:locals => {:courses_results => courses_results}%>
<% else %> <% else %>
<strong><%= l(:label_tags_all_objects)%></strong> <strong><%= l(:label_tags_all_objects)%></strong>
<!-- 这里为显示搜有过滤结果预留了默认设置 --> <!-- 这里为显示搜有过滤结果预留了默认设置 -->

View File

@ -23,7 +23,7 @@
<%= l(:label_user_plural) %>(<%= @users_tags_num %>) | <%= l(:label_user_plural) %>(<%= @users_tags_num %>) |
<%= l(:label_tags_call)%>(<%= @bids_tags_num %>) | <%= l(:label_tags_call)%>(<%= @bids_tags_num %>) |
<%= l(:field_filename)%>(<%= @attachments_tags_num %>) | <%= l(:field_filename)%>(<%= @attachments_tags_num %>) |
开源项目(<%= @open_source_projects_num %>) 开源项目(<%= @open_source_projects_num %>) |
<%= l(:label_tags_contest)%>(<%= @contests_tags_num %>) | <%= l(:label_tags_contest)%>(<%= @contests_tags_num %>) |
</div> </div>
<div id="show_results"> <div id="show_results">
@ -37,6 +37,7 @@
:attachments_results=> @attachments_results, :attachments_results=> @attachments_results,
:contests_results => @contests_results, :contests_results => @contests_results,
:open_source_projects_results => @open_source_projects_results, :open_source_projects_results => @open_source_projects_results,
:courses_results => @courses_results,
:show_flag => @obj_flag} :show_flag => @obj_flag}
%> %>
</div> </div>

View File

@ -0,0 +1,58 @@
<%
select_option = []
(select_option << ['项目', 'projects']) if project_type == Project::ProjectType_project
(select_option << ['课程', 'courses']) if project_type == Project::ProjectType_course
select_option << ['用户', 'users']
#select_option << ['教师', 'users_teacher'],
#select_option << ['学生', 'users_student']
%>
<style type="text/css">
form #q, form #search_type{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: inline-block;
margin: 0px;
padding: 5px;
height: 33px;
}
form #q{
font-size: 13px;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
border-right: none;
}
form #search_type{
font-size: 13px;
color: #363739;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 0px;
border-top-left-radius: 0px;
border-left: 1px outset #83A9A9;
margin-left: -4px;
-webkit-appearance: none;
-moz-appearance: none;
text-indent: 0.01px;
text-overflow: '';
}
.search_widget{
display:inline-block;
border-radius: 5px;
}
.search_widget:hover{
box-shadow: 0px 0px 3px #56B4EF;
}
<%#完了把上面东西放到 .css 里%>
</style>
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
<div class="project-search" style="float: right">
<div class='search_widget'>
<%= text_field_tag :q, nil, placeholder:'请输入要搜索的关键字', :size => 27 %>
<%= select_tag(:search_type, options_for_select(select_option) ) %>
</div>
<%#= hidden_field_tag 'project_type', project_type %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
</div>
<% end %>

View File

@ -9,8 +9,7 @@
}); });
//设置div居中 //设置div居中
function setCss() function setCss() {
{
var mainBar = $('#main-content-bar')[0]; var mainBar = $('#main-content-bar')[0];
var topHeight = mainBar.offsetHeight; var topHeight = mainBar.offsetHeight;
var welcomeLeft = $('#welcome_left')[0]; var welcomeLeft = $('#welcome_left')[0];
@ -39,30 +38,30 @@
</div> </div>
<div class="course welcome_left" id="welcome_left"> <div class="course welcome_left" id="welcome_left">
<span class="font_welcome_school"> <% if params[:school_id].nil? and User.current.user_extensions.school.nil? %> <span class="font_welcome_school"> <% if @school_id.nil? and User.current.user_extensions.school.nil? %>
<% else %> <% else %>
<% if params[:school_id] == "0" %> <% if @school_id == "0" %>
<% else %> <% else %>
<% if params[:school_id].nil? %> <% if @school_id.nil? %>
<%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course', :school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school', :method => 'get'} %> <%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course', :school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school', :method => 'get'} %>
<br/> <br/>
<% else %> <% else %>
<%= link_to School.find(params[:school_id]).name ,options={:action => 'course',:school_id => params[:school_id]}, html_options={:class => 'font_welcome_school',:method => 'get'}%> <%= link_to School.find(@school_id).name, options={:action => 'course', :school_id => @school_id}, html_options={:class => 'font_welcome_school', :method => 'get'} %>
<br/> <br/>
<% end %> <% end %>
<% end %> <% end %>
<% end %> </span> <% end %> </span>
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_course) %> </span> <span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_course) %> </span>
<% if params[:school_id].nil? and User.current.user_extensions.school.nil? %> <% if @school_id.nil? and User.current.user_extensions.school.nil? %>
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span> <span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
<% else %> <% else %>
<% if params[:school_id] == "0" %> <% if @school_id == "0" %>
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span> <span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="search-bar" id="search-bar"> <div class="search-bar" id="search-bar">
<%= render :partial => "search_project", :locals => {:project_type => Project::ProjectType_course}%> <%= render :partial => "search_course", :locals => {:project_type => Project::ProjectType_course} %>
</div> </div>
<div style="clear: both;"></div> <div style="clear: both;"></div>
</div> </div>
@ -73,28 +72,34 @@
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject"> <div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3><strong>新开课程</strong></h3> <h3><strong>新开课程</strong></h3>
<% school_course = find_miracle_course(10, 7,params[:school_id]) %> <% if @school_id %>
<% school_course = find_miracle_course(10, 7, @school_id) %>
<% else %>
<%school_course=[]%>
<% end %>
<% if (school_course.count == 0) %> <% if (school_course.count == 0) %>
<span><%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => nil} %></span> <span><%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => nil} %></span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
</ul> </ul>
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
<h1></h1> <h1></h1>
<p id="errorExplanation"> <p id="errorExplanation">
该学校未开设任何课程,您可以查看其他学校课程 该学校未开设任何课程,您可以查看其他学校课程
</p> </p>
<h1></h1> <h1></h1>
<% find_all_new_hot_course(9,params[:school_id]).map do |project| %> <% find_all_new_hot_course(9, @school_id).map do |course| %>
<li class='<%= cycle("odd", "even") %>' title=<%=project.description.to_s%>> <li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s %>>
<div class='avatar'> <div class='avatar'>
<%= image_tag(get_course_avatar(project), :class => "avatar-4") %> <%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
</div> </div>
<!-- 上左下右 --> <!-- 上左下右 -->
<div class='desc_item'> <div class='desc_item'>
<span class=''> <span class=''>
<% course = Course.find_by_extra(project.identifier)%>
<% if (course.school == nil) %> <% if (course.school == nil) %>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% else %> <% else %>
@ -107,21 +112,11 @@
</span> </span>
</div> </div>
<div class='desc_item text_nowrap' style="width: 310px;"> <div class='desc_item text_nowrap' style="width: 310px;">
[<%= get_course_term project %>] [<%= get_course_term course %>]
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> <%= link_to(course.name, course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
(<%= "#{studentCount(project)}人" %>) (<%= "#{studentCount(course)}人" %>)
<% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %> <% files_count = course.attachments.count.to_s %>
(<%=link_to "#{files_count}份", project_files_path(project) %>资料) (<%= link_to "#{files_count}份", course_files_path(course) %>资料)
</div>
<!-- <div class='desc_item' style="">
<span class='font_lighter' title=<%#=project.description.to_s%>><%#=project.description.truncate(25, omission: '...')%></span>
</div> -->
<div>
<% if !course_endTime_timeout?(project)%>
<div >
<%= new_watcher_link(project, User.current)%>
</div>
<% end %>
</div> </div>
</li> </li>
<% end %> <% end %>
@ -130,11 +125,11 @@
<% else %> <% else %>
<% if school_course.count < 9 %> <% if school_course.count < 9 %>
<span> <span>
<%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => nil} %> <%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => nil} %>
</span> </span>
<% else %> <% else %>
<span> <span>
<%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => params[:school_id]} %> <%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => @school_id} %>
</span> </span>
<% end %> <% end %>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
@ -142,15 +137,14 @@
</ul> </ul>
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
<% school_course.map do |project| %> <% school_course.map do |course| %>
<li class='<%= cycle("odd", "even") %>' title=<%=project.description.to_s%>> <li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s %>>
<div class='avatar'> <div class='avatar'>
<%= image_tag(get_course_avatar(project), :class => "avatar-4") %> <%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
</div> </div>
<!-- 上左下右 --> <!-- 上左下右 -->
<div class='desc_item'> <div class='desc_item'>
<span class=''> <span class=''>
<% course = Course.find_by_extra(project.identifier) %>
<%= link_to course.school.name.try(:gsub, /(.+)$/, '\1:'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %> <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1:'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
</span> </span>
<span class='font_bolder'> <span class='font_bolder'>
@ -158,17 +152,17 @@
</span> </span>
</div> </div>
<div class='desc_item text_nowrap' style="width: 310px;"> <div class='desc_item text_nowrap' style="width: 310px;">
[<%= get_course_term project %>] [<%= get_course_term course %>]
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> <%= link_to(course.name, course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
(<%= "#{studentCount(project)}人" %>) (<%= "#{studentCount(course)}人" %>)
<% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %> <% files_count = course.attachments.count.to_s %>
(<%=link_to "#{files_count}份", project_files_path(project) %>资料) (<%= link_to "#{files_count}份", course_files_path(course) %>资料)
</div> </div>
<div class='join_course_link'> <div class='join_course_link'>
<% if !course_endTime_timeout?(project)%> <% if !course_endTime_timeout?(course) %>
<div> <div>
<%= join_in_course(project, User.current)%> <%= join_in_course(course, User.current) %>
</div> </div>
<% end %> <% end %>
</div> </div>
@ -177,19 +171,19 @@
<% if school_course.count < 9 %> <% if school_course.count < 9 %>
<li> <li>
<h1></h1> <h1></h1>
<p id="errorExplanation"> <p id="errorExplanation">
该学校开设课程较少,您可以查看其他学校课程 该学校开设课程较少,您可以查看其他学校课程
</p> </p>
</li> </li>
<% find_all_new_hot_course(9 - school_course.count,params[:school_id]).map do |project| %> <% find_all_new_hot_course(9 - school_course.count, @school_id).map do |course| %>
<li class='<%= cycle("odd", "even") %>' title=<%=project.description.to_s%>> <li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s %>>
<div class='avatar'> <div class='avatar'>
<%= image_tag(get_course_avatar(project), :class => "avatar-4") %> <%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
</div> </div>
<!-- 上左下右 --> <!-- 上左下右 -->
<div class='desc_item'> <div class='desc_item'>
<span class=''> <span class=''>
<% course = Course.find_by_extra(project.identifier)%>
<% if (course.school == nil) %> <% if (course.school == nil) %>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% else %> <% else %>
@ -202,18 +196,11 @@
</span> </span>
</div> </div>
<div class='desc_item text_nowrap' style="width: 310px;"> <div class='desc_item text_nowrap' style="width: 310px;">
[<%= get_course_term project %>] [<%= get_course_term course %>]
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> <%= link_to(course.name, course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
<%= "#{studentCount(project)}人" %> ) <%= "#{studentCount(course)}人" %> )
<% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %> <% files_count = course.attachments.count.to_i.to_s %>
(<%=link_to "#{files_count}份", project_files_path(project) %>资料) (<%= link_to "#{files_count}份", course_files_path(course) %>资料)
</div>
<div>
<% if !course_endTime_timeout?(project)%>
<div >
<%= new_watcher_link(project, User.current)%>
</div>
<% end %>
</div> </div>
</li> </li>
<% end %> <% end %>
@ -230,6 +217,7 @@
<%= link_to "我要反馈", suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE"} %> <%= link_to "我要反馈", suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE"} %>
</h3> </h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span> <span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
<% find_new_forum_topics(10).each do |topic| %> <% find_new_forum_topics(10).each do |topic| %>
@ -238,6 +226,7 @@
<span class="memo_activity text_nowrap" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="memo_activity text_nowrap" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to '['+topic.forum.name + ']', forum_path(topic.forum), :class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray", :style => "font-size: 10pt !important;" %> <%= link_to '['+topic.forum.name + ']', forum_path(topic.forum), :class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray", :style => "font-size: 10pt !important;" %>
</span> </span>
<div class='memo_activity memo_attr'> <div class='memo_activity memo_attr'>
<span class='memo_timestamp'> <span class='memo_timestamp'>
<%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %> <%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>

View File

@ -1574,6 +1574,7 @@ zh:
field_budget: 奖励 field_budget: 奖励
field_deadline: 截止日期 field_deadline: 截止日期
field_is_evaluation: 是否启动互评 field_is_evaluation: 是否启动互评
field_proportion: 教师评分比例
label_tags_selected: 已选标签 label_tags_selected: 已选标签
label_tags_related: 相关标签 label_tags_related: 相关标签
button_project_tags_add: 增加 button_project_tags_add: 增加

View File

@ -573,6 +573,8 @@ RedmineApp::Application.routes.draw do
end end
end end
match 'projects/course', :to => 'courses#course', :as => 'courses_course'
match 'courses/search', :to => 'courses#search'
# add by nwb # add by nwb
# 课程路由设置 # 课程路由设置
resources :courses do resources :courses do
@ -698,8 +700,8 @@ RedmineApp::Application.routes.draw do
#######confusing######## #######confusing########
get 'welcome/search', to: 'welcome#search' get 'welcome/search', to: 'welcome#search'
get 'school/index', to: 'school#index' get 'school/index', to: 'school#index'
get 'course/:school_id', to: 'welcome#course' get 'course/:school_id', to: 'welcome#course', :as => 'school_course_list'
get 'course/:school_id', to: 'welcome#course' #get 'course/:school_id', to: 'welcome#course'
post 'school/get_options/:province', :to => 'school#get_options' post 'school/get_options/:province', :to => 'school#get_options'
get 'school/get_options/:province', :to => 'school#get_options' get 'school/get_options/:province', :to => 'school#get_options'

View File

@ -0,0 +1,5 @@
class AddProportionToBid < ActiveRecord::Migration
def change
add_column :bids, :proportion, :integer, default: 60
end
end

View File

@ -0,0 +1,11 @@
class ClearCourseData < ActiveRecord::Migration
def up
# 清理课程表垃圾数据
# 之前删除项目未删除课程的数据
sql = 'delete from courses where name is null and extra not in (select identifier from projects)'
execute(sql)
end
def down
end
end

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140626012511) do ActiveRecord::Schema.define(:version => 20140703085204) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -106,6 +106,7 @@ ActiveRecord::Schema.define(:version => 20140626012511) do
t.integer "parent_id" t.integer "parent_id"
t.string "password" t.string "password"
t.integer "is_evaluation" t.integer "is_evaluation"
t.integer "proportion", :default => 60
end end
create_table "boards", :force => true do |t| create_table "boards", :force => true do |t|
@ -793,7 +794,7 @@ ActiveRecord::Schema.define(:version => 20140626012511) do
end end
create_table "relative_memos", :force => true do |t| create_table "relative_memos", :force => true do |t|
t.integer "osp_id" t.integer "osp_id", :null => false
t.integer "parent_id" t.integer "parent_id"
t.string "subject", :null => false t.string "subject", :null => false
t.text "content", :null => false t.text "content", :null => false
@ -924,6 +925,7 @@ ActiveRecord::Schema.define(:version => 20140626012511) do
add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"
add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type"
create_table "tags", :force => true do |t| create_table "tags", :force => true do |t|
t.string "name" t.string "name"

Binary file not shown.

Binary file not shown.

Binary file not shown.