Conflicts:
	app/views/users/show.html.erb
GitlabVersion
z9hang 11 years ago
commit 4bd083b059

@ -1,3 +1,4 @@
# -*coding:utf-8 -*-
# Redmine - project management software # Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang # Copyright (C) 2006-2013 Jean-Philippe Lang
# #
@ -14,6 +15,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class MembersController < ApplicationController class MembersController < ApplicationController
model_object Member model_object Member
before_filter :find_model_object, :except => [:index, :create, :autocomplete] before_filter :find_model_object, :except => [:index, :create, :autocomplete]
@ -124,7 +126,13 @@ class MembersController < ApplicationController
attrs = params[:membership].dup attrs = params[:membership].dup
user_ids = attrs.delete(:user_ids) user_ids = attrs.delete(:user_ids)
user_ids.each do |user_id| user_ids.each do |user_id|
members << Member.new(:role_ids => params[:membership][:role_ids], :user_id => user_id) member = Member.new(:role_ids => params[:membership][:role_ids], :user_id => user_id)
role = Role.find_by_id(params[:membership][:role_ids])
# 这里的判断只能通过角色名,可以弄成常量
if role.name == "学生"
StudentsForCourse.create(:student_id => user_id, :course_id =>@course.id)
end
members << member
#user_grades << UserGrade.new(:user_id => user_id, :course_id => @course.id) #user_grades << UserGrade.new(:user_id => user_id, :course_id => @course.id)
if (params[:membership][:role_ids]) if (params[:membership][:role_ids])
role = Role.find(params[:membership][:role_ids][0]) role = Role.find(params[:membership][:role_ids][0])
@ -201,6 +209,15 @@ class MembersController < ApplicationController
if (params[:membership][:role_ids]) if (params[:membership][:role_ids])
role = Role.find(params[:membership][:role_ids][0]) role = Role.find(params[:membership][:role_ids][0])
# 这里的判断只能通过角色名,可以弄成常量
if role.name == "学生"
StudentsForCourse.create(:student_id => @member.user_id, :course_id =>@course.id)
else
joined = StudentsForCourse.where('student_id = ? and course_id = ?', @member.user_id,@course.id)
joined.each do |join|
join.delete
end
end
if role.allowed_to?(:is_manager) if role.allowed_to?(:is_manager)
@courseInfo = CourseInfos.new(:user_id => @member.user_id, :course_id => @course.id) @courseInfo = CourseInfos.new(:user_id => @member.user_id, :course_id => @course.id)
@courseInfo.save @courseInfo.save
@ -271,6 +288,11 @@ class MembersController < ApplicationController
user.destroy user.destroy
end end
end end
joined = StudentsForCourse.where('student_id = ? and course_id = ?', @member.user_id,@course.id)
joined.each do |join|
join.delete
end
end end
respond_to do |format| respond_to do |format|
format.html { redirect_to_settings_in_courses } format.html { redirect_to_settings_in_courses }

@ -642,9 +642,9 @@ class UsersController < ApplicationController
return return
end end
if @obj.save if @obj.save
## 执行成功的操作。 logger.debug "#{__FILE__}:#{__LINE__} ===> #{@obj.to_json}"
else else
#捕获异常 logger.error "#{__FILE__}:#{__LINE__} ===> #{@obj.errors.try(:full_messages)}"
end end
respond_to do |format| respond_to do |format|
format.js format.js

@ -114,7 +114,15 @@ module CoursesHelper
# 学生人数计算 # 学生人数计算
# add by nwb # add by nwb
def studentCount course def studentCount course
course.student.count count = course.student.count
if count <= 5
result = count.to_s
elsif count < 10 && count > 5
result = "5+"
else
result = (count-count % 10).to_s + "+"
end
result
end end
def eventToLanguageCourse event_type, course def eventToLanguageCourse event_type, course

@ -42,7 +42,6 @@ module StoresHelper
container = attachment.container container = attachment.container
case container.class.to_s case container.class.to_s
when 'Message' when 'Message'
# binding.pry
# '项目 > zzz > 论坛 > 帖子xxx' # '项目 > zzz > 论坛 > 帖子xxx'
# topic_str = container.project.project_type == 0 ? l(:label_board) : l(:label_new_course) # topic_str = container.project.project_type == 0 ? l(:label_board) : l(:label_new_course)

