Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

Conflicts:
	db/schema.rb
This commit is contained in:
cxt 2017-03-03 15:37:55 +08:00
commit 95595c6fe6
13 changed files with 133 additions and 167 deletions

View File

@ -756,7 +756,7 @@ class AdminController < ApplicationController
# 单位审核:批准
# 消息发送,发送对象为申请人
# status: 0表示未批准 status1表示已批准 status 2表示已更改 status 3表示已拒绝
# status: 0表示未批准 status1表示已批准 status 2表示已更改 status 3表示已拒绝 status: 4表示已更改后废除的高校
def approve_applied_schools
applied_school = ApplyAddSchools.find params[:id]
applied_message_id = applied_school.school_id
@ -783,8 +783,8 @@ class AdminController < ApplicationController
begin
#更新消息表的status
applied_message_id = aas.school_id
#applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddSchools")
#applied_message.update_all(:status => 2)
applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddSchools")
applied_message.update_all(:status => 4)
aas.update_attribute(:status, 2)
AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school[0].name )
users = UserExtensions.where("school_id = #{aas.school_id}")

View File

@ -79,7 +79,7 @@
<%#= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
<!--REDO: 权限测试-->
<% if User.current.member_of?(@project) %>
<input class="blueBtn fr mr5" value="上传资源" onclick="project_files_upload();">
<a href="#" class="blue-btn fr mr5" value="上传资源" onclick="project_files_upload();">上传资源</a>
<%= link_to("导入资源", import_resources_user_path(User.current, :type => 6, :project_id => @project.id), :class => "blue-btn fr mr5", :remote => true) %>
<!--<input class="blueBtn fr mr5" value="导入资源" onclick="project_files_import();">-->
<% end %>

View File

@ -259,9 +259,11 @@
<% update_visiti_count @user %>
<div class="">
<ul class="home-user-footerinfo">
<li><i class="icon-map-marker mr5 ml10 f14"></i>
<span><%= @user.user_extensions.location %><% unless @user.user_extensions.location_city.blank? %>-<%= @user.user_extensions.location_city %><% end %></span>
</li>
<% unless @user.user_extensions.location.blank? %>
<li><i class="icon-map-marker mr5 ml10 f14"></i>
<span><%= @user.user_extensions.location %>-<%= @user.user_extensions.location_city %></span>
</li>
<% end %>
<li><i class="icon-time mr5 ml10 f14"></i><span><%= @user.created_on.strftime('%Y-%m-%d') %>开始使用</span></li>
<li style="color:#b3b3b3"><i class="icon-eye-open mr5 ml10 f14"></i><span><%= @user.visits.to_i %>次访问自2016年5月</span></li>
</ul>

View File

@ -6,8 +6,8 @@
<% message.update_attribute(:viewed, true)%>
</div>
<% end %>
<div class="homepageRightBanner" style="border-bottom:2px solid #ddd;">
<div class="polls_head" style="color:red; font-size:17px;">&nbsp;&nbsp;提示:&nbsp;&nbsp;您尚未完善您的基本资料,完善后可使用更多功能</div>
<div class="alert alert-orange mb10 mt10" >
<div >&nbsp;&nbsp;提示:&nbsp;&nbsp;您尚未完善您的基本资料,完善后可使用更多功能</div>
</div>
<% end %>
<div id="RSide" style="margin-left:0px; margin-bottom:0px; width:728px;">

View File

