Conflicts:
	app/models/user.rb
	app/views/courses/_course_form.html.erb
	db/schema.rb
This commit is contained in:
sw 2014-11-08 16:40:36 +08:00
commit 460ba55dde
46 changed files with 744 additions and 534 deletions

View File

@ -125,6 +125,7 @@ GEM
mocha (1.1.0)
metaclass (~> 0.0.1)
multi_json (1.10.1)
mysql2 (0.3.11)
mysql2 (0.3.11-x86-mingw32)
net-ldap (0.3.1)
nokogiri (1.6.3)

View File

@ -126,7 +126,7 @@ class AdminController < ApplicationController
@status = params[:status] || 1
scope = User.logged.status(@status)
scope = scope.like(params[:name]) if params[:name].present?
scope = scope.like(params[:name],params[:search_by][:id]) if params[:name].present?
@user_count = scope.count
@user_pages = Paginator.new @user_count, @limit, params['page']
@user_base_tag = params[:id] ? 'base_users':'base'

View File

@ -29,7 +29,11 @@ class AutoCompletesController < ApplicationController
@issues += scope.where("LOWER(#{Issue.table_name}.subject) LIKE LOWER(?)", "%#{q}%").order("#{Issue.table_name}.id DESC").limit(10).all
@issues.compact!
end
render :layout => false
#render :layout => false
render :json => @issues.map {|issue| {
'value' => issue[:subject]
}}
end

View File

@ -265,6 +265,7 @@ class FilesController < ApplicationController
'size' => "#{Attachment.table_name}.filesize",
'downloads' => "#{Attachment.table_name}.downloads"
sort=''
if params[:sort]
params[:sort].split(",").each do |sort_type|
order_by = sort_type.split(":")

View File

@ -52,7 +52,7 @@ class ForumsController < ApplicationController
def index
@offset, @limit = api_offset_and_limit({:limit => 10})
@forums_all = Forum.where('1=1')
@forums_all = Forum.reorder("sticky DESC")
@forums_count = @forums_all.count
@forums_pages = Paginator.new @forums_count, @limit, params['page']
@ -208,6 +208,8 @@ class ForumsController < ApplicationController
end
end
private

View File

@ -374,7 +374,7 @@ class UsersController < ApplicationController
"show_changesets" => true
}
scope = User.logged.status(@status)
scope = scope.like(params[:name]) if params[:name].present?
scope = scope.like(params[:name],params[:search_by][:id]) if params[:name].present?
@user_count = scope.count
@user_pages = Paginator.new @user_count, @limit, params['page']
@user_base_tag = params[:id] ? 'base_users':'users_base'

View File

@ -5,7 +5,7 @@ class Course < ActiveRecord::Base
STATUS_CLOSED = 5
STATUS_ARCHIVED = 9
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student
belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表
@ -52,7 +52,8 @@ class Course < ActiveRecord::Base
'term',
'is_public',
'description',
'class_period'
'class_period',
'open_student'
acts_as_customizable

View File

@ -8,7 +8,9 @@ class Forum < ActiveRecord::Base
'topic_count',
'memo_count',
'last_memo_id',
'creator_id'
'creator_id',
'sticky',
'locked'
validates_presence_of :name, :creator_id, :description
validates_length_of :name, maximum: 50
#validates_length_of :description, maximum: 255

View File

@ -1359,7 +1359,7 @@ class Issue < ActiveRecord::Base
# Callback on file attachment
def attachment_added(obj)
if @current_journal && !obj.new_record?
if @current_journal && !obj.new_record? && @current_journal.journalized_id == obj.author_id
@current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
end
end

View File

@ -78,9 +78,13 @@ class Message < ActiveRecord::Base
safe_attributes 'subject', 'content'
safe_attributes 'locked', 'sticky', 'board_id',
safe_attributes 'board_id','locked', 'sticky',
:if => lambda {|message, user|
user.allowed_to?(:edit_messages, message.project)
if message.project
user.allowed_to?(:edit_messages, message.project)
else
user.allowed_to?(:edit_messages, message.course)
end
}
def visible?(user=User.current)
@ -158,6 +162,7 @@ class Message < ActiveRecord::Base
#更新用户分数 -by zjc
def be_user_score
#新建message且无parent的为发帖
if self.parent_id.nil? && !self.board.project.nil?
UserScore.joint(:post_message, self.author,nil,self, { message_id: self.id })
update_memo_number(self.author,1)

