Conflicts:
	app/views/welcome/index.html.erb
course_group
linhk 11 years ago
commit 3ef05e64b8

File diff suppressed because it is too large Load Diff

@ -468,8 +468,8 @@ class ProjectsController < ApplicationController
def new
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@project = Project.new
@trackers = Tracker.sorted.all
@project = Project.new
@project.safe_attributes = params[:project]
render :layout => 'base'
end

@ -791,7 +791,7 @@ class UsersController < ApplicationController
# 必填自己的工作单位,其实就是学校
def auth_user_extension
if @user == User.current && @user.user_extensions.school.nil?
if @user == User.current && (@user.user_extensions.nil? || @user.user_extensions.school.nil?)
flash[:error] = l(:error_complete_occupation)
redirect_to my_account_path
end

@ -64,7 +64,7 @@ class WelcomeController < ApplicationController
@course_page = FirstPage.where("page_type = 'course'").first
if params[:school_id]
@school_id = params[:school_id]
elsif User.current.logged? && User.current.user_extensions.school
elsif User.current.logged? && User.current.user_extensions.try(:school)
@school_id = User.current.user_extensions.school.try(:id)
end
@logoLink ||= logolink()

@ -1,5 +1,5 @@
require 'zip'
class ZipdownController < ApplicationController
#查找项目(课程)
before_filter :find_project_by_bid_id, :only => [:assort]
#检查权限
@ -44,15 +44,14 @@ class ZipdownController < ApplicationController
zipfile = zip_homework_by_user homework
send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile)
else
render_403 :message => :no_file_dowmload ,:layout => "course_base"
render file: 'public/no_file_found.html' , :layout => 'course_base'
end
else
render_403 :message =>:notice_file_not_found ,:layout => "course_base"
render file: 'public/file_not_found.html' , :layout => 'course_base'
end
else
render_403 :message => :notice_not_authorized ,:layout => "course_base"
end
rescue => e
render file: 'public/file_not_found.html' , :layout => 'course_base'
end
@ -76,13 +75,19 @@ class ZipdownController < ApplicationController
# Todo: User Access Controll
homeattaches = bid.homeworks
#记录所有作业是不是有附件有一个附件就改为true
has_file = false
# 得到每一个人所有文件打包的zip文件
# 并将每一个人的zip打包为一个并返回路径
user_zip_paths = homeattaches.map do |homeattach|
if homeattach.attachments.count > 0
zip_homework_by_user homeattach
has_file = true unless has_file
end
end
unless has_file
render file: 'public/no_file_fond.html' , :layout => 'course_base'
end
zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER
#@paths = homeworks_attach_path
@ -119,9 +124,9 @@ class ZipdownController < ApplicationController
Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name))
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
input_filename.each do |filename|
rename_file = Time.now.to_i.to_s+ ic.iconv( (File.basename(filename)) ).to_s
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
input_filename.each do |filename|
rename_file = Time.now.to_i.to_s+ ic.iconv( (File.basename(filename)) ).to_s
rename_file = ic.iconv( filename_to_real( File.basename(filename))).to_s if is_attachment
zipfile.add(rename_file, filename)

@ -33,8 +33,8 @@ module ApplicationHelper
extend Forwardable
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
#Added by young
#Define the course menu's link class
# Added by young
# Define the course menu's link class
# 不是数组的转化成数组然后判断当前menu_item是否在给定的列表
# REVIEW: 目测menu的机制貌似不是很需要转换再说
def link_class(label)
@ -679,15 +679,15 @@ module ApplicationHelper
def textilizable(*args)
options = args.last.is_a?(Hash) ? args.pop : {}
case args.size
when 1
obj = options[:object]
text = args.shift
when 2
obj = args.shift
attr = args.shift
text = obj.send(attr).to_s
else
raise ArgumentError, 'invalid arguments to textilizable'
when 1
obj = options[:object]
text = args.shift
when 2
obj = args.shift
attr = args.shift
text = obj.send(attr).to_s
else
raise ArgumentError, 'invalid arguments to textilizable'
end
return '' if text.blank?
project = options[:project] || @project || (obj && obj.respond_to?(:project) ? obj.project : nil)