@ -258,4 +258,24 @@ module UsersHelper
end end
return result return result
end end
#获取用户参与的公开的课程列表
def user_public_course_list user
membership = user.coursememberships.all#@user.coursememberships.all(:conditions => Course.visible_condition(User.current))
membership.sort! {|older, newer| newer.created_on <=> older.created_on }
memberships = []
membership.collect { |e|
memberships.push(e)
}
## 判断课程是否过期 [需封装]
memberships_doing = []
memberships_done = []
memberships.map { |e|
if course_endTime_timeout?(e.course)
memberships_done.push e
else
memberships_doing.push e
end
}
end
end end

@ -227,7 +227,8 @@ class Attachment < ActiveRecord::Base
def file=(incoming_file) def file=(incoming_file)
unless incoming_file.nil? unless incoming_file.nil?
@temp_file = incoming_file @temp_file = incoming_file
if @temp_file.size > 0 # 允许上传文件大小为0的文件
#if @temp_file.size > 0
if @temp_file.respond_to?(:original_filename) if @temp_file.respond_to?(:original_filename)
self.filename = @temp_file.original_filename self.filename = @temp_file.original_filename
self.filename.force_encoding("UTF-8") if filename.respond_to?(:force_encoding) self.filename.force_encoding("UTF-8") if filename.respond_to?(:force_encoding)
@ -239,7 +240,7 @@ class Attachment < ActiveRecord::Base
self.content_type = Redmine::MimeType.of(filename) self.content_type = Redmine::MimeType.of(filename)
end end
self.filesize = @temp_file.size self.filesize = @temp_file.size
end #end
end end
end end
@ -255,7 +256,8 @@ class Attachment < ActiveRecord::Base
# Copies the temporary file to its final location # Copies the temporary file to its final location
# and computes its MD5 hash # and computes its MD5 hash
def files_to_final_location def files_to_final_location
if @temp_file && (@temp_file.size > 0) # # 允许上传文件大小为0的文件
if @temp_file# && (@temp_file.size > 0)
self.disk_directory = target_directory self.disk_directory = target_directory
self.disk_filename = Attachment.disk_filename(filename, disk_directory) self.disk_filename = Attachment.disk_filename(filename, disk_directory)
logger.info("Saving attachment '#{self.diskfile}' (#{@temp_file.size} bytes)") logger.info("Saving attachment '#{self.diskfile}' (#{@temp_file.size} bytes)")

@ -36,7 +36,7 @@ class Course < ActiveRecord::Base
validates_presence_of :password, :term,:name validates_presence_of :password, :term,:name
validates_format_of :class_period, :with =>/^[1-9]\d*$/ validates_format_of :class_period, :with =>/^[1-9]\d*$/
validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/ #validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/
before_save :self_validate before_save :self_validate
after_create :create_board_sync after_create :create_board_sync

@ -564,10 +564,8 @@ class Issue < ActiveRecord::Base
end end
# 缺陷的短描述信息 # 缺陷的短描述信息
def short_description(length = 255) def short_description(length = 255)
# 不再使用短描述 description.gsub(/<\/?.*?>/,"").html_safe if description
#description.gsub(/<\/?.*?>/,"").html_safe if description
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
description
end end
private :workflow_rule_by_attribute private :workflow_rule_by_attribute

@ -76,10 +76,9 @@ class News < ActiveRecord::Base
# 新闻的短描述信息 # 新闻的短描述信息
def short_description(length = 255) def short_description(length = 255)
#description.gsub(/<\/?.*?>/,"").html_safe if description description.gsub(/<\/?.*?>/,"").html_safe if description
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
# 不再使用短描述 #description
description
end end
private private

@ -84,10 +84,10 @@ class OpenSourceProject < ActiveRecord::Base
# end # end
def short_description(length = 255) def short_description(length = 255)
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
#description.gsub(/<\/?.*?>/,"").html_safe if description #description.gsub(/<\/?.*?>/,"").html_safe if description
# 不再使用短描述 # 不再使用短描述
description # description
end end
def applied_by?(user) def applied_by?(user)

@ -630,9 +630,7 @@ class Project < ActiveRecord::Base
# Returns a short description of the projects (first lines) # Returns a short description of the projects (first lines)
def short_description(length = 255) def short_description(length = 255)
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
# 不再使用短描述 description.gsub(/<\/?.*?>/,"").html_safe if description
# description.gsub(/<\/?.*?>/,"").html_safe if description
description
end end
def css_classes def css_classes