View File

@ -199,13 +199,19 @@ class User < Principal
}
scope :sorted, lambda { order(*User.fields_for_order_statement)}
scope :like, lambda {|arg|
scope :like, lambda {|arg, type|
if arg.blank?
where(nil)
else
pattern = "%#{arg.to_s.strip.downcase}%"
#where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern)
where(" LOWER(login) LIKE :p ", :p => pattern)
if type == "0"
where(" LOWER(login) LIKE :p ", :p => pattern)
elsif type == "1"
where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern)
else
where(" LOWER(mail) LIKE :p ", :p => pattern)
end
end
}

View File

@ -17,7 +17,10 @@
<label for='group_id'><%= l(:label_group) %>:</label>
<%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %>
<% end %>
<label for="user_browse_label"><%= l(:label_user_search_type) %></label>
<%= select "search_by", "id",
{ l(:label_search_by_login) => "0", l(:label_search_by_name) => "1", l(:label_search_by_email) => "2" },
:size => 20 %>
<label for='name'><%= l(:label_user) %>:</label>
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %>

View File

@ -17,7 +17,10 @@
<label for='group_id'><%= l(:label_group) %>:</label>
<%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %>
<% end %>
<label for="user_browse_label"><%= l(:label_user_search_type) %></label>
<%= select "search_by", "id",
{ l(:label_search_by_login) => "0", l(:label_search_by_name) => "1", l(:label_search_by_email) => "2" },
:size => 20 %>
<label for='name'><%= l(:label_user) %>:</label>
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %><!--Modified by young-->

View File

@ -43,6 +43,7 @@
<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) %>
@ -57,6 +58,9 @@
<table>
<tr>
<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="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px">
<%= l(:label_class_period) %>
<span class="required"> *&nbsp;&nbsp;</span>
@ -64,6 +68,8 @@
<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>
<strong><%= l(:label_class_hour) %></strong>
<strong>
<%= l(:label_class_hour) %>
</strong>
@ -80,6 +86,7 @@
<table>
<tr>
<td class="info" align="right" style="width: 86px">
<strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong>
<strong>
<%= l(:label_term) %>
<span class="required"> *&nbsp;&nbsp;</span>
@ -89,6 +96,7 @@
<%= select_tag :time,options_for_select(course_time_option,@course.time), {} %>
</td>
<td class="info" style="width: 10px">
<%= select_tag :term,options_for_select(course_term_option,@course.term),{} %>
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %>
</td>
</tr>
@ -99,12 +107,14 @@
</table>
</p>
<p style="margin-left:-10px;">
<label for="course[course]_password" style="font-size: 13px;"><%= l(:label_new_course_password) %>
<label for="course[course]_password" style="font-size: 13px;">
<%= l(:label_new_course_password) %>
<span class="required">*</span>
</label>
<input id="course_course_password" type="text" style="width:488px;margin-left: 10px;" value="<%= @course.password %>" size="60" name="course[password]"/>
</p>
<em class="info" style="margin-left:95px;"><%= l(:text_command) %></em>
<em class="info" style="margin-left:95px;">
<%= l(:text_command) %>
</em>
@ -124,12 +134,19 @@
<%= f.check_box :is_public, :style => "margin-left:10px;" %>
<%= l(:label_course_public_info) %>
</em>
</p><!-- modified by bai -->
</p>
<p style="margin-left:-10px;">
<em style="color: #888888;display: block;font-size: 90%;font-style: normal;">
<%= f.check_box :open_student, :style => "margin-left:10px;" %>
<%= l(:label_course_open_student_info) %>
</em>
</p>
<p style="display:none;">
<%= f.text_field :course_type, :value => 1 %>
</p>
<%= wikitoolbar_for 'course_description' %>
<% @course.custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :course, value %></p>
<p>
<%= custom_field_tag_with_label :course, value %>
</p>

View File

