Merge branch 'develop' into 'develop'

本周任务上线



See merge request !164
This commit is contained in:
陈晓婷 2017-03-10 13:55:31 +08:00
commit 66553a2a5e
23 changed files with 2800 additions and 2666 deletions

View File

@ -475,7 +475,6 @@ class AdminController < ApplicationController
else
@limit = 15#per_page_option
end
@status = params[:status] || 1
scope = User.logged.status(@status)
scope = scope.like(params[:name],params[:search_by][:id]) if params[:name].present?
@ -483,8 +482,7 @@ class AdminController < ApplicationController
@user_pages = Paginator.new @user_count, @limit, params['page']
@user_base_tag = params[:id] ? 'base_users':'base'
@users = scope.offset(@user_pages.offset).limit(@user_pages.per_page)
@users = scope.order(sort_clause).offset(@user_pages.offset).limit(@user_pages.per_page).all
respond_to do |format|
format.html {
@groups = Group.all.sort

View File

@ -47,6 +47,8 @@ class AtController < ApplicationController
find_topic(id)
when 'JournalsForMessage'
find_journals_for_message(id)
when 'Journal'
find_journal(id)
when 'Principal'
find_principal(id)
when 'BlogComment'
@ -159,6 +161,12 @@ class AtController < ApplicationController
#Journal
def find_journal(id)
journal = Journal.find id
if journal.journalized_type == 'Issue'
issue_id = journal.issue.id
find_at_users(journal.journalized_type, issue_id)
end
end
#Document

View File

@ -121,7 +121,7 @@ class ForumsController < ApplicationController
order = ""
@order_str = ""
if(params[:reorder_complex])
order = " last_replies_memos.created_at #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}"
order = "last_replies_memos.created_at #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}"
@order_str = "reorder_complex="+params[:reorder_complex]
elsif(params[:reorder_popu])
order = "replies_count #{params[:reorder_popu]}"
@ -166,16 +166,16 @@ class ForumsController < ApplicationController
order = ""
@order_str = ""
if(params[:reorder_complex])
order = " last_replies_memos.created_at #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}"
order = "#{Memo.table_name}.sticky desc, last_replies_memos.created_at #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}"
@order_str = "reorder_complex="+params[:reorder_complex]
elsif(params[:reorder_popu])
order = "replies_count #{params[:reorder_popu]}"
order = "#{Memo.table_name}.sticky desc, replies_count #{params[:reorder_popu]}"
@order_str = "reorder_popu="+params[:reorder_popu]
elsif(params[:reorder_time])
order = "#{Memo.table_name}.updated_at #{params[:reorder_time]}"
order = "#{Memo.table_name}.sticky desc, #{Memo.table_name}.updated_at #{params[:reorder_time]}"
@order_str = "reorder_time="+params[:reorder_time]
else
order = "#{Memo.table_name}.updated_at desc"
order = "#{Memo.table_name}.sticky desc, #{Memo.table_name}.updated_at desc"
@order_str = "reorder_time=desc"
end
@memo = Memo.new(:forum => @forum)

View File

@ -50,6 +50,8 @@ class MemosController < ApplicationController
@memo = Memo.new(params[:memo])
@memo.forum_id = @forum.id
@memo.author_id = User.current.id
# 问吧置顶sticky:1 置顶0不置顶
@memo.sticky = params[:memo][:sticky].to_i
if params[:memo][:parent_id]
@memo.root_id = (Memo.find params[:memo][:parent_id]).root_id.nil? ? params[:memo][:parent_id].to_i : (Memo.find params[:memo][:parent_id]).root_id
@ -189,6 +191,14 @@ class MemosController < ApplicationController
end
end
#置顶功能
def change_sticky
@memo.sticky ? @memo.update_attribute(:sticky, false) : @memo.update_attribute(:sticky, true)
respond_to do |format|
format.html { redirect_to forum_memo_path(@memo.forum, @memo) }
end
end
private
def find_memo

View File

@ -64,6 +64,11 @@ class MessagesController < ApplicationController
#offset(@reply_pages.offset).
#all
#@replies = paginateHelper messages_replies,10
# 班级帖子消息设为已读
@replies.each do |comment|
course_message = CourseMessage.where(:course_message_id => comment.id, :user_id => User.current.id, :viewed => 0)
course_message.update_all(:viewed => 1)
end
@left_nav_type = 2
respond_to do |format|
format.js
@ -187,13 +192,15 @@ class MessagesController < ApplicationController
# @reply.reply_id = params[:id]
parent.children << @reply
else
@quote = params[:quote][:quote]
#@quote = params[:quote][:quote]
@reply = Message.new
@reply.author = User.current
@reply.board = @board
@reply.subject = @topic.subject
@reply.content = params[:content]
@reply.safe_attributes = params[:reply]
@reply.content = @quote + @reply.content
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
#@reply.content = @quote + @reply.content
#@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
@reply.root_id = @topic.id
@topic.children << @reply
# @reply.reply_id = params[:id]

View File

@ -160,7 +160,7 @@ class StudentWorkController < ApplicationController
student_work.name = params[:title]
student_work.description = params[:src]
if @homework.end_time < Time.now.to_s
if !is_test && @homework.end_time < Time.now.to_s
student_work.late_penalty = @homework.late_penalty
else
student_work.late_penalty = 0

View File

@ -2089,6 +2089,8 @@ class UsersController < ApplicationController
def show
if User.current == @user
# 点击小铃铛,更新点击时间
update_onclick_time if params[:click_user_message] == 'true'
# 全部设为已读
# 自己的主页显示消息
messages_all = MessageAll.where(:user_id => @user.id)

View File

@ -202,6 +202,7 @@ class VersionsController < ApplicationController
@is_setting = params[:is_setting]
@is_create = params[:is_create]
@is_index = params[:is_index]
@version_id = params[:id]
end
def update
@ -276,10 +277,11 @@ class VersionsController < ApplicationController
end
# 判断里程碑是否重名
# 项目内的里程碑不能重名,项目之间的里程碑能重名
def judge_version_title
begin
version = Version.where(:name => params[:version_name], :project_id => @project.id).first
if version.blank?
if version.blank? || version.id == params[:version_id].to_i
result = {:result => true}
else
result = {:result => false}

View File

@ -12,6 +12,9 @@
</div>
</div>
<script type="text/javascript">
$("#search_course_input").bind('change',function(e){
search_courses(e)
});
function school_submit() {
var checkboxs = $("input[name='school_id[]']:checked");
if(checkboxs.length == 0) {
@ -34,22 +37,9 @@
url: '<%= url_for(:controller => 'admin', :action => 'all_schools') %>'+'?search='+ e.target.value+'&school_id=<%=edit_id %>',
type:'get',
data: {is_observe:true},
success: function(data){ },
success: function(data){ },
beforeSend: function(){ $(this).addClass('ajax-loading'); },
complete: function(){ $(this).removeClass('ajax-loading'); }
});
}
function throttle(method,context,e){
clearTimeout(method.tId);
method.tId=setTimeout(function(){
method.call(context,e);
},500);
}
//查询项目
$("input[name='search']").on('input', function (e) {
throttle(search_courses,window,e);
});
</script>

