Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
wanglinchun 2013-12-20 22:04:49 +08:00
commit 775f07a89d
45 changed files with 346 additions and 285 deletions

View File

@ -622,16 +622,12 @@ class ApplicationController < ActionController::Base
## Please added code in html.
# <div class="pagination"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %></div>
def paginateHelper obj, pre_size=20
# current_count = pre_size * (params['page'].to_i - 1) if params['page'].to_i > 0
offset, limit = api_offset_and_limit({:limit => pre_size})
objs_all = obj
@obj_count = objs_all.count
@obj_pages = Paginator.new @obj_count, limit, params['page']
offset ||= @obj_pages.offset
@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
obj.offset(offset).limit(limit).all
obj.limit(@obj_pages.per_page).offset(@obj_pages.offset).all
elsif obj.kind_of? Array
obj[offset..(offset+limit-1)]
obj[@obj_pages.offset, @obj_pages.per_page]
else
logger.error "[ApplicationController] Error : application_controller#paginateHelper ===> unknow category: #{obj.class}"
nil

View File

@ -3,7 +3,7 @@ class BidsController < ApplicationController
#Added by young
menu_item l(:label_homework), :only => [:edit, :udpate]
menu_item :respond
menu_item :project, :only => [:show_project,:show_results]
menu_item :project, :only => [:show_project,:show_results, :new_submit_homework]
menu_item :homework_respond, :only => :homework_respond
menu_item :homework_statistics, :only => :homework_statistics
#Ended by young
@ -454,7 +454,7 @@ class BidsController < ApplicationController
###添加应标项目
def add
project = Project.where('name = ?', params[:bid]).first
project = Project.find(params[:bid])
bid_message = params[:bid_for_save][:bid_message]
if BidingProject.where("project_id = ? and bid_id = ?", project.id, @bid.id).size == 0
if BidingProject.cerate_bidding(@bid.id, project.id, bid_message)
@ -714,23 +714,41 @@ class BidsController < ApplicationController
end
end
def new_submit_homework
#render html to prepare create submit homework
find_bid
render :layout => 'base_homework'
end
def add_homework
if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)
# homework = HomeworkAttach.create(:bid_id => @bid.id, :user_id => User.current.id)
# homework.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads]))
@homework = HomeworkAttach.new
@homework.safe_attributes = params[:homeworkattach]
@homework.bid_id = @bid.id
@homework.user_id = User.current.id
@homework.save_attachments(params[:attachments])
@homework.save
render_attachment_warning_if_needed(@homework)
if @homework.save
@homework_flag = l(:label_bidding_homework_succeed)
else
@homework_flag = l(:label_bidding_homework_failed)
end
if @homework.attachments.empty?
@homework.delete
flash[:error] = l(:no_attachmens_allowed)
@homework_flag = l(:no_attachmens_allowed)
# else
end
end
@homework_list = @bid.homeworks
@homework = HomeworkAttach.new
respond_to do |format|
format.html{
redirect_to project_for_bid_path, notice: @homework_flag.to_s
}
format.js
end
end

View File

@ -410,8 +410,8 @@ class UsersController < ApplicationController
@message = messages[@info_pages.offset, @info_pages.per_page]
@state = 2
else
where_condition = nil;#"act_type <> 'JournalsForMessage'"
where_condition = "act_type <> 'JournalsForMessage'"
where_condition = nil;
# where_condition = "act_type <> 'JournalsForMessage'"
if @user == User.current
watcher = User.watched_by(@user)
watcher.push(User.current)

View File

@ -1378,6 +1378,39 @@ module ApplicationHelper
html.html_safe
end
#display bid project
def show_more_bid_project?(bid)
if bid.projects.where('is_public = 1').count > 12
return true
else
return false
end
end
def show_bid_project(bid)
html = ''
if bid.projects.where('is_public = 1').count == 0
html << (content_tag "p", l(:label_no_bid_project), :class => "font_lighter")
else
bid.projects.where('is_public = 1').take(12).each do |project|
html << (link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar")
end
end
html.html_safe
end
def show_bid_fans_picture(obj)
html = ''
if obj.watcher_users.count == 0
html << (content_tag "span", l(:label_project_no_follow))
else
obj.watcher_users.take(12).each do |user|
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => user.name)
end
end
html.html_safe
end
#display fans picture
def show_more_fans?(obj)
if obj.watcher_users.count > 12
@ -1389,15 +1422,11 @@ module ApplicationHelper
def show_fans_picture(obj)
html = ''
count = 0
if obj.watcher_users.count == 0
html << (content_tag "span", l(:label_no_current_fans))
end
for user in obj.watcher_users
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.show_name}")
count = count + 1
if count >= 12
break
else
obj.watcher_users.take(12).each do |user|
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => user.name)
end
end
html.html_safe
@ -1405,7 +1434,7 @@ module ApplicationHelper
# added by bai
def show_more_participate?(obj)
if obj.join_in_contests.count > 0
if obj.join_in_contests.count > 12
return true
else
return false
@ -1427,6 +1456,7 @@ module ApplicationHelper
end
html.html_safe
end
#end
# add by huang

