This commit is contained in:
sw 2015-01-19 17:08:47 +08:00
commit e493ae22cf
17 changed files with 98 additions and 41 deletions

View File

@ -561,12 +561,13 @@ module CoursesHelper
def course_in_current_or_next_term course
is_current_term = false
is_next_term = false
if course.time == Time.now.year && course.term == cur_course_term
year_now = Time.now.month < 3 ? Time.now.year - 1:Time.now.year
if course.time == year_now && course.term == cur_course_term
is_current_term = true
end
if cur_course_term == "秋季学期" && course.time == (Time.now.year + 1) && course.term == "春季学期"
if cur_course_term == "秋季学期" && course.time == (year_now + 1) && course.term == "春季学期"
is_next_term = true
elsif cur_course_term == "春季学期" && course.time == Time.now.year && course.term == "秋季学期"
elsif cur_course_term == "春季学期" && course.time == year_now && course.term == "秋季学期"
is_next_term = true
end
is_current_term || is_next_term

View File

@ -15,7 +15,8 @@ class Contest < ActiveRecord::Base
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_many :contestnotifications, :dependent => :destroy, :include => :author
acts_as_attachable

View File

@ -56,24 +56,36 @@
</a>
<ul style="margin-left: 15px">
<% if @canShowCode %>
<li>
<%= l(:label_bidding_user_studentname) %> :
<%= link_to member.user.show_name, user_path(member.user) %>
</li>
</br>
<% if member.user.show_name == '' && member.user.user_extensions.student_id == '' %>
<li>
<%= l(:label_username)%>
<%= link_to(member.user.name, user_path(member.user)) %>
</li>
<% else %>
<% unless member.user.show_name == ''%>
<li>
<%= l(:label_bidding_user_studentname) %> :
<%= link_to member.user.show_name, user_path(member.user) %>
</li>
</br>
<% end %>
<% unless member.user.user_extensions.student_id == '' %>
<li>
<%= l(:label_bidding_user_studentcode) %> :
<%= link_to member.user.user_extensions.student_id, user_path(member.user) %>
</li>
<% end %>
<% end %>
<%#= content_tag "li", "#{l(:label_bidding_user_studentname)}#{' : '}"link_to(member.user.show_name, user_path(member.user)) %>
<% else %>
<%= content_tag "li", link_to(member.user.name, user_path(member.user)) %>
<% end %>
<li>
<%= l(:label_username)%>
<%= link_to(member.user.name, user_path(member.user)) %>
</li>
<% end %>
<!--teacher's code disapeared moified by huang-->
<% if @canShowCode %>
<li>
<%= l(:label_bidding_user_studentcode) %> :
<%= link_to member.user.user_extensions.student_id, user_path(member.user) %>
</li>
<%#= content_tag "li", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :style=> "color:#1c9ec7;" %>
<% end %>
</ul>
<% if @subPage_title == l(:label_student_list) %>
<%= link_to format("%0.2f",member.score.nil? ? 0 : member.score.to_s), {

View File

@ -7,24 +7,36 @@
<a href="#" class="st_img" style="float:left;"> <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %></a>
<ul style="margin-left: 15px">
<% if @canShowCode %>
<li>
<%= l(:label_bidding_user_studentname) %> :
<%= link_to member.user.show_name, user_path(member.user) %>
</li> </br>
<% if member.user.show_name == '' && member.user.user_extensions.student_id == '' %>
<li>
<%= l(:label_username)%>
<%= link_to(member.user.name, user_path(member.user)) %>
</li>
<% else %>
<% unless member.user.show_name == ''%>
<li>
<%= l(:label_bidding_user_studentname) %> :
<%= link_to member.user.show_name, user_path(member.user) %>
</li>
</br>
<% end %>
<% unless member.user.user_extensions.student_id == '' %>
<li>
<%= l(:label_bidding_user_studentcode) %> :
<%= link_to member.user.user_extensions.student_id, user_path(member.user) %>
</li>
<% end %>
<% end %>
<%#= content_tag "li", "#{l(:label_bidding_user_studentname)}#{' : '}"link_to(member.user.show_name, user_path(member.user)) %>
<% else %>
<%= content_tag "li", link_to(member.user.name, user_path(member.user)) %>
<li>
<%= l(:label_username)%>
<%= link_to(member.user.name, user_path(member.user)) %>
</li>
<% end %>
<!--teacher's code disapeared moified by huang-->
<% if @canShowCode %>
<li>
<%= l(:label_bidding_user_studentcode) %> :
<%= link_to member.user.user_extensions.student_id, user_path(member.user) %>
</li>
<%#= content_tag "li", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :style=> "color:#1c9ec7;" %>
<% end %>
</ul>
<% if @subPage_title == l(:label_student_list) %>
<%= link_to format("%0.2f",member.score.to_s), {

View File

@ -47,12 +47,36 @@
</td>
<td rowspan="2" width="250px">
<div class="top-content-search">
<script type="text/javascript">
function regexName()
{
var name = $.trim($("#name").val());
if(name.length == 0)
{
$("#project_name_span").text("<%= l(:label_search_conditions_not_null) %>");
$("#project_name_span").css('color','#ff0000');
$("#project_name_span").focus();
return false;
}
else
{
$("#project_name_span").text("");
return true;
}
}
function submitSerch()
{
if(regexName()){$("#course_search_form").submit();}
}
</script>
<%= form_tag({:controller => 'courses', :action => 'search'},:id => "course_search_form", :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20, :style => "float:left" %>
<a href="#" onclick="$('#course_search_form').submit();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%>
</a>
<br />
<span id="project_name_span" style="float: left"></span>
<%#= submit_tag l(:label_search), :class => "ButtonColor m3p10", :name => nil, :style => "float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" %>
<% end %>
</div>

View File

@ -70,7 +70,7 @@
<%= l(:label_search)%>
</a>
<br />
<span id="contest_name_span_head"></span>
<span id="contest_name_span_head" style="float: left"></span>
<% end %>
</div>
</td>

View File

@ -71,7 +71,7 @@
<%= l(:label_search)%>
</a>
<br />
<span id="project_name_span"></span>
<span id="project_name_span" style="float: left"></span>
<% end %>
</div>
</td>

View File

@ -39,7 +39,7 @@ a:hover.mail_reply{ background:#06a9bc; text-decoration:none;}
</div><!--mail_head end-->
<%= yield %>
<hr />
<div class="mail_foot"><%= link_to("退订该邮件?", @user_url) %> </div><!--mail_foot end-->
<span class="footer"><%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_footer).html_safe %></span><!--mail_foot end-->
</div>
</div>
</body>

View File

@ -5,4 +5,5 @@
</div>
<div class="mail_foot"><%= link_to("退订该邮件?", @user_url) %> </div>

View File

@ -1,2 +1,3 @@
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
<%= link_to("退订该邮件?", @user_url) %>

View File

@ -11,3 +11,5 @@
<span style="float: left"><strong><%= l(:field_content)%></strong></span><span style="float: left; width: 540px"><%= @journal.notes %></span>
<hr />
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
<div class="mail_foot"><%= link_to("退订该邮件?", @user_url) %> </div>

View File

@ -12,3 +12,5 @@
<% end -%>
----------------------------------------
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
<%= link_to("退订该邮件?", @user_url) %>

View File

@ -242,7 +242,7 @@
<div id="WOpenWindow">
<a class="modal_close" href="#"></a>
<h2><%= l(:lable_school_list)%></h2>
<h2 style="margin: 10px"><%= l(:lable_school_list)%></h2>
&nbsp;&nbsp;
<div class="pcontent">
<ul id="provincelist" class="school_list">

View File

@ -47,7 +47,7 @@ form #search_type{
<%#完了把上面东西放到 .css 里%>
</style>
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
<div class="project-search" style="float: right">
<div class="project-search" style="float: right; width: 260px">
<div class='search_widget'>
<%= text_field_tag :q, nil, placeholder:'请输入要搜索的关键字', :size => 27, style: "float:left" %>
<%= select_tag(:search_type, options_for_select(select_option), :style => "float:right" ) %>

View File

@ -86,7 +86,7 @@ form #search_by
}
</script>
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
<div class="project-search" style="float: right">
<div class="project-search" style="float: right; width: 260px">
<div class='search_widget' >
<%= text_field_tag :q, nil, placeholder:'请输入要搜索的关键字', style:"float:left" %>

View File

@ -2110,7 +2110,7 @@ zh:
excel_homework_list: 作品列表
excel_been_rated: 已评
excel_not_rated: 未评
label_export_excel: 导出Excel
label_export_excel: 导出列表
label_softapplication: 应用软件
label_attending_contest: 参加竞赛

View File

@ -41,8 +41,9 @@ input.f_2 {
.st_search{ margin:10px 0;}
.st_search span{ font-size:14px; font-weight:bold; color:#606060; margin-right:35px;}
.st_search input{ border:1px solid #1c9ec7; height:20px; width:200px;}
a:hover.xls{ background: url('../images/icon_excel.gif') no-repeat scroll 1px 50% transparent !important;
padding: 2px 0px 3px 16px;
a:hover.xls{ /*background: url('../images/icon_excel.gif') no-repeat scroll 1px 50% transparent !important;*/
/*padding: 2px 0px 3px 16px;*/
background:#ffffff !important;
font-family:微软雅黑 !important;
font-size: 12px !important;
color: #136b3b !important;