@ -1,12 +1,12 @@
<!-- <%= course_board_breadcrumb(@board) %> --> <!-- <%#= course_board_breadcrumb(@board) %> -->
<!--new and follow--> <!--new and follow-->
<!-- <div class="content-title-top"> <!-- <div class="content-title-top">
<%= link_to l(:label_message_new), <%#= link_to l(:label_message_new),
new_board_message_path(@board), new_board_message_path(@board),
:class => 'icon icon-add', :class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %> --> :onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %> -->
<!-- <%= watcher_link(@board, User.current) %> --> <!-- <%#= watcher_link(@board, User.current) %> -->
<!-- </div> --> <!-- </div> -->
<div id="add-message" class="add_frame" style="display:none;"> <div id="add-message" class="add_frame" style="display:none;">
<% if User.current.logged? %> <% if User.current.logged? %>

@ -1,33 +1,35 @@
<!-- <%= board_breadcrumb(@board) %> --> <!-- <%#= board_breadcrumb(@board) %> -->
<!--new and follow--> <!--new and follow-->
<!-- <div class="content-title-top"> <!-- <div class="content-title-top">
<%= link_to l(:label_message_new), <%#= link_to l(:label_message_new),
new_board_message_path(@board), new_board_message_path(@board),
:class => 'icon icon-add', :class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %> --> :onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %> -->
<!-- <%= watcher_link(@board, User.current) %> --> <!-- <%#= watcher_link(@board, User.current) %> -->
<!-- </div> --> <!-- </div> -->
<div id="add-message" class="add_frame" style="display:none;"> <div id="add-message" class="add_frame" style="display:none;">
<% if User.current.logged? %> <% if User.current.logged? %>
<h3><%= link_to h(@board.name), project_board_path(@project, @board) %> &#187; <%= l(:label_message_new) %></h3> <h3><%= link_to h(@board.name), project_board_path(@project, @board) %> &#187; <%= l(:label_message_new) %></h3>
<div class="add_frame_header" >
<div class="add_frame_header">
<%= l(:label_message_new) %> <%= l(:label_message_new) %>
</div> </div>
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %> <%= render :partial => 'messages/form', :locals => {:f => f} %>
<p><%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> <p><%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
<%= preview_link(preview_board_message_path(@board), 'message-form' ,target='preview',{:class => 'whiteButton m3p10'} )%> | <%= preview_link(preview_board_message_path(@board), 'message-form', target='preview', {:class => 'whiteButton m3p10'}) %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'whiteButton m3p10' %></p> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'whiteButton m3p10' %></p>
<% end %> <% end %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>
<% end %> <% end %>
</div> </div>
<!--display the board--> <!--display the board-->
<div class="borad-title"><%=h @board.name %></div> <div class="borad-title"><%= h @board.name %></div>
<% if !User.current.logged?%> <% if !User.current.logged? %>
<div style="font-size: 14px;margin:20px;"> <div style="font-size: 14px;margin:20px;">
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>
<%= l(:label_user_login_course_board) %> <%= l(:label_user_login_course_board) %>
@ -39,15 +41,17 @@
</div> </div>
<% end %> <% end %>
<!-- <div class="borad-description"><%=h @board.description %></div> --> <!-- <div class="borad-description"><%= h @board.description %></div> -->
<div class="borad-setitle"> <div class="borad-setitle">
<span class="borad-topic-count">共有 <%=link_to @topics.count %> 个贴子</span> <span class="borad-topic-count">共有 <%= link_to @topics.count %> 个贴子</span>
<span> <% if @project.enabled_modules.where("name = 'boards'").count > 0 %>
<%= link_to l(:label_message_new), <span>
new_board_message_path(@board), <%= link_to l(:label_message_new),
:class => 'icon icon-add', new_board_message_path(@board),
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %> :class => 'icon icon-add',
</span> :onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %>
</span>
<% end %>
</div> </div>
<div style="padding-top: 10px"> <div style="padding-top: 10px">
<% if @topics.any? %> <% if @topics.any? %>
@ -63,18 +67,29 @@
<% @topics.each do |topic| %> <% @topics.each do |topic| %>
<table class="content-text-list"> <table class="content-text-list">
<tr> <tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %></td> <td colspan="2" valign="top" width="50"><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %></td>
<td> <td>
<table width="640px" border="0"> <table width="640px" border="0">
<tr> <tr>
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td> <td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td>
<td align="right" rowspan="3"><table class="borad-count"><tr><td align="center" class="borad-count-digit"><%=link_to (topic.replies_count), board_message_path(@board, topic) %></td></tr> <td align="right" rowspan="3">
<tr><td align="center">回答</td></tr> <table class="borad-count">
</table></td> <tr>
<td align="center" class="borad-count-digit"><%= link_to (topic.replies_count), board_message_path(@board, topic) %></td>
</tr>
<tr>
<td align="center">回答</td>
</tr>
</table>
</td>
</tr> </tr>
<!-- <tr><td colspan="2" ><span class="font_description">标签</span></td></tr> --> <!-- <tr><td colspan="2" ><span class="font_description">标签</span></td></tr> -->
<tr><td align="left" colspan="2" ><span class="font_lighter"><%= authoring topic.created_on, topic.author %><br /></span></td></tr> <tr>
</table></td> <td align="left" colspan="2">
<span class="font_lighter"><%= authoring topic.created_on, topic.author %><br/></span></td>
</tr>
</table>
</td>
</tr> </tr>
</table> </table>