@ -62,8 +62,8 @@
<input class=" width190" type="password" name="course_password" id="course_password" value="" >
</li>
<li>
<a href="#" class="btn" onclick="submit_form(this);"><%= l(:label_new_join) %></a>
<a href="#" onclick="hideModal(this);"><%= l(:button_cancel)%></a>
<a href="#" class="btn" style="margin-left: 50px;" onclick="submit_form(this);"><%= l(:label_new_join) %></a>
<a href="#" class="btn" style="margin-left: 20px;" onclick="hideModal(this);"><%= l(:button_cancel)%></a>
</li>
</ul>
<% end%>

View File

@ -2,6 +2,7 @@
<% attachmenttypes = @course.attachmenttypes %>
<% sufixtypes = @course.contenttypes %>
<span class="borad-title"><%= t(:label_user_course) %>资源共享区</span>
<div class="content-title-top">
@ -49,7 +50,8 @@
<% if attachmenttypes.any? %>
&nbsp; &nbsp; &nbsp;
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label>
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName"),
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0' ) +options_from_collection_for_select(attachmenttypes, "id", "typeName", params[:type]),
:onchange => "course_attachmenttypes_searchex(this.value)" %>
<% end %>
<% if sufixtypes.any? %>

View File

@ -52,7 +52,7 @@
<% if attachmenttypes.any? %>
&nbsp; &nbsp; &nbsp;
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label>
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName"),
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]),
:onchange => "attachmenttypes_searchex(this.value)" %>
<% end %>
<% if sufixtypes.any? %>

View File

@ -17,6 +17,18 @@
<div class="field">
<%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share' %>
</div>
<div>
<% if User.current.logged? && User.current.admin? %>
<% if @forum.safe_attribute? 'sticky' %>
<%= f.check_box :sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<% end %>
<% if @forum.safe_attribute? 'locked' %>
<%= f.check_box :locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %>
<% end %>
</div>
<div>
<script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
<p style="max-width:680px">

View File

@ -7,9 +7,14 @@
<%= forum.creator.nil? ? (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar")) : (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator)) %>
</div>
<div class="forums-index-content">
<p ><%= link_to h(forum.name), forum_path(forum) %></p>
<p ><%= textAreailizable forum.description%></p>
<p ><%= authoring forum.created_at, forum.creator %></p></div>
<table class="content-text-list">
<tr><td valign="top" width="500px" class=" <%= forum.sticky? ? 'sticky' : '' %>
<%= forum.locked? ? 'locked' : '' %>">
<p ><%= link_to h(forum.name), forum_path(forum) %></p></td></tr>
<tr><td><p ><%= textAreailizable forum.description%></p></td></tr>
<tr><td><p ><%= authoring forum.created_at, forum.creator %></p></td></tr>
</table>
</div>
<div class="forums-index-count">
<table class="forums-count-color"><tr class="forums-count-color" align="center"><td><%= link_to (forum.memo_count), forum_path(forum) %></td><td><%= link_to (forum.topic_count), forum_path(forum) %></td></tr>
<tr align="center"><td>回答</td><td>帖子</td></tr></table></div>

View File

@ -11,7 +11,8 @@
<td rowspan="2">
<% if User.current.logged? %>
<%= link_to( l(:label_forum_new), new_forum_path, :class => 'icon icon-add') %>
<% end %>
<% end %>
</td>
<td rowspan="2" width="250px" >
<div class="top-content-search">

View File

@ -30,8 +30,13 @@
<% if @issue.safe_attribute? 'subject' %>
<p><%= f.text_field :subject, :size => 80, :maxlength => 255, :required => true, :style => "font-size:small" %></p>
<!--Added by young-->
<%= javascript_tag "observeAutocompleteField('issue_subject', '#{escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil))}')" %>
<!--Ended by young-->
<%= javascript_tag do %>
observeAutocompleteField('issue_subject', '<%= escape_javascript auto_complete_issues_path(:project_id => @project,:scope => (Setting.cross_project_issue_relations? ? 'all' : nil)) %>',
{ select: function(event, ui) {
$('input#issue_subject').val(ui.item.value);
}
});
<% end %>
<% end %>

View File

@ -121,7 +121,7 @@
<% end%>
</td>
<td class="font_index">
<% if User.current.member_of_course?(@course) %>
<% if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) %>
<%= link_to "#{studentCount(@course)}", course_member_path(@course, :role => 2), :course => '1' %>
<% else %>
<span>

