From 5b30036639be3702217b39150e2646b3ad284eda Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 29 Jul 2016 16:11:26 +0800 Subject: [PATCH 01/26] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 19 ++++++++++++++-- app/controllers/school_controller.rb | 3 +++ app/views/admin/_all_schools.html.erb | 2 +- app/views/admin/applied_schools.html.erb | 23 ++++++++++++++------ app/views/admin/has_applied_schools.html.erb | 23 ++++++++++++++++---- app/views/my/account.html.erb | 2 +- config/routes.rb | 1 + 7 files changed, 58 insertions(+), 15 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 397235f4b..1b95ef895 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -154,6 +154,19 @@ class AdminController < ApplicationController end end + # 单位名称列表下的已审批按照名字排序 + def apply_shcool_sort + @order = "" + @sort = "" + if params[:sort] && (params[:order] == 'name') + # courses = School.find_by_sql("SELECT c.*,count(c.id) FROM courses c,course_activities ca WHERE c.id = ca.course_id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count(c.id) #{params[:sort]}, c.id desc") + school = School.find_by_sql(" SELECT aas.name FROM apply_add_schools aas where aas.status = '0' GROUP BY CONVERT(name USING gbk) #{params[:sort]}, aas.id desc ") + @order = params[:order] + @sort = params[:sort] + end + redirect_to unapplied_schools_url + end + #精品课程下的全部课程 def excellent_all_courses name = params[:name] @@ -700,8 +713,10 @@ class AdminController < ApplicationController user.update_column("school_id", nil) end applied_school.school.destroy - respond_to do |format| - format.html{ redirect_to unapplied_schools_url } + if params[:tip] == "unapplied" + redirect_to unapplied_schools_url + elsif params[:tip] == "applied" + redirect_to applied_schools_url end end diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index dd3169905..ec585e2b2 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -184,6 +184,9 @@ class SchoolController < ApplicationController applyschool.user_id = User.current.id if applyschool.save data[:school_id] = school.id + user_extention= User.current.extensions + user_extention.school_id = school.id + user_extention.save! else data[:result] = 3 end diff --git a/app/views/admin/_all_schools.html.erb b/app/views/admin/_all_schools.html.erb index 0ecb38544..af59d7687 100644 --- a/app/views/admin/_all_schools.html.erb +++ b/app/views/admin/_all_schools.html.erb @@ -16,7 +16,7 @@ function school_submit() { var checkboxs = $("input[name='school_id[]']:checked"); if(checkboxs.length == 0) { - $("#choose_courses_notice").text("请先选择班级"); + $("#choose_courses_notice").text("请选择单位"); } else{ $("#choose_courses_notice").text(""); $("#schools_list_form").submit(); diff --git a/app/views/admin/applied_schools.html.erb b/app/views/admin/applied_schools.html.erb index 4f48897ce..32e67914f 100644 --- a/app/views/admin/applied_schools.html.erb +++ b/app/views/admin/applied_schools.html.erb @@ -23,8 +23,11 @@ 序号 - - 单位名称 + + <%= link_to '单位名称', apply_shcool_sort_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'name', :tip=>'unapplied') %> + + + 申请者 地区 @@ -46,7 +49,7 @@ <% @apply_status.each do |apply| %> <% if apply.status == 0 %> - "> + "> <%= apply.id %> @@ -54,7 +57,13 @@ <%= apply.name %> - <%= apply.province + apply.city %> + <% user = User.where("id=?", apply.user_id).first %> + <% unless user.nil? %> + <%= user.login %> + <% end %> + + + <%= (apply.province.nil? ? "" : apply.province) + (apply.city.nil? ? "" : apply.city) %> <%= apply.address %> @@ -67,13 +76,13 @@ <%= format_date(apply.created_at) %> - <%= 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( l(:label_approve), { :controller => 'admin', :action => 'approve_applied_schools', :id => apply.id }) %> + <%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id, :tip => 'unapplied' },:method => :delete, :confirm => l(:text_are_you_sure)) %> <%=link_to '更改', admin_all_schools_path(:school_id =>apply.id), :remote => true %> - <% unless apply.remarks.empty? %> + <% unless apply.remarks.blank? %> diff --git a/app/views/admin/has_applied_schools.html.erb b/app/views/admin/has_applied_schools.html.erb index 07459fa0f..11361dbac 100644 --- a/app/views/admin/has_applied_schools.html.erb +++ b/app/views/admin/has_applied_schools.html.erb @@ -26,6 +26,9 @@ 单位名称 + + 申请者 + 地区 @@ -51,10 +54,22 @@ <%= apply.id %> - <%= (School.find apply.school_id).name %> + <% unless apply.school_id.nil? %> + <% school_name = School.where("id=?", apply.school_id).first %> + <%= school_name.name %> + <% end %> + + + <% user = User.where("id=?", apply.user_id).first %> + <% unless user.nil? %> + <%= user.login %> + <% end %> - <%= (School.find apply.school_id).province %> + <% unless apply.school_id.nil? %> + <% school_province = School.where("id=?", apply.school_id).first %> + <%= school_province.province %> + <% end %> <%= apply.address %> @@ -66,10 +81,10 @@ <%= format_date(apply.created_at) %> - <%= 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( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id, :tip => 'applied' },:method => :delete, :confirm => l(:text_are_you_sure) ) %> - <% unless apply.remarks.empty? %> + <% unless apply.remarks.blank? %> diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index f35d47079..46e8e015a 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -369,7 +369,7 @@ function apply_add_school(){ var htmlvalue = "<%= escape_javascript( render :partial => 'my/apply_add_school' )%>"; pop_up_box(htmlvalue,580,20,48); - + $("#schoolname").val($("input[name='province']").val()); } function add_school(name){ $.ajax({ diff --git a/config/routes.rb b/config/routes.rb index 2cc2bd906..b07600400 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1074,6 +1074,7 @@ RedmineApp::Application.routes.draw do get 'admin/approve_applied_schools' post 'admin/edit_applied_schools' get 'admin/all_schools' + get 'admin/apply_shcool_sort', as: :apply_shcool_sort delete 'admin/delete_applied_schools' get 'admin/leave_messages' From 4d3f4c358a9cda6823da71702870a68f4e9d0db4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 29 Jul 2016 16:13:25 +0800 Subject: [PATCH 02/26] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/app.html | 110 ++-- public/assets/wechat/new_class.html | 28 +- public/assets/wechat/new_project.html | 56 +- .../wechat/controllers/invite_code.js | 36 +- .../javascripts/wechat/directives/ellipsis.js | 48 +- public/stylesheets/weui/weixin.css | 488 +++++++++--------- 6 files changed, 383 insertions(+), 383 deletions(-) diff --git a/public/assets/wechat/app.html b/public/assets/wechat/app.html index 606164efe..74af26cfe 100644 --- a/public/assets/wechat/app.html +++ b/public/assets/wechat/app.html @@ -1,56 +1,56 @@ - - - - - 仅供本地调试使用 - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 仅供本地调试使用 + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/assets/wechat/new_class.html b/public/assets/wechat/new_class.html index 843bed0b2..e4d02be5a 100644 --- a/public/assets/wechat/new_class.html +++ b/public/assets/wechat/new_class.html @@ -1,14 +1,14 @@ -
-
- -
新建课程
-
-
课程名称
- -
班级名称删除
- - 完成 -
- - -
+
+
+ +
新建课程
+
+
课程名称
+ +
班级名称删除
+ + 完成 +
+ + +
diff --git a/public/assets/wechat/new_project.html b/public/assets/wechat/new_project.html index a59904e14..785de322f 100644 --- a/public/assets/wechat/new_project.html +++ b/public/assets/wechat/new_project.html @@ -1,28 +1,28 @@ -
-
- -
新建项目
-
-
项目名称
- 完成 -
- 项目功能特性(微信版) -
    -
  • 创建项目、加入项目
  • -
  • 邀请成员、修改角色
  • -
  • 浏览、回复项目动态
  • -
  • 点赞、分享项目动态
  • -
-
-
- 更多项目特性(浏览器版) -
    -
  • 发布任务、问题跟踪
  • -
  • 代码托管、质量分析
  • -
  • 资源分享、交流研讨
  • -
-
-
- - -
+
+
+ +
新建项目
+
+
项目名称
+ 完成 +
+ 项目功能特性(微信版) +
    +
  • 创建项目、加入项目
  • +
  • 邀请成员、修改角色
  • +
  • 浏览、回复项目动态
  • +
  • 点赞、分享项目动态
  • +
+
+
+ 更多项目特性(浏览器版) +
    +
  • 发布任务、问题跟踪
  • +
  • 代码托管、质量分析
  • +
  • 资源分享、交流研讨
  • +