View File

@ -135,4 +135,12 @@ module BidsHelper
people.include?(User.current)
end
def select_option_helper option
tmp = Hash.new
option.each do |project|
tmp[project.name] = project.identifier
end
tmp
end
end

View File

@ -243,6 +243,21 @@ module ProjectsHelper
end
end
def eventToLanguageCourse event_type, project
case event_type
when "issue-note"
l :label_issue
when "issue"
l :label_issue
when "attachment"
l :label_attachment
when "news"
project.project_type == 1 ? (l :label_notification) : (l :label_news)
else
""
end
end
def sort_project_by_hot
return sort_project_by_hot_rails
@projects_status = ProjectStatus.visible.where("project_statuses.project_type <> ? or project_statuses.project_type is null", 1)

View File

@ -1,9 +1,10 @@
class HomeworkAttach < ActiveRecord::Base
attr_accessible :bid_id, :user_id
include Redmine::SafeAttributes
belongs_to :user
belongs_to :bid
safe_attributes "bid_id",
"user_id"
acts_as_attachable
end

View File

@ -245,6 +245,8 @@ class User < Principal
self.read_attribute(:identity_url)
end
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i
# VALID_EMAIL_REGEX = /^[0-9a-zA-Z_-]+@[0-9a-zA-Z_-]+(\.[0-9a-zA-Z_-]+)+$/
# Returns the user that matches provided login and password, or nil
#登录,返回用户名与密码匹配的用户
def self.try_to_login(login, password)
@ -253,7 +255,11 @@ class User < Principal
# Make sure no one can sign in with an empty login or password
return nil if login.empty? || password.empty?
if (login =~ VALID_EMAIL_REGEX)
user = find_by_mail(login)
else
user = find_by_login(login)
end
if user
# user is already in local database
#return nil unless user.active?

View File

@ -1,4 +1,8 @@
var fileSpan = $('#attachments_<%= j params[:attachment_id] %>');
<% if(!@attachment.nil? && @attachment.new_record?) %>
fileSpan.hide();
alert("<%= escape_javascript @attachment.errors.full_messages.join(', ') %>");
<% else %>
$('<input>', { type: 'hidden', name: 'attachments[<%= j params[:attachment_id] %>][token]' } ).val('<%= j @attachment.token %>').appendTo(fileSpan);
fileSpan.find('a.remove-upload')
.attr({
@ -7,3 +11,4 @@ fileSpan.find('a.remove-upload')
href: '<%= j attachment_path(@attachment, :attachment_id => params[:attachment_id], :format => 'js') %>'
})
.off('click');
<% end %>

View File

@ -56,7 +56,7 @@
<td colspan="2" width="580px" ><span class="font_description"><%= bid.description %></span></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"><span> <%= l(:label_create_time) %> : <%=format_time bid.created_on %></span><span style="float: right"> <%= l(:field_deadline) %> : <%=bid.deadline %></span></td>
<td align="left"><span class="font_lighter"><span> <%= l(:label_create_time) %> :&nbsp; <%=format_time bid.created_on %></span><span style="float: right"> <%= l(:field_deadline) %> :&nbsp; <%=bid.deadline %></span></td>
<td></td>
</tr>
</table></td>

View File

@ -1,21 +1,33 @@
<%= render_flash_messages %>
<div id="put-bid-form" style="display: none">
<%= form_for "bid_for_save", :remote=>true, :url => {:controller => 'bids', :action => 'add_homework'},
:update => "bidding_project_list",
:complete => '$("#put-bid-form").hide();' do |f| %>
<%= form_for HomeworkAttach.new, :url => {:controller => 'bids', :action => 'add_homework'}, :update => "bidding_project_list", :complete => '$("#put-bid-form").hide();', :html => {:multipart => true, :id => 'add_homework_form'} do |f| %>
<fieldset>
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form', :locals => {:container => @homework} %>
<%= render :partial => 'attachments/form' %>
</p>
</fieldset>
<%= submit_tag l(:button_create) %>
<%= submit_tag l(:button_create),
:onclick => "return true;"
%>
<% end %>
<script type="text/javascript">
function j_submit () {
alert('start')
var submit_homework = function(){
$('#add_homework_form').clone().attr('action', '<%= url_for({:controller => "bids", :action => "add_homework"})+".js" %>').ajaxSubmit()
};
alert('stop')
$.globalEval(submit_homework());
return false;
}
</script>
</div>
<% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) %>
<div class='icon icon-add'>
<%= toggle_link l(:label_commit_homework), 'put-bid-form' %>
<%= link_to l(:label_commit_homework), new_submit_homework_path, :onclick => "$('#put-bid-form').slideToggle(); this.blur(); return false;" %>
</div>
<% end %>

