Merge branch 'szzh' of http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git into szzh
This commit is contained in:
commit
8e87e83ad8
|
@ -377,7 +377,7 @@ class UsersController < ApplicationController
|
|||
}
|
||||
scope = User.logged.status(@status)
|
||||
@search_by = params[:search_by] ? params[:search_by][:id] : 0
|
||||
scope = scope.like(params[:name],@search_by) if params[:name].present?
|
||||
scope = scope.like(params[:name],"0") if params[:name].present?
|
||||
@user_count = scope.count
|
||||
@user_pages = Paginator.new @user_count, @limit, params['page']
|
||||
@user_base_tag = params[:id] ? 'base_users':'users_base'
|
||||
|
|
|
@ -98,7 +98,7 @@ module WatchersHelper
|
|||
# modify by nwb
|
||||
# 主讲教师不允许退出课程
|
||||
return '' if user.id == course.tea_id
|
||||
joined = user.member_of_course?(course)
|
||||
joined = course.members.map{|m| m.user}.include? user
|
||||
text = joined ? l(:label_exit_course) : l(:label_new_join)
|
||||
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id)
|
||||
method = joined ? 'delete' : 'post'
|
||||
|
|
|
@ -206,11 +206,11 @@ class User < Principal
|
|||
pattern = "%#{arg.to_s.strip.downcase}%"
|
||||
#where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern)
|
||||
if type == "0"
|
||||
where(" LOWER(login) LIKE :p ", :p => pattern)
|
||||
where(" LOWER(login) LIKE '#{pattern}' ")
|
||||
elsif type == "1"
|
||||
where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern)
|
||||
where(" LOWER(concat(lastname, firstname)) LIKE '#{pattern}' ")
|
||||
else
|
||||
where(" LOWER(mail) LIKE :p ", :p => pattern)
|
||||
where(" LOWER(mail) LIKE '#{pattern}' ")
|
||||
end
|
||||
end
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<td>
|
||||
<table width="580px" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top">
|
||||
<td valign="top">
|
||||
<strong>
|
||||
<%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %>
|
||||
</strong>
|
||||
|
@ -55,6 +55,8 @@
|
|||
<span>
|
||||
<%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %>
|
||||
</span>
|
||||
</td>
|
||||
<td style="width: 110px;">
|
||||
<span style="float: right">
|
||||
<% if User.current.logged? && is_cur_course_student(@course) %>
|
||||
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
|
||||
|
@ -83,8 +85,8 @@
|
|||
<%end%>
|
||||
<span class="span_wping">
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}
|
||||
) %>
|
||||
</span>
|
||||
<%#= link_to(
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
|
||||
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
|
||||
div,img,tr,td{ border:0;}
|
||||
table,tr,td{border:0 cellspacing:0; cellpadding:0;}
|
||||
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
|
||||
ul,li{ list-style-type:none}
|
||||
.cl{ clear:both; overflow:hidden; }
|
||||
a{ text-decoration:none; }
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff;}
|
||||
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
|
||||
div,img,tr,td{ border:0;}
|
||||
table,tr,td{border:0 cellspacing:0; cellpadding:0;}
|
||||
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
|
||||
ul,li{ list-style-type:none}
|
||||
.cl{ clear:both; overflow:hidden; }
|
||||
a{ text-decoration:none; }
|
||||
|
|
|
@ -21,36 +21,36 @@
|
|||
<td rowspan="2" >
|
||||
<div class="project-search" style="float: right">
|
||||
<script type="text/javascript">
|
||||
function regexName()
|
||||
function regexName1()
|
||||
{
|
||||
var name = $.trim($("#name").val());
|
||||
if(name.length == 0)
|
||||
{
|
||||
$("#contest_name_span").text("<%= l(:label_search_conditions_not_null) %>");
|
||||
$("#contest_name_span").css('color','#ff0000');
|
||||
$("#contest_name_span").focus();
|
||||
$("#contest_name_span_head").text("<%= l(:label_search_conditions_not_null) %>");
|
||||
$("#contest_name_span_head").css('color','#ff0000');
|
||||
$("#contest_name_span_head").focus();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#contest_name_span").text("");
|
||||
$("#contest_name_span_head").text("");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function submitSerch()
|
||||
{
|
||||
if(regexName()){$("#contests_serch").submit();}
|
||||
if(regexName1()){$("#contests_serch").submit();}
|
||||
}
|
||||
</script>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => 'regexName();' %>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => 'regexName1();', :width => "125px" %>
|
||||
<%= hidden_field_tag 'project_type', params[:project_type] %>
|
||||
<%#= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
|
||||
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="padding-top: 7px !important;">
|
||||
<%= l(:label_search)%>
|
||||
</a>
|
||||
<br />
|
||||
<span id="contest_name_span"></span>
|
||||
<span id="contest_name_span_head"></span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<div class="dis">
|
||||
<div class="msg_box" id='leave-message'>
|
||||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
<%# reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
|
||||
<h3><%= l(:label_user_response) %></h3>
|
||||
<h3>
|
||||
<%= l(:label_user_response) %>
|
||||
</h3>
|
||||
|
||||
<% if !User.current.logged?%>
|
||||
<div style="font-size: 14px;margin:20px;">
|
||||
|
@ -30,5 +32,7 @@
|
|||
<div id="history">
|
||||
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
|
||||
</div>
|
||||
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul>
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
</div>
|
|
@ -5,18 +5,29 @@
|
|||
<% if journals.size > 0 %>
|
||||
<% for journal in journals %>
|
||||
<div class="ping_C" id='word_li_<%= journal.id.to_s %>'>
|
||||
<div class="ping_dispic"><a target="_blank" href="#"><%= image_tag(url_to_avatar(journal.user)) %></a></div>
|
||||
<div class="ping_dispic">
|
||||
<a target="_blank" href="#">
|
||||
<%= image_tag(url_to_avatar(journal.user)) %>
|
||||
</a>
|
||||
</div>
|
||||
<div class="ping_discon" style="width: 85%;">
|
||||
<div class="ping_distop">
|
||||
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
|
||||
<span><%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%></span><span style="color:#a6a6a6; margin-right:40px; margin-left:30px;"><%= format_time(journal.created_on) %></span>
|
||||
<span>
|
||||
<%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%>
|
||||
</span>
|
||||
<span style="color:#a6a6a6; margin-right:40px; margin-left:30px;">
|
||||
<%= format_time(journal.created_on) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<p><%= textilizable journal.notes%></p>
|
||||
<p>
|
||||
<%= textilizable journal.notes%>
|
||||
</p>
|
||||
</div>
|
||||
<div class="ping_disfoot">
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
<span style="float: right">
|
||||
<% if journal.user == User.current|| User.current.admin? %>
|
||||
<% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
|
||||
<%= 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',
|
||||
|
@ -43,7 +54,7 @@
|
|||
<% end %>
|
||||
<div style="clear: both;"></div>
|
||||
<div>
|
||||
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true} %>
|
||||
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true, :allow_delete => @course && User.current.allowed_to?(:as_teacher,@course)} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -37,37 +37,38 @@
|
|||
</td>
|
||||
<td rowspan="2" width="250px">
|
||||
<script type="text/javascript">
|
||||
function regexName()
|
||||
function regexName1()
|
||||
{
|
||||
var name = $.trim($("#name").val());
|
||||
if(name.length == 0)
|
||||
{
|
||||
$("#contest_name_span").text("<%= l(:label_search_conditions_not_null) %>");
|
||||
$("#contest_name_span").css('color','#ff0000');
|
||||
$("#contest_name_span").focus();
|
||||
$("#contest_name_span_head").text("<%= l(:label_search_conditions_not_null) %>");
|
||||
$("#contest_name_span_head").css('color','#ff0000');
|
||||
$("#contest_name_span_head").focus();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#contest_name_span").text("");
|
||||
$("#contest_name_span_head").text("");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function submitSerch()
|
||||
{
|
||||
if(regexName()){$("#contst_search_form").submit();}
|
||||
if(regexName1()){$("#contst_search_form").submit();}
|
||||
}
|
||||
</script>
|
||||
<div class="project-search">
|
||||
<%= form_tag({controller: 'contests', action: 'index'}, method: :get, :id => "contst_search_form") do %>
|
||||
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => 'regexName();' %>
|
||||
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => 'regexName1();', :width => "125px" %>
|
||||
<%= hidden_field_tag 'project_type', params[:project_type] %>
|
||||
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
||||
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="padding-top: 7px !important;">
|
||||
<%= l(:label_search)%>
|
||||
</a>
|
||||
<span id="contest_name_span"></span>
|
||||
<br />
|
||||
<span id="contest_name_span_head"></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
@ -11,9 +11,15 @@
|
|||
|
||||
<div class="table1">
|
||||
<div class='table_row1'>
|
||||
<div class='table_cell1 filename1' style='text-align: center;'><%=l(:label_attachment)%></div>
|
||||
<div class='table_cell1 filedown1'><%=l(:field_downloads)%></div>
|
||||
<div class='table_cell1 downicon1'><%=l(:button_download)%></div>
|
||||
<div class='table_cell1 filename1' style='text-align: center;'>
|
||||
<%=l(:label_attachment)%>
|
||||
</div>
|
||||
<div class='table_cell1 filedown1'>
|
||||
<%=l(:field_downloads)%>
|
||||
</div>
|
||||
<div class='table_cell1 downicon1'>
|
||||
<%=l(:button_download)%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<% if @content.current_version? %>
|
||||
<%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %>
|
||||
<%= watcher_link(@page, User.current) %>
|
||||
<%= link_to_if_authorized(l(:button_lock), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %>
|
||||
<%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %>
|
||||
<%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') %>
|
||||
<%#= link_to_if_authorized(l(:button_lock), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %>
|
||||
<%#= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %>
|
||||
<%#= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') %>
|
||||
<%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del') %>
|
||||
<% else %>
|
||||
<%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') %>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
|
||||
<% id = "journal_reply_ul_" + journal.id.to_s%>
|
||||
<% allow_delete ||= false%>
|
||||
<div id = '<%= id %>' >
|
||||
<% fetch_user_leaveWord_reply(journal).each do |reply|%>
|
||||
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name} %>
|
||||
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name, :allow_delete => allow_delete} %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<% parent_jour = JournalsForMessage.where("id = #{reply.m_reply_id}").first %>
|
||||
<% allow_delete ||= false %>
|
||||
<% if parent_jour%>
|
||||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
|
||||
|
@ -30,7 +31,7 @@
|
|||
<%= format_time reply.created_on %>
|
||||
</span>
|
||||
<span class="ping_disfoot" style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
|
||||
<% if User.current.admin? || reply.user.id == User.current.id%>
|
||||
<% if User.current.admin? || reply.user.id == User.current.id || allow_delete%>
|
||||
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
|
|
|
@ -1382,7 +1382,7 @@ zh:
|
|||
label_activity_time: 发布时间
|
||||
label_update_time: 更新时间
|
||||
label_current_contributors: 位当前贡献者
|
||||
label_commit_limit: 截止了,可补交
|
||||
label_commit_limit: 已截止,但可补交
|
||||
label_commit_ar: 作业提交截止时间快到了!
|
||||
lable_has_commit_homework: 您已提交过作业
|
||||
#modify by men
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20141201085218) do
|
||||
ActiveRecord::Schema.define(:version => 20141210070327) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
|
|
@ -36,6 +36,7 @@ div.loginForm{
|
|||
border-bottom: 1px dashed rgb(229, 229, 229);
|
||||
width: 95%;
|
||||
height: auto;
|
||||
min-height: 60px;
|
||||
}
|
||||
li {
|
||||
list-style-type: none;
|
||||
|
|
Loading…
Reference in New Issue