Merge branch 'test', remote-tracking branch 'origin/szzh' into develop

exceptionHandle
yanxd 11 years ago
commit 2f47cc1cd8

@ -49,7 +49,7 @@ class ActivitiesController < ApplicationController
@activity_pages = Paginator.new @activity_count, @limit, params['page']
@offset ||= @activity_pages.offset
@project_base_tag = params[:id]?'base_projects':'base'
@project_base_tag = params[:id] ? 'base_projects' : 'base'
if events.empty? || stale?(:etag => [@activity.scope, @date_to, @date_from, @with_subprojects, @author, events.first, events.size, User.current, current_language])
respond_to do |format|
format.html {

@ -30,6 +30,7 @@ class AutoCompletesController < ApplicationController
@issues.compact!
end
render :layout => false
end
private

@ -74,7 +74,7 @@ class ContestsController < ApplicationController
def show_contest
@user = @contest.author
@jours = @contest.journals_for_messages.order('created_on DESC')
@jours = @contest.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@limit = 10
@feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']

@ -983,16 +983,17 @@ class ProjectsController < ApplicationController
end
# end
before_filter :toggleCourse, only: [:finishcourse, :restartcourse]
# TODO:#finishcourse and #restartcourse 没有设置权限也就是说任何人的调用都会关闭or重启课程。
# 最好通过用户与项目的权限解决这种事情。还没写
def finishcourse
course_prefs = Course.find_by_extra(@project.identifier)
#course_prefs = Course.find_by_extra(@project.identifier)
# setup_time = Time.parse(course_prefs.setup_time)
# end_time = Time.parse(course_prefs.endup_time)
yesterday = Date.today.prev_day.to_time
course_prefs.endup_time = yesterday
@save_flag = course_prefs.save
@course_prefs.endup_time = yesterday
@save_flag = @course_prefs.save
respond_to do |format|
format.js
@ -1000,11 +1001,11 @@ class ProjectsController < ApplicationController
end
def restartcourse
course_prefs = Course.find_by_extra(@project.identifier)
#course_prefs = Course.find_by_extra(@project.identifier)
day = Time.parse("3000-01-01")
course_prefs.endup_time = day
@save_flag = course_prefs.save
@course_prefs.endup_time = day
@save_flag = @course_prefs.save
respond_to do |format|
format.js {
@ -1014,6 +1015,13 @@ class ProjectsController < ApplicationController
end
private
def toggleCourse
@course_prefs = Course.find_by_extra(@project.identifier)
unless (@course_prefs.teacher == User.current || User.current.admin?)
render_403
end
end
def select_project_layout
project = Project.find_by_id(params[:id])

@ -59,7 +59,13 @@ module IssuesHelper
def issue_heading(issue)
#h("#{issue.tracker} ##{issue.id}")
h("#{issue.tracker} #{issue.source_from}")
#h("#{issue.tracker} #{issue.source_from}")
s = ''
s << ">>"
s << link_to(@issue.project.name+l(:issue_list), project_issues_path(@issue.project))
s << " >"
s << @issue.source_from
s.html_safe
end
def render_issue_subject_with_tree(issue)

@ -28,20 +28,32 @@ class Mailer < ActionMailer::Base
end
# Builds a Mail::Message object used to email recipients of the added journals for message.
#
# 留言分为直接留言,和对留言人留言的回复
# 字段说明在JournalsForMessage.rb
# 直接留言后 reply_id,m_parent_id 为空相对应的at_user取值为nil
def journals_for_message_add(user, journals_for_message)
@user = journals_for_message.user
if journals_for_message.jour_type!="Project"&&journals_for_message.jour_type!="Bid"
if(journals_for_message.reply_id==0)
@mail = journals_for_message.jour
else
@mail = journals_for_message.at_user
end
@message = journals_for_message.notes
@url = url_for(:controller => 'users', :action => 'user_newfeedback', :id => journals_for_message.jour)
str = "#{@user} #{t(:label_leave_your_message, :locale => 'zh')}"
mail :to => @mail.mail, :subject => str
end
@user = journals_for_message.user # 留言人
@mail = journals_for_message.jour if journals_for_message.at_user.nil? # 留言
@mail = journals_for_message.at_user if journals_for_message.at_user
@message = journals_for_message.notes
@title = "#@user #{t(:label_leave_your_message, :locale => 'zh')}"
@url = case journals_for_message.jour.class.to_s.to_sym # 判断留言的对象所属类型
when :Bid
respond_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Project
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Contest
show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :User
user_newfeedback_user_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
else
logger.error "[Builds a Mail::Message ERROR] journalsForMessage's jour is unkown type, journalsForMessage.id = #{journals_for_message.id}"
return -1
end
mail :to => @mail.mail, :subject => @title
end
# Builds a Mail::Message object used to email recipients of the added issue.

@ -3,5 +3,5 @@
'label' => "#{issue.tracker} ##{issue.id}: #{truncate issue.subject.to_s, :length => 60}",
'value' => issue.id
}
}.to_json
}.to_json
%>