View File

@ -1,10 +1,9 @@
<!-- fq -->
<%= render_flash_messages %>
<%= form_tag(:controller => 'bids', :action => "show_project", :method => :get) do %>
<div class="project-search-block">
<table width="100%" valign="center">
<tr>
<td ><span style="margin-left:0px"><%= l(:label_task_plural)%></span></td>
<td ><span style="margin-left:0px"><%= l(:label_task_plural)%>(<%= @homework_list.count%>)</span></td>
<td align="right">
<div class="project-search">
<%= text_field_tag 'student_id', params[:student_id], :size => 30 %>
@ -18,7 +17,6 @@
<% if homework.attachments.any?%>
<table width="660px" border="0" align="center">
<tr>
<!-- <td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar"), user_path(homework.user), :class => "avatar" %></td> -->
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(homework.user), :class => "avatar")%></td>
<td>
<table width="580px" border="0">
@ -28,7 +26,6 @@
<tr>
<td colspan="2" valign="top"><strong><%= l(:label_bidding_user_studentcode) %> <%= homework.user.user_extensions.student_id%></td>
</tr>
<tr>
<td colspan="2" width="580px" >
<% if (User.current == homework.user) || (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',3,7, 9)).size >0) %>

View File

@ -4,9 +4,6 @@
<table width="100%" valign="center">
<tr>
<td width="16%"><span style="margin-left:0px"><%= l(:label_task_plural)%></span></td>
<td align="right">
<div class="project-search">
<%= text_field_tag 'student_id', params[:student_id], :size => 30 %>
@ -19,9 +16,6 @@
<% end %>
<% bidding_project.each do |b_project|%>
<% if b_project.project %>
<table width="90%" border="0" align='center'>
<tr>
<td>
@ -38,7 +32,15 @@
<td colspan="2" valign="top" width="50%"><strong>
<%= link_to(b_project.project.name, project_path(b_project.project)) %>
</strong><a class="font_lighter"><%= l(:label_join_bidding)%></a>
</strong><span class="font_lighter">
<% if @bid.reward_type == 2 %>
<%= l(:label_joined_contest)%>
<% end %>
<% if @bid.reward_type == 1 %>
<%= l(:label_join_bidding)%>
<% end %>
</span>
</td>
<!-- 如果需求到期 并且是该需求的管理员 -->
@ -142,7 +144,7 @@
<tr>
<td valign="top"><span class="font_lighter">
<%= b_project.created_at%>
<%= format_time b_project.created_at%>
</span></td>
</tr>
</table>
@ -170,7 +172,13 @@
</tr>
<% else %>
<tr>
<td><strong><%= l(:label_bidding_user) %>
<td><strong>
<% if @bid.reward_type == 2%>
<%= l(:label_contest_user) %>
<% end %>
<% if @bid.reward_type == 1 %>
<%= l(:label_bidding_user) %>
<% end %>
<% unless b_project.user.nil? %>
<%= b_project.user.lastname %><%= b_project.user.firstname %>
<% end %></strong>
@ -185,7 +193,15 @@
</tr>
<tr>
<td style=" word-wrap: break-word; word-break: break-all"><%= l(:label_bidding_reason) %><%= b_project.description %></td>
<td style=" word-wrap: break-word; word-break: break-all">
<% if @bid.reward_type == 2%>
<%= l(:label_contest_reason) %>
<% end %>
<% if @bid.reward_type == 1 %>
<%= l(:label_bidding_reason) %>
<% end %>
<%= b_project.description %></td>
</tr>
<% end %>
</table>

View File

@ -1,5 +1,7 @@
$('#bidding_project_list').html('<%= escape_javascript(render(:partial => 'homework_list', :locals => {:homework => @homework_list})) %>');
$('#put-bid-form-partial').html(' <%= escape_javascript( render( :partial => 'attachments/form', :locals => {:container => @homework}) )%>')
$('#put-bid-form-partial').html(' <%= escape_javascript( render( :partial => 'attachments/form') )%>')
$('#flash_notice').remove()
$("#project_id").val("请选择项目");
$("#bid_message").val( "<%= l(:label_bid_reason) %>" );
$("#put-bid-form").hide();
alert('<%= @homework_flag %>');

View File

@ -30,7 +30,7 @@
</div>
<!-- end -->
<%= sort_contest(@s_state)%>
<!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 15px" >
<ul style="margin-right:0px">
@ -45,9 +45,13 @@
</li> -->
<!-- </ul>
</div> -->
<% if @bids.size > 0%>
<%= sort_contest(@s_state)%>
<div id="bid-show">
<%= render :partial => 'contest_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>
</div>
<% else %>
<%= render :partial => "layouts/no_content"%>
<% end %>

View File

@ -27,27 +27,12 @@
</table>
<% end %>
</div>
<!-- end -->
<%= sort_bid(@s_state, @project_type)%>
<!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 15px" >
<ul style="margin-right:0px">
<li>
<%= link_to l(:label_sort_by_time), calls_path(:bid_sort_type => '0') %></li>
<li>
<%= link_to l(:label_sort_by_active), calls_path(:bid_sort_type => '1') %>
</li>
<!-- <li>
<%= link_to l(:label_sort_by_influence), calls_path(:bid_sort_type => '2') %>
</li> -->
<!-- </ul>
</div> -->
<% if @bids.size > 0 %>
<div id="bid-show">
<%= sort_bid(@s_state, @project_type)%>
<%= render :partial => 'bid_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>
</div>
<% else %>
<%= render :partial => "layouts/no_content"%>
<% end %>

View File

@ -0,0 +1,15 @@
<h3><%= l :label_bidding_homework %></h3>
<div id="put-bid-form">
<%= form_for HomeworkAttach.new, :method => :post, :url => {:controller => 'bids', :action => 'add_homework'}, :update => "bidding_project_list", :complete => '$("#put-bid-form").hide();', :html => {:multipart => true} do |f| %>
<fieldset>
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %>
</p>
</fieldset>
<%= submit_tag l(:button_create) %>
<%= link_to (t :button_back), project_for_bid_homework_path %>
<% end %>
</div>

View File

@ -1,5 +1,5 @@
<div class="inf_user_image">
<% for user in @users %>
<% for user in @bid.watcher_users %>
<ul class="list_watch"><li>
<table width="660px" border="0" align="center">
<tr>

View File

@ -70,7 +70,7 @@
:complete => '$("#put-bid-form").hide();' do |f| %>
<table id="bidding_table" border="0" width="100%" style="margin-left: 40px;">
<tr>
<td><%= select_tag 'bid', options_for_select(@option), :name => 'bid', :class => 'grayline' %></td>
<td><%= select_tag 'bid', options_for_select(select_option_helper(@option)), :name => 'bid', :class => 'grayline' %></td>
<div id="prompt_create_pro"><!-- nyan -->
<td>
<p>

View File

@ -25,7 +25,7 @@
</p>
</div>
<div class="reviews">
<%= content_tag('a', tag('img', {:src => '../images/pai.png', :class => 'img-ta'}, false, false), :class => 'img-tag3') %>
<%= content_tag('a', tag('img', {:class => 'img-ta'}, false, false), :class => 'img-tag3') %>
<%= content_tag('div', "Vert High Activity", :class => 'img-tag4') %>
<%= content_tag('div', tag('img', {:src => '../images/stars_ro.png', :class => 'img-ta'}, false, false), :class => 'img-tag2') %>
<%= content_tag('div', "#{WatchersOfProjects.watcher_count(project)}Reviews", :class => 'img-tag1') %>

View File

@ -24,5 +24,8 @@
</tr>
</table>
</div>
<% if @forums.size > 0 %>
<%= render :partial => 'forums/forum_list', :locals => {:forums => @forums} %>
<% else %>
<%= render :partial => "layouts/no_content" %>
<% end %>

View File

@ -38,12 +38,12 @@
<% end -%>
<ul class="list-group-item-meta">
<div class="issue-list-description">
<%= l(:field_description)%>:<%= issue.description %>
<%= l(:field_description)%>:&nbsp;<%= issue.description %>
</div>
</ul>
<ul class="list-group-item-meta">
<% unless issue.assigned_to_id.nil? %>
<span><%= l(:field_assigned_to)%></span><%= raw column_content[5] %>
<span><%= l(:field_assigned_to)%>&nbsp;</span><%= raw column_content[5] %>&nbsp;
<% end %>
<%= l(:label_updated_time_on, format_date(issue.updated_on)).html_safe %>
<div class="find-comment-class">

View File

@ -4,7 +4,7 @@
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :class => 'icon icon-add' %>
<%= link_to l(:label_query), '#', :class => 'icon icon-help',
:onclick => '$("#custom_query").toggle(); ' if User.current.logged? %>
:onclick => '$("#custom_query").slideToggle(); ' if User.current.logged? %>
</div>
</div>

View File

@ -5,3 +5,13 @@
<%= "Trustie Team "%> &copy; 2013
</div></div>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46523987-1', 'trustie.net');
ga('send', 'pageview');
</script>

View File

@ -0,0 +1,10 @@
<div>
<p>没有搜索到相关的内容!</p>
<dl>
<dt><h3><strong>建议您 </strong></h3></dt>
<dd>重新设置搜索关键词</dd>
<dd>不要使用太长的关键词</dd>
<dd>不要使用特殊符号,如"^&%$#@*%"等</dd>
<dd>清除关键词之间的空格</dd>
</dl>
</div>

View File

@ -21,13 +21,12 @@
<div id="wrapper3">
<%=render :partial => 'layouts/base_header'%>
<div id="main" class="">
<!-- added by bai -->
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf"">创新竞赛社区</td>
<td style="width: 430px; color: #15bccf""><strong><%= l(:label_user_location) %> : </strong></td>
<td class="info_font" style="width: 240px; color: #15bccf">创新竞赛社区</td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px">
<div class="project-search">
<%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %>
@ -46,9 +45,7 @@
</tr>
</table>
</div>
<!-- end -->
<div id="sidebar">
<div class="main_context">
<div class="spaceleft">
@ -71,8 +68,6 @@
</tr>
</table>
<!-- added by bai 增加了竞赛的配置 -->
<% if User.current.logged? %>
<% if @bid.author.id == User.current.id %>
<%= link_to l(:label_contest_modify_settings), {:controller => 'bids', :action => 'settings', :id => @bid} %>
@ -81,7 +76,6 @@
</td>
</table>
</div>
<!-- added by bai 增加参与人和参与项目的数量显示 -->
<div class="user_fans">
<table width="240" border="0">
@ -98,7 +92,6 @@
<div class="user_underline"></div>
</div>
<!-- end -->
<div class="inf_user_image">
<table>
<tr>
@ -112,20 +105,13 @@
<td><%= l(:label_limit_time) %> : <%= @bid.deadline%></td>
</tr>
</table>
<div>
<%= link_to l(:label_x_followers, :count => @bid.watcher_users.count)+"("+@bid.watcher_users.count.to_s+")", respond_path(@bid) %> &nbsp;
<%= link_to l(:label_bidding_project)+"("+@bid.biding_projects.count.to_s+")", project_for_bid_path(@bid) %>&nbsp;
<%= link_to l(:label_x_bids_responses, :count => @bid.commit)+"("+@bid.commit.to_s+")", respond_path(@bid)%>
</div>
</div>
<div class="user_underline"></div>
<!--description-->
<div class="inf_user_context">
<div class="font_title_left">
<%= l(:label_project_overview) %>
</div>
<div style="padding-bottom: 8px">
<% if @bid.description.size>0 %>
<div class="font_lighter_sidebar">
@ -145,7 +131,6 @@
</div>
<!--tags-->
<div class="user_fans">
<div class="user_underline"></div>
<table style="font-family:微软雅黑">
<tr>
@ -154,24 +139,20 @@
</td>
</tr>
</table>
</div>
<div class="user_fans">
<div class="user_underline"></div>
<div class="font_title_left">
<strong><%= l(:label_x_followers, :count => @bid.watcher_users.count) %></strong>
<% if show_more_fans?(@bid) %>
<span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), :controller => 'bids', :action => 'show_bid_user'%></span>
<% end %>
</div>
<div class="user_underline"></div>
<div class="left_wf">
<table>
<tr>
<td style="padding-top: 5px">
<% if @bid.watcher_users.size>0 && @bid.watcher_users.count<13%>
<% for user in @bid.watcher_users%>
<%= link_to image_tag(url_to_avatar(user), :class => "avatar", :title => user.name ), user_path(user), :class => "avatar" %>
<% end %>
<% else %>
<p class="font_lighter"><%= l(:label_project_no_follow) %></p>
<% end%>
<%= show_bid_fans_picture(@bid)%>
</td>
</tr>
</table>
@ -179,33 +160,24 @@
</div>
<!-- participate -->
<div class="user_fans">
<div class="user_underline"></div>
<div class="font_title_left">
<strong><%= l(:label_bidding_project) %></strong>
<span style="font-size: 13px"><%= link_to "更多>>", :controller => 'bids', :action => 'show_project'%>
<% if show_more_bid_project?(@bid) %>
<span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), :controller => 'bids', :action => 'show_project'%></span>
<% end %>
</div>
<div class="user_underline"></div>
<div class="left_wf">
<table>
<tr>
<td style="padding-top: 5px">
<% if @bid.projects.size<0%>
<p class="font_lighter"><%= l(:label_no_bid_project) %></p>
<%else%>
<% for project in objCut12(@bid.projects.where('is_public=1')) %>
<%= link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar" %>
<% end%>
<% end %>
<%= show_bid_project(@bid) %>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<!-- end -->
@ -215,9 +187,9 @@
<div class="font_title_left">
<strong><%= l(:label_x_join_in_contest, :count => @bid.join_in_contests.count) %></strong>
<% if show_more_participate?(@bid) %>
<div style="font-size: 11px; display: inline; float: right; margin-top: 5px; margin-right: 20px" >
<span style="font-size: 12px; display: inline; float: right;" >
<%= link_to l(:label_more), :controller => "bids", :action => "show_participator"%>
</div>
</span>
<% end %>
</div>
<div class="left_wf">
@ -228,8 +200,8 @@
</table>
</div>
</div>
</div>
<div id="content">
<% if display_main_menu?(@bid) %>
<div class="tabs_new">