View File

@ -95,7 +95,7 @@
<td align="center" width="70px"> <%= l(:label_member) %></td>
<td align="center" width="100px"><%= l(:label_user_watchered) %></td>
<td align="center" width="70px"> <%= l(:label_project_issues) %></td>
<!-- <td align="center" width="58px"><%= l(:label_attachment) %></td> -->
<!-- <td align="center" width="58px"><%#= l(:label_attachment) %></td> -->
</tr>
</table>
<div class="user_underline"></div>

View File

@ -21,6 +21,9 @@
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<% title1 = @user.user_extensions.technical_title %>
<% language1 = @user.language %>
<script type="text/javascript">
function startXMLHttp()
{
@ -36,11 +39,55 @@
{
setInterval("startXMLHttp()",5000);
}
function init_title() {
var title = "<%= "#{title1}" %>"
var language = "<%= "#{language1}" %>"
if(language == 'zh') {
switch (title) {
case 'Professor' :
title1 = '教授';
break;
case 'Associate professor' :
title1 = '副教授';
break;
case 'Lecturer' :
title1 = '讲师';
break;
case 'Teaching assistant' :
title1 = '助教';
break;
default :
title1 = title;
break;
}
}
else {
switch (title) {
case '教授' :
title1 = 'Professor';
break;
case '副教授' :
title1 = 'Associate professor';
break;
case '讲师' :
title1 = 'Lecturer';
break;
case '助教' :
title1 = 'Teaching assistant';
break;
default :
title1 = title;
break;
}
}
document.getElementById('td_tech_title').innerHTML = title1;
}
</script>
</head>
<!--加上 onload="Javascript:t()" 开始定时刷新分数 -->
<body class="<%= h body_css_classes %>">
<body class="<%= h body_css_classes %>" onload="init_title()" >
<div id="wrapper">
<div id="wrapper2">
<div id="wrapper3">
@ -193,8 +240,8 @@
<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 class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<span id = "td_tech_title"></span>
</td>
<% end %>
</tr>

View File

@ -1,3 +1,3 @@
<%= error_messages_for 'bid' %>
<p><%= f.text_field :content, :required => true, :size => 60, :style => "width:150px;" %></p>
<p><%= hidden_field_tag 'subject', ||=@memo.subject %>
<p><%= hidden_field_tag 'subject'||=@memo.subject %>

View File

@ -106,7 +106,11 @@
<%= authoring @topic.created_on, @topic.author %>
</div>
<div style="float: right">
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
<% if User.current.logged? %>
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
<% else %>
<%= link_to l(:button_reply), signin_path %>
<% end %>
</div>
</div>
</div>

View File

@ -111,7 +111,11 @@
<%= authoring @topic.created_on, @topic.author %>
</div>
<div style="float: right">
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
<% if User.current.logged? %>
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
<% else %>
<%= link_to l(:button_reply), signin_path %>
<% end %>
</div>
</div>
</div>

View File

@ -61,7 +61,7 @@
<!-- 昵称 -->
<p style="width:630px;padding-left: 26px;">
<%= f.text_field :login, :required => true, :name => "login"%>
<%= f.text_field :login, :required => true, :size => 25, :name => "login"%>
<span class='font_lighter'><%= l(:label_max_number) %></span>
<br/>
</p>
@ -69,13 +69,13 @@
<div>
<span id='name' style='display:none'>
<p style="width:530px;padding-left: 26px;">
<%= f.text_field :lastname, :required => true %>
<%= f.text_field :lastname, :size => 25, :required => true %>
<span class='font_lighter'>
<%= l(:field_lastname_eg) %>
</span>
</p>
<p style="width:530px;padding-left: 26px;">
<%= f.text_field :firstname, :required => true %>
<%= f.text_field :firstname, :size => 25, :required => true %>
<span class='font_lighter'>
<%= l(:field_firstname_eg) %>
</span>

View File

@ -11,6 +11,9 @@
<% if @project.enabled_modules.where("name = 'wiki'").count > 0 %>
<li style="background: url('http://<%= Setting.host_name %>/images/sidebar/tool_tag_alpha.png') no-repeat scroll 10px 30% transparent;"><%= link_to l(:project_module_wiki), project_wiki_path(@project) %></li>
<% end %>
<% if @project.enabled_modules.where("name = 'code_review'").count > 0 %>
<li style="background: url('http://<%= Setting.host_name %>/images/sidebar/tool_tag_alpha.png') no-repeat scroll 10px 30% transparent;"><%= link_to l(:project_module_code_review), {controller: 'code_review', action: 'index', id: @project.id} %></li>
<% end %>
</ul>
<ul><h3>进度跟踪</h3>
<% if @project.enabled_modules.where("name = 'calendar'").count > 0 %>

View File

@ -21,7 +21,7 @@
<!--modified by longjun 因为新建竞赛作品时没有填写运行平台和类别所有如果为空不能使用truncate函数-->
<p><%=l(:label_attendingcontestwork_belongs_type)%><%= softapplication.app_type_name ? softapplication.app_type_name.truncate(14, omission: '...') : "" %></p>
<p><%=l(:label_attendingcontestwork_belongs_type)%><%= softapplication.app_type_name ? softapplication.app_type_name.truncate(10, omission: '...') : "" %></p>
</div>
<div style="padding-left: 53px; float: left; width: 928px;">

View File

@ -8,8 +8,10 @@
alert("搜索条件不能为空");
return;
}
$("#search_user_form").submit();
}
</script>
<div class="top-content">
@ -21,8 +23,12 @@
<td rowspan="2">
</td>
<td rowspan="2" >
<div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 30 %>
<div class="project-search" style="float: right">
<label for="user_browse_label"><%= l(:label_user_search_type) %></label>
<%= select "search_by", "id",
{ l(:label_search_by_login) => "0", l(:label_search_by_name) => "1", l(:label_search_by_email) => "2" },
:size => 20 %>
<%= text_field_tag 'name', params[:name], :size => 30 %>
<input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="searchUser();"/>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
</div>