@ -29,6 +29,6 @@
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
<ul>
</ul>
</div>

@ -1,10 +1,13 @@
<%
id = "finish_course_#{project.id}"
display = (project.course_extra.teacher.id == User.current.id )
display = (project.course_extra.teacher.id == User.current.id || User.current.admin?)
%>
<% if display && course_endTime_timeout?(project) #如果课程已结束%>
<%= link_to '重启课程', restartcourse_project_path(project), :remote => true, :method => :post, :id => id, :confirm => ('确定要重启课程?') %>
<% if display #如果课程已结束%>
<% linkPath = course_endTime_timeout?(project) ? restartcourse_project_path(project) : finishcourse_project_path(project, format: :js) %>
<% desc = course_endTime_timeout?(project) ? '重启' : '关闭' %>
<%= link_to "#{desc}课程", linkPath, :remote => true, :method => :post, :id => id, :confirm => ("确定要#{desc}课程?") %>
<% else %>
<%= link_to '关闭课程', finishcourse_project_path(project), :remote => true, :method => :post, :id => id, :confirm => ('确定要关闭课程?') %>
<!-- 关闭课程block -->
<% end %>

@ -14,7 +14,8 @@
<% if @issue.safe_attribute? 'tracker_id' %>
<p><%= f.select :tracker_id, @issue.project.trackers.collect {|t| [t.name, t.id]}, {:required => true},
:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')" %></p>
:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')" %></p>
<% end %>

@ -1,4 +1,5 @@
<%# html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
<% html_title "#{@issue.tracker.name} #{@issue.source_from}: #{@issue.subject}" %>
<%= render :partial => 'action_menu' %>

@ -4,5 +4,5 @@
<% end %>
$('#finish_course_<%=@project.id%>').replaceWith("<%= j(render partial: 'courses/set_course_time', :locals => {:project => @project} )%>")
<% else %>
alert('设置失败,请在论坛提交问题,等待管理员处理。');
alert('权限不足,设置失败,请在论坛提交问题,等待管理员处理。');
<% end %>

@ -76,6 +76,7 @@
</ul>
</div>
<div style="clear: both"></div>
<div>
<ul id="schoollist" style="line-height: 25px">

@ -96,22 +96,28 @@
<%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%></h3>
<span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
</div>
<div class="welcome-box-list-new">
<% find_new_forum_topics(7).each do |topic|%>
<li class="message-brief-intro" style="line-height: 1.63em;padding-bottom:3px;">
<div style="display: inline-block; width: 100%;">
<span style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;", :target => "_blank" %>
</span>
<br>
<span style="margin-left: 24px; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;"><%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前</span>
<span style="margin-left: 8px; margin-bottom: 0px; color: rgb(172, 174, 177) !important; white-space: nowrap;">
由&nbsp;<%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);", :target => "_blank" %>&nbsp;发表
</span>
<span style="float: right; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;">回复(<%= link_to (topic.parent ? topic.parent.replies_count : topic.replies_count), topic.event_url, :target => "_blank" %>)</span>
<div class="welcome-box-list-new memo_activity">
<% find_new_forum_topics(7).each do |topic|%>
<li class="message-brief-intro">
<div class='memo_title'>
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
</div>
<div class='memo_attr'>
<span class='memo_timestamp'>
<%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
</span>
<span class="memo_author">
楼主: <%= link_to_user(topic.author) %>
</span>
<span class="memo_last_person">
最后回复:<%=link_to_user topic.last_reply.try(:author) %>
</span>
<span class="memo_reply">
回复(<%= link_to topic.try(:replies_count), topic.event_url %>)
</span>
</div>
</li>
<% end %>
<% end %>
</div>
</ul>
</div>