View File

@ -8,7 +8,7 @@
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= heads_for_theme %>

View File

@ -162,24 +162,12 @@
</div>
<!--Modified by nie-->
<!--tags-->
<% if User.current.logged? %>
<% if User.current.admin?||User.current.login==@user.login%>
<div class="user_underline"></div>
<!-- <div class="user_fans"> -->
<!-- added by william -for tag -->
<!-- <div class="user_tags"> -->
<div class="user_tags">
<div id="tags">
<%= render :partial => 'tags/tag', :locals => {:obj => @user,:object_flag => "1"}%>
</div>
</div>
<% end %>
<% end %>
<!-- </div> -->
<!-- </div> -->
<!--watch-->
<div class="user_underline"></div>
<div class="user_fans">
<div class="font_title_left">

View File

@ -1,4 +1,4 @@
<%= form_for(@mome_new, url: forum_memos_path) do |f| %>
<%= form_for(@mome_new, url: forum_memos_path, :html => {:multipart => true}) do |f| %>
<%= f.hidden_field :subject, :required => true, value: @memo.subject %>
<%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %>
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
@ -8,7 +8,7 @@
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
<p><%= l(:label_attachment_plural) %><br />
<%= render :partial => 'attachments/form', :locals => {:container => @mome_new} %>
<%= render :partial => 'attachments/form' %>
</p>
<%= f.submit value: l(:label_reply_plural), class: "replies" %>
<% end %>

