Conflicts:
	app/models/user.rb
	app/views/courses/_course_form.html.erb
	db/schema.rb
course_group
sw 11 years ago
commit 460ba55dde

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

@ -126,7 +126,7 @@ class AdminController < ApplicationController
@status = params[:status] || 1 @status = params[:status] || 1
scope = User.logged.status(@status) 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_count = scope.count
@user_pages = Paginator.new @user_count, @limit, params['page'] @user_pages = Paginator.new @user_count, @limit, params['page']
@user_base_tag = params[:id] ? 'base_users':'base' @user_base_tag = params[:id] ? 'base_users':'base'

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

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

@ -52,7 +52,7 @@ class ForumsController < ApplicationController
def index def index
@offset, @limit = api_offset_and_limit({:limit => 10}) @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_count = @forums_all.count
@forums_pages = Paginator.new @forums_count, @limit, params['page'] @forums_pages = Paginator.new @forums_count, @limit, params['page']
@ -208,6 +208,8 @@ class ForumsController < ApplicationController
end end
end end
private private

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

@ -5,7 +5,7 @@ class Course < ActiveRecord::Base
STATUS_CLOSED = 5 STATUS_CLOSED = 5
STATUS_ARCHIVED = 9 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 :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 :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表 belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表
@ -52,7 +52,8 @@ class Course < ActiveRecord::Base
'term', 'term',
'is_public', 'is_public',
'description', 'description',
'class_period' 'class_period',
'open_student'
acts_as_customizable acts_as_customizable

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

@ -1359,7 +1359,7 @@ class Issue < ActiveRecord::Base
# Callback on file attachment # Callback on file attachment
def attachment_added(obj) 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) @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
end end
end end

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

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

@ -17,7 +17,10 @@
<label for='group_id'><%= l(:label_group) %>:</label> <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;" %> <%= 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 %> <% 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> <label for='name'><%= l(:label_user) %>:</label>
<%= text_field_tag 'name', params[:name], :size => 30 %> <%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %> <%= submit_tag l(:label_search), :class => "small", :name => nil %>

@ -17,7 +17,10 @@
<label for='group_id'><%= l(:label_group) %>:</label> <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;" %> <%= 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 %> <% 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> <label for='name'><%= l(:label_user) %>:</label>
<%= text_field_tag 'name', params[:name], :size => 30 %> <%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %><!--Modified by young--> <%= submit_tag l(:label_search), :class => "small", :name => nil %><!--Modified by young-->

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

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

@ -2,6 +2,7 @@
<% attachmenttypes = @course.attachmenttypes %> <% attachmenttypes = @course.attachmenttypes %>
<% sufixtypes = @course.contenttypes %> <% sufixtypes = @course.contenttypes %>
<span class="borad-title"><%= t(:label_user_course) %>资源共享区</span> <span class="borad-title"><%= t(:label_user_course) %>资源共享区</span>
<div class="content-title-top"> <div class="content-title-top">
@ -49,7 +50,8 @@
<% if attachmenttypes.any? %> <% if attachmenttypes.any? %>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label> <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)" %> :onchange => "course_attachmenttypes_searchex(this.value)" %>
<% end %> <% end %>
<% if sufixtypes.any? %> <% if sufixtypes.any? %>

@ -52,7 +52,7 @@
<% if attachmenttypes.any? %> <% if attachmenttypes.any? %>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label> <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)" %> :onchange => "attachmenttypes_searchex(this.value)" %>
<% end %> <% end %>
<% if sufixtypes.any? %> <% if sufixtypes.any? %>

@ -17,6 +17,18 @@
<div class="field"> <div class="field">
<%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share' %> <%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share' %>
</div> </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> <div>
<script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script> <script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
<p style="max-width:680px"> <p style="max-width:680px">

@ -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)) %> <%= 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>
<div class="forums-index-content"> <div class="forums-index-content">
<p ><%= link_to h(forum.name), forum_path(forum) %></p> <table class="content-text-list">
<p ><%= textAreailizable forum.description%></p> <tr><td valign="top" width="500px" class=" <%= forum.sticky? ? 'sticky' : '' %>
<p ><%= authoring forum.created_at, forum.creator %></p></div> <%= 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"> <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> <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> <tr align="center"><td>回答</td><td>帖子</td></tr></table></div>

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

@ -30,8 +30,13 @@
<% if @issue.safe_attribute? 'subject' %> <% if @issue.safe_attribute? 'subject' %>
<p><%= f.text_field :subject, :size => 80, :maxlength => 255, :required => true, :style => "font-size:small" %></p> <p><%= f.text_field :subject, :size => 80, :maxlength => 255, :required => true, :style => "font-size:small" %></p>
<!--Added by young--> <!--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))}')" %> <%= javascript_tag do %>
<!--Ended by young--> 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 %> <% end %>

@ -121,7 +121,7 @@
<% end%> <% end%>
</td> </td>
<td class="font_index"> <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' %> <%= link_to "#{studentCount(@course)}", course_member_path(@course, :role => 2), :course => '1' %>
<% else %> <% else %>
<span> <span>

@ -95,7 +95,7 @@
<td align="center" width="70px"> <%= l(:label_member) %></td> <td align="center" width="70px"> <%= l(:label_member) %></td>
<td align="center" width="100px"><%= l(:label_user_watchered) %></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="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> </tr>
</table> </table>
<div class="user_underline"></div> <div class="user_underline"></div>