View File

@ -24,4 +24,4 @@
<a href="javascript:void(0);" class="sendSourceText" onclick="hideModal();">取消</a>
</div>
</div>
<div class="cl"></div>
<div class="cl"></div>

View File

@ -122,18 +122,18 @@
<div id="new_course_topic">
<div class="homepagePostBrief c_grey">
<div>
<input type="text" name="message[subject]" id="message_subject" class="InputBox w713" maxlength="128" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布帖子,请先输入帖子标题" value="<%= topic.subject%>" >
<input type="text" name="message[subject]" id="message_subject" class="InputBox w713" maxlength="128" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布帖子,请先输入帖子标题" value="<%= topic.subject%>" >
<p id="subjectmsg"></p>
</div>
<div id="topic_editor" style="display: none;">
<%if User.current.member_of_course?(course) %>
<div class="mt10">
<% if User.current.id == course.tea_id %>
<%= f.check_box :sticky, :value => topic.sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<%= f.check_box :locked, :value => topic.locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %>
<% if User.current.id == course.tea_id %>
<%= f.check_box :sticky, :value => topic.sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<%= f.check_box :locked, :value => topic.locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %>
<div class="cl"></div>
</div>
<% end %>

View File

@ -26,8 +26,11 @@
<%= link_to image_tag(url_to_avatar(topic.author), :width => 50,:height => 50,:alt => '贴吧图片'), user_path(topic.author) if topic.author%>
</div>
<div class="postDetailWrap">
<div class="postDetailTitle fl">
<a href="<%= forum_memo_path(topic.forum, topic) %>" class="f14 linkGrey4 fb"><%=topic.subject%></a>
<div class="postDetailTitle" style="display: inline-block;">
<a href="<%= forum_memo_path(topic.forum, topic) %>" class="fl f14 linkGrey4 fb" style="max-width: 550px"><%= topic.subject %></a>
<% if topic.sticky && !params[:id].blank? %>
<span class="fl ml10 red-cir-btn">顶</span>
<% end %>
</div>
<div class="postDetailReply fr">
<a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a>