View File

@ -45,7 +45,7 @@
</div>
<div class="replies">
<h3 class="comments"><%= l(:label_reply_plural) %> (<%= @replies.nil? ? 0 : @replies.size %>)</h3>
<% pages_count = (params['page'].to_i - 1) * 10 %>
<% pages_count = @reply_pages.offset %>
<% @replies.each do |reply| %>
<div class="reply" id="<%= "reply-#{reply.id}" %>">
<p class="font_lighter"><%= pages_count += 1 %>楼 :</p>

View File

@ -171,6 +171,10 @@
<%= link_to_attachments message, :author => false %> -->
<% end %>
<div class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></div>
<% end %>
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
<p style="float: right;"><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></p>
<div id="reply" style="display:none;">
@ -179,10 +183,6 @@
<%= submit_tag l(:button_submit) %>
<%= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %>
<% end %>
<div class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></div>
<% end %>
<div id="preview" class="wiki"></div>
</div>
<% end %>

View File

@ -28,23 +28,6 @@
<% end if @project %>
<div id="preview" class="wiki"></div>
</div>
<!--<h3><%=l(:label_news_plural)%></h3>
<% if @newss.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% else %>
<% @newss.each do |news| %>
<h3><%= avatar(news.author, :size => "24") %><%= link_to_project(news.project) + ': ' unless news.project == @project %>
<%= link_to h(news.title), news_path(news) %>
<%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %></h3>
<p class="author"><%= authoring news.created_on, news.author %></p>
<div class="wiki">
<%= textilizable(news, :description) %>
</div>
<% end %>
<% end %> -->
<!--add by huang :list news-->
<div>
<% if @newss.empty? %>
@ -73,7 +56,7 @@
<td colspan="2" width="580px" ><span class="font_description"><%= textilizable(news, :description) %></span></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= l :label_update_time %>: <%= format_time(news.created_on) %></span></td>
<td align="left"><span class="font_lighter"> <%= l :label_update_time %>&nbsp;<%= format_time(news.created_on) %></span></td>
<td width="350" align="right" class="a"><%= link_to l(:label_project_newother),news_path(news)%><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %></td>
</tr>
</table></td>