@ -21,6 +21,9 @@
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags --> <!-- page specific tags -->
<%= yield :header_tags -%> <%= yield :header_tags -%>
<% title1 = @user.user_extensions.technical_title %>
<% language1 = @user.language %>
<script type="text/javascript"> <script type="text/javascript">
function startXMLHttp() function startXMLHttp()
{ {
@ -36,11 +39,55 @@
{ {
setInterval("startXMLHttp()",5000); 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> </script>
</head> </head>
<!--加上 onload="Javascript:t()" 开始定时刷新分数 --> <!--加上 onload="Javascript:t()" 开始定时刷新分数 -->
<body class="<%= h body_css_classes %>"> <body class="<%= h body_css_classes %>" onload="init_title()" >
<div id="wrapper"> <div id="wrapper">
<div id="wrapper2"> <div id="wrapper2">
<div id="wrapper3"> <div id="wrapper3">
@ -194,7 +241,7 @@
<%= l(:label_technical_title) %>: <%= l(:label_technical_title) %>:
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.technical_title %> <span id = "td_tech_title"></span>
</td> </td>
<% end %> <% end %>
</tr> </tr>

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

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

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

@ -61,7 +61,7 @@
<!-- 昵称 --> <!-- 昵称 -->
<p style="width:630px;padding-left: 26px;"> <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> <span class='font_lighter'><%= l(:label_max_number) %></span>
<br/> <br/>
</p> </p>
@ -69,13 +69,13 @@
<div> <div>
<span id='name' style='display:none'> <span id='name' style='display:none'>
<p style="width:530px;padding-left: 26px;"> <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'> <span class='font_lighter'>
<%= l(:field_lastname_eg) %> <%= l(:field_lastname_eg) %>
</span> </span>
</p> </p>
<p style="width:530px;padding-left: 26px;"> <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'> <span class='font_lighter'>
<%= l(:field_firstname_eg) %> <%= l(:field_firstname_eg) %>
</span> </span>

@ -11,6 +11,9 @@
<% if @project.enabled_modules.where("name = 'wiki'").count > 0 %> <% 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> <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 %> <% 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>
<ul><h3>进度跟踪</h3> <ul><h3>进度跟踪</h3>
<% if @project.enabled_modules.where("name = 'calendar'").count > 0 %> <% if @project.enabled_modules.where("name = 'calendar'").count > 0 %>

@ -21,7 +21,7 @@
<!--modified by longjun 因为新建竞赛作品时没有填写运行平台和类别所有如果为空不能使用truncate函数--> <!--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>
<div style="padding-left: 53px; float: left; width: 928px;"> <div style="padding-left: 53px; float: left; width: 928px;">

@ -8,8 +8,10 @@
alert("搜索条件不能为空"); alert("搜索条件不能为空");
return; return;
} }
$("#search_user_form").submit(); $("#search_user_form").submit();
} }
</script> </script>
<div class="top-content"> <div class="top-content">
@ -22,6 +24,10 @@
</td> </td>
<td rowspan="2" > <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 %> <%= text_field_tag 'name', params[:name], :size => 30 %>
<input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="searchUser();"/> <input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="searchUser();"/>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>

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

@ -20,6 +20,10 @@
</td> </td>
<td rowspan="2" > <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 %> <%= text_field_tag 'name', params[:name], :size => 30 %>
<input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="searchUser();"/> <input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="searchUser();"/>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>

@ -228,7 +228,7 @@
<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(9 - @contest_notifications.count).each do |topic|%> <% 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%;"> <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; <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;" %>

@ -135,7 +135,7 @@
<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| %>
<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%;"> <div style="display: inline-block; width: 100%;">
<span class="memo_activity text_nowrap" title="<%= topic.subject%>" <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;"> style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">

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

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

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

@ -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

@ -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

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

@ -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

@ -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

@ -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 => 20141105012624) do ActiveRecord::Schema.define(:version => 20141103065703) 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
@ -108,8 +108,6 @@ ActiveRecord::Schema.define(:version => 20141105012624) do
t.string "password" t.string "password"
t.integer "is_evaluation" t.integer "is_evaluation"
t.integer "proportion", :default => 60 t.integer "proportion", :default => 60
t.integer "comment_status", :default => 0
t.integer "evaluation_num", :default => 3
end end
create_table "boards", :force => true do |t| create_table "boards", :force => true do |t|
@ -459,6 +457,8 @@ ActiveRecord::Schema.define(:version => 20141105012624) do
t.integer "creator_id", :null => false t.integer "creator_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.integer "sticky"
t.integer "locked"
end end
create_table "groups_users", :id => false, :force => true do |t| 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 t.integer "project_id", :default => 0
end 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| create_table "homework_for_courses", :force => true do |t|
t.integer "course_id" t.integer "course_id"
t.integer "bid_id" t.integer "bid_id"

@ -170,8 +170,10 @@ module Redmine
end end
def render_single_menu_node(item, caption, url, selected) def render_single_menu_node(item, caption, url, selected)
unless url.include?('code_review')
link_to(h(caption), url, item.html_options(:selected => selected)) link_to(h(caption), url, item.html_options(:selected => selected))
end end
end
def render_unattached_menu_item(menu_item, project) def render_unattached_menu_item(menu_item, project)
raise MenuError, ":child_menus must be an array of MenuItems" unless menu_item.is_a? MenuItem raise MenuError, ":child_menus must be an array of MenuItems" unless menu_item.is_a? MenuItem
@ -198,6 +200,7 @@ module Redmine
end end
def extract_node_details(node, project=nil) def extract_node_details(node, project=nil)
item = node item = node
url = case item.url url = case item.url
when Hash when Hash
@ -209,6 +212,7 @@ module Redmine
end end
caption = item.caption(project) caption = item.caption(project)
return [caption, url, (current_menu_item == item.name)] return [caption, url, (current_menu_item == item.name)]
end end
# Checks if a user is allowed to access the menu item by: # Checks if a user is allowed to access the menu item by:

Loading…
Cancel
Save