View File

@ -14,7 +14,7 @@
<% if @auth_sources.present? && @auth_sources.any?(&:searchable?) %>
<%= javascript_tag do %>
observeAutocompleteField('user_login', '<%= escape_javascript autocomplete_for_new_user_auth_sources_path %>', {
('user_login', '<%= escape_javascript autocomplete_for_new_user_auth_sources_path %>', {
select: function(event, ui) {
$('input#user_firstname').val(ui.item.firstname);
$('input#user_lastname').val(ui.item.lastname);

View File

@ -19,7 +19,11 @@
<td rowspan="2">
</td>
<td rowspan="2" >
<div class="project-search" style="float: right">
<div class="project-search" style="float: right">
<label for="user_browse_label"><%= l(:label_user_search_type) %></label>
<%= select "search_by", "id",
{ l(:label_search_by_login) => "0", l(:label_search_by_name) => "1", l(:label_search_by_email) => "2" },
:size => 20 %>
<%= text_field_tag 'name', params[:name], :size => 30 %>
<input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="searchUser();"/>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>

View File

@ -228,7 +228,7 @@
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_new_forum_topics(9 - @contest_notifications.count).each do |topic|%>
<li class="message-brief-intro" style="height: auto; line-height:2em; padding-bottom: 1px ">
<li class="message-brief-intro" style="height: auto; line-height:2em; padding-bottom: 1px; border-bottom: 1px dashed ">
<div style="display: inline-block; width: 100%;">
<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;" %>

View File

@ -135,7 +135,7 @@
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_new_forum_topics(10).each do |topic| %>
<li class="message-brief-intro" style="min-height: 65px; line-height:2em; ">
<li class="message-brief-intro" style="min-height: 65px; line-height:2em; border-bottom: 1px dashed; padding-bottom: 3px">
<div style="display: inline-block; width: 100%;">
<span class="memo_activity text_nowrap" title="<%= topic.subject%>"
style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">

View File

@ -288,6 +288,7 @@ zh:
field_class_period: 学时
field_code: 学分
field_is_public: 公开
field_open_student: 学生列表公开
field_parent: 上级项目
field_is_in_roadmap: 在路线图中显示
field_login: 昵称
@ -851,6 +852,10 @@ zh:
label_roadmap_due_in: "截止日期到 %{value}"
label_roadmap_overdue: "%{value} 延期"
label_roadmap_no_issues: 该版本没有问题
label_user_search_type: 搜索类型
label_search_by_login: 昵称
label_search_by_name: 名字
label_search_by_email: 邮箱
label_search: 搜索
label_result_plural: 结果
label_all_words: 所有单词
@ -1796,6 +1801,7 @@ zh:
label_course_join_student: 加入课程
label_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。)
label_course_public_info: (打钩为公开,不打钩则不公开,若不公开,仅课程成员可见该课程。)
label_course_open_student_info: (打钩为“学生列表公开”,不打钩为不公开,若不公开,则课程外部人员看不到学生列表)
label_course_view_student: 查看其他课程
label_course_student: 学生
label_course_file: 资源库 #资料共享
@ -1957,6 +1963,7 @@ zh:
label_memo_new_from_forum: 发布帖子
label_forum: 公共贴吧
label_forum_new: 新建贴吧
label_forum_set: 贴吧设置
label_tags_forum_description: 贴吧描述
label_tags_forum: 贴吧名称
label_project_module_forums: 公共贴吧
@ -2184,4 +2191,4 @@ zh:
label_anonymous: 匿名
label_submit_comments: 提交评论
field_evaluation_num: 匿评分配数量
label_my_score: 我的评分
label_my_score: 我的评分

View File

@ -164,6 +164,7 @@ RedmineApp::Application.routes.draw do
resources :forums do
collection do
match 'search_forum', :via => [:get, :post]
end
member do
post 'create_memo'
@ -402,6 +403,7 @@ RedmineApp::Application.routes.draw do
end
end
resources :versions, :except => [:index, :show, :edit, :update, :destroy] do
collection do
put 'close_completed'
@ -620,7 +622,7 @@ RedmineApp::Application.routes.draw do
get 'test_connection', :as => 'try_connection'
end
collection do
get 'autocomplete_for_new_user'
get 'autocomplete_for_new_user'
end
end

View File

@ -1,5 +1,6 @@
class ChangeBidsDescriptionType < ActiveRecord::Migration
def change
change_column :bids, :description, :text, default: nil
end
end
#encoding=UTF-8
class ChangeBidsDescriptionType < ActiveRecord::Migration
def change
change_column :bids, :description, :text, default: nil
end
end

View File

@ -0,0 +1,10 @@
#encoding=UTF-8
class ChangeDataForCourses < ActiveRecord::Migration
def up
sql = "UPDATE courses set school_id = 117 where id =58"
execute(sql)
end
def down
end
end

View File

@ -0,0 +1,11 @@
#encoding=UTF-8
class ChangeSchoolIdForSchool < ActiveRecord::Migration
def up
sql = "update courses, user_extensions set courses.school_id = user_extensions.school_id
where courses.tea_id = user_extensions.user_id"
execute(sql)
end
def down
end
end

View File

@ -0,0 +1,6 @@
class AddColumnToForums < ActiveRecord::Migration
def change
add_column :forums, :sticky, :integer
add_column :forums, :locked, :integer
end
end

View File

@ -0,0 +1,9 @@
class SetStickyLockedForForum < ActiveRecord::Migration
def up
sql = "update forums set sticky=0, locked = 0 "
execute(sql)
end
def down
end
end

View File

@ -0,0 +1,29 @@
#encoding=UTF-8
class AddDataForSchoolName < ActiveRecord::Migration
def up
sql = " Insert into schools (name, province, logo_link, created_at, updated_at) values
('香港大学','香港','/images/transparent.png', NOW(),NOW()),
('香港大学','香港','/images/transparent.png',NOW(),NOW()),
('香港中文大学','香港','/images/transparent.png',NOW(),NOW()),
('香港科技大学','香港','/images/transparent.png',NOW(),NOW()),('香港理工大学','香港','/images/transparent.png',NOW(),NOW()),
('香港城市大学','香港','/images/transparent.png',NOW(),NOW()),('香港浸会大学','香港','/images/transparent.png',NOW(),NOW()),
('香港教育学院','香港','/images/transparent.png',NOW(),NOW()),('香港歌德学院','香港','/images/transparent.png',NOW(),NOW()),
('香港岭南大学','香港','/images/transparent.png',NOW(),NOW()),('澳门大学','澳门','/images/transparent.png',NOW(),NOW()),
('澳门理工学院','澳门','/images/transparent.png',NOW(),NOW()),('澳门科技大学','澳门','/images/transparent.png',NOW(),NOW()),
('澳门保安部队高等学校','澳门','/images/transparent.png',NOW(),NOW()),('亚洲国际公开大学','澳门','/images/transparent.png',NOW(),NOW()),
('澳门旅游学院','澳门','/images/transparent.png',NOW(),NOW()),('清华大学(新竹)','台湾','/images/transparent.png',NOW(),NOW()),
('台湾大学','台湾','/images/transparent.png',NOW(),NOW()),('交通大学','台湾','/images/transparent.png',NOW(),NOW()),
('中央大学','台湾','/images/transparent.png',NOW(),NOW()),('成功大学','台湾','/images/transparent.png',NOW(),NOW()),
('中山大学','台湾','/images/transparent.png',NOW(),NOW()),('中原大学','台湾','/images/transparent.png',NOW(),NOW()),
('政治大学','台湾','/images/transparent.png',NOW(),NOW()),('元智大学','台湾','/images/transparent.png',NOW(),NOW()),
('天主教辅仁大学','台湾','/images/transparent.png',NOW(),NOW()),('台湾科技大学','台湾','/images/transparent.png',NOW(),NOW()),
('台湾师范大学','台湾','/images/transparent.png',NOW(),NOW()),('台湾艺术大学','台湾','/images/transparent.png',NOW(),NOW())"
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.
ActiveRecord::Schema.define(:version => 20141105012624) do
ActiveRecord::Schema.define(:version => 20141103065703) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -95,21 +95,19 @@ ActiveRecord::Schema.define(:version => 20141105012624) do
create_table "bids", :force => true do |t|
t.string "name"
t.string "budget", :null => false
t.string "budget", :null => false
t.integer "author_id"
t.date "deadline"
t.text "description"
t.datetime "created_on", :null => false
t.datetime "updated_on", :null => false
t.datetime "created_on", :null => false
t.datetime "updated_on", :null => false
t.integer "commit"
t.integer "reward_type"
t.integer "homework_type"
t.integer "parent_id"
t.string "password"
t.integer "is_evaluation"
t.integer "proportion", :default => 60
t.integer "comment_status", :default => 0
t.integer "evaluation_num", :default => 3
t.integer "proportion", :default => 60
end
create_table "boards", :force => true do |t|
@ -459,6 +457,8 @@ ActiveRecord::Schema.define(:version => 20141105012624) do
t.integer "creator_id", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "sticky"
t.integer "locked"
end
create_table "groups_users", :id => false, :force => true do |t|
@ -480,13 +480,6 @@ ActiveRecord::Schema.define(:version => 20141105012624) do
t.integer "project_id", :default => 0
end
create_table "homework_evaluations", :force => true do |t|
t.string "user_id"
t.string "homework_attach_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "homework_for_courses", :force => true do |t|
t.integer "course_id"
t.integer "bid_id"

View File

@ -170,7 +170,9 @@ module Redmine
end
def render_single_menu_node(item, caption, url, selected)
link_to(h(caption), url, item.html_options(:selected => selected))
unless url.include?('code_review')
link_to(h(caption), url, item.html_options(:selected => selected))
end
end
def render_unattached_menu_item(menu_item, project)
@ -198,17 +200,19 @@ module Redmine
end
def extract_node_details(node, project=nil)
item = node
url = case item.url
when Hash
project.nil? ? item.url : {item.param => project}.merge(item.url)
when Symbol
send(item.url)
else
item.url
end
caption = item.caption(project)
return [caption, url, (current_menu_item == item.name)]
item = node
url = case item.url
when Hash
project.nil? ? item.url : {item.param => project}.merge(item.url)
when Symbol
send(item.url)
else
item.url
end
caption = item.caption(project)
return [caption, url, (current_menu_item == item.name)]
end
# Checks if a user is allowed to access the menu item by:

File diff suppressed because it is too large Load Diff