View File

@ -25,7 +25,7 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px"><a><%= link_to "forge.trustie.net/projects", :controller => 'projects', :action => 'course', :project_type => 1 %> </a></td>
<td style="padding-left: 8px"><a><%= link_to "forge.trustie.net/project/course", :controller => 'projects', :action => 'course', :project_type => 1 %> </a></td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course', :project_type => 1 %></td>
</tr>
</table>

View File

@ -1,36 +1,6 @@
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %>
<% end %>
<!-- <%= form_tag(:controller => 'projects', :action => 'search', :method => :get) do %>
<div class="project-search-block">
<table width="100%" valign="center">
<tr>
<td width="16%"><span style="margin-left:0px">
<% if params[:project_type] == '0'%>
<%= l(:label_project_plural)%>
</span></td>
<td valign="center"><%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td>
<% else %>
<%= l(:label_new_course)%>
</span></td>
<% if User.current.user_extensions.identity == 0 %>
<td valign="center"><%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td>
<% end %>
<% end %>
<td align="right">
<div class="project-search">
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= hidden_field_tag 'project_type', params[:project_type]%>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
</div></td>
</tr>
</table>
</div>
<%end%> -->
<div class="top-content">
<%= form_tag(:controller => 'projects', :action => "search", :method => :get) do %>
<% if params[:project_type] == "1" %>
@ -85,10 +55,13 @@
<% end %>
</div>
<% if @projects.size == 0 %>
<%= render :partial => 'layouts/no_content'%>
<% else %>
<div id="projects-index">
<%= render_project_hierarchy(@projects)%>
</div>
<% end %>
<div class="pagination">
<ul>