@ -22,6 +22,9 @@ module AttachmentsHelper
# Options:
# :author -- author names are not displayed if set to false
# :thumbails -- display thumbnails if enabled in settings
include Redmine::Pagination
def link_to_attachments(container, options = {})
options.assert_valid_keys(:author, :thumbnails)
@ -171,7 +174,9 @@ module AttachmentsHelper
s.html_safe
end
def private_filter resultSet
# Modified by Longjun
# 有参数的方法要加()
def private_filter(resultSet)
result = resultSet.to_a.dup
# modify by nwb
@ -190,8 +195,12 @@ module AttachmentsHelper
result
end
include Redmine::Pagination
def paginateHelper obj, pre_size=10
# Modified by Longjun
# include 应放在class/model 的开始处
# include Redmine::Pagination
# end
def paginateHelper (obj, pre_size=10)
@obj_count = obj.count
@obj_pages = Paginator.new @obj_count, pre_size, params['page']
if obj.kind_of? ActiveRecord::Base or obj.kind_of? ActiveRecord::Relation

@ -43,16 +43,16 @@ module ContestsHelper
def sort_contest_enterprise(state, project_type)
content = ''.html_safe
case state
when 0
content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:contest_sort_type => '1', :project_type => project_type)))
content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:contest_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected")
when 0
content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:contest_sort_type => '1', :project_type => project_type)))
content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:contest_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected")
when 1
content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:contest_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:contest_sort_type => '0', :project_type => project_type)))
end
content = content_tag('ul', content)
content_tag('div', content, :class => "tabs_enterprise")
when 1
content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:contest_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:contest_sort_type => '0', :project_type => project_type)))
end
content = content_tag('ul', content)
content_tag('div', content, :class => "tabs_enterprise")
end
#end
@ -100,7 +100,10 @@ module ContestsHelper
def count_contest_project
contests = Contest.find(:id)
@projects = []
for contest in contests
# Modified by longjun
# for contest in contests
contests.each do |contest|
# end longjun
@projects += contest.contesting_projects
end
@projects.count
@ -109,7 +112,10 @@ module ContestsHelper
def count_contest_softapplication
contests = Contest.find(:id)
@softapplications = []
for contest in contests
# Modified by alan
# for contest in contests
contests.each do |contest|
# end alan
@softapplications += contest.contesting_softapplications
end
@projects.count
@ -119,19 +125,29 @@ module ContestsHelper
def count_contest_user
contests = Contest.find(:id)
@users = []
for contest in contests
for project in contest.projects
# Modified by alan
# for contest in contests
contests.each do |contest|
contest.projects.each do |project|
@users += project.users
end
end
# end alan
@users.count
end
def count_contest_softapplication_user
contests = Contest.find(:id)
@users = []
for contest in contests
for project in contest.softapplications
# Modified by alan
# for contest in contests
contests.each do |contest|
contest.projects.each do |softapplications|
# for project in contest.softapplications
@users += softapplication.users
end
end