@ -1,85 +1,59 @@
<% unless activity.author.nil? %>
<div class="issues_list_box clear" id="user_activity_<%= user_activity_id%>">
<div class="issues_ciricons fl ">
<% if activity.status_id.to_i == 5 %>
<span class="issues_ciricons_02"></span>
<% else %>
<span class="issues_ciricons_01"></span>
<% end %>
</div>
<div class=" fl ml5">
<div class="issues_list_titlebox clear">
<a href="<%= issue_path(activity) %>" class="issues_list_title fl" style="width: 400px" target="_blank" title="<%= activity.subject.to_s %>"><%= activity.subject.to_s %></a>
<div class="cl"></div>
</div>
<div class="issues_list_small">
<p class="fl issues_list_name" ><span class="mr5"><%= format_time(activity.created_on) %> </span>发布</p>
<p class="fl ml10"> <span class="mr5"><%= format_time(activity.updated_on) %> </span>更新</p>
</div>
</div>
<ul class="issues_list_txt fr">
<li class=" c_grey issues_list_max mr5">
<%= Project.find(activity.project_id).name %>
</li>
<li class="issues_list_min c_grey">
<% case activity.tracker_id %>
<% when 1 %>
缺陷
<% when 2 %>
功能
<% when 3 %>
支持
<% when 4 %>
任务
<% when 5 %>
周报
<% end %>
</li>
<li class="c_grey">
<% if !activity.assigned_to_id.nil? && activity.assigned_to_id != 0 %>
<% if activity.try(:assigned_to).try(:realname).blank? %>
<%= link_to activity.assigned_to, user_path(activity.assigned_to_id)%>
<% else %>
<%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id)%>
<% end %>
<% end %></li>
<li class="issues_list_min c_grey">
<%= activity.priority.name %>
</li>
<li class="c_grey issues_list_max" title="<%= activity.fixed_version %>"><%= activity.fixed_version %></li>
<li class="issues_list_min c_grey mr5" ><%= activity.status.name %></li>
<li class="<%= (activity.done_ratio == 100 ? 'c_green issues_list_min mr5' : 'c_red issues_list_min mr5') %>"><%= activity.done_ratio %>%</li>
<li class="issues_list_min">
<% if activity.journals.count > 0 %>
<span class="issues_icons_mes fl mr5 mt12"></span>
<span class="fl mr5"><%= activity.journals.count %></span>
<% end %>
</li>
</ul>
<tr>
<td>
<div class="issues_ciricons fl ml15">
<% if activity.status_id.to_i == 5 %>
<span class="issues_ciricons_02"></span>
<% else %>
<span class="issues_ciricons_01"></span>
<% end %>
</div>
<div class=" fl ml5">
<div class="issues_list_titlebox clear">
<a href="<%= issue_path(activity) %>" class="issues_list_title fl" target="_blank" title="<%= activity.subject.to_s %>">
<%= activity.subject.to_s %>
</a>
<div class="cl"></div>
</div>
<div class="issues_list_small">
<p class="fl issues_list_name" ><span class="mr5"><%= format_time(activity.created_on) %></span>发布</p>
<p class="fl ml10"> <span class="mr5"><%= format_time(activity.updated_on) %></span>更新</p>
</div>
</div>
</td>
<td><span class="w100"> <%= Project.find(activity.project_id).name %></span></td>
<td>
<% case activity.tracker_id %>
<% when 1 %>
缺陷
<% when 2 %>
功能
<% when 3 %>
支持
<% when 4 %>
任务
<% when 5 %>
周报
<% end %>
</td>
<td>
<% if !activity.assigned_to_id.nil? && activity.assigned_to_id != 0 %>
<% if activity.try(:assigned_to).try(:realname).blank? %>
<%= link_to activity.assigned_to, user_path(activity.assigned_to_id)%>
<% else %>
<%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id)%>
<% end %>
<% end %>
</td>
<td><%= activity.priority.name %></td>
<td title="<%= activity.fixed_version %>"><%= activity.fixed_version %></td>
<td><%= activity.status.name %></td>
<td><span class="<%= (activity.done_ratio == 100 ? 'c_green' : 'c_red') %>"><%= activity.done_ratio %>%</span></td>
<td>
<% if activity.journals.count > 0 %>
<a href="javascript:void(0);" class="issues_icons_mes fl mr5 ml5 "></a>
<a href="javascript:void(0);" class="fl mt2"><%= activity.journals.count %></a>
<% end %>
</td>
</tr>
<% end %>
<script>
$(".issues_list_box").mouseover(function(){
var iconOrder;
var iconSize = $(this).children().eq(2).children().eq(7).children().size();
if(iconSize > 1){
iconOrder = 2;
} else{
iconOrder = 0;
}
$(this).children().eq(2).children().eq(7).children().eq(iconOrder).show();
});
$(".issues_list_box").mouseout(function(){
var iconOrder;
var iconSize = $(this).children().eq(2).children().eq(7).children().size();
if(iconSize > 1){
iconOrder = 2;
} else{
iconOrder = 0;
}
$(this).children().eq(2).children().eq(7).children().eq(iconOrder).hide();
});
</script>

View File

@ -1,24 +1,3 @@
<% issue_list(issues) do |issue| -%>
<script>
$(function () {
sd_create_editor_from_data(<%= issue.id %>, null, "100%", "<%= issue.class.name %>");
});
</script>
<%= render :partial => 'users/my_manage_issue_list', :locals => {:activity => issue, :user_activity_id => issue.id} %>
<% end %>
<div style="text-align:left;">
<div style="width:auto; display:inline-block;">
<ul>
<%= link_to "导出EXCEL", user_manage_issues_user_path(:format => 'xls'), :class => "hw_btn_blue ml10 mt10 mb10", :id => "sendexcel",
:onclick => "remote_function_export('#{User.current}')"%>
</ul>
</div>
<div class="pages fr" style="width:auto; display:inline-block;margin-top:10px">
<ul id="issue_list_pagination" class="fr">
<%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>
<% end %>

View File