@ -476,12 +476,16 @@ function observeAutocompleteField(fieldId, url, options) {
$(document).ready(function() {
$('#'+fieldId).autocomplete($.extend({
source: url,
select: function(e,ui){self.location="/issues/"+ui.item.value;},
minLength: 2,
search: function(){$('#'+fieldId).addClass('ajax-loading');},
response: function(){$('#'+fieldId).removeClass('ajax-loading');}
response: function(){$('#'+fieldId).removeClass('ajax-loading');
}
}, options));
$('#'+fieldId).addClass('autocomplete');
});
}
function observeSearchfield(fieldId, targetId, url) {

File diff suppressed because it is too large Load Diff

@ -1,3 +1,8 @@
/*
* 便
*/
/************************** 某部分开始 *****************************/
/************************** 某部分结束 *****************************/
.top_bar{
height: auto;
}
@ -285,8 +290,8 @@ div#tooltip::after {
background-color: #FCE6EA;
text-decoration: none;
border-top: 1px solid #FFFFFF;
border-left: 1px solid #FFFFFF:
border-bottom: 1px solid #717171;
border-left: 1px solid #FFFFFF;
border-bottom: 1px solid #717171;
border-right: 1px solid #717171;
}
.inner-content a:hover{
@ -376,4 +381,65 @@ a.attachments_list_color {
padding: 0 6px;
line-height: 1.3em;
margin-bottom: 3px;
}
}
/************************** 贴吧动态 开始 *****************************/
/*贴吧活动*/
.memo_activity{
}
/*帖子li*/
.memo_activity .message-brief-intro{
line-height: 1.76em;
padding:3px;
margin:3px;
}
/*帖子中的链接*/
.memo_activity a {
color: #105CB6;
}
/*帖子标题*/
.memo_activity .memo_title{
display: inline-block;
margin-bottom: 3px;
padding-left: 20px;
background: url('../images/list-icon.png') no-repeat scroll left center;
font-size: 10pt;
}
/*帖子的各种属性*/
.memo_activity .memo_attr{
margin-left: 20px;
}
/*帖子的时间*/
.memo_activity .memo_timestamp{
color: #999999;
white-space: nowrap;
font-size: 9pt;
}
/*帖子的作者*/
.memo_activity .memo_author{
margin-left: 8px;
margin-bottom: 0px;
color: #999999;
white-space: nowrap;
font-size: 9pt;
}
.memo_activity span a{
color: gray;
}
/*帖子的最后回复人*/
.memo_activity .memo_last_person{
margin-left: 8px;
margin-bottom: 0px;
color: #999999;
white-space: nowrap;
font-size: 9pt;
}
/*帖子的总回复数量*/
.memo_activity .memo_reply{
float: right;
color: rgb(172, 174, 177);
white-space: nowrap;
font-size: 10pt;
}
/************************** ****************************

@ -66,7 +66,9 @@ a
.action-settings #header h1:before
{
font-family: Fontawesome;
/* content: "\f0f0 ";*/
padding-right: 5px;
}
/*by young*/
.action-settings #header h1:before
@ -190,11 +192,7 @@ a
.controller-gantts #header h1:before
{
font-family: Fontawesome;
/* content: "\f080";*/
padding-right: 5px;
}
@ -210,25 +208,16 @@ a
.controller-welcome #header h1:before
{
font-family: Fontawesome;
/* content: "\f015 ";*/
/* content: "\f015 ";*/
padding-right: 5px;
font-weight: 100;
}
.controller-users #header h1:before
{
font-family: Fontawesome;
padding-right: 5px;
}
/* content: "\f0f0 ";*/
padding-right: 5px;
}
/*end*/
@ -373,11 +362,10 @@ ul.projects li.root
background-color:#fff; /*顶层导航颜色*/
color: #fff;
font-size:13px; /* bai */
font-family: ;
font-family: "Microsoft YaHei";
position:relative;
padding:0;
height:1px;
padding-top:0;
/*by bai*/
border-radius: 5px;/*导航栏边角变圆*/
/*end*/
@ -403,7 +391,6 @@ ul.projects li.root
{
/*by young*/
color:#fff; /*the color of the fonts*/
font-weight:6px;
padding:4px 3px
}
@ -454,7 +441,7 @@ ul.projects li.root
#main.nosidebar #content_
{
width:auto;
float:center;
/*float:center;*/
min-height:800px;
border: 1px solid #ffffff;
}
@ -537,7 +524,7 @@ ul.projects li.root
margin:4px 20px 20px;
padding-bottom:15px;
text-align:left
font-size: 18px;
/*font-size: 18px;*/
}
#footer a:hover
@ -664,8 +651,8 @@ div.splitcontentleft h2
position:relative;
z-index: 2;
background: #fff;*/
font-family:, "PT Sans", Helvetica, Arial;
font: color: #FFF;
/*font-family:"Microsoft YaHei", "PT Sans", Helvetica, Arial;*/
/*font: color: #FFF;*/
transition:all .4s linear;
-moz-transition:all .4s linear;
-o-transition:all .4s linear;
@ -695,8 +682,9 @@ div.splitcontentleft h2
}
#top-menu li a.my-page:before {
font-family: Fontawesome;
content: "\f0c9 ";
content: "\f0c9 ";
/* content: "\f0f0 ";*/
}
/*by young*/
#top-menu li a.home:before {
font-family: Fontawesome;
@ -745,9 +733,6 @@ div.splitcontentleft h2
content: "\f08b ";
}
/* content: "\f0f0 ";*/
}
#top-menu #account a.logout:before {
font-family: Fontawesome;
/* content: "\f08b ";*/
@ -1065,7 +1050,7 @@ input[type="submit"]
html > body #content
{
min-height:auto!important
/*min-height:auto !important;*/
}
pre,code,.line-code
@ -1479,7 +1464,6 @@ div.pagination span {
-moz-border-bottom-colors: none;
border-image: none;
}
}
div.pagination span.current-page {
/*color: rgb(153, 153, 153); add by huang*/
@ -1548,7 +1532,6 @@ div.pagination_new span {
-moz-border-bottom-colors: none;
border-image: none;
}
}
div.pagination_new span.current-page {
color: rgb(153, 153, 153);
@ -1745,7 +1728,7 @@ div.project-search-block {
margin-bottom: 0px;
padding: 10px;
width: 95%;
border-top 1px solid rgb(242,242,242);
border-top: 1px solid rgb(242,242,242);
/*border-bottom: 1px solid rgb(223, 223, 223);*/
margin-left: auto;
margin-right: auto;
@ -1833,7 +1816,7 @@ a.usage {
/*end*/
a.bid_user {
font-family:;
font-family:"Microsoft YaHei";
color:#acaeb1;
font-size:12px;
}
@ -1850,7 +1833,7 @@ a.bid_course{
}
a.bids_user {
font-family:;
font-family:"Microsoft YaHei";
color:#15bccf;
font-size:14px;
font-weight: bold;
@ -1866,10 +1849,10 @@ input[type='text'].noline {
.noline {
/*border-style: none;
border-color: white;*/
font-family:; /*modify by men*/
font-family:"Microsoft YaHei"; /*modify by men*/
border: #d5dee9 1px solid;
font-size: 12px;
color: #818283; # modified by bai
color: #818283;
padding: 9px 5px;
width: 98%;
cursor: text;
@ -2096,7 +2079,7 @@ ul.message-for-user {
list-style-type: none;
margin: 0px;
padding: 0px;
font-family: ,Verdana,sans-serif,;
font-family: "Microsoft YaHei",Verdana,sans-serif,simsun;
text-align: left;
font-size: 10pt;
width: 100%;

Loading…
Cancel
Save