@ -77,7 +77,7 @@
<%= stylesheet_link_tag 'scm' %> <%= stylesheet_link_tag 'scm' %>
<% end %> <% end %>
<% html_title(l(:label_news_plural)) -%> <% html_title(l(:label_contest_notification)) -%>
</div> </div>
<script type='text/javascript'> <script type='text/javascript'>

@ -14,7 +14,7 @@
<% unless contest.author.nil? %> <% unless contest.author.nil? %>
<%= link_to(contest.author, user_path(contest.author), :class => 'bid_user') %>: <%= link_to(contest.author, user_path(contest.author), :class => 'bid_user') %>:
<% end %> <% end %>
&nbsp;<%= link_to(contest.name, show_contest_contest_path(contest), :class => 'bid_path', :target => "_blank") %></strong></td> &nbsp;<%= link_to(contest.name, contest_contestnotifications_path(contest), :class => 'bid_path', :target => "_blank") %></strong></td>
</tr> </tr>
<tr> <tr>
<td width="500"> <td width="500">

@ -87,83 +87,72 @@
<div id="put-project-form" style="display: none; padding-left: 83px; width: 88%"> <div id="put-project-form" style="display: none; padding-left: 83px; width: 88%">
<%= form_for Softapplication.new, :url => softapplications_path do |f| %> <%= form_for Softapplication.new, :url => softapplications_path do |f| %>
<fieldset class="contes-new-box" style="padding-left: 36px; line-height: 8px; margin-left: 1px" > <fieldset class="contes-new-box" style="padding-left: 36px; line-height: 8px; margin-left: 1px" >
<%= hidden_field_tag 'contest_id', @contest.id %> <%= hidden_field_tag 'contest_id', @contest.id %>
<tr style="width:700px; margin-left: -10px;"> <tr style="width:700px; margin-left: -10px;">
<span><%= l(:label_work_name) %></span> <span><%= l(:label_work_name) %></span>
<span class="contest-star"> * </span>: <span class="contest-star"> * </span>:
<td><%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %></td> <td><%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %></td>
<span style="font-size: 10px">(<%= l(:label_workname_lengthlimit) %>)</span> <span style="font-size: 10px">(<%= l(:label_workname_lengthlimit) %>)</span>
</tr> </tr>
<br/> <br/>
<br/> <br/>
<br/> <br/>
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_running_platform) %></span> <span><%= l(:label_running_platform) %></span>
<span class="contest-star"> * </span>: <span class="contest-star"> * </span>:
<td style="width: 100px"><%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %></td> <td style="width: 100px"><%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr> </tr>
<br/> <br/>
<br/>
<br/> <br/>
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_work_type) %></span> <span><%= l(:label_work_description) %></span>
<span class="contest-star"> * </span>:
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td>
<td style="width: 100px"><%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %></td> <span style="font-size: 10px">(<%= l(:label_workdescription_lengthlimit) %>)</span>
</tr>
</tr> <br/>
<br/> <br/>
<br/> <br/>
<br/>
<tr style="width:800px;">
<tr style="width:800px;"> <span><%= l(:label_softapplication_developers) %></span>
<span><%= l(:label_work_description) %></span> <span class="contest-star"> * </span>:
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %></td>
<td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td>
<span style="font-size: 10px">(<%= l(:label_workdescription_lengthlimit) %>)</span> </tr>
</tr> <br/>
<br/> <br/>
<br/> <br/>
<br/>
<tr style="width:800px;">
<tr style="width:800px;"> <span><%= l(:label_work_deposit_project) %></span>
<span><%= l(:label_softapplication_developers) %></span> <span style="padding-left: 4px"><%= select_tag 'project', options_for_select(select_option_helper(@option)), :name => 'project', :class => 'grayline2' %></span>
<span class="contest-star"> * </span>: <span><%= link_to l(:label_create_new_projects), new_project_path(course: 0, project_type: 0), :target => '_blank' %></span>
<td style="width: 100px"><%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %></td> </tr>
<br/>
</tr> <br/>
<br/> <br/>
<br/>
<br/> <fieldset style="width: 500px; padding-top: 10px">
<legend>
<tr style="width:800px;"> <%= l(:label_upload_softworkpacket_photo) %>
<span><%= l(:label_work_deposit_project) %></span> </legend>
<span style="padding-left: 4px"><%= select_tag 'project', options_for_select(select_option_helper(@option)), :name => 'project', :class => 'grayline2' %></span> <%#= render_flash_messages %>
<span><%= link_to l(:label_create_new_projects), new_project_path(course: 0, project_type: 0), :target => '_blank' %></span> <p id="put-bid-form-partial">
</tr> <%= render :partial => 'attachments/form' %>
<br/> </p>
<br/>
<br/> <p style="font-size: 11px">
1、<%= l(:label_upload_softapplication_packets_mustpacketed) %> <br/>
<fieldset style="width: 500px; padding-top: 10px"> <br>
<legend> 2、<%= l(:label_upload_softapplication_photo_condition) %>
<%= l(:label_upload_softworkpacket_photo) %> </p>
</legend>
<%#= render_flash_messages %> </fieldset>
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %>
</p>
<p style="font-size: 11px">
1、<%= l(:label_upload_softapplication_packets_mustpacketed) %> <br/>
<br>
2、<%= l(:label_upload_softapplication_photo_condition) %>
</p>
</fieldset>
</fieldset></br> </fieldset></br>
<div class="align-center" style="padding-top: -3px; padding-bottom: 8px"> <div class="align-center" style="padding-top: -3px; padding-bottom: 8px">
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>
@ -261,9 +250,9 @@
<span style="padding-left: 240px"><strong><%= l(:label_attendingcontest_spoksman) %> <span style="padding-left: 240px"><strong><%= l(:label_attendingcontest_spoksman) %>
<!-- modified by zjc 添加超链接 --> <!-- modified by zjc 添加超链接 -->
<% unless c_project.nil? || c_project.user.nil? %> <% unless c_project.nil? || c_project.user.nil? %>
</strong><%= link_to c_project.user.name,user_path(c_project.user) %></span> </strong><%= link_to c_project.user.name,user_path(c_project.user) %></span>
<% end %> <% end %>
</div> </div>
<div style="padding-left: 68px"> <div style="padding-left: 68px">
@ -298,9 +287,9 @@
<span style="padding-left: 240px"><strong><%= l(:label_attendingcontest_spoksman) %> <span style="padding-left: 240px"><strong><%= l(:label_attendingcontest_spoksman) %>
<!-- modified by zjc 添加超链接 --> <!-- modified by zjc 添加超链接 -->
<% unless c_softapplication.nil? || c_softapplication.softapplication.nil? || c_softapplication.softapplication.user.nil? %> <% unless c_softapplication.nil? || c_softapplication.softapplication.nil? || c_softapplication.softapplication.user.nil? %>
</strong><%= link_to c_softapplication.softapplication.user.name,user_path(c_softapplication.softapplication.user) %></span> </strong><%= link_to c_softapplication.softapplication.user.name,user_path(c_softapplication.softapplication.user) %></span>
<% end %> <% end %>
</div> </div>
<!--获奖及教师评奖--> <!--获奖及教师评奖-->
<div style="padding-left: 18px; padding-bottom: 5px"> <div style="padding-left: 18px; padding-bottom: 5px">