@ -1,5 +1,5 @@
<!-- 申请添加单位 -->
<% if ma.applied_type == "ApplyAddSchools" %>
<% if ma.applied_type == "ApplyAddSchools" && ma.status != 4 %>
<ul class="homepageNewsList fl">
<div class="longMessageWidth">
<li class="homepageNewsPortrait fl">

View File

@ -10,6 +10,6 @@
<%= link_to "“"+ma.name+"”" + "的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", { :controller=> "my",:action => "account" }, :title => "“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%>
<% elsif ma.status == 0 %>
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank'>
<%= link_to User.where("id=?", ma.applied_user_id).first.show_name + "提交了申请:添加新的单位“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %>
<%= link_to "“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %>
</a>
<% end %>

View File

@ -45,7 +45,6 @@ $('#reply_div_<%= params[:div_id].to_i %>').html('<%= escape_javascript(render :
:locals => {:comments => @journals,
:user_activity_id => @user_activity_id,
:activity => @activity}) %>');
sd_create_editor_from_data(<%= @user_activity_id %>, null, "100%", "UserActivity");
<% elsif params[:type] == 'is_project_message' %>
$('#reply_div_<%= params[:div_id].to_i %>').html('<%= escape_javascript(render :partial => 'projects/project_message_replies',
:locals => {:comments => @journals,
@ -53,3 +52,5 @@ sd_create_editor_from_data(<%= @user_activity_id %>, null, "100%", "UserActivity
:type => @type,
:activity_id => params[:id].to_i}) %>');
<% end %>
// 创建回复框
sd_create_editor_from_data(<%= @user_activity_id %>, null, "100%", "UserActivity");

View File

@ -214,10 +214,10 @@
});
});
$(document).ready(function(){
if($.browser.webkit){
if($.browser.webkit){
$("#issues_filter_por").css("padding-left","5px");
$("#issue_filter_status").css("padding-left","15px");
}
}
});
</script>
@ -254,52 +254,47 @@
<div id="turnover_time" class="w65 fl"><a href="javascript:void(0);" class="linkGrey2 fl">更新时间</a><a href="javascript:void(0);" id="reorder_turnover_time" class="sortArrowActiveD"></a></div>
</div>
</div>
<div class="issues_con_list" style="position: relative;">
<ul id="issues_list_nav" >
<li id="issues_list_nav_1" class="issues_nav_hover" onclick="HoverLi(1);all_reset_form();">
<a href="javascript:void(0);" id="issues_type_1" onclick="all_reset_form();" >搜索结果</a>
<span id="issue_filter_all"><%= render :partial => "users/my_issue_filter_all" %></span>
</li>
<div class="cl"></div>
</ul>
<div class="issues_filter">
<div class="my_issues_form_filter mt5">
<table class="issues-table mb10" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th ><p class="text-left">搜索结果<span class="issues_nav_tag ml5" style=" font-weight: normal;" id="issue_filter_all"><%= @issue_count %></span></p></th>
<th class="w100">
<%= select( :project, :project_id, options_for_issue_project_list(@issues_filter),
{ :include_blank => false,:selected => @project_id ? @project_id : 0 },
{ :onchange => "remote_function();add_style();", :id => "project_id", :name => "project_id", :class => "fl", :style => "margin: 0 15px;text-align: left;"}
)%>
<select class="my_issues_filter" disabled="disabled" style="width: 50px;;padding-left: 10px;text-align: left;">
<option value="0" selected="selected">类型</option>
</select>
<select class="my_issues_filter" disabled="disabled" style="width: 65px;padding-left: 10px;text-align: left;">
<option value="0" selected="selected">指派给</option>
</select>
<%= select( :issue, :user_id, [[@user.show_name, @user.id]].unshift(["指派给",0]),
{ :include_blank => false, :selected => @assigned_to ? @assigned_to : 0},
{:onchange=>"remote_function();add_style();",:id => "assigned_to_id",:name => "assigned_to_id", :class => "fl", :style => "visibility:hidden; width:0px;margin:0px;padding:0px;"} )
%>
<select class="my_issues_filter" disabled="disabled" style="width: 50px;text-align: left;" id="issues_filter_por">
<option value="0" selected="selected">优先度</option>
</select>
<select class="my_issues_filter" disabled="disabled" style="width: 80px;padding-left: 20px;text-align: left;">
<option value="0" selected="selected">里程碑</option>
</select>
<select class="my_issues_filter" disabled="disabled" style="width: 60px;padding-left: 10px;text-align: left;" id="issue_filter_status">
<option value="0" selected="selected">状态</option>
</select>
<select class="my_issues_filter" disabled="disabled" style="width: 50px;text-align: left;">
<option value="0" selected="selected">完成度</option>
</select>
</div>
{ :include_blank => false, :selected => @project_id ? @project_id : 0 },
{ :onchange => "remote_function();add_style();", :id => "project_id", :name => "project_id" }
)%>
</th>
<th class="w50">类型</th>
<th class="w50">指派给</th>
<th class="w50">优先度</th>
<th class="w50">里程碑</th>
<th class="w50">状态</th>
<th class="w50">完成度</th>
<th class="w50">&nbsp;</th>
</tr>
</thead>
<tbody id="issue_list">
<% if @issues.empty? %>
<p class="nodata mt10"><%= l(:label_no_data) %></p>
<% else %>
<%= render :partial => 'users/user_manage_issue_list', :locals => {:issues => @issues, :issue_pages => @issue_pages, :issue_count => @issue_count, :subject => @subject } %>
<% end %>
</tbody>
</table>
<div style="text-align:left;">
<div style="width:auto; display:inline-block;">
<ul>
<%= link_to "导出EXCEL", user_manage_issues_user_path(:format => 'xls'), :class => "hw_btn_blue mb10", :id => "sendexcel",
:onclick => "remote_function_export('#{User.current}')"%>
</ul>
</div>
<div class="pages fr" style="width:auto; display:inline-block;margin-top:0px;margin-right:0px;">
<ul id="issue_list_pagination" class="fr">
<%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
<% end %>
<% if @issues.empty? %>
<p class="nodata mt10"><%= l(:label_no_data) %></p>
<% else %>
<div id="issue_list">
<%= render :partial => 'users/user_manage_issue_list', :locals => {:issues => @issues, :issue_pages => @issue_pages, :issue_count => @issue_count, :subject => @subject } %>
</div>
<% end %>
</div>