@ -142,7 +142,7 @@ module ProjectsHelper
# end
#Added by young
# Added by young
def course_settings_tabs
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'},
#{:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural, :project_type => 1},
@ -151,7 +151,7 @@ module ProjectsHelper
]
tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
end
#Ended by young
# Ended by young
@ -173,14 +173,42 @@ module ProjectsHelper
# Renders the projects index
def render_project_hierarchy(projects)
render_project_nested_lists(projects) do |project|
if (project.try(:project_type) == Project::ProjectType_course )
s = project.is_public == 1 ? "".html_safe : "<span class='private_project'>#{l(:label_private)}</span>".html_safe
s += link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe
else
s = project.is_public ? "".html_safe : "<span class='private_project'>#{l(:label_private)}</span>".html_safe
s += link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")
end
#Modified by young
if project.try(:project_type) == Project::ProjectType_course
# modified by longjun
# never use unless and else
# unless project.is_public == 1
if project.is_public != 1
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe
else
s = "".html_safe
end
# end longjun
# modified by Longjun
s += link_to_project(project, {},
:class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe
# end longjun
else
# modified by longjun
# unless project.is_public
if !project.is_public
# end longjun
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe
else
s = "".html_safe
end
# modified by longjun
s += link_to_project(project, {},
:class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")
# end longjun
end
#Ended by young
if project.description.present?
#Delete by nie.
# s << content_tag('td', textilizable(project.short_description, :project => project), :class => 'wiki description')
end
s
@ -243,9 +271,14 @@ module ProjectsHelper
def is_manager?(user_id,project_id)
@result = false
@user_id = ProjectInfo.find_by_project_id(project_id)
if @user_id == user.id
@result = true
end
# modified by longjun
# if @user_id == user.id
# @result = true
# end
@result = true if @user_id = user.id
# end longjun
return @result
end
@ -330,9 +363,9 @@ module ProjectsHelper
return true if (project.nil? && project.course_extra.nil?)
courses_year = project.course_extra.time
current_year = Time.now.year
if(courses_year >= current_year)
if courses_year >= current_year
return false
elsif( (courses_year < current_year) && (Time.now.month < 3) )
elsif (courses_year < current_year) && (Time.now.month < 3)
return false
else
return true

@ -72,10 +72,13 @@ class Contest < ActiveRecord::Base
end
end
def self.creat_contests(budget, deadline, name, description=nil)
self.create(:author_id => User.current.id, :budget => budget,
:deadline => deadline, :name => name, :description => description, :commit => 0)
end
# modified by longjun
# 这个函数没有用到
# def self.creat_contests(budget, deadline, name, description=nil)
# self.create(:author_id => User.current.id, :budget => budget,
# :deadline => deadline, :name => name, :description => description, :commit => 0)
# end
# end longjun
def update_contests(budget, deadline, name, description=nil)
if(User.current.id == self.author_id)

@ -14,7 +14,7 @@ class ContestingProject < ActiveRecord::Base
validate :validate_project
validates_uniqueness_of :contest_id, :scope => :project_id
def self.cerate_contesting(contest_id, project_id, description = nil)
def self.create_contesting(contest_id, project_id, description = nil)
self.create(:user_id => User.current.id, :contest_id => contest_id,
:project_id => project_id, :description => description)
end

@ -123,7 +123,8 @@ class Project < ActiveRecord::Base
# reserved words
validates_exclusion_of :identifier, :in => %w( new )
after_save :update_position_under_parent, :if => Proc.new {|project| project.name_changed?}
#此代码功能为原redmine中项目的树形结构按名称首字母排序本系统项目非树形结构且项目排序方式无按首字母排序另该代码执行会使空数据库时创建项目时出异常故注释掉
#after_save :update_position_under_parent, :if => Proc.new {|project| project.name_changed?}
after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?}
# 创建project之后默认创建一个board之后的board去掉了board的概念
after_create :create_board_sync

@ -12,9 +12,9 @@
</p>
<p>
<label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label>
<%= password_field_tag 'new_password_confirmation', nil, :size => 25 %>
</p>
<label for="new_password_confirmation"><%= l(:field_password_confirmation)%> <span class="required">*</span></label>
<%= password_field_tag 'new_password_confirmation', nil, :size => 25 %>
</p>
</div>
<p><%= submit_tag l(:button_save) %></p>
<% end %>

@ -67,12 +67,15 @@
<% @topics.each do |topic| %>
<table class="content-text-list">
<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>
<table width="640px" border="0">
<tr>
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %>
<%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title:topic.subject.to_s %>
<%= topic.locked? ? 'locked' : '' %>">
<%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title:topic.subject.to_s %>
</td>
<td align="right" rowspan="3">
<table class="borad-count">

@ -9,8 +9,12 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px"><a href="http://contest.trustie.net/">contest.trustie.net</td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'welcome', :action => 'contest' %> > 详情</td>
<td style="padding-left: 8px">
<a href="http://contest.trustie.net/">contest.trustie.net</a>
</td>
<td >
<%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:label_contest_innovate), welcome_contest_path %> > 详情</td>
</tr>
</table>
</div>