View File

@ -94,10 +94,10 @@
</div>
<div class="navHomepageNews" id="user_messages">
<%= link_to "", user_path(User.current), :class => "homepageNewsIcon", :target => "_Blank", :title => "您的所有消息" %>
<%= link_to "", user_path(User.current, :click_user_message => true), :class => "homepageNewsIcon", :target => "_Blank", :title => "您的所有消息" %>
<% new_message_count = User.current.count_new_message.to_i %>
<% if new_message_count > 0 %>
<div ><%= link_to new_message_count, user_path(User.current), :class => "newsActive", :target => "_Blank" %></div>
<div ><%= link_to new_message_count, user_path(User.current, :click_user_message => true), :class => "newsActive", :target => "_Blank" %></div>
<% end %>
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
<div class="shadowbox_news undis" id="user_messages_list">

View File

@ -6,7 +6,16 @@
<div class="wenba-tiwen-con">
<ul >
<li class="mb10">
<%= f.text_field :subject, :no_label => true, :id => "memo_subject", :maxlength => "50", :style => "width:708px", :onblur => "check_memo_name();", :onfocus => "$('#memo_name_error_tips').hide();", :onmouseover => "this.style.borderColor='#d9d9d9'", :class => "wenba-tiwen-input", :placeholder => "请输入标题" %>
<%= f.text_field :subject,
:no_label => true,
:id => "memo_subject",
:maxlength => "50",
:style => "width:708px",
:onblur => "check_memo_name();",
:onfocus => "$('#memo_name_error_tips').hide();",
:onmouseover => "this.style.borderColor='#d9d9d9'",
:class => "wenba-tiwen-input",
:placeholder => "请输入标题" %>
<p class="c_red" style="display: none" id="memo_name_error_tips"></p>
<script>
var textarea1 = document.getElementById('memo_subject');

View File

@ -33,6 +33,11 @@
<ul class="homepagePostSettiongText">
<% if @memo.author.id == User.current.id || User.current.admin? %>
<li><a href="<%= edit_forum_memo_path(@memo.forum,@memo)%>" class="postOptionLink">编辑</a></li>
<% if @memo.sticky %>
<li><a href="<%= change_sticky_forum_memo_path(@memo.forum,@memo) %>" class="postOptionLink">取消置顶</a></li>
<% else %>
<li><a href="<%= change_sticky_forum_memo_path(@memo.forum,@memo) %>" class="postOptionLink">置顶</a></li>
<% end %>
<% end %>
<li><a href="javascript:void(0);" class="postOptionLink" onclick="del_confirm();">删除</a></li>
<li style="display: none"><a href="<%= forum_memo_path(@memo.forum, @memo) %>" data-method="delete" id="del_memo_link" ></a></li>