View File

@ -1,3 +1,6 @@
$("#issue_filter_all").html("<%= escape_javascript(render :partial => 'users/my_issue_filter_all') %>");
$("#issue_list").html("<%= escape_javascript(render :partial => 'users/user_manage_issue_list',:locals => {:issues => @issues, :issue_pages=> @issue_pages, :issue_count => @issue_count })%>");
$("#issue_filter_all").html("<%= @issue_count %>");
$("#issue_list").html("<%= escape_javascript(render :partial => 'users/user_manage_issue_list',
:locals => {:issues => @issues,
:issue_pages=> @issue_pages,
:issue_count => @issue_count })%>");
$("#issue_list_pagination").html('<%= pagination_links_full @issue_pages, @issue_count, :issues => @issues, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');

View File

@ -0,0 +1,8 @@
class UpdateStatusForAppliedMessages < ActiveRecord::Migration
def up
AppliedMessage.where(:applied_type => "ApplyAddSchools", :status => 0).update_all(:status => 4)
end
def down
end
end

View File

@ -661,12 +661,14 @@ a:hover.pro-fenzhi-a{color:#3b94d6;}
.pro-task-new-con input{ border:1px solid #c8c8c8; height: 28px; width: 200px; color: #888;}
.pro-task-new-con textarea{ width: 881px;border:1px solid #c8c8c8;}
.pro-task-new-con input.input-big{ width: 881px;}
.issues-table{ width: 100%;}
.issues-table select{ border: none; width: 100px; color:#888; font-weight: bold;appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("../images/project/arrow.png") no-repeat scroll right center transparent;}
.issues-table{ width: 100%; border:1px solid #c8c8c8; border-bottom: none;}
.issues-table select{ border: none; color:#888; font-weight: bold; text-align: center; width:50px; padding-left:0; -webkit-appearance: none;appearance: none;
-moz-appearance: none; background: url("/images/new_project/arrow.png") no-repeat scroll right center transparent;}
.issues-table tr th{ height: 40px; border-bottom:1px solid #e5e5e5; color: #888;}
.issues-table p.text-left{ text-align: left; color: #333; border-bottom: 3px solid #3498db; display: block; width: 100px; height:40px; line-height: 40px; padding-left:15px;}
.issues-table tr td{ padding:10px 0; border-bottom: 1px dashed #c8c8c8; text-align: center; color:#888;}
.issues-table tr td.w50{ width: 60px;}
.issues-table tr td{ padding:10px 0; border-bottom: 1px solid #e5e5e5; text-align: center; color:#888;}
.issues-table tr td.w50{ width: 50px;}
.issues-table tr td.w100{ width: 100px;}
.issues-table tbody tr:hover{ background:#f2f2f2;}
.issues-table tr td span.w100{ display: inline-block; width: 100px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis; }
span.task-linebtn-green{color:#59af48; border: 1px solid #59af48;font-size: 12px; padding: 0 5px; border-radius: 3px;line-height: 14px;}
@ -676,3 +678,5 @@ span.task-step{ color:#ee4a20;font-style: italic; font-weight:bold; font-size:14
.task-bgrey{background:#ccc;}
.task-title{ width: 830px;}
a.task-list-title{ max-width: 700px;}