This commit is contained in:
linhk 2014-09-17 16:03:17 +08:00
commit 05a5bf863f
25 changed files with 217 additions and 111 deletions

View File

@ -361,7 +361,7 @@ private
def login_without_softapplication def login_without_softapplication
referer = request.headers['Referer'] referer = request.headers['Referer']
require_login unless referer =~ /softapplication/ || referer =~ /memos/ require_login unless referer =~ /softapplication/ || @attachment.container_type == "Memo"
end end
def renderTag def renderTag

View File

@ -54,39 +54,29 @@ class ContestsController < ApplicationController
case params[:contest_sort_type] case params[:contest_sort_type]
when '0' when '0'
# modified by longjun # modified by longjun
# never use unless and else # never use unless and else, 将下面重复操作模块化放在private下
# unless @offset == 0 # unless @offset == 0
if @offset != 0 # if @offset != 0
@contests = @contests.reorder('contests.commit').offset(@offset).limit(@limit).all.reverse # @contests = @contests.reorder('contests.commit').offset(@offset).limit(@limit).all.reverse
else # else
limit = @contest_count % @limit # limit = @contest_count % @limit
limit = @limit if limit == 0 # limit = @limit if limit == 0
@contests = @contests.reorder('contests.commit').offset(@offset).limit(limit).all.reverse # @contests = @contests.reorder('contests.commit').offset(@offset).limit(limit).all.reverse
end
@contests = index_page_sort(@offset, @limit, @contest_count, @contests, 'contests.commit')
# end
@s_state = 0 @s_state = 0
when '1' when '1'
# modified by longjun
# never use unless and else @contests = index_page_sort(@offset, @limit, @contest_count, @contests, 'contests.created_on')
# unless @offset == 0
if @offset != 0
@contests = @contests.reorder('contests.created_on').offset(@offset).limit(@limit).all.reverse
else
limit = @contest_count % @limit
limit = @limit if limit == 0
@contests = @contests.reorder('contests.created_on').offset(@offset).limit(limit).all.reverse
end
@s_state = 1 @s_state = 1
when '2' # modified by longjun
# modified by longjun # 目前只有 0 1 两个sort_type
# never use unless and else # when '2'
# unless @offset == 0
if @offset != 0
@contests = @contests.offset(@offset).limit(@limit).all.reverse
else else
limit = @contest_count % @limit # end longjun
limit = @limit if limit == 0
@contests = @contests.offset(@offset).limit(@limit).all.reverse @contests = index_page_sort(@offset, @limit, @contest_count, @contests, '')
end
@s_state = 0 @s_state = 0
end end
else else
@ -723,5 +713,20 @@ class ContestsController < ApplicationController
end end
end end
# added by longjun
# 将index页面中分页排序的方法抽离出来
def index_page_sort(offset, limit, contest_count, contests, contest_sort_by)
# modified by longjun
# never use unless and else
# unless @offset == 0
if offset != 0
contests = contests.reorder(contest_sort_by).offset(offset).limit(limit).all.reverse
else
limit = contest_count % limit
limit = limit if limit == 0
contests = contests.reorder(contest_sort_by).offset(offset).limit(limit).all.reverse
end
contests
end
end end

View File

@ -62,7 +62,7 @@ class MemosController < ApplicationController
format.html { redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}" } format.html { redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}" }
format.json { render json: @memo, status: :created, location: @memo } format.json { render json: @memo, status: :created, location: @memo }
else else
flash[:error] = "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" flash.now[:error] = "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}"
# back_error_page = @memo.parent_id.nil? ? forum_path(@forum) : forum_memo_path(@forum, @memo.parent_id) # back_error_page = @memo.parent_id.nil? ? forum_path(@forum) : forum_memo_path(@forum, @memo.parent_id)
pre_count = REPLIES_PER_PAGE pre_count = REPLIES_PER_PAGE

View File