@ -3,8 +3,23 @@
<%= l(:bale_news_notice) %>
</div>
<div class="box tabular">
<p><%= f.text_field :title, :required => true, :size => 60,:maxlength => 60, :style => "width:488px;" %></p>
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;" %></p>
<p>
<%= f.text_field :title,
:required => true,
:size => 60,
:maxlength => 60,
:style => "width:488px;"
%>
</p>
<p>
<%= f.text_area :description,
:required => true,
:cols => 60,
:rows => 11,
:class => 'wiki-edit',
:style => "width:490px;"
%>
</p>
</div>

@ -2,24 +2,47 @@
<table><tr><td><img src="/images/new/news.png" width="40" height="40"/></td><td><%#= link_to h(news.title), news_path(news) %>
<%#= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %>
<%# unless news.summary.blank? %></td><td><span class="fontligher"><%#=h news.summary %></span><% end %></td>
<%# unless news.summary.blank? %></td><td><span class="fontligher"><%#=h news.summary %></span></td>
<td><span class="author"><%#= authoring news.created_on, news.author %></span></td></tr></table></p>-->
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><img src="/images/new/news.png" width="40" height="40"/></td>
<td colspan="2" valign="top" width="50" >
<img src="/images/new/news.png" width="40" height="40"/>
</td>
<td><table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%=link_to contestnotifications.author,contest_contestnotification_path(contestnotifications)%></strong>
<a class="font_lighter"><%= l(:label_project_newshare) %></a> <%= link_to h(contestnotifications.title), contest_contestnotification_path(contestnotifications) %>
<td colspan="2" valign="top">
<strong>
<%=link_to contestnotifications.author,
contest_contestnotification_path(contestnotifications)
%>
</strong>
<a class="font_lighter">
<%= l(:label_project_newshare) %>
</a>
<%= link_to h(contestnotifications.title),
contest_contestnotification_path(contestnotifications)
%>
</td>
</tr>
<tr>
<td colspan="2" width="580px" ><p class="font_description"><%=h contestnotifications.description%></p></td>
<td colspan="2" width="580px" >
<p class="font_description">
<%=h contestnotifications.description%>
</p>
</td>
</tr>
<tr>
<td align="left"><a class="font_lighter"> <%= contestnotifications.created_at %></a></td>
<td width="200" align="right" class="a"><%= link_to l(:label_project_newother),contest_contestnotification_path(contestnotifications)%>
<td align="left">
<a class="font_lighter">
<%= contestnotifications.created_at %>
</a>
</td>
<td width="200" align="right" class="a">
<%= link_to l(:label_project_newother),
contest_contestnotification_path(contestnotifications)
%>
<%= "(#{l(:label_x_comments, :count => contestnotifications.notificationcomments_count)})" if contestnotifications.notificationcomments_count > 0 %>
</td>
</tr>