+
+
+ + +
diff --git a/public/javascripts/wechat/controllers/invite_code.js b/public/javascripts/wechat/controllers/invite_code.js index 3908d1b40..ca69e308c 100644 --- a/public/javascripts/wechat/controllers/invite_code.js +++ b/public/javascripts/wechat/controllers/invite_code.js @@ -1,18 +1,18 @@ -/** - * Created by guange on 16/6/22. - */ - - -app.controller('InviteCodeController', ['$scope','$http', '$routeParams','config','auth', function($scope, $http, $routeParams, config, auth){ - var vm = $scope; - - vm.course = {}; - var courseid = $routeParams.id; - $http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then( - function(response){ - console.log(response.data); - vm.course = response.data.data; - } - ); - -}]); +/** + * Created by guange on 16/6/22. + */ + + +app.controller('InviteCodeController', ['$scope','$http', '$routeParams','config','auth', function($scope, $http, $routeParams, config, auth){ + var vm = $scope; + + vm.course = {}; + var courseid = $routeParams.id; + $http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then( + function(response){ + console.log(response.data); + vm.course = response.data.data; + } + ); + +}]); diff --git a/public/javascripts/wechat/directives/ellipsis.js b/public/javascripts/wechat/directives/ellipsis.js index a5d5d9845..dd826d6a3 100644 --- a/public/javascripts/wechat/directives/ellipsis.js +++ b/public/javascripts/wechat/directives/ellipsis.js @@ -1,25 +1,25 @@ -/** - * Created by Tim on 7/22/16. - */ -app.directive('ellipsisShow',["$timeout",function(timer){ - return{ - restrict: 'A', - scope: {}, - link: function(scope, element){ - timer(function() { - var textSplit = element.text().split(" "); - var newContent = []; - element.text(""); - for (var i = 0; i < textSplit.length; i++) { - newContent = newContent + " " + textSplit[i]; - element.text(newContent); - if(element[0].scrollHeight >= 100){ - newContent = newContent + " " + textSplit[i+1] + " " + textSplit[i+2] + " " + textSplit[i+3] + " " + textSplit[i+4] + "..."; - element.text(newContent); - break; - } - } - }); - } - } +/** + * Created by Tim on 7/22/16. + */ +app.directive('ellipsisShow',["$timeout",function(timer){ + return{ + restrict: 'A', + scope: {}, + link: function(scope, element){ + timer(function() { + var textSplit = element.text().split(" "); + var newContent = []; + element.text(""); + for (var i = 0; i < textSplit.length; i++) { + newContent = newContent + " " + textSplit[i]; + element.text(newContent); + if(element[0].scrollHeight >= 100){ + newContent = newContent + " " + textSplit[i+1] + " " + textSplit[i+2] + " " + textSplit[i+3] + " " + textSplit[i+4] + "..."; + element.text(newContent); + break; + } + } + }); + } + } }]); \ No newline at end of file diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 58b4a244e..987141088 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -1,245 +1,245 @@ -@charset "utf-8"; -/* CSS Document */ - -/*基本样式*/ -body,table,input,textarea,select,button { font-family: "微软雅黑","宋体","Helvetica Neue", Helvetica, Arial, sans-serif;} -body, ul, h1,h2,h3,h4,h5,p,pre,input {padding:0px; margin:0px;} -body{background-color: #efeff4;} -ul li {list-style:none;} -img {max-width:100%;} -blockquote {border:1px solid #d4d4d4; padding: 0.6em; margin: 5px 0.4em 5px 1.4em; border-radius: 4px; font-family: "Microsoft YaHei"; background-size: 100% 100%;} -.text-control {word-break:normal; word-wrap:break-word;} -.f12 {font-size:12px;} -.f13 {font-size:13px;} -.f14 {font-size:14px;} -.f15 {font-size:15px;} -.f16 {font-size:16px;} -.fb {font-weight:bold;} -.mt2 {margin-top:2px;} -.mt3 {margin-top:3px;} -.mt4 {margin-top:4px;} -.mt5 {margin-top:5px;} -.mt10 {margin-top:10px;} -.mt11 {margin-top:11px;} -.mt12 {margin-top:12px;} -.mt15 {margin-top:15px;} -.mt30 {margin-top:30px;} -.mt70 {margin-top:70px;} -.mb5 {margin-bottom:5px;} -.mb10 {margin-bottom:10px;} -.mb15 {margin-bottom:15px;} -.mb20 {margin-bottom:20px;} -.mb50 {margin-bottom:50px;} -.ml5 {margin-left:5px;} -.ml10 {margin-left:10px;} -.ml40 {margin-left:40px;} -.mr5 {margin-right:5px;} -.mr10 {margin-right:10px;} -.ml15 {margin-left:15px;} -.ml35 {margin-left:35px;} -.mr15 {margin-right:15px;} -.mr20 {margin-right:20px;} -.ml25 {margin-left:25px;} -.mr25 {margin-right:25px;} -.ml55 {margin-left:55px;} -.mr55 {margin-right:55px;} -.c-red {color:#e81a1a;} -.c-blue {color:#269ac9;} -.c-grey {color:#9a9a9a !important;} -.c-grey2 {color:#707070;} -.c-grey3 {color:#555555;} -.c-grey4 {color:#888888;} -.c-grey5 {color:#aaaaaa;} -.c-grey6 {color:#777777;} -.c-blue {color:#3b94d6;} -.c-white {color:#ffffff;} -.c-black {color:#333} -a {color:#707070;} -a.c-grey {color:#707070;} -a.c-grey2 {color:#9a9a9a;} -a.c-grey3 {color:#353535;} -a.c-green {color:#0bb20c;} -a:link,a:visited{text-decoration:none;} -a:hover,a:active{cursor:pointer;} -a.link-blue {color:#269ac9;} -a.link-blue2 {color:#3b94d6;} -a.underline {text-decoration:underline;} -.border-radius {border-radius:5px;} -.w36 {width:36px;} -.max-width-60 {max-width:60px;} -.max-width-130 {max-width:130px;} -.hidden {overflow:hidden; white-space:nowrap; text-overflow:ellipsis;} -.inline-block {display:inline-block;} -.dis {display:block;} -.undis {display:none;} -.text-nowrap {white-space:nowrap;} -.v-top {vertical-align:top;} -.tac {text-align:center;} -.block-center {margin-left:auto; margin-right:auto; display:block;} - -/*背景色*/ -.bg-grey {background-color:#c1c1c1 !important;} -.bg-blue {background-color:#3b94d6;} - -/*按钮样式*/ -.btn1 {width:100%; height:40px; line-height:40px; vertical-align:middle; text-align:center; color:#fff; display:block; border-radius:5px;} -.bg-blue:not(.btn-disabled):active {background-color:#2780c2;} -.btn-disabled {background-color:#ccc !important;} -.btn2 {width:145px; height:35px; color:#fff; font-size:15px; line-height:35px; text-align:center; vertical-align:middle; margin:18px auto 20px auto; border-radius:50px; display:block;} -.btn3 {width:145px; height:35px; color:#fff; font-size:15px; line-height:35px; text-align:center; vertical-align:middle; border-radius:50px; display:block;} -.fixed-bottom-btn {position:fixed; bottom:5px; left:50%; transform:translate(-50%,0);} - -/*tab*/ -.tab-wrap {position:relative; width:100%; line-height:38px; display:-webkit-box; display:-moz-box; display:-ms-flexbox; display:-webkit-flex; display:flex; font-size:13px; background-color:#fff;} -.tab-wrap a {position:relative; display:block; -webkit-box-flex:1; -moz-box-flex:1; -ms-flex:1; flex:1;} -.tab-wrap a:first-child:after {display:none;} -.tab-wrap a:after {content:" "; position:absolute; left:0; top:0; width:1px; height:100%; border-left:1px solid #ccc; color:#707070;} -.weixin-tab {text-align:center; border-bottom:1px solid #ccc;} - -/*bottom-tab*/ -.bottom-tab-wrap {position:fixed; width:100%; bottom:0; line-height:38px; display:-webkit-box; display:-moz-box; display:-ms-flexbox; display:-webkit-flex; display:flex; font-size:13px; background-color:#fff;} -.bottom-tab-wrap a {display:block; -webkit-box-flex:1; -moz-box-flex:1; -ms-flex:1; flex:1; position:relative;} -.bottom-tab-wrap a:after {content:" "; position:absolute; left:0; top:0; width:1px; height:100%; border-left:1px solid #ccc; color:#707070;} - -/*动态样式*/ -.post-container {width:100%;} -.post-wrapper {width:100%; background-color:#ffffff; margin:10px auto;} -.post-main {padding:10px 15px; color:#9a9a9a;} -.post-avatar {width:30px; height:30px;} -.post-title {font-size:13px; text-align:left;} -.post-detail-info {font-size:13px; text-align:left; color:#9a9a9a;} -.fl {float:left;} -.fr {float:right;} -.cl {clear:both; overflow:hidden;} -.post-content {width:100%; font-size:14px; line-height:20px; height:100px; overflow:hidden; word-break:normal; word-wrap:break-word; text-align:justify;} -.post-all-content a {color:#136ec2;} -.post-interactive {width:100%; height:35px; line-height:35px; vertical-align:middle; border-top:1px solid #e6e6e6; background-color:#f8f9fb;} -.post-interactive-column, -.post-interactive-reply, -.post-interactive-praise {width:50%; text-align:center; float:left; font-size:13px;} -.more-wrap {width:100%;} -.more-events {width:100%; font-size:13px; text-align:center; margin:0 auto; padding: 5px 0; border-top:1px solid #e6e6e6; border-bottom:1px solid #e6e6e6; border-radius:3px; background-color:#f8f9fb; } -.border-bottom {border-bottom:1px solid #e6e6e6;} -.post-reply-wrap {width:100%;} -.post-reply-wrap:first-child {border-top:1px solid #ccc;} -.post-input-wrap {width:100%; position:fixed; bottom:0; background-color:#fff;} -.post-input-wrap2 {width:100%;} -.post-reply-row {margin:10px 15px; color:#9a9a9a; background-color:#fff; border-bottom:1px solid #f0f0f0;} -.post-reply-avatar {width:45px; height:30px; text-align:center; margin-right:10px;} -.post-reply-user {font-size:13px; text-align:left; margin-bottom:10px;} -.post-reply-content {font-size:13px; word-break:break-all; word-wrap:break-word; overflow:hidden; text-align:justify;} -.post-reply-content img {max-width:100%;} -.post-reply-content a {color:#136ec2;} -.post-reply-date, .post-reply-trigger {font-size:13px;} -.post-input-container {position:relative; padding-right:70px;} -.copy-input-container {position:relative; padding-right:70px;} -.copy-input {width:100%; height:18px; line-height:18px; padding:5px; vertical-align: middle; font-size:12px; border-radius:3px; position:absolute; left:-999em;} -.post-reply-input {width:100%; height:18px; max-height:54px; line-height:18px; vertical-align: middle; font-size:13px; border:1px solid #e6e6e6; outline:none; padding:5px; margin:0; border-radius:3px; overflow-y:auto; resize:none; background-color:#f0eff4;} -.post-reply-submit {position:absolute; font-size:13px; height:30px; line-height:30px; vertical-align:middle; padding:0 8px; color:#fff; background-color:#269ac9; outline:none; border:none; top:0; right:0;} -.reply-icon {background:url(/images/wechat/icon_list.gif) -150px -155px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} -.praise-icon {background:url(/images/wechat/icon_list.gif) -36px -88px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} -.praised-icon {background:url(/images/wechat/icon_list.gif) -152px -86px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} -.num-block {display:inline-block; vertical-align:top;} -.post-op-banner {height:20px; line-height:20px; vertical-align:middle;} - -/*20160628动态新样式*/ -.post-dynamic-author {width:50%; height:30px; line-height:30px; font-size:14px; color:#5b5b5b; vertical-align:middle;} -.post-dynamic-time {height:30px; line-height:30px; vertical-align:middle;} -.post-dynamic-title {font-size:15px;} -.post-dynamic-from {width:50%; font-size:13px;} -.post-box-shadow {box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);} -.post-reply-author {width:50%; height:20px; line-height:20px; font-size:12px; color:#5d5d5d; vertical-align:middle;} -.post-reply-time {height:20px; line-height:20px; vertical-align:middle;} - -/* loading 弹框*/ -.loading-bg {position:fixed; width:100%; height:100%; left:0; top:0; z-index:99; background:rgba(206, 206, 206, 0.3); overflow:hidden;} -.loading-box {position:absolute; top:50%; background:rgba(240,240,240, 0.5); width:160px; height:72px; left:50%; margin-top:-36px; margin-left:-80px; text-align:center;} -.loading-box img {margin-top: 3px; text-align: center;} -.loading-box span {display: block; font-size:12px;} - -/*帖子锁定样式*/ -.locked_btn_cir {background: url("/images/wechat/locked.png") 0 0 no-repeat; cursor: default;} - -/*20150612加入班级样式*/ -.add-class-box {position:fixed; width:80%; max-width:300px; min-width:240px; font-size:15px; color:#444; background-color:#fff; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); border-radius:5px; top:50%; left:50%; transform: translate(-50%,-50%); -ms-transform: translate(-50%,-50%); -moz-transform: translate(-50%,-50%); -webkit-transform: translate(-50%,-50%); -o-transform: translate(-50%,-50%);} -.add-class-tip {padding-top:1.2em; padding-bottom:.5em; font-weight:400;} -.class-number-input {width:80%; max-width:240px; height:28px; border:1px solid #ccc; padding-left:5px; margin:0 auto; display:block;} -.cancel-btn {width:49%; height:37px; line-height:37px; text-align:center; vertical-align:middle; border-top:1px solid #ccc;} -.submit-btn {width:49%; height:37px; line-height:37px; text-align:center; vertical-align:middle; border-top:1px solid #ccc;} -.slice {width:2%; text-align:center; border-top:1px solid #ccc;} -.slice-line {width:1px; height:37px; margin:auto; background:#ccc;} - -/*20160613邀请码样式*/ -.qr-code-wrap {width:100%; padding:40px 0; background-color:#3b94d6;} -.qr-code-box {width:225px; background-color:#fff; border-radius:3px; margin:0 auto;} -.share-class-name {font-size:18px; color:#3b3b3b; text-align:center; padding:12px; border-bottom:1px solid #cccccc;} -.qr-img-wrap {width:100%; border-bottom:1px dashed #ccc;} -.qr-code-img {margin:36px auto; display:block;} -.invitation-code-wrap {text-align:center; font-size:18px; color:#3b3b3b; padding:16px;} -.share-code-wrap {width:100%; background-color:#efeff4;} -.share-code-btn, .finish-btn {width:145px; height:35px; color:#fff; font-size:15px; line-height:35px; text-align:center; vertical-align:middle; background-color:#ff7239; margin:18px auto 20px auto; border-radius:50px; display:block;} -.share-code-instruction {max-width:228px; font-size:12px; color:#666; line-height:20px; margin:0 auto;} - -/*20160613班级详情*/ -.class-detail-name, .blue-title {width:100%; height:45px; line-height:45px; vertical-align:middle; background-color:#3b94d6; color:#fff; font-size:18px; text-align:center;} -.blue-title-sub {position:absolute; right:10px;} -.slice2 {width:2%; text-align:center; background-color:#fff; border-bottom:1px solid #ccc;} -.slice3 {width:1%; height:38px; text-align:center; background-color:#fff; border-bottom:1px solid #ccc;} -.slice-line2 {width:1px; height:38px; margin:auto; background:#ccc;} -.class-detail-tab {width:23%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;} -.class-detail-tab2 {width:32%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;} -.class-detail-tab3 {width:48%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;} -.class-tab-active {border-bottom:3px solid #3b94d6;} -.tab-active-arrow {border-width:4px; position:absolute; top:41px; left:50%; transform:translate(-50%,0); border-color:#3b94d6 transparent transparent transparent; border-style:solid dashed dashed dashed;} -.class-search-wrap {padding:8px 12px; position:relative;} -.class-search-inner {padding:0 30px; background-color:#fff;} -.class-search-icon {position:absolute; top:16px; left:16px;} -.class-detail-search {width:100%; height:33px; color:#999; background-color:#fff; border:none; outline:none;} -.border-top {border-top:1px solid #ccc;} -.class-detail-row {width:100%; line-height:18px; padding:10px 0; border-bottom:1px solid #ccc; background-color:#fff;} -.class-member-row {width:100%; line-height:18px; padding:5px 0; border-bottom:1px solid #ccc; background-color:#fff; position:relative;} -.class-test-tip {text-align:center; font-size:13px; color:#444; padding-top:40px;} -.img-circle {border-radius:50% !important;} -.member-banner {height:24px; line-height:24px; text-align:center; vertical-align:middle; background-color:#dfdfdf;} -.resource-width {width:76%;} -.courseware-from-width {max-width:57%;} -.other-from-width {max-width:80%;} -.course-name-width {width:68%;} - -/*20160614班级列表*/ -.course-diff-row {width:100%; height:28px; line-height:28px; vertical-align:middle; background-color:#fff; border-bottom:1px solid #ccc;} -.course-list-row {width:100%; height:38px; line-height:38px; vertical-align:middle; border-top:1px solid #ccc; border-bottom:1px solid #ccc; background-color:#fff;} -.class-list {width:100%; border-bottom:1px solid #ccc;} -.class-list li {height:40px; line-height:40px; vertical-align:middle; margin:0 25px; border-left:1px solid #ccc; border-bottom:1px solid #ccc; position:relative;} -.class-list-name {max-width:75%; display:inline-block;} -.class-list-dot {position:absolute; top:13px; left:-8px;} -.border-bottom-none {border-bottom:none !important;} -.border-top-none {border-top:none !important;} -.students-amount {height:14px; line-height:14px; vertical-align:middle; padding:2px 5px; background-color:#e6e6e6; border-radius:10px;} -.new-class-btn {font-size:15px; color:#fff; background-color:#3b94d6; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;} -.join-class-btn {font-size:15px; color:#444; background-color:#ccc; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;} -.new-class-input {width:60%; color:#555; height:16px; line-height:16px; vertical-align:middle; border:none; outline:none; padding:8px 0;} -.class-list-setting {position:absolute; top:11px; right:10px;} -.class-setting-wrap {width:38px; height:38px; position:absolute; top:0; right:0;} - -/*20160616登录注册*/ -.login-wrap {padding:0 10px;} -.input-box-wrap {padding-right:17px;} -.input-box { -webkit-appearance: none; font-size: 15px;width:100%; height:18px; padding: 10px 0px 10px 5px; line-height:18px; border:1px solid #ccc; border-radius:5px;} -.login-op-wrap {height:30px; line-height:30px; vertical-align:middle;} -.login-box{display:inline-block; width:14px; height:14px; line-height:14px; text-align:center; vertical-align:middle; border:1px solid #ccc; background:#fff; border-radius:3px; color:#fff; cursor:pointer;} -.login-box.checked{background:#63c360; border:1px solid #63c360;} -.login-box.checked:after{content:url(/images/wechat/checked.png);} -.forget-psw-wrap {width:60px; margin:0 auto;} -.forget-psw {position:fixed; bottom:10px;} - -/*二级回复*/ -.mult-reply-container{ border:solid 1px #f3ddb3; background:#fffef4; padding:4px;color:#999;} -.mult-reply-content{ color:#555; font-size:13px;} -.mult-reply-hide{ text-align:center; display:block; font-size:14px; color:#aaa; border-bottom:1px solid #F3DDB3; padding:8px 0;} -.mult-reply-arrow{ color:#aaa; margin-right:10px; font-size:14px; font-weight:bold;} - - -/*20160729项目说明*/ -.project-intro {line-height:2;} +@charset "utf-8"; +/* CSS Document */ + +/*基本样式*/ +body,table,input,textarea,select,button { font-family: "微软雅黑","宋体","Helvetica Neue", Helvetica, Arial, sans-serif;} +body, ul, h1,h2,h3,h4,h5,p,pre,input {padding:0px; margin:0px;} +body{background-color: #efeff4;} +ul li {list-style:none;} +img {max-width:100%;} +blockquote {border:1px solid #d4d4d4; padding: 0.6em; margin: 5px 0.4em 5px 1.4em; border-radius: 4px; font-family: "Microsoft YaHei"; background-size: 100% 100%;} +.text-control {word-break:normal; word-wrap:break-word;} +.f12 {font-size:12px;} +.f13 {font-size:13px;} +.f14 {font-size:14px;} +.f15 {font-size:15px;} +.f16 {font-size:16px;} +.fb {font-weight:bold;} +.mt2 {margin-top:2px;} +.mt3 {margin-top:3px;} +.mt4 {margin-top:4px;} +.mt5 {margin-top:5px;} +.mt10 {margin-top:10px;} +.mt11 {margin-top:11px;} +.mt12 {margin-top:12px;} +.mt15 {margin-top:15px;} +.mt30 {margin-top:30px;} +.mt70 {margin-top:70px;} +.mb5 {margin-bottom:5px;} +.mb10 {margin-bottom:10px;} +.mb15 {margin-bottom:15px;} +.mb20 {margin-bottom:20px;} +.mb50 {margin-bottom:50px;} +.ml5 {margin-left:5px;} +.ml10 {margin-left:10px;} +.ml40 {margin-left:40px;} +.mr5 {margin-right:5px;} +.mr10 {margin-right:10px;} +.ml15 {margin-left:15px;} +.ml35 {margin-left:35px;} +.mr15 {margin-right:15px;} +.mr20 {margin-right:20px;} +.ml25 {margin-left:25px;} +.mr25 {margin-right:25px;} +.ml55 {margin-left:55px;} +.mr55 {margin-right:55px;} +.c-red {color:#e81a1a;} +.c-blue {color:#269ac9;} +.c-grey {color:#9a9a9a !important;} +.c-grey2 {color:#707070;} +.c-grey3 {color:#555555;} +.c-grey4 {color:#888888;} +.c-grey5 {color:#aaaaaa;} +.c-grey6 {color:#777777;} +.c-blue {color:#3b94d6;} +.c-white {color:#ffffff;} +.c-black {color:#333} +a {color:#707070;} +a.c-grey {color:#707070;} +a.c-grey2 {color:#9a9a9a;} +a.c-grey3 {color:#353535;} +a.c-green {color:#0bb20c;} +a:link,a:visited{text-decoration:none;} +a:hover,a:active{cursor:pointer;} +a.link-blue {color:#269ac9;} +a.link-blue2 {color:#3b94d6;} +a.underline {text-decoration:underline;} +.border-radius {border-radius:5px;} +.w36 {width:36px;} +.max-width-60 {max-width:60px;} +.max-width-130 {max-width:130px;} +.hidden {overflow:hidden; white-space:nowrap; text-overflow:ellipsis;} +.inline-block {display:inline-block;} +.dis {display:block;} +.undis {display:none;} +.text-nowrap {white-space:nowrap;} +.v-top {vertical-align:top;} +.tac {text-align:center;} +.block-center {margin-left:auto; margin-right:auto; display:block;} + +/*背景色*/ +.bg-grey {background-color:#c1c1c1 !important;} +.bg-blue {background-color:#3b94d6;} + +/*按钮样式*/ +.btn1 {width:100%; height:40px; line-height:40px; vertical-align:middle; text-align:center; color:#fff; display:block; border-radius:5px;} +.bg-blue:not(.btn-disabled):active {background-color:#2780c2;} +.btn-disabled {background-color:#ccc !important;} +.btn2 {width:145px; height:35px; color:#fff; font-size:15px; line-height:35px; text-align:center; vertical-align:middle; margin:18px auto 20px auto; border-radius:50px; display:block;} +.btn3 {width:145px; height:35px; color:#fff; font-size:15px; line-height:35px; text-align:center; vertical-align:middle; border-radius:50px; display:block;} +.fixed-bottom-btn {position:fixed; bottom:5px; left:50%; transform:translate(-50%,0);} + +/*tab*/ +.tab-wrap {position:relative; width:100%; line-height:38px; display:-webkit-box; display:-moz-box; display:-ms-flexbox; display:-webkit-flex; display:flex; font-size:13px; background-color:#fff;} +.tab-wrap a {position:relative; display:block; -webkit-box-flex:1; -moz-box-flex:1; -ms-flex:1; flex:1;} +.tab-wrap a:first-child:after {display:none;} +.tab-wrap a:after {content:" "; position:absolute; left:0; top:0; width:1px; height:100%; border-left:1px solid #ccc; color:#707070;} +.weixin-tab {text-align:center; border-bottom:1px solid #ccc;} + +/*bottom-tab*/ +.bottom-tab-wrap {position:fixed; width:100%; bottom:0; line-height:38px; display:-webkit-box; display:-moz-box; display:-ms-flexbox; display:-webkit-flex; display:flex; font-size:13px; background-color:#fff;} +.bottom-tab-wrap a {display:block; -webkit-box-flex:1; -moz-box-flex:1; -ms-flex:1; flex:1; position:relative;} +.bottom-tab-wrap a:after {content:" "; position:absolute; left:0; top:0; width:1px; height:100%; border-left:1px solid #ccc; color:#707070;} + +/*动态样式*/ +.post-container {width:100%;} +.post-wrapper {width:100%; background-color:#ffffff; margin:10px auto;} +.post-main {padding:10px 15px; color:#9a9a9a;} +.post-avatar {width:30px; height:30px;} +.post-title {font-size:13px; text-align:left;} +.post-detail-info {font-size:13px; text-align:left; color:#9a9a9a;} +.fl {float:left;} +.fr {float:right;} +.cl {clear:both; overflow:hidden;} +.post-content {width:100%; font-size:14px; line-height:20px; height:100px; overflow:hidden; word-break:normal; word-wrap:break-word; text-align:justify;} +.post-all-content a {color:#136ec2;} +.post-interactive {width:100%; height:35px; line-height:35px; vertical-align:middle; border-top:1px solid #e6e6e6; background-color:#f8f9fb;} +.post-interactive-column, +.post-interactive-reply, +.post-interactive-praise {width:50%; text-align:center; float:left; font-size:13px;} +.more-wrap {width:100%;} +.more-events {width:100%; font-size:13px; text-align:center; margin:0 auto; padding: 5px 0; border-top:1px solid #e6e6e6; border-bottom:1px solid #e6e6e6; border-radius:3px; background-color:#f8f9fb; } +.border-bottom {border-bottom:1px solid #e6e6e6;} +.post-reply-wrap {width:100%;} +.post-reply-wrap:first-child {border-top:1px solid #ccc;} +.post-input-wrap {width:100%; position:fixed; bottom:0; background-color:#fff;} +.post-input-wrap2 {width:100%;} +.post-reply-row {margin:10px 15px; color:#9a9a9a; background-color:#fff; border-bottom:1px solid #f0f0f0;} +.post-reply-avatar {width:45px; height:30px; text-align:center; margin-right:10px;} +.post-reply-user {font-size:13px; text-align:left; margin-bottom:10px;} +.post-reply-content {font-size:13px; word-break:break-all; word-wrap:break-word; overflow:hidden; text-align:justify;} +.post-reply-content img {max-width:100%;} +.post-reply-content a {color:#136ec2;} +.post-reply-date, .post-reply-trigger {font-size:13px;} +.post-input-container {position:relative; padding-right:70px;} +.copy-input-container {position:relative; padding-right:70px;} +.copy-input {width:100%; height:18px; line-height:18px; padding:5px; vertical-align: middle; font-size:12px; border-radius:3px; position:absolute; left:-999em;} +.post-reply-input {width:100%; height:18px; max-height:54px; line-height:18px; vertical-align: middle; font-size:13px; border:1px solid #e6e6e6; outline:none; padding:5px; margin:0; border-radius:3px; overflow-y:auto; resize:none; background-color:#f0eff4;} +.post-reply-submit {position:absolute; font-size:13px; height:30px; line-height:30px; vertical-align:middle; padding:0 8px; color:#fff; background-color:#269ac9; outline:none; border:none; top:0; right:0;} +.reply-icon {background:url(/images/wechat/icon_list.gif) -150px -155px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.praise-icon {background:url(/images/wechat/icon_list.gif) -36px -88px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.praised-icon {background:url(/images/wechat/icon_list.gif) -152px -86px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.num-block {display:inline-block; vertical-align:top;} +.post-op-banner {height:20px; line-height:20px; vertical-align:middle;} + +/*20160628动态新样式*/ +.post-dynamic-author {width:50%; height:30px; line-height:30px; font-size:14px; color:#5b5b5b; vertical-align:middle;} +.post-dynamic-time {height:30px; line-height:30px; vertical-align:middle;} +.post-dynamic-title {font-size:15px;} +.post-dynamic-from {width:50%; font-size:13px;} +.post-box-shadow {box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);} +.post-reply-author {width:50%; height:20px; line-height:20px; font-size:12px; color:#5d5d5d; vertical-align:middle;} +.post-reply-time {height:20px; line-height:20px; vertical-align:middle;} + +/* loading 弹框*/ +.loading-bg {position:fixed; width:100%; height:100%; left:0; top:0; z-index:99; background:rgba(206, 206, 206, 0.3); overflow:hidden;} +.loading-box {position:absolute; top:50%; background:rgba(240,240,240, 0.5); width:160px; height:72px; left:50%; margin-top:-36px; margin-left:-80px; text-align:center;} +.loading-box img {margin-top: 3px; text-align: center;} +.loading-box span {display: block; font-size:12px;} + +/*帖子锁定样式*/ +.locked_btn_cir {background: url("/images/wechat/locked.png") 0 0 no-repeat; cursor: default;} + +/*20150612加入班级样式*/ +.add-class-box {position:fixed; width:80%; max-width:300px; min-width:240px; font-size:15px; color:#444; background-color:#fff; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); border-radius:5px; top:50%; left:50%; transform: translate(-50%,-50%); -ms-transform: translate(-50%,-50%); -moz-transform: translate(-50%,-50%); -webkit-transform: translate(-50%,-50%); -o-transform: translate(-50%,-50%);} +.add-class-tip {padding-top:1.2em; padding-bottom:.5em; font-weight:400;} +.class-number-input {width:80%; max-width:240px; height:28px; border:1px solid #ccc; padding-left:5px; margin:0 auto; display:block;} +.cancel-btn {width:49%; height:37px; line-height:37px; text-align:center; vertical-align:middle; border-top:1px solid #ccc;} +.submit-btn {width:49%; height:37px; line-height:37px; text-align:center; vertical-align:middle; border-top:1px solid #ccc;} +.slice {width:2%; text-align:center; border-top:1px solid #ccc;} +.slice-line {width:1px; height:37px; margin:auto; background:#ccc;} + +/*20160613邀请码样式*/ +.qr-code-wrap {width:100%; padding:40px 0; background-color:#3b94d6;} +.qr-code-box {width:225px; background-color:#fff; border-radius:3px; margin:0 auto;} +.share-class-name {font-size:18px; color:#3b3b3b; text-align:center; padding:12px; border-bottom:1px solid #cccccc;} +.qr-img-wrap {width:100%; border-bottom:1px dashed #ccc;} +.qr-code-img {margin:36px auto; display:block;} +.invitation-code-wrap {text-align:center; font-size:18px; color:#3b3b3b; padding:16px;} +.share-code-wrap {width:100%; background-color:#efeff4;} +.share-code-btn, .finish-btn {width:145px; height:35px; color:#fff; font-size:15px; line-height:35px; text-align:center; vertical-align:middle; background-color:#ff7239; margin:18px auto 20px auto; border-radius:50px; display:block;} +.share-code-instruction {max-width:228px; font-size:12px; color:#666; line-height:20px; margin:0 auto;} + +/*20160613班级详情*/ +.class-detail-name, .blue-title {width:100%; height:45px; line-height:45px; vertical-align:middle; background-color:#3b94d6; color:#fff; font-size:18px; text-align:center;} +.blue-title-sub {position:absolute; right:10px;} +.slice2 {width:2%; text-align:center; background-color:#fff; border-bottom:1px solid #ccc;} +.slice3 {width:1%; height:38px; text-align:center; background-color:#fff; border-bottom:1px solid #ccc;} +.slice-line2 {width:1px; height:38px; margin:auto; background:#ccc;} +.class-detail-tab {width:23%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;} +.class-detail-tab2 {width:32%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;} +.class-detail-tab3 {width:48%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;} +.class-tab-active {border-bottom:3px solid #3b94d6;} +.tab-active-arrow {border-width:4px; position:absolute; top:41px; left:50%; transform:translate(-50%,0); border-color:#3b94d6 transparent transparent transparent; border-style:solid dashed dashed dashed;} +.class-search-wrap {padding:8px 12px; position:relative;} +.class-search-inner {padding:0 30px; background-color:#fff;} +.class-search-icon {position:absolute; top:16px; left:16px;} +.class-detail-search {width:100%; height:33px; color:#999; background-color:#fff; border:none; outline:none;} +.border-top {border-top:1px solid #ccc;} +.class-detail-row {width:100%; line-height:18px; padding:10px 0; border-bottom:1px solid #ccc; background-color:#fff;} +.class-member-row {width:100%; line-height:18px; padding:5px 0; border-bottom:1px solid #ccc; background-color:#fff; position:relative;} +.class-test-tip {text-align:center; font-size:13px; color:#444; padding-top:40px;} +.img-circle {border-radius:50% !important;} +.member-banner {height:24px; line-height:24px; text-align:center; vertical-align:middle; background-color:#dfdfdf;} +.resource-width {width:76%;} +.courseware-from-width {max-width:57%;} +.other-from-width {max-width:80%;} +.course-name-width {width:68%;} + +/*20160614班级列表*/ +.course-diff-row {width:100%; height:28px; line-height:28px; vertical-align:middle; background-color:#fff; border-bottom:1px solid #ccc;} +.course-list-row {width:100%; height:38px; line-height:38px; vertical-align:middle; border-top:1px solid #ccc; border-bottom:1px solid #ccc; background-color:#fff;} +.class-list {width:100%; border-bottom:1px solid #ccc;} +.class-list li {height:40px; line-height:40px; vertical-align:middle; margin:0 25px; border-left:1px solid #ccc; border-bottom:1px solid #ccc; position:relative;} +.class-list-name {max-width:75%; display:inline-block;} +.class-list-dot {position:absolute; top:13px; left:-8px;} +.border-bottom-none {border-bottom:none !important;} +.border-top-none {border-top:none !important;} +.students-amount {height:14px; line-height:14px; vertical-align:middle; padding:2px 5px; background-color:#e6e6e6; border-radius:10px;} +.new-class-btn {font-size:15px; color:#fff; background-color:#3b94d6; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;} +.join-class-btn {font-size:15px; color:#444; background-color:#ccc; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;} +.new-class-input {width:60%; color:#555; height:16px; line-height:16px; vertical-align:middle; border:none; outline:none; padding:8px 0;} +.class-list-setting {position:absolute; top:11px; right:10px;} +.class-setting-wrap {width:38px; height:38px; position:absolute; top:0; right:0;} + +/*20160616登录注册*/ +.login-wrap {padding:0 10px;} +.input-box-wrap {padding-right:17px;} +.input-box { -webkit-appearance: none; font-size: 15px;width:100%; height:18px; padding: 10px 0px 10px 5px; line-height:18px; border:1px solid #ccc; border-radius:5px;} +.login-op-wrap {height:30px; line-height:30px; vertical-align:middle;} +.login-box{display:inline-block; width:14px; height:14px; line-height:14px; text-align:center; vertical-align:middle; border:1px solid #ccc; background:#fff; border-radius:3px; color:#fff; cursor:pointer;} +.login-box.checked{background:#63c360; border:1px solid #63c360;} +.login-box.checked:after{content:url(/images/wechat/checked.png);} +.forget-psw-wrap {width:60px; margin:0 auto;} +.forget-psw {position:fixed; bottom:10px;} + +/*二级回复*/ +.mult-reply-container{ border:solid 1px #f3ddb3; background:#fffef4; padding:4px;color:#999;} +.mult-reply-content{ color:#555; font-size:13px;} +.mult-reply-hide{ text-align:center; display:block; font-size:14px; color:#aaa; border-bottom:1px solid #F3DDB3; padding:8px 0;} +.mult-reply-arrow{ color:#aaa; margin-right:10px; font-size:14px; font-weight:bold;} + + +/*20160729项目说明*/ +.project-intro {line-height:2;} .project-intro li {list-style:disc; margin-left:20px;} \ No newline at end of file From b3d34d6e0fc0c3361136ec71beff366d3e914aea Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 29 Jul 2016 20:18:26 +0800 Subject: [PATCH 03/26] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E5=90=8D=E7=A7=B0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/courses_service.rb | 2 ++ app/views/admin/_courselist_detail_tr.html.erb | 2 +- app/views/admin/non_syllabus_courses.html.erb | 2 +- app/views/admin/syllabuses.html.erb | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index fd3aa6ebf..48a4a560c 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -397,6 +397,8 @@ class CoursesService if course if course_endTime_timeout? course @state = 2 + elsif course[:is_delete] == 1 + @state = 11 else if current_user.member_of_course?(course) #如果已经是成员 @state = 3 diff --git a/app/views/admin/_courselist_detail_tr.html.erb b/app/views/admin/_courselist_detail_tr.html.erb index 83b7904ce..6bec90845 100644 --- a/app/views/admin/_courselist_detail_tr.html.erb +++ b/app/views/admin/_courselist_detail_tr.html.erb @@ -7,7 +7,7 @@ - <%= link_to(course.teacher.show_name.truncate(6, omission: '...'), user_path(course.teacher)) %> + <%= link_to(course.teacher.show_name, user_path(course.teacher)) %> <%= course.class_period %> diff --git a/app/views/admin/non_syllabus_courses.html.erb b/app/views/admin/non_syllabus_courses.html.erb index 1be979eeb..c5a2c81ec 100644 --- a/app/views/admin/non_syllabus_courses.html.erb +++ b/app/views/admin/non_syllabus_courses.html.erb @@ -72,7 +72,7 @@ - <%= link_to(course.teacher.show_name.truncate(6, omission: '...'), user_path(course.teacher)) %> + <%= link_to(course.teacher.show_name, user_path(course.teacher)) %> <%= course.class_period %> diff --git a/app/views/admin/syllabuses.html.erb b/app/views/admin/syllabuses.html.erb index 194091abc..5098131da 100644 --- a/app/views/admin/syllabuses.html.erb +++ b/app/views/admin/syllabuses.html.erb @@ -52,7 +52,7 @@ - <%= link_to(syllabus.try(:user).try(:realname).truncate(6, omission: '...'), user_path(syllabus.user)) %> + <%= link_to syllabus.user.show_name, user_path(syllabus.user) %> <%= format_date(syllabus.created_at) %> @@ -70,7 +70,7 @@ <%= render :partial => 'admin/rename_course_name', :locals => {:course => course} %> - <%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %> + <%= link_to(course.teacher.show_name, user_path(course.teacher)) %> <%= format_date(course.created_at) %> From d0f83aab64c7802dc9f6ccfeaa1299e0b2b1c091 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 29 Jul 2016 20:24:04 +0800 Subject: [PATCH 04/26] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A7=93=E5=92=8C?= =?UTF-8?q?=E5=90=8D=E4=B9=8B=E9=97=B4=E7=9A=84=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index afd45e08b..3d9e59f2e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -42,12 +42,12 @@ class User < Principal # Different ways of displaying/sorting users USER_FORMATS = { :firstname_lastname => { - :string => '#{firstname} #{lastname}', + :string => '#{firstname}#{lastname}', :order => %w(firstname lastname id), :setting_order => 1 }, :firstname_lastinitial => { - :string => '#{firstname} #{lastname.to_s.chars.first}.', + :string => '#{firstname}#{lastname.to_s.chars.first}.', :order => %w(firstname lastname id), :setting_order => 2 }, @@ -57,7 +57,7 @@ class User < Principal :setting_order => 3 }, :lastname_firstname => { - :string => '#{lastname} #{firstname}', + :string => '#{lastname}#{firstname}', :order => %w(lastname firstname id), :setting_order => 4 }, From 02bee33ad27678aadda12d29438d9e127cefaf98 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 29 Jul 2016 20:33:35 +0800 Subject: [PATCH 05/26] =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_course_base_info.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_course_base_info.html.erb b/app/views/layouts/_course_base_info.html.erb index afd82646a..d2cc0840d 100644 --- a/app/views/layouts/_course_base_info.html.erb +++ b/app/views/layouts/_course_base_info.html.erb @@ -61,9 +61,9 @@ <% is_TE = get_user_member_roles_course @course, User.current, 9 %> <% is_ST = get_user_member_roles_course @course, User.current, 10 %> <% if !is_teacher && (is_TA || is_TE) %> - <%= link_to '教师身份', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => 10, :tar_role => (is_TA ? 7 : 9)), :class => "sy_btn_orange mr10 fl" %> + <%= link_to '教师身份', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => 10, :tar_role => (is_TA ? 7 : 9)), :class => "sy_btn_orange mr10 fl", :title => "由学生身份切换至教师身份" %> <% elsif is_teacher && is_ST %> - <%= link_to '学生身份', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => (is_TA ? 7 : 9), :tar_role => 10), :class => "sy_btn_orange mr10 fl" %> + <%= link_to '学生身份', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => (is_TA ? 7 : 9), :tar_role => 10), :class => "sy_btn_orange mr10 fl", :title => "由教师身份切换至学生身份" %> <% end %> <% unless (is_teacher || is_TA || is_TE) %>
<%= join_in_course_header(@course, User.current) %>
From 430a93e4b2f6c19224c2c2f23051bd540c36cd0b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 29 Jul 2016 20:48:36 +0800 Subject: [PATCH 06/26] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=8A=9F=E8=83=BD=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 2 +- app/controllers/school_controller.rb | 6 ++++++ app/views/admin/_all_schools.html.erb | 1 - app/views/admin/applied_schools.html.erb | 10 ++++----- app/views/admin/has_applied_schools.html.erb | 21 ++++++++----------- app/views/layouts/base_admin.html.erb | 7 +++++++ .../users/_user_message_applied.html.erb | 10 ++++++++- config/locales/zh.yml | 2 +- public/stylesheets/application.css | 3 +++ 9 files changed, 41 insertions(+), 21 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 1b95ef895..7602b10a5 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -160,7 +160,7 @@ class AdminController < ApplicationController @sort = "" if params[:sort] && (params[:order] == 'name') # courses = School.find_by_sql("SELECT c.*,count(c.id) FROM courses c,course_activities ca WHERE c.id = ca.course_id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count(c.id) #{params[:sort]}, c.id desc") - school = School.find_by_sql(" SELECT aas.name FROM apply_add_schools aas where aas.status = '0' GROUP BY CONVERT(name USING gbk) #{params[:sort]}, aas.id desc ") + school = School.find_by_sql(" SELECT aas.name FROM apply_add_schools aas where aas.status = '0' ORDER BY CONVERT(aas.name USING gbk) #{params[:sort]}, aas.id asc ") @order = params[:order] @sort = params[:sort] end diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index ec585e2b2..b927b1108 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -187,6 +187,12 @@ class SchoolController < ApplicationController user_extention= User.current.extensions user_extention.school_id = school.id user_extention.save! + + # status=4 向管理员发送信息 + users = User.where(:admin => 1) + users.each do |user| + AppliedMessage.create(:user_id => user.id, :status => 4, :viewed => true, :applied_id => school.id, :applied_type => "ApplyAddSchools", :name => school.name ) + end else data[:result] = 3 end diff --git a/app/views/admin/_all_schools.html.erb b/app/views/admin/_all_schools.html.erb index af59d7687..d4cf916f5 100644 --- a/app/views/admin/_all_schools.html.erb +++ b/app/views/admin/_all_schools.html.erb @@ -1,5 +1,4 @@ <%= stylesheet_link_tag 'css/common','css/popup' %> -
更改为
diff --git a/app/views/admin/applied_schools.html.erb b/app/views/admin/applied_schools.html.erb index 32e67914f..507cb7c49 100644 --- a/app/views/admin/applied_schools.html.erb +++ b/app/views/admin/applied_schools.html.erb @@ -53,7 +53,7 @@ <%= apply.id %> - + <%= apply.name %> @@ -65,7 +65,7 @@ <%= (apply.province.nil? ? "" : apply.province) + (apply.city.nil? ? "" : apply.city) %> - + <%= apply.address %> @@ -76,9 +76,9 @@ <%= format_date(apply.created_at) %> - <%= link_to( l(:label_approve), { :controller => 'admin', :action => 'approve_applied_schools', :id => apply.id }) %> - <%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id, :tip => 'unapplied' },:method => :delete, :confirm => l(:text_are_you_sure)) %> - <%=link_to '更改', admin_all_schools_path(:school_id =>apply.id), :remote => true %> + <%= link_to( l(:label_approve), { :controller => 'admin', :action => 'approve_applied_schools', :id => apply.id }, :class => "application-default-link" ) %> + <%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id, :tip => 'unapplied' },:method => :delete, :confirm => l(:text_are_you_sure), :class => "application-default-link") %> + <%=link_to '更改', admin_all_schools_path(:school_id =>apply.id), :remote => true, :class => "application-default-link" %> diff --git a/app/views/admin/has_applied_schools.html.erb b/app/views/admin/has_applied_schools.html.erb index 11361dbac..555dce689 100644 --- a/app/views/admin/has_applied_schools.html.erb +++ b/app/views/admin/has_applied_schools.html.erb @@ -38,6 +38,9 @@ 原名 + + 用户 + 创建时间 @@ -53,7 +56,7 @@ <%= apply.id %> - + <% unless apply.school_id.nil? %> <% school_name = School.where("id=?", apply.school_id).first %> <%= school_name.name %> @@ -71,12 +74,16 @@ <%= school_province.province %> <% end %> - + <%= apply.address %> <%= apply.name %> + + <% count = UserExtensions.where("school_id = #{apply.school_id}").count %> + <%= count %> + <%= format_date(apply.created_at) %> @@ -84,16 +91,6 @@ <%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id, :tip => 'applied' },:method => :delete, :confirm => l(:text_are_you_sure) ) %> - <% unless apply.remarks.blank? %> - - - - - - <%= apply.remarks %> - - - <% end %> <% end %> <% end %> diff --git a/app/views/layouts/base_admin.html.erb b/app/views/layouts/base_admin.html.erb index 81cc2df9d..7f62da514 100644 --- a/app/views/layouts/base_admin.html.erb +++ b/app/views/layouts/base_admin.html.erb @@ -62,3 +62,10 @@ <%= call_hook :view_layouts_base_body_bottom %> + + diff --git a/app/views/users/_user_message_applied.html.erb b/app/views/users/_user_message_applied.html.erb index 0a4924c27..d6815e988 100644 --- a/app/views/users/_user_message_applied.html.erb +++ b/app/views/users/_user_message_applied.html.erb @@ -27,7 +27,15 @@ <%= link_to ma.name + "的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", { :controller=> "my",:action => "account" } %>
  • <%= time_tag(ma.created_at).html_safe %>
  • - <% end %> + <% elsif ma.status == 4 %> + <%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> + "> +
  • + + <%= User.where("id=?", ma.user_id).first.login %>提交了申请:添加新的单位“<%= ma.name %>” +
  • +
  • <%= time_tag(ma.created_at).html_safe %>
  • + <% end %> <% end %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index df9c26895..1340e7aa6 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -388,7 +388,7 @@ zh: label_organization_name: 组织名称 label_organization_list: 组织列表 label_school_plural: 学校列表 - label_applied_shcools: 单位名称列表 + label_applied_shcools: 单位审核 label_organization_new: 新建组织 label_edit_organization: 编辑组织 label_organization_edit: 修改组织 diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 112f8224b..9031ed9d8 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1281,6 +1281,9 @@ a, a:link, a:visited{ color: #169; text-decoration: none; } a:hover, a:active{ color: #c61a1a; text-decoration: underline;} a img{ border: 0; } +a.application-default-link {color: #169 !important; text-decoration: none;} +a.application-default-link:hover {color: #c61a1a !important; text-decoration: underline;} + a.issue.closed, a.issue.closed:link, a.issue.closed:visited { color: #999; text-decoration: line-through; } a.project.closed, a.project.closed:link, a.project.closed:visited { color: #999; } a.user.locked, a.user.locked:link, a.user.locked:visited {color: #999;} From 1f47eb5ea87cf162e24a5ef812a84f9ce3b46c3f Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 29 Jul 2016 21:19:09 +0800 Subject: [PATCH 07/26] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/school_controller.rb | 57 +++++++++ app/views/admin/applied_schools.html.erb | 51 +++++++- app/views/admin/has_applied_schools.html.erb | 2 +- config/routes.rb | 3 + public/javascripts/application.js | 121 +++++++++++++++++++ 5 files changed, 230 insertions(+), 4 deletions(-) diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index ec585e2b2..264f0ae1f 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -210,4 +210,61 @@ class SchoolController < ApplicationController render :json =>status end + + def edit_apply_name + name = params[:name] || "" + status = -1 + + if name != "" + applyschool = ApplyAddSchools.where("id=?",params[:id]).first + + applyschool.name = name.strip + + if applyschool.school + applyschool.school.name = name + applyschool.school.pinyin = Pinyin.t(name.strip, splitter: '') + applyschool.school.save! + end + applyschool.save! + status = 0 + end + + render :json=>{:status=>status,:id=>params[:id],:address=>name} + end + + def edit_apply_address + address = params[:address] || "" + + status = -1 + + if address != "" + applyschool = ApplyAddSchools.where("id=?",params[:id]).first + applyschool.address = address + applyschool.save! + status = 0 + end + + render :json=>{:status=>status,:id=>params[:id],:address=>address} + end + + def edit_apply_province + province = params[:province] || "" + city = params[:city] || "" + status = -1 + + if(province != "") &&(city != "") + applyschool = ApplyAddSchools.where("id=?",params[:id]).first + applyschool.province = province + applyschool.city = city + + if applyschool.school + applyschool.school.province = province + applyschool.school.save! + end + applyschool.save! + status = 0 + end + + render :json=>{:status=>status,:id=>params[:id],:province=>province,:city=>city} + end end diff --git a/app/views/admin/applied_schools.html.erb b/app/views/admin/applied_schools.html.erb index 32e67914f..319051d78 100644 --- a/app/views/admin/applied_schools.html.erb +++ b/app/views/admin/applied_schools.html.erb @@ -53,8 +53,9 @@ <%= apply.id %> - - <%= apply.name %> + + <%= apply.name %> + <% user = User.where("id=?", apply.user_id).first %> @@ -63,10 +64,51 @@ <% end %> + <%= (apply.province.nil? ? "" : apply.province) + (apply.city.nil? ? "" : apply.city) %> + + + - <%= apply.address %> + <%= apply.address %> + <% count = UserExtensions.where("school_id = #{apply.school_id}").count %> @@ -82,6 +124,9 @@ + <% unless apply.remarks.blank? %> diff --git a/app/views/admin/has_applied_schools.html.erb b/app/views/admin/has_applied_schools.html.erb index 11361dbac..2f6fc1f23 100644 --- a/app/views/admin/has_applied_schools.html.erb +++ b/app/views/admin/has_applied_schools.html.erb @@ -53,7 +53,7 @@ <%= apply.id %> - + <% unless apply.school_id.nil? %> <% school_name = School.where("id=?", apply.school_id).first %> <%= school_name.name %> diff --git a/config/routes.rb b/config/routes.rb index b07600400..77e6c2791 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -226,6 +226,9 @@ RedmineApp::Application.routes.draw do member do get 'upload_logo' post 'upload' + get 'edit_apply_name' + get 'edit_apply_address' + get 'edit_apply_province' end end diff --git a/public/javascripts/application.js b/public/javascripts/application.js index b7468366a..c31bc0f3e 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1880,3 +1880,124 @@ function updateCourseName(){ } } } + +function edit_school_name(url,id){ + if($("#school_name_edit_"+id).val() == ""){ + $("#apply_title_"+id).show(); + $("#school_name_edit_"+id).hide(); + return; + } + $.get( + url, + {id: id ,name: $("#school_name_edit_"+id).val() }, + function (data) { + if(data.status == 0){ + $("#apply_title_"+data.id).show(); + $("#school_name_edit_"+data.id).hide(); + $("#apply_title_"+data.id).text(data.name); + } + else{ + $("#apply_title_"+data.id).show(); + $("#school_name_edit_"+data.id).hide(); + } + + } + ); +} + +function show_edit_school_name(id){ + $("#apply_title_"+id).hide(); + $("#school_name_edit_"+id).val($("#apply_title_"+id).text()); + $("#school_name_edit_"+id).show(); + $("#school_name_edit_"+id).focus(); + + +} + +function edit_school_address(url,id){ + if($("#school_address_edit_"+id).val() == ""){ + $("#apply_address_"+id).show(); + $("#school_address_edit_"+id).hide(); + return; + } + $.get( + url, + {id: id ,address: $("#school_address_edit_"+id).val() }, + function (data) { + if(data.status == 0){ + $("#apply_address_"+data.id).show(); + $("#school_address_edit_"+data.id).hide(); + $("#apply_address_"+data.id).text(data.address); + } + else{ + $("#apply_address_"+data.id).show(); + $("#school_address_edit_"+data.id).hide(); + } + + + } + ); +} + +function show_edit_school_address(id){ + $("#apply_address_"+id).hide(); + $("#school_address_edit_"+id).val($("#apply_address_"+id).text()); + $("#school_address_edit_"+id).show(); + $("#school_address_edit_"+id).focus(); +} + +function edit_school_province(url,id){ + + var province = $("#school_province_edit_"+id).val(); + var city = $("#schoolCity_"+id).val(); + + if((province == "")||(city == "")){ + $("#apply_province_"+id).show(); + $("#school_province_edit_"+id).hide(); + $("#schoolCity_"+id).hide(); + return; + } + + $.get( + url, + {id: id ,province: province,city:city }, + function (data) { + if(data.status == 0){ + $("#apply_province_"+data.id).show(); + $("#school_province_edit_"+data.id).hide(); + $("#schoolCity_"+data.id).hide(); + init_province_and_city(document.getElementById('school_province_edit_'+data.id), data.province, document.getElementById('schoolCity_'+data.id), data.city); + $("#apply_province_"+data.id).text(data.province+data.city); + + } + else{ + $("#apply_province_"+data.id).show(); + $("#school_province_edit_"+data.id).hide(); + $("#schoolCity_"+data.id).hide(); + } + + } + ); +} + +function init_province_and_city(pField, province, cField, city) { + for (var i = 0; i < pField.options.length; i++) { + if (pField.options[i].value == province) { + pField.selectedIndex = i; + } + } + showcity(province, cField); + for (var i = 0; i < cField.options.length; i++) { + if (cField.options[i].value == city) { + cField.selectedIndex = i; + } + } +} + +function show_edit_school_province(id){ + $("#apply_province_"+id).hide(); + $("#school_province_edit_"+id).show(); + $("#schoolCity_"+id).show(); + +} + From 807db1ac405c53577f1d9985bb640f71cfe790e2 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 29 Jul 2016 21:41:19 +0800 Subject: [PATCH 08/26] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E9=93=BE=E6=8E=A5=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_join_course_course_message.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/_join_course_course_message.html.erb b/app/views/users/_join_course_course_message.html.erb index cecbe2755..c0d32eda1 100644 --- a/app/views/users/_join_course_course_message.html.erb +++ b/app/views/users/_join_course_course_message.html.erb @@ -23,9 +23,9 @@
  • <% if ma.status == 0 || ma.status.nil?%> - <%= link_to '同意',dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>ma.id),:remote=>'true'%> + <%= link_to '同意',dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>ma.id),:remote=>'true',:class=>'linkBlue'%> | - <%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>ma.id),:remote=>'true'%> + <%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>ma.id),:remote=>'true',:class=>'linkBlue'%> <% elsif ma.status == 1%> 您已经同意了该申请 <% elsif ma.status == 2%> From 17044629869e944de71a7cd9c7f9309e8cf99775 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 29 Jul 2016 21:45:32 +0800 Subject: [PATCH 09/26] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=8D=95=E4=BD=8D=E7=94=B3=E8=AF=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/school_controller.rb | 2 +- app/views/admin/applied_schools.html.erb | 2 +- app/views/admin/has_applied_schools.html.erb | 56 +++++++++++++++++--- 3 files changed, 51 insertions(+), 9 deletions(-) diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index 264f0ae1f..4553d6ea9 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -229,7 +229,7 @@ class SchoolController < ApplicationController status = 0 end - render :json=>{:status=>status,:id=>params[:id],:address=>name} + render :json=>{:status=>status,:id=>params[:id],:name=>name} end def edit_apply_address diff --git a/app/views/admin/applied_schools.html.erb b/app/views/admin/applied_schools.html.erb index 319051d78..61db6769f 100644 --- a/app/views/admin/applied_schools.html.erb +++ b/app/views/admin/applied_schools.html.erb @@ -54,7 +54,7 @@ <%= apply.id %> - <%= apply.name %> + <%= apply.name %> diff --git a/app/views/admin/has_applied_schools.html.erb b/app/views/admin/has_applied_schools.html.erb index 2f6fc1f23..cbb0e70e5 100644 --- a/app/views/admin/has_applied_schools.html.erb +++ b/app/views/admin/has_applied_schools.html.erb @@ -53,10 +53,11 @@ <%= apply.id %> - + <% unless apply.school_id.nil? %> <% school_name = School.where("id=?", apply.school_id).first %> - <%= school_name.name %> + <%= school_name %> + <% end %> @@ -66,13 +67,51 @@ <% end %> - <% unless apply.school_id.nil? %> - <% school_province = School.where("id=?", apply.school_id).first %> - <%= school_province.province %> - <% end %> + + <%= (apply.province.nil? ? "" : apply.province) + (apply.city.nil? ? "" : apply.city) %> + + + - <%= apply.address %> + <%= apply.address %> + <%= apply.name %> @@ -84,6 +123,9 @@ <%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id, :tip => 'applied' },:method => :delete, :confirm => l(:text_are_you_sure) ) %> + <% unless apply.remarks.blank? %> From d6178ec7dd2a1be954ddf9b2380274d858cc4eb6 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 29 Jul 2016 21:45:52 +0800 Subject: [PATCH 10/26] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=8D=95=E4=BD=8D=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/school_controller.rb | 2 +- app/models/applied_message.rb | 3 ++- app/views/admin/applied_schools.html.erb | 2 +- app/views/admin/has_applied_schools.html.erb | 2 +- app/views/users/_user_message_applied.html.erb | 10 ++++++---- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index b927b1108..037fdd411 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -191,7 +191,7 @@ class SchoolController < ApplicationController # status=4 向管理员发送信息 users = User.where(:admin => 1) users.each do |user| - AppliedMessage.create(:user_id => user.id, :status => 4, :viewed => true, :applied_id => school.id, :applied_type => "ApplyAddSchools", :name => school.name ) + AppliedMessage.create(:user_id => user.id, :status => 4, :applied_user_id => User.current.id, :viewed => true, :applied_id => school.id, :applied_type => "ApplyAddSchools", :name => school.name ) end else data[:result] = 3 diff --git a/app/models/applied_message.rb b/app/models/applied_message.rb index c008a2284..2e8891fcd 100644 --- a/app/models/applied_message.rb +++ b/app/models/applied_message.rb @@ -1,6 +1,7 @@ class AppliedMessage < ActiveRecord::Base # status: 0表示未批准; status:1表示已批准; status: 2表示已拒绝 - attr_accessible :applied_id, :applied_type, :status, :user_id, :viewed, :applied_user_id, :role, :project_id, :name belongs_to :applied ,:polymorphic => true + attr_accessible :applied_id, :applied_type, :status, :user_id, :viewed, :applied_user_id, :role, :project_id, :name + belongs_to :applied ,:polymorphic => true belongs_to :apply_add_schools belongs_to :user has_many :message_alls, :class_name => 'MessageAll', :as =>:message, :dependent => :destroy diff --git a/app/views/admin/applied_schools.html.erb b/app/views/admin/applied_schools.html.erb index 507cb7c49..518624b5f 100644 --- a/app/views/admin/applied_schools.html.erb +++ b/app/views/admin/applied_schools.html.erb @@ -59,7 +59,7 @@ <% user = User.where("id=?", apply.user_id).first %> <% unless user.nil? %> - <%= user.login %> + <%=link_to user.show_name, user_path(user) %> <% end %> diff --git a/app/views/admin/has_applied_schools.html.erb b/app/views/admin/has_applied_schools.html.erb index 555dce689..286edbd19 100644 --- a/app/views/admin/has_applied_schools.html.erb +++ b/app/views/admin/has_applied_schools.html.erb @@ -65,7 +65,7 @@ <% user = User.where("id=?", apply.user_id).first %> <% unless user.nil? %> - <%= user.login %> + <%=link_to user.show_name, user_path(user) %> <% end %> diff --git a/app/views/users/_user_message_applied.html.erb b/app/views/users/_user_message_applied.html.erb index b2735f32a..d52e4c2c8 100644 --- a/app/views/users/_user_message_applied.html.erb +++ b/app/views/users/_user_message_applied.html.erb @@ -1,6 +1,7 @@ <% if ma.class == AppliedMessage %> <% if ma.applied_type == "ApplyAddSchools" %> + <% if ma.status == 1 || ma.status == 2 || ma.status == 3 || ma.status == 4 %> + <% end %> <% elsif ma && ma.applied_type == "AppliedProject" %>
  • 更新:<%=format_date Time.at(course.updatetime) %>学期:<%=current_time_and_term(course) %>

    -

    <%=studentCount course %>学生|<%=visable_course_homework course %>作业|<%=visable_attachemnts_incourse(@course).count %>资源

    +

    <%=studentCount course %>学生|<%=visable_course_homework course %>作业|<%=visable_attachemnts_incourse(course).count %>资源

    From 97288d4eb499e3e1a610bf338f2734e58f512f9d Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 29 Jul 2016 22:51:13 +0800 Subject: [PATCH 17/26] =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/applied_project/_applied_join_project.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/applied_project/_applied_join_project.html.erb b/app/views/applied_project/_applied_join_project.html.erb index 457cdf9cc..e2c447992 100644 --- a/app/views/applied_project/_applied_join_project.html.erb +++ b/app/views/applied_project/_applied_join_project.html.erb @@ -19,8 +19,8 @@
  • - - + + 确  定 取  消
  • From b1fd7048fed572a84cf9e0b7eff3224f7b3e8327 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 29 Jul 2016 22:58:24 +0800 Subject: [PATCH 18/26] =?UTF-8?q?=E6=8A=A5=E5=91=8A=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/applied_project_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/applied_project_controller.rb b/app/controllers/applied_project_controller.rb index d779c7759..49ba03eda 100644 --- a/app/controllers/applied_project_controller.rb +++ b/app/controllers/applied_project_controller.rb @@ -61,7 +61,7 @@ class AppliedProjectController < ApplicationController @flag = 3 else @flag = 4 - role = params[:member] == "member_manager" ? 3 : (params[:member] = "member_developer" ? 4 :5) + role = params[:member] == "member_manager" ? 3 : (params[:member] == "member_developer" ? 4 :5) applied_project = AppliedProject.create(:user_id => User.current.id, :project_id => @project.id, :role => role) # 申请成功则给项目管理员发送邮件及发送消息 Mailer.run.applied_project(applied_project) From 21eed9ebb39331e806ffbc2d61db8a7944bc5a63 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 29 Jul 2016 23:03:18 +0800 Subject: [PATCH 19/26] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=90=8C=E6=84=8F?= =?UTF-8?q?=E6=8B=92=E7=BB=9D=E2=80=9C=EF=BC=9A=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_message_applide_action.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_message_applide_action.html.erb b/app/views/users/_user_message_applide_action.html.erb index fc56b9f22..48e479b22 100644 --- a/app/views/users/_user_message_applide_action.html.erb +++ b/app/views/users/_user_message_applide_action.html.erb @@ -1,5 +1,5 @@ <% if allow_to_show(ma) %> - :<%= link_to "同意", allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :post, :class => "link-blue"%> | + <%= link_to "同意", allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :post, :class => "link-blue"%> | <%= link_to "拒绝", refused_allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :get, :class => "link-blue" %> <% elsif ma.status == 4 %> 被拒绝 From db690bedab1e27605b6263de4870195ef7912f61 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 29 Jul 2016 23:22:32 +0800 Subject: [PATCH 20/26] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=BC=BA=E9=99=B7=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 12 ++++++---- app/views/admin/applied_schools.html.erb | 11 ++++++---- app/views/admin/has_applied_schools.html.erb | 15 ++++++++----- .../users/_user_message_applied.html.erb | 22 ++++++++++++------- 4 files changed, 38 insertions(+), 22 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 7602b10a5..935ca1d71 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -615,8 +615,10 @@ class AdminController < ApplicationController # 获取申请的高校列表 # status: 0 未审批; 1 已批阅; def applied_schools - @name = params[:name] - @apply_status = ApplyAddSchools.where(:status => 0).order('created_at desc') + @name = params[:name] || "" + condition = "#{@name.strip}".gsub(" ","") + + @apply_status = ApplyAddSchools.where("status = 0 and name like '%#{condition}%'").order('created_at desc') @apply_count = @apply_status.count @apply_pages = Paginator.new @apply_count, 30, params['page'] || 1 @@ -629,8 +631,10 @@ class AdminController < ApplicationController end def has_applied_schools - @name = params[:name] - @has_apply_status = ApplyAddSchools.where("status = 1 or status = 2").order('created_at desc') + @name = params[:name] || "" + condition = "#{@name.strip}".gsub(" ","") + + @has_apply_status = ApplyAddSchools.where("(status = 1 or status = 2) and name like '%#{condition}%'").order('created_at desc') @has_apply_count = @has_apply_status.count @has_apply_pages = Paginator.new @has_apply_count, 30, params['page'] || 1 diff --git a/app/views/admin/applied_schools.html.erb b/app/views/admin/applied_schools.html.erb index c9ebdfb66..2f139ca72 100644 --- a/app/views/admin/applied_schools.html.erb +++ b/app/views/admin/applied_schools.html.erb @@ -53,14 +53,14 @@ <%= apply.id %> - - <%= apply.name %> + + <%= apply.name %> <% user = User.where("id=?", apply.user_id).first %> <% unless user.nil? %> - <%=link_to user.show_name, user_path(user) %> + <%=link_to user.show_name, user_path(user),:target => '_blank' %> <% end %> @@ -141,4 +141,7 @@ <% end %> - \ No newline at end of file + +
      + <%= pagination_links_full @apply_pages, @apply_count ,:per_page_links => true, :remote => false, :flag => true %> +
    \ No newline at end of file diff --git a/app/views/admin/has_applied_schools.html.erb b/app/views/admin/has_applied_schools.html.erb index b0419bcab..5be3517c8 100644 --- a/app/views/admin/has_applied_schools.html.erb +++ b/app/views/admin/has_applied_schools.html.erb @@ -23,7 +23,7 @@ 序号 - + 单位名称 @@ -41,7 +41,7 @@ 用户 - + 创建时间 @@ -56,7 +56,7 @@ <%= apply.id %> - + <% unless apply.school_id.nil? %> <% school_name = School.where("id=?", apply.school_id).first %> <%= school_name %> @@ -64,9 +64,9 @@ <% end %> - <% user = User.where("id=?", apply.user_id).first %> + <% user = User.where("id=?", apply.user_id).first%> <% unless user.nil? %> - <%=link_to user.show_name, user_path(user) %> + <%=link_to user.show_name, user_path(user), :target => '_blank'%> <% end %> @@ -137,4 +137,7 @@ <% end %> - \ No newline at end of file + +
      + <%= pagination_links_full @has_apply_pages, @has_apply_count ,:per_page_links => true, :remote => false, :flag => true %> +
    \ No newline at end of file diff --git a/app/views/users/_user_message_applied.html.erb b/app/views/users/_user_message_applied.html.erb index e6fcfb25d..dd1b787fd 100644 --- a/app/views/users/_user_message_applied.html.erb +++ b/app/views/users/_user_message_applied.html.erb @@ -4,33 +4,39 @@ <% if ma.status == 1 || ma.status == 2 || ma.status == 3 || ma.status == 4 %>