@ -122,12 +122,24 @@ module ApplicationHelper
s s
end end
# Generates a link to an attachment.
# Options:
# * :text - Link text (default to attachment filename)
# * :download - Force download (default: false)
def link_to_short_attachment(attachment, options={})
text = h(truncate(options.delete(:text) || attachment.filename, length: 25, omission: '...'))
route_method = options.delete(:download) ? :download_named_attachment_path : :named_attachment_path
html_options = options.slice!(:only_path)
url = send(route_method, attachment, attachment.filename, options)
link_to text, url, html_options
end
# Generates a link to an attachment. # Generates a link to an attachment.
# Options: # Options:
# * :text - Link text (default to attachment filename) # * :text - Link text (default to attachment filename)
# * :download - Force download (default: false) # * :download - Force download (default: false)
def link_to_attachment(attachment, options={}) def link_to_attachment(attachment, options={})
text = h(truncate(options.delete(:text) || attachment.filename, length: 60, omission: '...')) text = options.delete(:text) || attachment.filename
route_method = options.delete(:download) ? :download_named_attachment_path : :named_attachment_path route_method = options.delete(:download) ? :download_named_attachment_path : :named_attachment_path
html_options = options.slice!(:only_path) html_options = options.slice!(:only_path)
url = send(route_method, attachment, attachment.filename, options) url = send(route_method, attachment, attachment.filename, options)

View File

@ -3,13 +3,15 @@
<% if attachments.count > 1 && attachment != attachments.first%> <% if attachments.count > 1 && attachment != attachments.first%>
<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% end %> <% end %>
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%> <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<% if attachment.is_text? %> <% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'), <%= link_to image_tag('magnifier.png'),
:controller => 'attachments', :action => 'show', :controller => 'attachments', :action => 'show',
:id => attachment, :filename => attachment.filename %> :id => attachment, :filename => attachment.filename %>
<% end %> <% end %>
<%= h(" - #{attachment.description}") unless attachment.description.blank? %> <span title="<%= attachment.description%>">
<%= h(truncate(" - #{attachment.description}", length: 20, omission: '...')) unless attachment.description.blank? %>
</span>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span> <span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<% end -%> <% end -%>

View File

@ -2,7 +2,7 @@
<% for attachment in attachments %> <% for attachment in attachments %>
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"> <p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<span title="<%= attachment.filename%>"> <span title="<%= attachment.filename%>">
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%> <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
</span> </span>
<% if attachment.is_text? %> <% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'), <%= link_to image_tag('magnifier.png'),
@ -11,7 +11,9 @@
:id => attachment, :id => attachment,
:filename => attachment.filename%> :filename => attachment.filename%>
<% end %> <% end %>
<%= h(" - #{attachment.description}") unless attachment.description.blank? %> <span title="<%= attachment.description%>">
<%= h(truncate(" - #{attachment.description}", length: 20, omission: '...')) unless attachment.description.blank? %>
</span>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span> <span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<% if options[:deletable] %> <% if options[:deletable] %>
<% if attachment.container_type == 'HomeworkAttach' %> <% if attachment.container_type == 'HomeworkAttach' %>

View File

@ -14,7 +14,7 @@
</td> </td>
<td > <td >
<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:label_contest_innovate), welcome_contest_path %> > 详情</td> <%=link_to l(:label_contest_innovate), welcome_contest_path %> > l(:label_details)</td>
</tr> </tr>
</table> </table>
</div> </div>

View File