View File

@ -20,7 +20,8 @@
<span class="font_lighter">
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
<%= l(:label_new_activity) %> </span>
<%= link_to "#{eventToLanguage(e.event_type)}: "<< format_activity_title(e.event_title), e.event_type.eql?("attachment") ? project_files_path(e.container) : e.event_url %>
<%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), e.event_type.eql?("attachment") ? project_files_path(e.container) : e.event_url %>
</td>
</tr>
<tr>
@ -30,7 +31,7 @@
</p></td>
</tr>
<tr>
<td align="left"><a class="font_lighter"> <%= l :label_activity_time %>: <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %></a></td>
<td align="left"><span class="font_lighter"> <%= l :label_activity_time %>&nbsp; <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %></span></td>
<% if e.event_type == "issue" %>
<td align="right"><span> <%= link_to l(:label_find_all_comments), issue_path(e) %> </span><span class="font_lighter"><%= l(:label_comments_count, :count => e.journals.count)%></span></td>
<% end %>

View File

@ -119,7 +119,7 @@
<% end -%>
<% end -%>
<% else %>
<div style="height: 60px; margin-left: auto; margin-right: auto; color:#6c5524; background-color: #; vertical-align: center;">如果没有搜到希望的结果,请清除用户姓和名之间的空格,或者重新输入搜索关键词!</div>
<%= render :partial => "layouts/no_content"%>
<% end %>
</div>
<div class="pagination">

View File

@ -263,6 +263,7 @@
<div class="right" style="float: right; margin-right: 10px; height: 445px; width: 45%; ">
<ul class="user-welcome-message-list" style="width: 94%; margin-top: 0px;">
<h3 style="margin-left: -5px; color: rgb(21, 188, 207)"><strong>用户动态</strong></h3>
<span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'users', :action => 'index'} %></span>
<div class="user-message-box-list">
<% find_all_activities.each do |event| %>
<li style="display: block;height:60px; padding-bottom: 4px;">

View File

