Merge branch 'weixin_guange' of https://git.trustie.net/jacknudt/trustieforge into weixin_guange
commit
9e6575211f
@ -0,0 +1,56 @@
|
||||
<%= stylesheet_link_tag 'css/common','css/popup' %>
|
||||
|
||||
<div class="boxContainer" style="height: auto;">
|
||||
<div class="sendText fl mr10" style="width: auto">更改为</div>
|
||||
<div class="cl"></div>
|
||||
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
|
||||
<div>
|
||||
<!--<input type="text" name="search" placeholder="输入班级ID或者名称搜索" class="subjectSearch fr" />-->
|
||||
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入名称搜索" class="mt10 mb10 course-search" />
|
||||
</div>
|
||||
<div id="schools_list">
|
||||
<%= render :partial => "admin/update_school_form", :locals => {:schools => schools, :edit_id => edit_id} %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function school_submit() {
|
||||
var checkboxs = $("input[name='school_id[]']:checked");
|
||||
if(checkboxs.length == 0) {
|
||||
$("#choose_courses_notice").text("请先选择班级");
|
||||
} else{
|
||||
$("#choose_courses_notice").text("");
|
||||
$("#schools_list_form").submit();
|
||||
hideModal();
|
||||
}
|
||||
}
|
||||
var lastSearchCondition = '';
|
||||
var count = 0;
|
||||
function search_courses(e){
|
||||
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||
{
|
||||
return;
|
||||
}
|
||||
lastSearchCondition = $(e.target).val().trim();
|
||||
$.ajax({
|
||||
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){ },
|
||||
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>
|
@ -0,0 +1,6 @@
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><%= link_to '未审批', {:action => 'applied_schools'}, class: "#{current_page?(unapplied_schools_path)? 'selected' : nil }" %></li>
|
||||
<li><%= link_to '已审批', {:action => 'has_applied_schools'}, class: "#{current_page?(applied_schools_path)? 'selected' : nil }" %></li>
|
||||
</ul>
|
||||
</div>
|
@ -0,0 +1,27 @@
|
||||
<%= form_tag admin_edit_applied_schools_path(:applied_id =>edit_id), :id => 'schools_list_form' %>
|
||||
<div>
|
||||
<%#= hidden_field_tag(:send_id, edit_id) %>
|
||||
<div class="courseReferContainer">
|
||||
<% if !schools.empty? %>
|
||||
<% schools.each do |school| %>
|
||||
<ul class="courseSend">
|
||||
<li class="" style="display:inline-block">
|
||||
<input name="school_id[]" type="radio" value="<%= school.id %>" class="courseSendCheckbox"/>
|
||||
</li>
|
||||
<li class="sendCourseName"><%= truncate(school.name, :lendght => 25)%></li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span id="choose_courses_notice" class="c_red"></span>
|
||||
<div>
|
||||
<div class="courseSendSubmit">
|
||||
<a href="javascript:void(0);" onfocus='this.blur();' onclick="school_submit();" class="sendSourceText">确定</a>
|
||||
</div>
|
||||
<div class="courseSendCancel">
|
||||
<a href="javascript:void(0);" class="sendSourceText" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
@ -0,0 +1,11 @@
|
||||
<% if params[:search].nil? %>
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'admin/all_schools', :locals => {:schools => @schools, :edit_id => @edit_id}) %>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
<% else %>
|
||||
$("#schools_list").html("<%= escape_javascript(render :partial => 'admin/update_school_form', :locals => {:schools => @schools, :edit_id => @edit_id}) %>");
|
||||
<% end %>
|
@ -0,0 +1,90 @@
|
||||
<h3>
|
||||
<%=l(:label_applied_shcools)%>
|
||||
</h3>
|
||||
|
||||
<%= render 'tab_has_applied_applied' %>
|
||||
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<fieldset>
|
||||
<label for='name'>
|
||||
单位名称:
|
||||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %>
|
||||
<%= submit_tag l(:button_apply ), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_shcools'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="autoscroll" id = "applied_school">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 85px;">
|
||||
单位名称
|
||||
</th>
|
||||
<th style="width: 75px;">
|
||||
地区
|
||||
</th>
|
||||
<th style="width: 75px;">
|
||||
详细地址
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
用户
|
||||
</th>
|
||||
<th style="width: 60px;">
|
||||
创建时间
|
||||
</th>
|
||||
<th style="width: 75px;">
|
||||
操作
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @apply_status.each do |apply| %>
|
||||
<% if apply.status == 0 %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: center;">
|
||||
<%= apply.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=apply.name%>' id="apply_title_<%= apply.id %>">
|
||||
<%= apply.name %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= apply.province + apply.city %>
|
||||
</td>
|
||||
<td align="left" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<%= apply.address %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<% count = UserExtensions.where("school_id = #{apply.school_id}").count %>
|
||||
<%= count %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(apply.created_at) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= link_to( l(:label_approve), { :controller => 'admin', :action => 'approve_applied_schools', :id => apply.id }, :class => 'icon-del') %>
|
||||
<%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id },:method => :delete, :confirm => l(:text_are_you_sure), :class => 'icon-del') %>
|
||||
<%=link_to '更改', admin_all_schools_path(:school_id =>apply.id), :remote => true %>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<% unless apply.remarks.empty? %>
|
||||
<tr class="odd">
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td style="text-align: left;" colspan="6">
|
||||
<%= apply.remarks %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,86 @@
|
||||
<h3>
|
||||
<%=l(:label_applied_shcools)%>
|
||||
</h3>
|
||||
|
||||
<%= render 'tab_has_applied_applied' %>
|
||||
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<fieldset>
|
||||
<label for='name'>
|
||||
单位名称:
|
||||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %>
|
||||
<%= submit_tag l(:button_apply ), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_shcools'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 85px;">
|
||||
单位名称
|
||||
</th>
|
||||
<th style="width: 75px;">
|
||||
地区
|
||||
</th>
|
||||
<th style="width: 75px;">
|
||||
详细地址
|
||||
</th>
|
||||
<th style="width: 85px;">
|
||||
原名
|
||||
</th>
|
||||
<th style="width: 60px;">
|
||||
创建时间
|
||||
</th>
|
||||
<th style="width: 75px;">
|
||||
操作
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @has_apply_status.each do |apply| %>
|
||||
<% if apply.status == 1 || apply.status == 2%>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: center;">
|
||||
<%= apply.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=apply.name%>' id="apply_title_<%= apply.id %>">
|
||||
<%= (School.find apply.school_id).name %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= (School.find apply.school_id).province %>
|
||||
</td>
|
||||
<td align="left" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<%= apply.address %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= apply.name %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(apply.created_at) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id },:method => :delete, :confirm => l(:text_are_you_sure), :class => 'icon-del') %>
|
||||
</td>
|
||||
</tr>
|
||||
<% unless apply.remarks.empty? %>
|
||||
<tr class="odd">
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td style="text-align: left;" colspan="6">
|
||||
<%= apply.remarks %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,34 @@
|
||||
<% if ma.class == AppliedMessage %>
|
||||
<!--申请加入项目-->
|
||||
<% if ma.applied_type == "ApplyAddSchools" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %></a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<% if ma.status == 1 %>
|
||||
<%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
|
||||
<li class="homepageNewsContent fl">
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank'><%= ma.name %>的申请,已通过</a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
<% elsif ma.status == 2 %>
|
||||
<%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
|
||||
<li class="homepageNewsContent fl">
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank'><%= ma.applied.name %>的申请,因名称不合法,系统已将其更改为“<%= ma.name %>”</a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
<% elsif ma.status == 3 %>
|
||||
<%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.name + "的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", { :controller=> "my",:action => "account" } %>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
@ -0,0 +1,13 @@
|
||||
class CreateAppliedMessages < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :applied_messages do |t|
|
||||
t.integer :user_id
|
||||
t.integer :applied_id
|
||||
t.string :applied_type
|
||||
t.integer :viewed, :default => false
|
||||
t.integer :status, :default => false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddNameToAppliedMessage < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :applied_messages, :name, :string
|
||||
end
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
FactoryGirl.define do
|
||||
factory :applied_message do
|
||||
user_id 1
|
||||
applied_id 1
|
||||
applied_type "MyString"
|
||||
viewed 1
|
||||
status 1
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe AppliedMessage, :type => :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in new issue