@ -1,120 +1,127 @@
<div class="content-title-top"> <div class="content-title-top">
<div> <% if @project.enabled_modules.where("name = 'issue_tracking'").count > 0 %>
<%= link_to l(:label_issue_new), { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new, <div>
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :class => 'icon icon-add' %> <%= link_to l(:label_issue_new), {:controller => 'issues', :action => 'new', :copy_from => nil}, :param => :project_id, :caption => :label_issue_new,
:html => {:accesskey => Redmine::AccessKeys.key_for(:new_issue)}, :class => 'icon icon-add' %>
<%= link_to l(:label_query), '#', :class => 'icon icon-help', <%= link_to l(:label_query), '#', :class => 'icon icon-help',
:onclick => '$("#custom_query").slideToggle(400); ' if true || User.current.logged? %> :onclick => '$("#custom_query").slideToggle(400); ' if true || User.current.logged? %>
</div> </div>
<% end %>
</div> </div>
<div class="contextual"> <div class="contextual">
<% if !@query.new_record? && @query.editable_by?(User.current) %> <% if !@query.new_record? && @query.editable_by?(User.current) %>
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
<%= delete_link query_path(@query) %> <%= delete_link query_path(@query) %>
<% end %> <% end %>
</div> </div>
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> <% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
<div style="clear:right; "> <div style="clear:right; ">
<%= form_tag({ :controller => 'issues', :action => 'index', :project_id => @project }, :method => :get, :id => 'query_form', :class => 'query_form') do %> <%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project}, :method => :get, :id => 'query_form', :class => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %> <%= hidden_field_tag 'set_filter', '1' %>
<div id="custom_query" class="custom_query" style="display: <%= !params[:utf8].blank? ? 'block' : 'none' %>;"> <div id="custom_query" class="custom_query" style="display: <%= !params[:utf8].blank? ? 'block' : 'none' %>;">
<span>---<%= l :label_query_new %>---</span> <span>---<%= l :label_query_new %>---</span>
<div id="query_form_content" class="hide-when-print">
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> <div id="query_form_content" class="hide-when-print">
<legend onclick="toggleFieldset(this);"> <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<%= l(:label_issue_query_condition) %> <legend onclick="toggleFieldset(this);">
</legend> <%= l(:label_issue_query_condition) %>
<div style="<%= @query.new_record? ? "" : "display: none;" %>"> </legend>
<%= render :partial => 'queries/filters', :locals => {:query => @query} %> <div style="<%= @query.new_record? ? "" : "display: none;" %>">
</div> <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
</fieldset> </div>
<fieldset class="collapsible collapsed" > </fieldset>
<legend onclick="toggleFieldset(this);"> <fieldset class="collapsible collapsed">
<%= l(:label_options) %> <legend onclick="toggleFieldset(this);">
</legend> <%= l(:label_options) %>
<div style="display: none;"> </legend>
<table> <div style="display: none;">
<tr> <table>
<td><%= l(:field_column_names) %></td> <tr>
<td><%= render_query_columns_selection(@query) %></td> <td><%= l(:field_column_names) %></td>
</tr> <td><%= render_query_columns_selection(@query) %></td>
<tr> </tr>
<td><label for='group_by'><%= l(:field_group_by) %></label></td> <tr>
<td><%= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, @query.group_by) ) %></td> <td><label for='group_by'><%= l(:field_group_by) %></label></td>
</tr> <td><%= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect { |c| [c.caption, c.name.to_s] }, @query.group_by)) %></td>
<tr> </tr>
<td><%= l(:button_show) %></td> <tr>
<td><%= available_block_columns_tags(@query) %></td> <td><%= l(:button_show) %></td>
</tr> <td><%= available_block_columns_tags(@query) %></td>
</table> </tr>
</div> </table>
</fieldset> </div>
<div class="buttons hide-when-print"> </fieldset>
<%= link_to_function l(:label_issue_query), 'submit_query_form("query_form")', :class => 'icon icon-checked' %> <div class="buttons hide-when-print">
<%= link_to l(:label_issue_cancel_query), { :set_filter => 1, :project_id => @project }, :class => 'icon icon-reload' %> <%= link_to_function l(:label_issue_query), 'submit_query_form("query_form")', :class => 'icon icon-checked' %>
</div> <%= link_to l(:label_issue_cancel_query), {:set_filter => 1, :project_id => @project}, :class => 'icon icon-reload' %>
</div> </div>
</div> </div>
<% end %> </div>
<% end %>
</div> </div>
<%= error_messages_for 'query' %> <%= error_messages_for 'query' %>
<% if @query.valid? %> <% if @query.valid? %>
<% if @issues.empty? %> <% if @issues.empty? %>
<p class="nodata"> <p class="nodata">
<%= l(:label_no_data) %> <%= l(:label_no_data) %>
</p> </p>
<% else %> <% else %>
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %> <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %>
<div class="pagination"><ul><%= pagination_links_full @issue_pages, @issue_count %></ul></div> <div class="pagination">
<% end %> <ul><%= pagination_links_full @issue_pages, @issue_count %></ul>
<div style="float: right; padding-top: 30px"> </div>
<% other_formats_links do |f| %> <% end %>
<%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %> <div style="float: right; padding-top: 30px">
<%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %> <% other_formats_links do |f| %>
<%= f.link_to 'PDF', :url => params %> <%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
<% end %> <%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %>
</div> <%= f.link_to 'PDF', :url => params %>
<% end %>
</div>
<div id="csv-export-options" style="display:none;">
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
<%= form_tag(params.merge({:format => 'csv',:page=>nil}), :method => :get, :id => 'csv-export-form') do %> <div id="csv-export-options" style="display:none;">
<p> <h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
<label><%= radio_button_tag 'columns', 'all' %> <%= l(:description_all_columns) %></label> <%= form_tag(params.merge({:format => 'csv', :page => nil}), :method => :get, :id => 'csv-export-form') do %>
</p> <p>
<p> <label><%= radio_button_tag 'columns', 'all' %> <%= l(:description_all_columns) %></label>
<label><%= check_box_tag 'description', '1', @query.has_column?(:description) %> <%= l(:field_description) %></label> </p>
</p>
<p class="buttons"> <p>
<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %> <label><%= check_box_tag 'description', '1', @query.has_column?(:description) %> <%= l(:field_description) %></label>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %> </p>
</p>
<% end %> <p class="buttons">
</div> <%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
</p>
<% end %>
</div>
<% end %> <% end %>
<%= call_hook(:view_issues_index_bottom, { :issues => @issues, :project => @project, :query => @query }) %> <%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %>
<% content_for :sidebar do %> <% content_for :sidebar do %>
<%= render :partial => 'issues/sidebar' %> <%= render :partial => 'issues/sidebar' %>
<% end %> <% end %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, <%= auto_discovery_link_tag(:atom,
{:query_id => @query, :format => 'atom', {:query_id => @query, :format => 'atom',
:page => nil, :key => User.current.rss_key}, :page => nil, :key => User.current.rss_key},
:title => l(:label_issue_plural)) %> :title => l(:label_issue_plural)) %>
<%= auto_discovery_link_tag(:atom, <%= auto_discovery_link_tag(:atom,
{:controller => 'journals', :action => 'index', {:controller => 'journals', :action => 'index',
:query_id => @query, :format => 'atom', :query_id => @query, :format => 'atom',
:page => nil, :key => User.current.rss_key}, :page => nil, :key => User.current.rss_key},
:title => l(:label_changes_details)) %> :title => l(:label_changes_details)) %>
<% end %> <% end %>
<%= context_menu issues_context_menu_path %> <%= context_menu issues_context_menu_path %>