@ -23,7 +23,7 @@
</p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= l :label_comment_time %>: <%= format_time journal.created_on %></span></td>
<td align="left"><span class="font_lighter"> <%= l :label_comment_time %>&nbsp; <%= format_time journal.created_on %></span></td>
<td width="200" align="right" class="a"> <% if @user == User.current %>
<%= link_to(l(:label_newfeedback_quote), {:controller => 'words', :action => 'new', :id => user, :journal_id => journal}, :remote => true,

View File

@ -878,7 +878,7 @@ zh:
label_age: 提交时间
label_change_properties: 修改属性
label_general: 一般
label_more: 更多
label_more: 更多>>
label_scm: SCM
label_plugins: 插件
label_ldap_authentication: LDAP 认证
@ -1331,6 +1331,7 @@ zh:
label_bidding_succeed: 应标成功
label_bidding_contest_succeed: 竞赛提交成功 #added by bai
label_bidding_homework_succeed: 作业提交成功 #added by bai
label_bidding_homework_failed: 作业提交失败 #added by bai
label_bidding_fail: 应标失败,该项目已经应标
label_bidding_homework_fail: 作业提交失败,该作业已经被提交!
@ -1748,3 +1749,7 @@ zh:
label_project_module_forums: 公共贴吧
label_memo_locked: 帖子已被锁定
label_downloads_list: 进入附件列表
label_joined_contest: 参与了竞赛
label_contest_user: 参赛人:
label_contest_reason: 参赛宣言:
label_notification: 通知

View File

@ -466,7 +466,8 @@ RedmineApp::Application.routes.draw do
match 'calls/:id/show_project', :controller => 'bids', :action => 'show_project', :as => 'project_for_bid'
match 'calls/:id/show_project_homework', :controller => 'bids', :action => 'show_project_homework', :as => 'project_for_bid_homework' # by huang
match 'calls/:id/add', :controller => 'bids', :action => 'add'
match 'calls/:id/add_homework', :controller => 'bids', :action => 'add_homework'
match 'calls/:id/add_homework', :controller => 'bids', :action => 'add_homework', via: :post
match 'calls/:id/new_submit_homework', to: 'bids#new_submit_homework', via: :get, as: 'new_submit_homework'
match 'words/add_project_respond', :controller => 'words', :action => 'add_project_respond'
match 'words/:id/leave_project_message', :controller => 'words', :action => 'leave_project_message'
@ -499,7 +500,7 @@ RedmineApp::Application.routes.draw do
match 'new_join_in_contest', :to => 'bids#new_join', :as => 'try_join_in_contest'
match 'projects/:id/respond', :to => 'projects#project_respond', :via => :post
match 'calls/:id/manage',:to => 'bids#manage',:via => [:get,:post]
match 'project/course', :to => 'projects#course', :as => 'course' #nyan
match 'project/course', :to => 'projects#course', :as => 'course'
#added by william
# match 'calls/:id/set_results',:controller => 'bids', :action => 'set_results',:via => [:get,:post],:as => 'set_results'

View File

@ -141,7 +141,7 @@ function uploadAndAttachFiles(files, inputEl) {
var sizeExceeded = false;
$.each(files, function() {
if (this.size && maxFileSize && this.size > parseInt(maxFileSize)) {sizeExceeded=true;}
if (this.size && maxFileSize != null && this.size > parseInt(maxFileSize)) {sizeExceeded=true;}
});
if (sizeExceeded) {
window.alert(maxFileSizeExceeded);

View File

@ -211,7 +211,7 @@ div.forums-line{
}
div.forums-info{
background-image: url(../images/sidebar/forums.png);
/*background-image: url(../images/sidebar/forums.png); */
border-bottom: solid 1px #15bccf;
height: 100px;
width: 214px;

View File

@ -4,6 +4,10 @@
text-align: center;
}
* {
font-family: Helvetica, Tahoma, Arial, "Microsoft YaHei", "微软雅黑", SimSun, "宋体", STXihei, "华文细黑", Heiti, "黑体", sans-serif;
}
/* 按钮
*******************************************************************************/
input[class='whiteButton'], .whiteButton {

View File

@ -36,7 +36,7 @@
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-device-pixel-ratio: 2) {
#header > h1 {
background-image:ol url(../images/logo-2x.png);
/*background-image:ol url(../images/logo-2x.png);*/
background-size: 43px 30px;
}
}
@ -1251,7 +1251,7 @@ a.root {
a.img-tag3{
float: left;
background-image: url("../images/pai.png");
/*background-image: url("../images/pai.png");*/
background-position: 0px 0px;
background-repeat: no-repeat;
position: absolute;
@ -1891,7 +1891,7 @@ div.tableline{
*
* @2013-09-27
/*added by bai*/
input[type="submit"] {
input[type="submit"], .button_submit {
padding-bottom: 5px;
width: auto;
height: 25px;