commit
a1a2b3dd33
@ -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,78 @@
|
||||
<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: 20px;">
|
||||
用户
|
||||
</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="odd">
|
||||
<td style="text-align: center;">
|
||||
<%= apply.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=apply.name%>' id="schools_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">
|
||||
<%= apply.user_id %>
|
||||
</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 }, :class => 'icon-del') %>
|
||||
<%= link_to( l(:button_change), { :controller => 'admin', :action => 'edit_applied_schools', :id => apply.id, :name => apply.name }, :class => 'icon-del') %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,77 @@
|
||||
<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: 20px;">
|
||||
用户
|
||||
</th>
|
||||
<th style="width: 60px;">
|
||||
创建时间
|
||||
</th>
|
||||
<th style="width: 75px;">
|
||||
操作
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @has_apply_status.each do |apply| %>
|
||||
<% if apply.status == 1 %>
|
||||
<tr class="odd">
|
||||
<td style="text-align: center;">
|
||||
<%= apply.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=apply.name%>' id="schools_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">
|
||||
<%= apply.user_id %>
|
||||
</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 }, :class => 'icon-del') %>
|
||||
<%= link_to( l(:button_change), { :controller => 'admin', :action => 'edit_applied_schools', :id => apply.id, :name => apply.name }, :class => 'icon-del') %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,29 @@
|
||||
<div class="sy_popup_top">
|
||||
<h3 class="fl">欢迎加入项目</h3>
|
||||
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="sy_popup_con" style="width:370px;">
|
||||
<%= form_tag( url_for(:controller => 'applied_project', :action => 'applied_project_info', :project_id => @project.id), :remote => true, :id => 'project_applied_form') do %>
|
||||
<ul class="sy_popup_add ">
|
||||
<li>
|
||||
<label >项目邀请码:</label>
|
||||
<input name="invite_code" class=" sy_input_txt fl" placeholder="请输入六位项目邀请码" style="width:250px"/>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li>
|
||||
<label >身份:</label>
|
||||
<input name="member" value="member_manager" type="radio" class="ml5 mr5 " /><span class="mr10">管理人员</span>
|
||||
<input name="member" value="member_developer" type="radio" class="ml5 mr5 " /><span class="mr10">开发人员</span>
|
||||
<input name="member" value="member_reporter" type="radio" class="ml5 mr5 " /><span class="mr10">报告人员</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li>
|
||||
<label> </label>
|
||||
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sy_btn_blue fl" onclick="$('#project_applied_form').submit();hideModal()">确 定</a></div>
|
||||
<a href="javascript:void(0);" class="sy_btn_grey fl ml20" onclick="hideModal()">取 消</a>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
@ -0,0 +1,25 @@
|
||||
<div id="sy_popup_box" style="width:380px;">
|
||||
<div class="sy_popup_top sy_popup_top_tishi">
|
||||
<h3 class="fl">提示</h3>
|
||||
<a href="javascript:void(0);" class="sy_icons_close02 fr" onclick="hideModal()"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="sy_popup_con02" >
|
||||
<ul class="sy_popup_tishi ">
|
||||
<li>
|
||||
<% if @flag == 1 %>
|
||||
<p>您输入的邀请码错误</p>
|
||||
<% elsif @flag == 2 %>
|
||||
<p>您已经是该项目成员</p>
|
||||
<% elsif @flag == 3 %>
|
||||
<p>请选择一个角色</p>
|
||||
<% elsif @flag == 4 %>
|
||||
<p>您的申请已提交,请等待项目管理员审批</p>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="sy_btn_blue " onclick="hideModal()">知道了</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,3 @@
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'applied_project/applied_project_tip', locals: {:project_id => @project.id}) %>";
|
||||
pop_box_new(htmlvalue,380,40,50);
|
||||
//$("#join_in_project").attr('href','<%#= join_in_project_link(@project, User.current) %>');
|
@ -0,0 +1,35 @@
|
||||
<% 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">
|
||||
<%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">批准你加入项目:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank'><%= ma.applied.name %></a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% elsif ma && ma.applied_type == "AppliedProject" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.applied.user), :width => "30", :height => "30"), user_path(ma.applied.user), :target => '_blank' %></a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<%=link_to ma.applied.user, user_path(ma.applied.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">申请加入项目:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
以“<%= applied_project_message_type(ma.applied.role) %>”身份加入
|
||||
<%= link_to ma.applied.project, settings_project_path(:id => ma.applied.project.id, :tab => "members"), :class => "link-blue", :target => '_blank' %>
|
||||
:同意 | 拒绝
|
||||
</a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
@ -0,0 +1,5 @@
|
||||
class AddInviteCodeToProject < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :projects, :invite_code, :string
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddStudentIdToApplyAddSchool < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :apply_add_schools, :user_id, :integer
|
||||
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 AddQrcodeToProject < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :projects, :qrcode, :string
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddRoleToAppliedProject < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :applied_projects, :role, :integer, :default => 0
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 18 KiB |
@ -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