@ -217,11 +217,11 @@
<div id="content"> <div id="content">
<% if display_main_menu?(@contest) %> <% if display_main_menu?(@contest) %>
<div class="tabs_new"> <div class="tabs_new">
<ul> <ul>
<li ><%= link_to l(:label_contest_userresponse), show_contest_contest_path(@contest), :class => link_class(:respond) %></li> <li><%= link_to l(:label_contest_notification), contest_contestnotifications_path(@contest), :class => link_class(:contestnotifications) %></li>
<li><%= link_to l(:label_contest_joincontest), show_attendingcontest_contest_path(@contest), :class => link_class(:attendingcontests) %></li> <li><%= link_to l(:label_contest_joincontest), show_attendingcontest_contest_path(@contest), :class => link_class(:attendingcontests) %></li>
<li><%= link_to l(:label_contest_notification), contest_contestnotifications_path(@contest), :class => link_class(:contestnotifications) %></li> <li><%= link_to l(:label_contest_userresponse), show_contest_contest_path(@contest), :class => link_class(:respond) %></li>
</ul> </ul>
</div> </div>
<% end %> <% end %>

@ -11,11 +11,12 @@
<span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;"> <span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;">
<%= label_tips %> <%= label_tips %>
</span> </span>
<% if @project.enabled_modules.where("name = 'news'").count > 0 %>
<%= link_to(btn_tips, <%= link_to(btn_tips,
new_project_news_path(@project), new_project_news_path(@project),
:class => 'icon icon-add', :class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %> :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
<% end %>
<% if @project && User.current.allowed_to?(:manage_news, @project) %> <% if @project && User.current.allowed_to?(:manage_news, @project) %>
<div id="add-news" class="add_frame" style="display:none;"> <div id="add-news" class="add_frame" style="display:none;">
<%= labelled_form_for @news, :url => project_news_index_path(@project), <%= labelled_form_for @news, :url => project_news_index_path(@project),

@ -6,7 +6,9 @@
<ul><h3>项目交流</h3> <ul><h3>项目交流</h3>
<li><%= link_to l(:label_project_tool_response) ,project_feedback_path(@project) %></li> <li><%= link_to l(:label_project_tool_response) ,project_feedback_path(@project) %></li>
<li><%= link_to l(:project_module_files) ,project_files_path(@project) %></li> <li><%= link_to l(:project_module_files) ,project_files_path(@project) %></li>
<li><%= link_to l(:project_module_wiki), project_wiki_path(@project) %></li> <% if @project.enabled_modules.where("name = 'wiki'").count > 0 %>
<li><%= link_to l(:project_module_wiki), project_wiki_path(@project) %></li>
<% end %>
</ul> </ul>
<ul><h3>进度跟踪</h3> <ul><h3>进度跟踪</h3>
<li><%= link_to l(:project_module_calendar),project_calendar_path(@project) %></li> <li><%= link_to l(:project_module_calendar),project_calendar_path(@project) %></li>

@ -97,7 +97,6 @@
<div class="pagination"> <div class="pagination">
<ul> <ul>
<%= pagination_links_full @events_pages %> <%= pagination_links_full @events_pages %>
<% #binding.pry %>
</ul> </ul>
</div> </div>

@ -66,7 +66,7 @@
<%# unless user.memberships.empty? %> <%# unless user.memberships.empty? %>
<%# cond = Project.visible_condition(User.current) + " AND projects.project_type = 1" %> <%# cond = Project.visible_condition(User.current) + " AND projects.project_type = 1" %>
<%# memberships = user.memberships.all(:conditions => cond) %> <%# memberships = user.memberships.all(:conditions => cond) %>
<% user_courses = user.coursememberships.map(&:course) %> <% user_courses = user_courses_list(user) %>
<%= l(:label_x_course_contribute_to, :count => user_courses.count) %> <%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
<% for course in user_courses %> <% for course in user_courses %>
<%# if course.name != nil %> <%# if course.name != nil %>

File diff suppressed because it is too large Load Diff

@ -161,7 +161,7 @@
<div style="float: left; margin-left: 12px; margin-top: 10px; margin-bottom: -4px; width: 380px;"> <div style="float: left; margin-left: 12px; margin-top: 10px; margin-bottom: -4px; width: 380px;">
<!-- <%= link_to(contest.name, contest.event_url, :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %> --> <!-- <%= link_to(contest.name, contest.event_url, :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %> -->
<%= link_to(contest.name, show_contest_contest_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %> <%= link_to(contest.name, contest_contestnotifications_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
<% if contest.id == 2 or contest.id == 3 or contest.id == 6 %> <% if contest.id == 2 or contest.id == 3 or contest.id == 6 %>
<span class="font_lighter">(<span style="font-size: 13px"><%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span> <span class="font_lighter">(<span style="font-size: 13px"><%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
<% else %> <% else %>

@ -1776,7 +1776,7 @@ zh:
label_fork_homework_new: 选为作业 label_fork_homework_new: 选为作业
#wang #wang
label_contest_userresponse: 用户留言 label_contest_userresponse: 用户留言
label_contest_joincontest: 竞赛 label_contest_joincontest: 竞赛
label_contest_notification: 竞赛通知 label_contest_notification: 竞赛通知
#end #end

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

Loading…
Cancel
Save