@ -1,9 +1,15 @@
<h3><%=l(:label_news)%></h3>
<%= labelled_form_for @contestnotification, url: contest_contestnotification_path, :html => { :id => 'contestnotifications-form', :multipart => true, :method => :put } do |f| %>
<%= labelled_form_for @contestnotification,
:url => contest_contestnotification_path,
:html => { :id => 'contestnotifications-form',
:multipart => true,
:method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<%= preview_link preview_contestnotifications_path(id: @contestnotification), 'contestnotifications-form' %>
<%= preview_link preview_contestnotifications_path(id: @contestnotification),
'contestnotifications-form'
%>
<% end %>
<div id="preview" class="wiki"></div>

@ -1,5 +1,7 @@
<%= labelled_form_for @contestnotification, :url => contest_contestnotifications_path(@contest), :html => { :id => 'contestnotifications-form', :multipart => true } do |f| %>
<%= labelled_form_for @contestnotification,
:url => contest_contestnotifications_path(@contest),
:html => { :id => 'contestnotifications-form', :multipart => true } do |f| %>
<%= render :partial => 'contestnotifications/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
<%= submit_tag l(:button_cancel), :class => "whiteButton m3p10 h30",:onclick => "cancel();" %>

@ -1,21 +1,26 @@
<div class="contextual">
<%= link_to(l(:button_edit),
edit_contest_contestnotification_path(@contest, @contestnotification),
:class => 'icon icon-edit',
:accesskey => accesskey(:edit),
:onclick => '$("#edit-contestnotifications").show(); return true;') if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?)%>
edit_contest_contestnotification_path(@contest, @contestnotification),
:class => 'icon icon-edit',
:accesskey => accesskey(:edit),
:onclick => '$("#edit-contestnotifications").show(); return true;') if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?)%>
<%= delete_link contest_contestnotification_path(@contest, @contestnotification) if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?) %>
</div>
<h3><strong><%=h @contestnotification.title %></strong></h3>
<div id="edit-contestnotifications" style="display:none;">
<%= labelled_form_for @contestnotification, :url => contest_contestnotification_path(@contest),
:html => { :id => 'contestnotifications-form', :multipart => true, :method => :put } do |f| %>
<%= labelled_form_for @contestnotification,
:url => contest_contestnotification_path(@contest),
:html => { :id => 'contestnotifications-form',
:multipart => true,
:method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-contestnotifications").hide(); return false;' %>
<%= link_to l(:button_cancel),
"#",
:onclick => '$("#edit-contestnotifications").hide(); return false;' %>
<% end %>
<div id="preview" class="wiki"></div>
</div>
@ -23,7 +28,9 @@
<div id="notificationcomments" style="margin-bottom:16px;">
<div style="margin:15px">
<span class="font_description"> <%= textilizable(@contestnotification, :description) %> </span>
<span class="font_description">
<%= textilizable(@contestnotification, :description) %>
</span>
<br/>
<%#= link_to_attachments @contestnotification %>
<br/>
@ -31,16 +38,26 @@
<% if User.current.logged? %>
<p>
<%= toggle_link l(:label_comment_add), "add_notificationcomment_form", :focus => "notificationcomment_notificationcomments" %>
<%= toggle_link l(:label_comment_add),
"add_notificationcomment_form",
:focus => "notificationcomment_notificationcomments"
%>
</p>
<% else %>
<%= l(:label_user_login_notificationcomment) %>
<%= link_to l(:label_user_login_new), signin_path %>
<% end %>
<%= form_tag( contest_contestnotification_notificationcomments_path(@contest, @contestnotification) , :id => "add_notificationcomment_form", :style => "display:none;") do %>
<%= form_tag( contest_contestnotification_notificationcomments_path(@contest, @contestnotification) ,
:id => "add_notificationcomment_form",
:style => "display:none;") do %>
<div class="box">
<%= text_area 'notificationcomment', 'notificationcomments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
<%= text_area 'notificationcomment',
'notificationcomments',
:cols => 80,
:rows => 15,
:class => 'wiki-edit'
%>
<%= wikitoolbar_for 'notificationcomment_notificationcomments' %>
</div>
<p>
@ -65,7 +82,9 @@
<% next if notificationcomment.new_record? %>
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(notificationcomment.author), :class => "avatar")%></td>
<td colspan="2" valign="top" width="50" >
<%= image_tag(url_to_avatar(notificationcomment.author), :class => "avatar")%>
</td>
<td>
<table width="580px" border="0">
<tr>
@ -80,8 +99,9 @@
</td>
<td>
<% if notificationcomment.author==User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete), contest_contestnotification_notificationcomment_path(@contest, @contestnotification,notificationcomment),
:method => :delete,:confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
<%= link_to(l(:label_bid_respond_delete),
contest_contestnotification_notificationcomment_path(@contest, @contestnotification,notificationcomment),
:method => :delete,:confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
<% end %>
</td>
</tr>
@ -92,7 +112,11 @@
</p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= format_time(notificationcomment.created_at) %></span></td>
<td align="left">
<span class="font_lighter">
<%= format_time(notificationcomment.created_at) %>
</span>
</td>
<td width="200" align="right" class="a"><%#= link_to_if_authorized_contest image_tag('delete.png'), {:controller => 'notificationcomments', :action => 'destroy', :id => @contestnotifications, :notificationcomment_id => notificationcomment},
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %></td>
</tr>

@ -4,7 +4,10 @@
<tr>
<td colspan="2" valign="top" width="50" >
<% unless contest.author.nil? %>
<%= link_to(image_tag(url_to_avatar(contest.author), :class => 'avatar'), user_path(contest.author), :class => "avatar") %>
<%= link_to(image_tag(url_to_avatar(contest.author), :class => 'avatar'),
user_path(contest.author),
:class => "avatar")
%>
<% end %>
</td>
<td>
@ -12,33 +15,85 @@
<tr>
<td colspan="2" valign="top"><strong>
<% 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 %>
&nbsp;<%= link_to(contest.name, contest_contestnotifications_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>
<td width="500">
<table border="0">
<tr>
<td>
<strong><%= l(:label_contests_reward_method) %>:&nbsp;&nbsp;<span style="word-break: break-all; color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= contest.budget%></span></strong>
<strong><%= l(:label_contests_reward_method) %>:&nbsp;&nbsp;
<span style="word-break: break-all; color: #15bccf; font-family: 14px; font-family: '微软雅黑'">
<%= contest.budget%>
</span>
</strong>
</td>
</tr>
<tr>
<td class="font_lighter">
<!-- <span class="font_lighter"><%= l(:label_contest_project, :count => contest.contesting_projects.count) %>(<strong><span style="font-size: 17px"><%= link_to(contest.contesting_projects.count, show_project_contest_path(contest), :target => "_blank") %></span></strong>)</span>
<span class="font_lighter"><%= l(:label_contest_softapplication, :count => contest.contesting_softapplications.count) %>(<strong><span style="font-size: 17px"><%= link_to(contest.contesting_softapplications.count, show_softapplication_contest_path(contest), :target => "_blank") %></span></strong>)</span> -->
<% if contest.id == 2 or contest.id == 3 or contest.id == 6 %>
<%= l(:label_contest_work, :count => contest.contesting_projects.count) %>(<strong><span style="font-size: 17px"><%= link_to(contest.projects.where('is_public=1').count, show_attendingcontest_contest_path(contest), :target => "_blank") %></span></strong>)
<!-- <span class="font_lighter">
<%= l(:label_contest_project,
:count => contest.contesting_projects.count)
%>
(<strong><span style="font-size: 17px">
<%= link_to(contest.contesting_projects.count,
show_project_contest_path(contest),
:target => "_blank")
%></span></strong>)</span>
<span class="font_lighter">
<%= l(:label_contest_softapplication,
:count => contest.contesting_softapplications.count)
%>
(<strong><span style="font-size: 17px">
<%= link_to(contest.contesting_softapplications.count,
show_softapplication_contest_path(contest),
:target => "_blank")
%>
</span></strong>)</span> -->
<!-- modified by longjun
将 or 改成 || -->
<% if contest.id == 2 || contest.id == 3 || contest.id == 6 %>
<%= l(:label_contest_work,
:count => contest.contesting_projects.count)
%>
(<strong>
<span style="font-size: 17px">
<%= link_to(contest.projects.where('is_public=1').count,
show_attendingcontest_contest_path(contest),
:target => "_blank")
%>
</span>
</strong>)
<% else %>
<%= l(:label_contest_work, :count => contest.contesting_softapplications.count) %>(<strong><span style="font-size: 17px"><%= link_to(contest.contesting_softapplications.count, show_attendingcontest_contest_path(contest), :target => "_blank") %></span></strong>)
<%= l(:label_contest_work,
:count => contest.contesting_softapplications.count)
%>
(<strong>
<span style="font-size: 17px">
<%= link_to(contest.contesting_softapplications.count,
show_attendingcontest_contest_path(contest),
:target => "_blank") %>
</span>
</strong>)
<% end %>
</td>
</tr>
</table></td>
<td width="200" align="right" class="a"><span class="font_lighter"> <%= l :label_create_time %>: <%= format_time contest.created_on %></span></td>
<td width="200" align="right" class="a">
<span class="font_lighter">
<%= l :label_create_time %>: <%= format_time contest.created_on %>
</span>
</td>
</tr>
<tr>
<td>
@ -58,6 +113,6 @@
<div class="pagination">
<ul>
<ul>
</ul>
</div>

@ -20,17 +20,55 @@
</script>
<%= error_messages_for 'contest' %>
<!--[form:project]-->
<p style="width:500px;"><%= l(:label_bids_form_contest_new_description) %></p>
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Contest::NAME_LENGTH_LIMIT, :placeholder => "#{l(:label_contest_name)}" %></p>
<p style="width:500px;">
<%= l(:label_bids_form_contest_new_description) %>
</p>
<p>
<%= f.text_field :name,
:required => true,
:size => 60,
:style => "width:490px;",
:maxlength => Contest::NAME_LENGTH_LIMIT,
:placeholder => "#{l(:label_contest_name)}"
%>
</p>
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 5, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Contest::DESCRIPTION_LENGTH_LIMIT, :placeholder => "#{l(:label_contest_description)}" %></p>
<p style="margin-left:-10px;padding-right: 20px;">
<%= f.text_area :description,
:rows => 5,
:class => 'wiki-edit',
:style => "font-size:small;width:490px;margin-left:10px;",
:maxlength => Contest::DESCRIPTION_LENGTH_LIMIT,
:placeholder => "#{l(:label_contest_description)}"
%>
</p>
<p style="margin-left:-10px;"><%= f.text_field :password, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<p style="margin-left:-10px;">
<%= f.text_field :password,
:size => 60,
:style => "width:488px;margin-left: 10px;"
%>
</p>
<p>
<%= f.text_area :budget, :required => true, :size => 60,:rows => 4,:maxlength => Contest::DESCRIPTION_LENGTH_LIMIT, :style => "width:490px;", :placeholder => l(:label_bids_reward_what) %>
<%= f.text_area :budget,
:required => true,
:size => 60,
:rows => 4,
:maxlength => Contest::DESCRIPTION_LENGTH_LIMIT,
:style => "width:490px;",
:placeholder => l(:label_bids_reward_what)
%>
<!-- 设置奖项设置的打开 关闭开关-->
</p>
<!-- <em class="info" style="margin-left:95px;"><%= l(:text_contest_reward) %></em> -->
<p><%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;", :placeholder => "#{l(:label_deadline)}" %><%= calendar_for('contest_deadline')%></p>
<p>
<%= f.text_field :deadline,
:required => true,
:size => 60,
:style => "width:150px;",
:placeholder => "#{l(:label_deadline)}"
%>
<%= calendar_for('contest_deadline')%>
</p>

@ -11,36 +11,66 @@
<ul class="message-for-user">
<% for journal in journals%>
<li id='word_li_<%= journal.id.to_s %>' class="outer-message-for-user">
<span class="portrait"><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></span>
<span class="body">
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span>
<span class="font_lighter"><% label = l(:label_contest_requirement) %></span>
<div> <%= textilizable journal.notes%> </div>
<span class="font_lighter"><%= l(:label_bids_published) %>&nbsp;<%= time_tag(journal.created_on).html_safe %>&nbsp;<%= l(:label_bids_published_ago) %></span>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span>
<% if reply_allow %>
<%#= link_to(l(:button_quote), {:controller => 'contests', :action => 'new', :id => contest, :journal_id => journal}, :remote => true, :method => 'post', :title => l(:button_quote))%>
<%= link_to(l(:button_quote), contests_path(:id => contest, :journal_id => journal), :remote => true, :method => 'post', :title => l(:button_quote))%>
<%= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"}%>
<% end %>
<% if @user==User.current|| User.current.admin? %>
<%#= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),
:remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
<%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
<% end %>
</span>
</span>
<span class="portrait">
<%= image_tag(url_to_avatar(journal.user), :class => "avatar") %>
</span>
<span class="body">
<span class="user">
<%= link_to journal.user, user_path(journal.user)%>
</span>
<span class="font_lighter">
<% label = l(:label_contest_requirement) %>
</span>
<div> <%= textilizable journal.notes%> </div>
<span class="font_lighter">
<%= l(:label_bids_published) %>&nbsp;
<%= time_tag(journal.created_on).html_safe %>&nbsp;
<%= l(:label_bids_published_ago) %>
</span>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span>
<% if reply_allow %>
<%#= link_to(l(:button_quote), {:controller => 'contests', :action => 'new', :id => contest, :journal_id => journal}, :remote => true, :method => 'post', :title => l(:button_quote))%>
<%= link_to(l(:button_quote),
contests_path(:id => contest,
:journal_id => journal),
:remote => true,
:method => 'post',
:title => l(:button_quote))
%>
<%= link_to l(:label_bid_respond_quote),
'',
{:focus => 'project_respond',
:onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"
}
%>
<% end %>
<% if @user==User.current|| User.current.admin? %>
<%#= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),
:remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
<!-- modified by longjun -->
<%= link_to(l(:label_bid_respond_delete),
words_destroy_path(:user_id => @user, :object_id => journal),
:remote => true,
:confirm => l(:text_are_you_sure),
:method => 'delete',
:class => "delete",
:title => l(:button_delete)) %>
<% end %>
</span>
</span>
<div style="clear: both;"></div>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<% if reply_allow %>
<div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
<%= render :partial => 'words/new_respond',
:locals => {:journal => journal, :m_reply_id => journal}
%>
</div>
<% end %>
<div style="clear: both;"></div>

@ -26,8 +26,9 @@
<td style="color: #ec6300;" align="right" valign="0.1em" width="16%">
<strong>
<span id="reward_result_<%=c_project.id%>"> <!-- 调用js进行刷新 -->
<%= l(:label_system_grade) %>:<%= (c_project.project.project_status.nil? ? 0.0 : c_project.project.project_status.grade) unless (c_project.project.project_status.nil? && c_project.project.nil?) %>
<% if get_prize(c_project).nil? or get_prize(c_project) == "" %>
<%= l(:label_system_grade) %>:
<%= (c_project.project.project_status.nil? ? 0.0 : c_project.project.project_status.grade) unless (c_project.project.project_status.nil? && c_project.project.nil?) %>
<% if get_prize(c_project).nil? || get_prize(c_project) == "" %>
<% if @contest.deadline < Date.today %>
<%= l(:label_noawards)%>
<% end %>

@ -6,7 +6,10 @@
<tr>
<td><strong><%=l(:label_softapplication)%>:</strong></td>
<td>
<%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication), :target => '_blank') %>
<%= link_to(c_softapplication.softapplication.name,
softapplication_path(c_softapplication.softapplication),
:target => '_blank')
%>
</td>
</tr></br>
</div>
@ -31,5 +34,7 @@
<% end %>
<div class="underline-contests_three"></div>
<% end %>
<div class="pagination"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %></div>
<div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
</div>

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

Loading…
Cancel
Save