@ -41,20 +41,20 @@
<tr> <tr>
<td class="font_lighter"> <td class="font_lighter">
<!-- <span class="font_lighter"> <!-- <span class="font_lighter">
<%= l(:label_contest_project, <%#= l(:label_contest_project,
:count => contest.contesting_projects.count) :count => contest.contesting_projects.count)
%> %>
(<strong><span style="font-size: 17px"> (<strong><span style="font-size: 17px">
<%= link_to(contest.contesting_projects.count, <%#= link_to(contest.contesting_projects.count,
show_project_contest_path(contest), show_project_contest_path(contest),
:target => "_blank") :target => "_blank")
%></span></strong>)</span> %></span></strong>)</span>
<span class="font_lighter"> <span class="font_lighter">
<%= l(:label_contest_softapplication, <%#= l(:label_contest_softapplication,
:count => contest.contesting_softapplications.count) :count => contest.contesting_softapplications.count)
%> %>
(<strong><span style="font-size: 17px"> (<strong><span style="font-size: 17px">
<%= link_to(contest.contesting_softapplications.count, <%#= link_to(contest.contesting_softapplications.count,
show_softapplication_contest_path(contest), show_softapplication_contest_path(contest),
:target => "_blank") :target => "_blank")
%> %>
@ -77,7 +77,7 @@
<%= l(:label_contest_work, <%= l(:label_contest_work,
:count => contest.contesting_softapplications.count) :count => contest.contesting_softapplications.count)
%> %>
(<strong> (<strong>
<span style="font-size: 17px"> <span style="font-size: 17px">
<%= link_to(contest.contesting_softapplications.count, <%= link_to(contest.contesting_softapplications.count,
show_attendingcontest_contest_path(contest), show_attendingcontest_contest_path(contest),
@ -100,7 +100,7 @@
<div class="bid-description" style="border-left: 1px solid #d9d8d8; border-bottom: 1px solid #d9d8d8; padding-left: 20px; padding-bottom: 10px; margin-bottom: 20px;"> <div class="bid-description" style="border-left: 1px solid #d9d8d8; border-bottom: 1px solid #d9d8d8; padding-left: 20px; padding-bottom: 10px; margin-bottom: 20px;">
<table width="100%"> <table width="100%">
<tr> <tr>
<!-- <td> <%= contest.description%> </td> --> <!-- <td> <%#= contest.description%> </td> -->
</tr> </tr>
</table> </table>
</div> </div>

View File

@ -62,7 +62,7 @@
<!-- 设置奖项设置的打开 关闭开关--> <!-- 设置奖项设置的打开 关闭开关-->
</p> </p>
<!-- <em class="info" style="margin-left:95px;"><%= l(:text_contest_reward) %></em> --> <!-- <em class="info" style="margin-left:95px;"><%#= l(:text_contest_reward) %></em> -->
<p> <p>
<%= f.text_field :deadline, <%= f.text_field :deadline,
:required => true, :required => true,

View File

@ -78,7 +78,9 @@
<%= l(:label_contest_user) %> <%= l(:label_contest_user) %>
<% unless c_project.user.nil? %> <% unless c_project.user.nil? %>
<!-- modified by zjc 添加超链接 --> <!-- modified by zjc 添加超链接 -->
<%= link_to c_project.user.lastname + c_project.user.firstname,user_path(c_project.user) %> <%= link_to c_project.user.lastname + c_project.user.firstname,
user_path(c_project.user)
%>
<% end %> <% end %>
</strong> </strong>
@ -101,5 +103,7 @@
</table> </table>
<% end %> <% end %>
<% end %> <% 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>

View File

@ -1,6 +1,6 @@
<%#= error_messages_for 'softapplication' %> <%#= error_messages_for 'softapplication' %>
<script type="text/javascript"> <script type="text/javascript" xmlns="http://www.w3.org/1999/html">
//验证作品名称 //验证作品名称
function regexName() function regexName()
{ {
@ -57,19 +57,19 @@
var workDescription = $("#softapplication_application_developers").val(); var workDescription = $("#softapplication_application_developers").val();
if(workDescription.length ==0) if(workDescription.length ==0)
{ {
$("#span_softapplication_application_developers").text("开发人员不能为空"); $("#span_softapplication_application_developers").text(<%= l(:label_no_softapplication_developers) %>);
$("#span_softapplication_application_developers").css('color','#ff0000'); $("#span_softapplication_application_developers").css('color','#ff0000');
return false; return false;
} }
if(workDescription.length <= 125) if(workDescription.length <= 125)
{ {
$("#span_softapplication_application_developers").text("填写正确"); $("#span_softapplication_application_developers").text(<%= l(:label_field_correct) %>);
$("#span_softapplication_application_developers").css('color','#008000'); $("#span_softapplication_application_developers").css('color','#008000');
return true; return true;
} }
else else
{ {
$("#span_softapplication_application_developers").text("开发人员超过125个汉字"); $("#span_softapplication_application_developers").text(<%= l(:label_softapplication_developers_condition) %>);
$("#span_softapplication_application_developers").css('color','#ff0000'); $("#span_softapplication_application_developers").css('color','#ff0000');
return false; return false;
} }
@ -143,8 +143,10 @@
<br/> <br/>
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_work_description) %></span> <td style="padding-bottom: 290px;">
<span class="contest-star"> * </span>: <span><%= l(:label_work_description) %></span>
<span class="contest-star"> * </span>:
</td>
<td style="width: 100px"> <td style="width: 100px">
<%= f.text_field :description, <%= f.text_field :description,
:required => true, :required => true,

View File

@ -1,8 +1,9 @@
$("#<%=object_id%>").replaceWith('<%= escape_javascript join_in_competition(@contest, user) %>'); $("#<%=object_id%>").replaceWith('<%= escape_javascript join_in_competition(@contest, user) %>');
<% if @state %> <% if @state %>
// modified by longjun 去掉中文引用zh.yml中的标签
<% if @state == 0 %> <% if @state == 0 %>
alert("加入成功") alert(<%= l(:notice_successful_join) %>)
<% else %> <% else %>
alert("密码错误") alert(<%= l(:notice_account_wrong_password) %>)
<% end %> <% end %>
<% end %> <% end %>

View File

@ -7,7 +7,19 @@
<td rowspan="2"> <td rowspan="2">
<% if User.current.logged? %> <% if User.current.logged? %>
<% unless User.current.user_extensions.identity == 1 %> <% unless User.current.user_extensions.identity == 1 %>
<%= link_to(l(:label_newtype_contest), contest_new_contest_path, :class => 'icon icon-add', :target => "_blank") %> <<<<<<< HEAD
<!--
modified by longjun
<%#link_to l(:label_newtype_contest), :controller => 'contests', :action => 'new_contest' %>
-->
<%= link_to(l(:label_newtype_contest),
contest_new_contests_path,
:class => 'icon icon-add',
:target => "_blank")
%>
=======
<%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add', :target => "_blank") %>
>>>>>>> 5a14798290ec4fe5a5aeedb507e7f0077df96efc
<!-- end longjun --> <!-- end longjun -->
<% end %> <% end %>
<% end %> <% end %>
@ -16,20 +28,35 @@
<div class="project-search" style="float: right"> <div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 30 %> <%= text_field_tag 'name', params[:name], :size => 30 %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %> <%= submit_tag l(:label_search),
:class => "enterprise",
:name => "contests_search"
%>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"> <td style="padding-left: 8px">
<a> <a>
<<<<<<< HEAD
<!--modified by longjun-->
=======
>>>>>>> 5a14798290ec4fe5a5aeedb507e7f0077df96efc
<%= link_to request.host()+"/contests", contests_path %> <%= link_to request.host()+"/contests", contests_path %>
<!-- end longjun --> <!-- end longjun -->
</a> </a>
</td> </td>
<td > <td >
<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:field_homepage), home_path %> >
<<<<<<< HEAD
<!--
modified by longjun
<%#link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %>
-->
<%=link_to l(:label_contest_innovate), contests_path %>
=======
<%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %> <%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %>
>>>>>>> 5a14798290ec4fe5a5aeedb507e7f0077df96efc
<!-- end longjun --> <!-- end longjun -->
</td> </td>
</tr> </tr>
@ -39,7 +66,9 @@
<% if @contests.size > 0%> <% if @contests.size > 0%>
<%= sort_contest(@s_state)%> <%= sort_contest(@s_state)%>
<div id="bid-show"> <div id="bid-show">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %> <%= render :partial => 'contest_list',
:locals => {:contests => @contests, :contest_pages => @contest_pages}
%>
</div> </div>
<% else %> <% else %>
<%= render :partial => "layouts/no_content"%> <%= render :partial => "layouts/no_content"%>

View File

@ -1,6 +1,8 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% reply_allow = JournalsForMessage.create_by_user? User.current %>
<div style="margin-left: 20px;"> <div style="margin-left: 20px;">
<span class="portrait"><%= image_tag(url_to_avatar(@contest.author), :class => "avatar")%></span> <span class="portrait">
<%= image_tag(url_to_avatar(@contest.author), :class => "avatar")%>
</span>
<span class="body"> <span class="body">
<h3> <h3>
<%= link_to(@contest.author.lastname+@contest.author.firstname, <%= link_to(@contest.author.lastname+@contest.author.firstname,

View File

@ -3,7 +3,9 @@
<ul class="list_watch"><li> <ul class="list_watch"><li>
<table width="660px" border="0" align="center"> <table width="660px" border="0" align="center">
<tr> <tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(user), :class => "avatar") %></td> <td colspan="2" valign="top" width="50" >
<%= image_tag(url_to_avatar(user), :class => "avatar") %>
</td>
<td><table width="580px" border="0"> <td><table width="580px" border="0">
<tr> <tr>
<td colspan="2" valign="top"> <td colspan="2" valign="top">
@ -15,15 +17,17 @@
<tr> <tr>
<td colspan="2" width="580px" ><p class="font_description"> <td colspan="2" width="580px" ><p class="font_description">
<% unless user.memberships.empty? %> <% unless user.memberships.empty? %>
<%= l(:label_x_contribute_to, :count => user.memberships.count) %> <%= l(:label_x_contribute_to, :count => user.memberships.count) %>
<% for member in user.memberships %> <% for member in user.memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %> <%= link_to_project(member.project) %>
<% end %> <%= (user.memberships.last == member) ? '' : '' %>
<% end %>
<% end %> <% end %>
</p></td> </p></td>
</tr> </tr>
<tr> <tr>
<td width="200" align="right" class="font_lighter"><%= l(:label_user_joinin) %><%= format_date(user.created_on) %> <td width="200" align="right" class="font_lighter">
<%= l(:label_user_joinin) %><%= format_date(user.created_on) %>
</td> </td>
</tr> </tr>
</table></td> </table></td>

View File

@ -13,12 +13,20 @@
<tr> <tr>
<!-- modified by bai 显示人名全称--> <!-- modified by bai 显示人名全称-->
<td colspan="2" valign="top" width="50" > <td colspan="2" valign="top" width="50" >
<%= link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :title => "#{user.show_name}" %> <%= link_to image_tag(url_to_avatar(user), :class => "avatar"),
user_path(user),
:title => "#{user.show_name}"
%>
</td> </td>
<td> <td>
<table width="580px" border="0"> <table width="580px" border="0">
<tr> <tr>
<td colspan="2" valign="top"><%= content_tag "div", link_to(user.show_name, user_path(user)), :class => "project_avatar_name" , :title => "#{user.show_name}" %> <td colspan="2" valign="top">
<%= content_tag "div",
link_to(user.show_name, user_path(user)),
:class => "project_avatar_name" ,
:title => "#{user.show_name}"
%>
<!-- added by bai 增加了学员的学号 --> <!-- added by bai 增加了学员的学号 -->
<% if (im_watching_student_id? @contest) && user.user_extensions.identity.to_i.eql?(1) %> <% if (im_watching_student_id? @contest) && user.user_extensions.identity.to_i.eql?(1) %>
<%= l(:label_bidding_user_studentcode) %> <%= user.user_extensions.student_id%> <%= l(:label_bidding_user_studentcode) %> <%= user.user_extensions.student_id%>

View File

@ -66,7 +66,8 @@
:update => "contesting_softapplication_list", :update => "contesting_softapplication_list",
:complete => '$("#put-bid-form").hide();' do |f| :complete => '$("#put-bid-form").hide();' do |f|
%> %>
<table id="contesting_table" border="0" width="100%" style="margin-left: 40px;"> <!--该table为点击我要参加后弹出的--> <!--该table为点击我要参加后弹出的-->
<table id="contesting_table" border="0" width="100%" style="margin-left: 40px;">
<tr> <tr>
<td> <td>
<%= select_tag 'contest', <%= select_tag 'contest',
@ -90,7 +91,17 @@
</tr> </tr>
<tr> <tr>
<td><%= f.text_area :contest_message, :id => "contest_message", :required => true, :rows => 4, :cols => 40, :placeholder => l(:label_bid_reason), :style => "resize: none;", :class => 'noline'%></td> <td>
<%= f.text_area :contest_message,
:id => "contest_message",
:required => true,
:rows => 4,
:cols => 40,
:placeholder => l(:label_bid_reason),
:style => "resize: none;",
:class => 'noline'
%>
</td>
</tr> </tr>
<tr> <tr>

View File

@ -2,12 +2,14 @@
<% if attachments.count > 1 && attachment != attachments.first%> <% if attachments.count > 1 && attachment != attachments.first%>
<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% end %> <% end %>
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%> <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<% if attachment.is_text? %> <% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'), <%= link_to image_tag('magnifier.png'),
:controller => 'attachments', :action => 'show', :controller => 'attachments', :action => 'show',
:id => attachment, :filename => attachment.filename %> :id => attachment, :filename => attachment.filename %>
<% end %> <% end %>
<%= h(" - #{attachment.description}") unless attachment.description.blank? %> <span title="<%= attachment.description%>">
<%= h(truncate(" - #{attachment.description}", length: 20, omission: '...')) unless attachment.description.blank? %>
</span>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span> <span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<% end -%> <% end -%>

View File

@ -27,8 +27,7 @@
<p><%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %></p> <p><%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %></p>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> <script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
<br/> <br/>
<%= f.submit :value => l(:button_change) %> <%= f.submit :value => l(:button_change) %>&nbsp;&nbsp;<%= link_to l(:button_back), back_url ,:class => "button-canel",:style => "color: #ffffff;"%>
</div> </div>
<% end %> <% end %>
<%= link_to l(:button_back), back_url %>
</div> </div>

View File

@ -43,11 +43,14 @@
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete) :title => l(:button_delete)
) if @memo.destroyable_by?(User.current) %> ) if @memo.destroyable_by?(User.current) %>
</div> </div>
<div class="memo-title <%= @memo.sticky ? 'sticky' : '' %> <%= @memo.locked? ? 'locked' : '' %>" style="word-break: break-all;word-wrap: break-word;"><%= label_tag l(:field_subject) %>: <%=h @memo.subject %></div> <div>&nbsp;</div>
<div class="memo-title <%= @memo.sticky ? 'sticky' : '' %> <%= @memo.locked? ? 'locked' : '' %>"
style="word-break: break-all;word-wrap: break-word;">
<%= label_tag l(:field_subject) %>: <%=h @memo.subject %>
</div>
<div class="memo-content"> <div class="memo-content">
<%= textAreailizable(@memo,:content) %> <%= textAreailizable(@memo,:content) %>
<p> <p>

View File

@ -3,44 +3,44 @@
<% replying ||= false %> <% replying ||= false %>
<div class="box ph10_5"> <div class="box ph10_5">
<!--[form:message]--> <!--[form:message]-->
<% unless replying %> <% unless replying %>
<p> <p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br/>
<%= f.text_field :subject, :size => 60, :style => "width: 99%;display:none;", :id => "message_subject" %><!--by young--> <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject" %><!--by young-->
</p> </p>
<% else %> <% else %>
<p> <p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br/>
<%= f.text_field :subject, :size => 60, :style => "width: 99%;display:none;", :id => "message_subject", :readonly => true %> <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :readonly => true %>
</p> </p>
<% end %> <% end %>
<p> <p>
<% unless replying %> <% unless replying %>
<% if @message.safe_attribute? 'sticky' %> <% if @message.safe_attribute? 'sticky' %>
<%= f.check_box :sticky %> <%= label_tag 'message_sticky', l(:label_board_sticky) %> <%= f.check_box :sticky %> <%= label_tag 'message_sticky', l(:label_board_sticky) %>
<% end %> <% end %>
<% if @message.safe_attribute? 'locked' %> <% if @message.safe_attribute? 'locked' %>
<%= f.check_box :locked %> <%= label_tag 'message_locked', l(:label_board_locked) %> <%= f.check_box :locked %> <%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %> <% end %>
<% end %> <% end %>
</p> </p>
<p> <p>
<label for="message_subject"><%= l(:button_projects_feedback_respond) %> <label for="message_subject"><%= l(:field_description) %>
<span class="required"> *&nbsp;&nbsp;</span></label> <span class="required"> *&nbsp;&nbsp;</span></label>
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div> <div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
<%= text_area :quote,:quote,:style => 'display:none' %> <%= text_area :quote,:quote,:style => 'display:none' %>
</p> </p>
<p> <p>
<%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %> <%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %>
<%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content' %> <%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content' %>
</p> </p>
<!--[eoform:message]--> <!--[eoform:message]-->
<p> <p>
<%= l(:label_attachment_plural) %> <%= l(:label_attachment_plural) %>
<br /> <br />
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %> <%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>
</p> </p>
</div> </div>

View File

@ -157,7 +157,7 @@
<span style="margin-top: -20px;float: right; display: block;"> <span style="margin-top: -20px;float: right; display: block;">
<% if User.current.logged? %> <% if User.current.logged? %>
<% unless User.current.user_extensions.identity == 1 %> <% unless User.current.user_extensions.identity == 1 %>
<%= link_to(l(:label_newtype_contest), {:controller => 'bids', :action => 'new_contest'}, :class => 'icon icon-add') %> <%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add') %>
<% end %> <% end %>
<% end %> <% end %>
&nbsp;&nbsp; &nbsp;&nbsp;

View File

@ -173,6 +173,7 @@ zh:
notice_successful_delete: 删除成功 notice_successful_delete: 删除成功
notice_failed_delete: 删除失败 notice_failed_delete: 删除失败
notice_successful_connection: 连接成功 notice_successful_connection: 连接成功
notice_successful_join: 加入成功
notice_file_not_found: 您访问的页面不存在或已被删除。 notice_file_not_found: 您访问的页面不存在或已被删除。
notice_locking_conflict: 数据已被另一位用户更新 notice_locking_conflict: 数据已被另一位用户更新
notice_not_authorized: 对不起,您无权访问此页面。 notice_not_authorized: 对不起,您无权访问此页面。
@ -1936,7 +1937,7 @@ zh:
label_forum_edit: 编辑讨论区 label_forum_edit: 编辑讨论区
label_memo_create: 发布 label_memo_create: 发布
label_memo_new: 新建主题 label_memo_new: 新建主题
label_memo_edit: 修改主题label_board_new label_memo_edit: 修改主题
label_memo_new_from_forum: 发布帖子 label_memo_new_from_forum: 发布帖子
label_forum: 公共贴吧 label_forum: 公共贴吧
label_forum_new: 新建贴吧 label_forum_new: 新建贴吧
@ -2000,9 +2001,12 @@ zh:
label_work_deposit_project: 托管项目 label_work_deposit_project: 托管项目
label_softapplication_name_condition: 25个汉字以内50个字符 label_softapplication_name_condition: 25个汉字以内50个字符
label_softapplication_description_condition: 125个汉字以内 label_softapplication_description_condition: 125个汉字以内
label_softapplication_developers_condition: 开发人员超过125个汉字
label_no_softapplication_developers: 开发人员不能为空
label_user_login_softapplication_board: 您还没有登录,请登录后参与应用评价。 label_user_login_softapplication_board: 您还没有登录,请登录后参与应用评价。
label_contest_description_no: 暂无描述。 label_contest_description_no: 暂无描述。
label_no_contest_softapplication: 暂无参赛应用 label_no_contest_softapplication: 暂无参赛应用
label_field_correct: 填写正确
label_button_ok: 确定 label_button_ok: 确定
label_tags_contest: 竞赛标签 label_tags_contest: 竞赛标签
label_tags_contest: 竞赛名称 label_tags_contest: 竞赛名称
@ -2124,4 +2128,4 @@ zh:
lable_hot_course: 活跃课程 lable_hot_course: 活跃课程
lable_hot_projects: 热门项目 lable_hot_projects: 热门项目
lable_user_active: 用户动态 lable_user_active: 用户动态
lable_bar_active: 贴吧动态 lable_bar_active: 贴吧动态

View File

@ -657,7 +657,7 @@ RedmineApp::Application.routes.draw do
match 'delete_avatar', :to => 'avatar#delete_image',:via => :post match 'delete_avatar', :to => 'avatar#delete_image',:via => :post
# Endof Tao's code # Endof Tao's code
get 'robots.txt', :to => 'welcome#robots' get 'robots.txt', :to => 'welcome#robots'
match 'welcome/course', :to => 'welcome#course'
##############测试留言功能 fq ##############测试留言功能 fq
post 'words/new', :to => 'words#new' post 'words/new', :to => 'words#new'
post 'words/create', :to => 'words#create' post 'words/create', :to => 'words#create'
@ -724,7 +724,7 @@ RedmineApp::Application.routes.draw do
# added by young # added by young
match 'calls', :to => 'bids#index' match 'calls', :to => 'bids#index'
match 'calls/:id', :to => 'bid#show', :as => 'respond' match 'calls/:id', :to => 'bids#show', :as => 'respond'
# modified by longjun # modified by longjun
# bids#contests is not exist # bids#contests is not exist
# match 'contest', :to => 'bids#contests', :as => 'contest' #modified @20140403 # match 'contest', :to => 'bids#contests', :as => 'contest' #modified @20140403

View File

@ -2794,3 +2794,19 @@ div.repos_explain{
padding-top: 20px; padding-top: 20px;
padding-bottom: 20px; padding-bottom: 20px;
} }
.button-canel{
padding-bottom: 5px;
width: auto;
height: 25px;
font-family: '微软雅黑',Arial,Helvetica,sans-serif;
font-size: 12px;
color: #ffffff;
padding: 3px 9px;
background: #15bccf;
border-radius: 4px;
border: 1px solid #15bccf;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 0px 2px rgb(255, 255, 255) inset;
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2), 0px 1px 0px rgb(255, 255, 255);
cursor: pointer;
}