View File

@ -32,7 +32,7 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>
@ -165,11 +165,21 @@
<em class="talkWrapArrow"></em>
<div class="cl"></div>
<div class="talkConIpt ml5 mb10" id="reply<%= @topic.id %>">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'project_board_cancel_message_replay();', :class => "grey_btn fr c_white mt10 mr5 ml10" %>
<%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'project_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %>
<% end %>
<div nhname='new_message_<%= @topic.id%>' style="display:none;">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%#= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
<%#= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'project_board_cancel_message_replay();', :class => "grey_btn fr c_white mt10 mr5 ml10" %>
<%#= link_to l(:button_submit), "javascript:void(0)", :onclick => 'project_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %>
<input type="hidden" name="journal_id" value="<%= @topic.id %>"/>
<div nhname='toolbar_container_<%= @topic.id %>' ></div>
<div class="cl"></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @topic.id%>' name="content"></textarea>
<div class="cl"></div>
<span nhname='contentmsg_<%= @topic.id%>' class="fl"></span>
<a id="new_message_submit_btn_<%= @topic.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<% end %>
</div>
<div class="cl"></div>
</div>
</div>

View File

@ -40,7 +40,17 @@
<li>&nbsp;&nbsp;</li>
</ul>
<ul class="setting_right ">
<li><%= f.text_field :login,:no_label=>true, :required => true, :style => "color:grey", :nh_required => "1", :name => "login", :class => "w210" %></li>
<li>
<%= f.text_field :login,
:no_label => true,
:required => true,
:style => "color:grey",
:disabled => 'disabled',
:nh_required => "1",
:name => "login",
:class => "w210"
%>
</li>
<% if @force %>
<li><%= f.text_field :mail,:no_label=>true, :required => true,:nh_required => "1",:class=>"w210",:disabled=>'disabled'%></li>
<% else %>

View File

@ -14,7 +14,7 @@
</li>
<li class="messageInformationContents">
<%= link_to message_content(ma.journals_for_message.notes),
feedback_path(ma.journals_for_message.jour_id,
feedback_path(ma.journals_for_message.reply_id == 0 ? ma.journals_for_message.jour_id : ma.journals_for_message.user_id,
:anchor => "user_activity_#{ma.journals_for_message.id}"),
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:target => '_blank'%>

View File

@ -75,7 +75,8 @@
url:"<%= judge_version_title_project_versions_path(:project_id => @project) %>",
type: "GET",
data: {
version_name: $.trim($("#popub_setting_version_name").val())
version_name: $.trim($("#popub_setting_version_name").val()),
version_id: <%= version_id %>
},
success:function(data){
if(data.result == true) {

View File

@ -1,4 +1,4 @@
var htmlvalue = "<%= escape_javascript(render :partial => 'versions/edit') %>";
var htmlvalue = "<%= escape_javascript(render :partial => 'versions/edit', :locals => {:version_id => @version_id}) %>";
pop_box_new(htmlvalue,820,316);
var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
$(function() { $('#version_effective_date2').datepicker(datepickerOptions);

View File

@ -476,6 +476,9 @@ RedmineApp::Application.routes.draw do
collection do
get "quote"
end
member do
get "change_sticky"
end
end
end

File diff suppressed because it is too large Load Diff

View File

@ -285,7 +285,7 @@ a.sortArrowActiveU {background:url(../images/post_image_list.png) -17px -20px no
.postDetailRow {width:720px; border-bottom:1px solid #efefef; padding:15px 0;}
.postDetailPortrait {width:50px; height:50px; float:left; margin-right:15px;}
.postDetailWrap {width:655px; float:left;}
.postDetailTitle {width:570px; max-width:570px; margin-bottom:5px;}
.postDetailTitle {max-width:600px; margin-bottom:5px;}
.postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;}
/*.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;}*/
.postDetailDes ol li{list-style-type: decimal;margin-left: 40px;}