From eadab840b61b03fe62925c37530e27c98a3bba1d Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 3 Nov 2015 11:19:38 +0800 Subject: [PATCH 001/132] =?UTF-8?q?=E5=BB=BA=E7=AB=8B=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E3=80=81=E6=88=90=E5=91=98=E8=A1=A8=E5=8F=8A=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=99=A8=EF=BC=9B=20=E7=BC=96=E5=86=99?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=BB=84=E7=BB=87=E9=A1=B5=E9=9D=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javascripts/organizations.js.coffee | 3 + app/assets/stylesheets/organizations.css.scss | 3 + app/controllers/organizations_controller.rb | 15 +++ app/helpers/organizations_helper.rb | 2 +- app/models/org_member.rb | 4 + app/models/organization.rb | 4 +- app/views/layouts/new_base.html.erb | 2 +- app/views/organizations/create.js.erb | 0 app/views/organizations/new.html.erb | 95 +++++++++++++++++++ config/locales/commons/zh.yml | 4 + config/routes.rb | 2 + ...b => 20151103011119_create_org_members.rb} | 7 +- public/stylesheets/org.css | 6 ++ .../organizations_controller_spec.rb | 5 + spec/factories/org_members.rb | 8 ++ spec/models/org_member_spec.rb | 5 + 16 files changed, 156 insertions(+), 9 deletions(-) create mode 100644 app/assets/javascripts/organizations.js.coffee create mode 100644 app/assets/stylesheets/organizations.css.scss create mode 100644 app/controllers/organizations_controller.rb create mode 100644 app/models/org_member.rb create mode 100644 app/views/organizations/create.js.erb create mode 100644 app/views/organizations/new.html.erb rename db/migrate/{20151102090519_create_org_members.rb => 20151103011119_create_org_members.rb} (76%) create mode 100644 public/stylesheets/org.css create mode 100644 spec/controllers/organizations_controller_spec.rb create mode 100644 spec/factories/org_members.rb create mode 100644 spec/models/org_member_spec.rb diff --git a/app/assets/javascripts/organizations.js.coffee b/app/assets/javascripts/organizations.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/organizations.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/organizations.css.scss b/app/assets/stylesheets/organizations.css.scss new file mode 100644 index 000000000..39819880e --- /dev/null +++ b/app/assets/stylesheets/organizations.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the organizations controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb new file mode 100644 index 000000000..1d0edbd7e --- /dev/null +++ b/app/controllers/organizations_controller.rb @@ -0,0 +1,15 @@ +class OrganizationsController < ApplicationController + def new + @organization = Organization.new + render :layout => 'new_base' + end + def create + @organization = Organization.new + @organization.name = params[:organization][:name] + @organization.description = params[:organization][:description] + @organization.is_public = params[:organization][:is_public] + @organization.creator_id = User.current.id + member = OrgMember.new(:user_id => User.current.id, :role => 'Manager') + @organization.org_members << member + end +end diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 10321ba16..24cc9a80e 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -1,2 +1,2 @@ -module EnterprisesHelper +module OrganizationsHelper end diff --git a/app/models/org_member.rb b/app/models/org_member.rb new file mode 100644 index 000000000..c4be034fe --- /dev/null +++ b/app/models/org_member.rb @@ -0,0 +1,4 @@ +class OrgMember < ActiveRecord::Base + attr_accessible :organization_id, :role, :user_id + belongs_to :organization +end diff --git a/app/models/organization.rb b/app/models/organization.rb index 5f52dee98..39b5900d9 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -1,5 +1,5 @@ class Organization < ActiveRecord::Base - attr_accessible :logo_link, :name - + attr_accessible :name, :description, :creator_id, :home_id, :domain, :is_public + has_many :org_members, :dependent => :destroy has_many :projects end diff --git a/app/views/layouts/new_base.html.erb b/app/views/layouts/new_base.html.erb index 6ab83d393..a2bbee9e3 100644 --- a/app/views/layouts/new_base.html.erb +++ b/app/views/layouts/new_base.html.erb @@ -13,7 +13,7 @@ <%= javascript_heads %> <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> - <%= stylesheet_link_tag 'public', 'leftside', 'courses','header','prettify'%> + <%= stylesheet_link_tag 'public', 'leftside', 'courses','header','prettify', 'org'%> <%= javascript_include_tag "course","header",'prettify' %> <%= yield :header_tags -%> diff --git a/app/views/organizations/create.js.erb b/app/views/organizations/create.js.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/organizations/new.html.erb b/app/views/organizations/new.html.erb new file mode 100644 index 000000000..de8983f02 --- /dev/null +++ b/app/views/organizations/new.html.erb @@ -0,0 +1,95 @@ + +<% @nav_dispaly_organization_label = 1 + @nav_dispaly_forum_label = 1 %> +<%= error_messages_for 'organization' %> +
+

<%= l(:label_organization_new)%>

+
+
+ +
+
+ +<% html_title(l(:label_organization_new)) -%> + + + diff --git a/config/locales/commons/zh.yml b/config/locales/commons/zh.yml index 61bad2a00..54f0fbdaf 100644 --- a/config/locales/commons/zh.yml +++ b/config/locales/commons/zh.yml @@ -288,6 +288,10 @@ zh: label_tags_project_name: "项目名称:" label_projects_new_name: "项目名称" label_tags_project_description: "项目描述" + + label_organization_name: "组织名称" + label_organization_description: "组织描述" + label_organization_new: "新建组织" label_tags_user_mail: "用户邮箱:" label_tags_user_name: "用户名:" diff --git a/config/routes.rb b/config/routes.rb index 9a6b48da2..0394cdb53 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -31,6 +31,8 @@ RedmineApp::Application.routes.draw do # Enable Grack support # mount Trustie::Grack.new, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post] + resources :organizations + resources :homework_users resources :no_uses delete 'no_uses', :to => 'no_uses#delete' diff --git a/db/migrate/20151102090519_create_org_members.rb b/db/migrate/20151103011119_create_org_members.rb similarity index 76% rename from db/migrate/20151102090519_create_org_members.rb rename to db/migrate/20151103011119_create_org_members.rb index 037d8a3c6..6ef208794 100644 --- a/db/migrate/20151102090519_create_org_members.rb +++ b/db/migrate/20151103011119_create_org_members.rb @@ -1,14 +1,11 @@ class CreateOrgMembers < ActiveRecord::Migration - def up + def change create_table :org_members do |t| t.integer :user_id t.integer :organization_id t.string :role + t.timestamps end end - - def down - drop_table :org_members - end end diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css new file mode 100644 index 000000000..b1dfbbcf0 --- /dev/null +++ b/public/stylesheets/org.css @@ -0,0 +1,6 @@ +@charset "utf-8"; +/* CSS Document */ + +.orgName {width:130px; color:#484848;} +.organization_r_h02{ width:970px; height:40px; background:#eaeaea; margin-bottom:10px;} +.organization_h2{ background:#64bdd9; color:#fff; height:33px; width:90px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;} \ No newline at end of file diff --git a/spec/controllers/organizations_controller_spec.rb b/spec/controllers/organizations_controller_spec.rb new file mode 100644 index 000000000..cf00f4cf9 --- /dev/null +++ b/spec/controllers/organizations_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe OrganizationsController, :type => :controller do + +end diff --git a/spec/factories/org_members.rb b/spec/factories/org_members.rb new file mode 100644 index 000000000..90997fd30 --- /dev/null +++ b/spec/factories/org_members.rb @@ -0,0 +1,8 @@ +FactoryGirl.define do + factory :org_member do + user_id 1 +organization_id 1 +role "MyString" + end + +end diff --git a/spec/models/org_member_spec.rb b/spec/models/org_member_spec.rb new file mode 100644 index 000000000..e7058e5b3 --- /dev/null +++ b/spec/models/org_member_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe OrgMember, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end From 3f289dcd74ead27f1afbcb0593e0416d5dedf654 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 3 Nov 2015 17:21:32 +0800 Subject: [PATCH 002/132] =?UTF-8?q?org=E5=BC=80=E5=8F=91=E9=83=A8=E5=88=86?= =?UTF-8?q?=EF=BC=88=E6=9C=AA=E5=AE=8C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organization_controller.rb | 55 ------- app/controllers/organizations_controller.rb | 12 ++ app/views/layouts/base_org.html.erb | 157 ++++++++++++++++++++ app/views/organizations/show.html.erb | 4 + 4 files changed, 173 insertions(+), 55 deletions(-) delete mode 100644 app/controllers/organization_controller.rb create mode 100644 app/views/layouts/base_org.html.erb create mode 100644 app/views/organizations/show.html.erb diff --git a/app/controllers/organization_controller.rb b/app/controllers/organization_controller.rb deleted file mode 100644 index 748fc1732..000000000 --- a/app/controllers/organization_controller.rb +++ /dev/null @@ -1,55 +0,0 @@ -class OrganizationController < ApplicationController - # layout 'base_projects' - before_filter :require_admin, :except => [:index] - - def index - #@projects = Project.find_by_sql("SELECT * FROM projects WHERE id IN (select MAX(id) from projects GROUP BY enterprise_name)") - @organizations = Organization.all - respond_to do |format| - format.html - end - end - - def new - @organizations = Organization.new - respond_to do |format| - format.html - end - end - - def create - @organizations = Organization.new - @organizations.name = params[:organization][:name] - if @organizations.save - redirect_to admin_organization_url - end - end - - def edit - @organization = Organization.find params[:id] - respond_to do |format| - format.html - end - rescue Exception => e - render_404 - end - - def update - @organization = Organization.find params[:id] - @organization.name = params[:organization][:name] - if @organization.save - redirect_to admin_organization_url - end - rescue Exception => e - render_404 - end - - def destroy - @organization = Organization.find params[:id] - if @organization.destroy - redirect_to admin_organization_url - end - rescue Exception => e - render_404 - end -end diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 1d0edbd7e..0def8b5f8 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -1,4 +1,5 @@ class OrganizationsController < ApplicationController + layout 'base_org' def new @organization = Organization.new render :layout => 'new_base' @@ -11,5 +12,16 @@ class OrganizationsController < ApplicationController @organization.creator_id = User.current.id member = OrgMember.new(:user_id => User.current.id, :role => 'Manager') @organization.org_members << member + if @organization.save + redirect_to organization_path(@organization) + end + end + + def show + + end + + def update + end end diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb new file mode 100644 index 000000000..a3829ea3b --- /dev/null +++ b/app/views/layouts/base_org.html.erb @@ -0,0 +1,157 @@ +<% @nav_dispaly_project_label = 1 + @nav_dispaly_forum_label = 1 %> +<%#@nav_dispaly_project_label = 1 %> + + + + + <%= h html_title %> + + + <%= csrf_meta_tag %> + <%= favicon %> + <%= javascript_heads %> + <%= heads_for_theme %> + <%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository' %> + <%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move' %> + <%= call_hook :view_layouts_base_html_head %> + + <%= yield :header_tags -%> + + + + + + +
+ <% @organization = Organization.find(params[:id])%> +
+
+
+
+ +
组织id:<%= @organization.id %>
+ 配置 +
+
文章 ( 3 ) | 成员 ( 10 )
+
+ +
+
+
+
最新动态
+ +
+
+
+
用户头像
+
+ + +
发帖时间:2015-11-02 11:25
+
罗永浩已经把他的主题演讲成功变成了一次次的重大的媒体事件,这让科技界和营销界的从业者们羡慕不已。事实上,老罗不仅从乔布斯那里继承了乔式审美,设计哲学,同时也继承了乔布斯的演讲艺术。乔布斯是人类历史上最伟大的演讲者。在一次又一次的"罗氏演讲"中,我们可以清晰看到老罗对乔布斯演讲的拆解,学习,模仿。每一次的公开演讲,都是一堂案例级的营销课程,值得每一位有志于从事营销相关的朋友分析研究。
+ 下面,我们将从"故事"、"现场"、"准备"三个方面分析学习老罗的演讲技巧,教你如何打造一场"罗永浩式"的演讲。
+
+ +
+
+
+
+
+
+
回复(2)
+ + +
+
+
用户头像
+
+
黄井泉 学生 2015-11-03 12:26
+
学习下!
+
+
+
+
+
用户头像
+
+
陈正东 学生 2015-11-02 17:08
+
锤子手机,卖的就是情怀
+
+
+
+
+
用户头像
+
+ + 发送
+
+
+
+
+
+
+
+
用户头像
+
+ + +
创建时间:2015-10-29 11:23
+
+
+
+
+
+
+
+ +
+ <%= render_flash_messages %> + <%= yield %> + <%= call_hook :view_layouts_base_content %> +
+
+ + +
+ <%= render :partial => 'layouts/footer' %> +
+ + + diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb new file mode 100644 index 000000000..9d38aedc1 --- /dev/null +++ b/app/views/organizations/show.html.erb @@ -0,0 +1,4 @@ +<%= javascript_include_tag "jquery.infinitescroll.js" %> +
+

组织活动

+
\ No newline at end of file From 1133b35169b67a138f8b049467c0824e996f0e45 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 4 Nov 2015 15:24:24 +0800 Subject: [PATCH 003/132] =?UTF-8?q?=E4=BD=9C=E4=B8=9Atag=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20=E4=BD=9C=E4=B8=9A=E6=88=AA=E6=AD=A2=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=B2=BE=E7=A1=AE=E5=88=B0=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_homework.html.erb | 14 +++++++++---- .../users/_user_homework_detail.html.erb | 20 ++++++++++++------- public/stylesheets/courses.css | 2 +- public/stylesheets/new_user.css | 2 +- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 77f7d97dd..be7945cc0 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -13,25 +13,31 @@ <% end %> TO <%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%> -
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 3d841b087..f9743d7c3 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -10,7 +10,7 @@ TO <%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
-
<% end %>
- <%= l(:label_end_time)%>:<%= homework_common.end_time%> + <%= l(:label_end_time)%>:<%= homework_common.end_time%> 23:59
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 317a21d02..22560f0aa 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -966,7 +966,7 @@ a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-r .ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; } .W50{ width:50px;} .W200{ width:200px;} -.m_w480{max-width: 480px;} +.m_w505{max-width: 505px;} .m_w500{max-width: 500px;} .m_w530{max-width: 530px;} .ProResultTable{ color:#888888;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 6a296b941..061ad0561 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1073,7 +1073,7 @@ a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-r .ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; } .W50{ width:50px;} .W200{ width:200px;} -.m_w480{max-width: 480px;} +.m_w505{max-width: 505px;} .m_w530{max-width: 530px;} .ProResultTable{ color:#888888;} .T_C{ text-align:center;} From 3928b2dcaf2e820acf165ff8047c91dd94d5e1b7 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 4 Nov 2015 15:48:57 +0800 Subject: [PATCH 004/132] =?UTF-8?q?=E6=84=8F=E8=A7=81=E5=8F=8D=E9=A6=88?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/images/sidebar_bg.png | Bin 9913 -> 7281 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/public/images/sidebar_bg.png b/public/images/sidebar_bg.png index 9ceea0f9176902560fa21d8eddd17a372d761edd..e4d12da4dffa4b7d73d9767af38102b57212c1fa 100644 GIT binary patch literal 7281 zcmch5c|6oz`|v2;g%E{OmZp$B`xcXskfo69S;k0J7uCDkH~-=Vys3j-eSN)DrKSD+{G|Nkq>w%^X&Dt2l|ve`vXTIV zBr3qu*TG-X6Lslt3ffSVlaHI1uN%@+@Q|W|BNFYa4hAIs*A@_7|0e5+`b$lK!leBj zyrgBMt{!gbZ$LxC|2HTC@o#99?_KDBqs#)lpwf4tC?wj)2{4??r9)O;s#-o! z2VbO*84~I7w-!xYk-kWjE7D6)%T!VDiiMk}Gtv(w`WxQRP*u+ptLpDk#g{P?phFkde_*xFN5k0{moTm1M5!$ZIP6jjN4xLL;D_zJKF7{|8s= zA8`*|0pSI3)`t4HVW7@8eUJ#j-&zSd{FYUpPppC?nn;bzA9IE$H|#v)*f!drUx1BM(z)9+!_vAbP~DZJpCJI zoKskNQdgh~e1Xb`s_GclhCwkt&g~^N!^3G^s$WQuX`(O;WgRw=n`S#%C|HZ?eDk3Z z^L;O8&a-^D0n*INut0vLAhY^&)RMdJ0^$!ug2zGnbxh)ED(=g$*THUBc>;X}3~NYB zQnfBP2p92ByS>9oN3ZimY<1aD9fQ-$-*#c=kE!BQ=yubE<>k#?J~P@mKM=LM@$4Yb z_3W6SN}i0luID-lWR=ue4}7_lo82W-Y|9-8^V(4uMBk?iuU0pZF^W4!H^ST_j@BDZ zrj?R6nu?9Sz;<4Ea6IFB3VIq(EABhd_Q zDAN)EVB_X4?M)~bM4yjYOqtw6bfs@`tZ#KrD(M#sboQX-CB47I1O~yl_Ee65t~&|# z?uLh^T`3z3uHhX2^Q59$S?Hq##R=cROEKizJ6wLW4cvw5116Y-a@{w};4{IWS|WSM zXv&5#<$O0*O~WFzMg{vTWL<6K`&)I=W>c{ur6PERkdwVdJd>L9LHRyhjY1e&wjHSQ zfhEzsogzYPY@4f(fdu2e*m5|RIn2oljCUJ>O~&tTcl~MqR=awfiDJK`v(2TJ{!AbT ztjCz{hQHG^s{$Q^N8|cl?HIsqW`BMZ#ZH;V){a07&plXRBRY^?%o6oyp)+q5yLrb) zvD->6NRM&&L1l2Nq;$cw^-)kylN-6k-S&}F6!`1uk1{PX9hnn7R9(^d6rOH>#T@VM zl(q9^gm{tex$UmUdvmG}yImPG2yYw4u|KcUI&)?ayP02_iXRIM_mL4L2fEW;12FEI z?sna;Y=yH7AlId7DK?RqWz##Ukq3Y;WfQeGDWl;`@o0~m_@FmvYLi{{Y^M$pt%phB z+-4(<4A-YzBF27<5DgLx+3?}r6cV6zT{ySR2ntKqi|0vw79-y%pq6}DjBhzX2=FY^ zoqLb0KJau%J@xO-UAFMpnAR9t7Fp4oZ2qQxNe^xDM7-jh7BlZPq`L!7a;&zbabtF6 zL{En@6qFMj{$ut!=?<-Lp4qzADWhmSj#;9S6pB;9h$=7yE$1gvv$!*jPVjF4}uNuvI8bo|R>V4M~npxGVPbCbE z<|I*^e|;TnW1>Z9u@EEM=m;~-g^H5u0OLwlsc*Sc45z3Mb_m&B>3s*pnwb(IjtU++ z1uhy4YcEkA9X`%&t*WF^7J4tXyU;+(S#GY{^4ws#=?sn7n}RfE&UcR=vJD;fI4H;D z@~J0RXz_St*nJxJw5+ZCDT8LTyI@|uz>Ali#i z%R`mnCW4y-3cAnJC+gtoTdO~0w#VQ?b0V7?hGNSuPI0vZwtju9?$+euYTr?fI>h{y z4&Rgqiu&{0P1{GN4eoijE&&qp{oSR`uXEKkTCy-0|3( zVO3XF6I44M8u-d&#F7~P`_6LTJqTiPc* z;eX&e+bQ|HBCSuw*GBW%ev$MZC9`6;S`;+<)0vr&THw6+Mx^a=O#{x*U!PMsyvl`U%n|0oTnyntl1N*L{)=p7E+4aC~A&!uIQfP`GbaC zr@DZV$%<|QWHr)%I$Rc~&XlL(^WD=w01@8Ae>2%(bM(~88^}&bd(8c^0p^0VOgp(8 zyyW^L@jG=QF?e77xBDIT>};#X)K6bqh#UZA<2yW~SHYIJK+B#ehy{lUk zTB{Y5!|!9^_-a04>curn8<&>4e7R|B?A$@EUdU;FyvJ13!&ePh!6)h2Wnk;o5uggejIG8AeAYtqje?K23jqO&kXmA>QJsw|w)fe(bfMR)7O3E_orADt*^kmMn1E^AqV@EIX>=?kq5&APXK zEgrXDoBE1b$WS__G4)~(g9vD)i=3uj>AgtWX0r+296!bR-9l-VNfkSlNMBZ-N{Ii% zMzwTGBk=4voOf!s{Ey?)7dQnzm5kKM`AcRgoR!bvz-U9R6cvi>NuT+8Gr2WKMfOO~ zNQ?T3&3c7EP|8L84S4r)=rcg3o@d#Zy3=zLNyIYbZQw?^oM)1I(TD>gA<%!6O{^bL z?WZrkGx+X-R?9=~Df=|}7!Tz=$;B&n8ANJhizVVbIpM@*Cgpeydla_=frU=_T&*s(4 z885Mz5Kxif*jujb^^XL6eJhi{Zry`h59#K3PsJ>lh8SG@MQYq^;+NC~NG zN;_D7udZ1X;Ci;mLK@=bSQ(9ZbKS?0TEB@e?muwe-vT?Hr)%V{Z-b%zxR9nJ)W$Lzo-$@v9X7=@VwqPL8@AVMX1!eaO8L_;rG@JsQIEgqbQkr=H|Nuk+KkQQx@d5#(tK0> ztH@Xmcw(owJ|w!GU%Ufi^FrY1m{wr!{l>S94M?Na^Qq0Dp625XpbBUnl4R#$S`5aAJ)t*E&kn<<6?|SYhv>7jGqsmfW&(%nt}*jbqVikK4yOhCi!|+)TPy zva(m@Y1opSww&Qkb(d}KMy;*>qu!HYvrZFMUOE|oAmD# znCCofj6v-z-Vk5>6Rw26=SaJI(#=4k?`_@bX0>hsPaamuTQvU5UP~^mCDfEt&adt8U%)8g26p4FlL} zPlBE#pIHUAE!qy#SD`5?-X{b$H?P`$UcqvYd{SHHf*8RI2S!0F#PjdT^LP1)qxR3) zf4)-R`dpGrWGp~5zOZ)tR~Z5`UelBr{j~V>JV^Tm!wgx8_}Ddna{8F~Q3s3RadBg^ zfbT8&gOVpZ+7W)Bk^CBX7CfgVw(@ay+-~U``rrnd>W#}F}T$k3C8#PLO&sGs(G-*FvD)J3}OK4Mt zG&=mQNec5Y&PCcgtG|R}B`XR((L4vWTED_UFsT|Wqb|LMu{YF7p4u^4hk=az&Eee8F4ekJ^STTRcu#W_{>@TxKmr-` z4t$2}rA9!fE3RrJUX``z4{aODdcfL%RSc`TS=XB&!DMd{^h?kDu7X5cKC13rz*C@P z(WPJc%>IUcrA_5vm3UA32Pw6;gg@PssCJ@~<00X!vl4lsT*}A3|1ADK!Qqw)TcN{! z)=$e9`KDCoOk2i->OA&kA0xOmii$-2s|(wKtitfBQpv5*-lW{)y=oO2P0ZNgef5XL z*sk3Dnp5JMZ(sk|7WJMtf1sxztJ>MJOFvRyX@|w=i5yVb$dwBZRUedgX>3-` zl%x#3jARHiy}_{{52FV=)4g~zQdTaRB!%j4o!kI6Jh9HPkDO+_pOv!s!6!fRS7A#e zt_1l9{*KS3OJ`muD^F`TgqSi1fp^iJERkyASz;W0YX#5q1W_lKezv9WPczb{RJ4dK zTXmwpSU^v~tDz^tqZz+)wY%N$(j41o!qQxrCx9qerSz`8oS{IbJQB)TP6yBX9Ha!L zHX^U}#tKEH?!GMkWGv~x94O~`evpyp#V)1*CZ>EOMR$W}f6m^SMT!pzqs%#ofV`Hc zi%-Z}=9$cQr=)3T-lg-j|E~MAbNY%mM=hQQ8})iGxU8MmLEK$bQ_{Cym3P_yAuKso z9BmVG>&7Vc(lf{4S-TL`P*=1z<4M#l>01+_CO>CsO`<1PQ7N8%v*-rwu}TgyeC z26a82NNnIf-(>MFV@B=t`pXqYTpM`XI@yzzpDb1p0-fOp`+>sl39o{mmCBn<3a6b} z`B(k+*wW$n=?g1EPp~8K+aDCDh!}7B8Q(LPFUPZy%{NB>{S@mQigl+OcW26*ya4I<}z}d z0JL86YEeybl#}nz&uZcxvG#!#^Hux>J2u{yYmB8=eRzJQYzUBw=SPo#5_P7F=j>lg zW2G8@5$ZE-d8!X|@N}!+2JNDZPS?=OC3Z>=YNNj?R!(q7q`yN`r?=2#b9diRLxkYs z>jd^=*dn&zb8*zn!aynp&b+Wk<;^0SBudQlY%!nHuVa4#O%%+jo7wuCKT0=vVeH#^Y8>oV zg(Gj~eekzmliqOQIY|KaFLh>;fMH(~zRkxK4@6scZ%@a!u_Bh*wv z#uv2goJF2gLvo2*$Zpszm}XX?>XtrB2|^Q_nl|bZ&z#EUUXBRz@MWOv1JN3N* zQdc#$@99gSW?MpSMcY;FjmRMaGoz@yQQXmD{U7Y=8Ex60If!03zZc(C8v*e z-1xC+NWj}46=He?x(!DT*DTxVp~E&Wukx^s9tDitbXOUm`vtHR$V&EPhgMkR6#4Br z5a^VjtNNbfFt@l=3I4L@QkQ$G)hpwf!!0HnUWxIX+RKq={LMWjMt$9b@~UZatD;do z91&qJOyEAN1v?H<_@;Qdzo0|x1v6%+@si>PWc6g_AP&;tqh?M7G#8Ee8qb%_Wd++D zp2ZI-px#%(!%5!-tk1X7JNr&tpJn?D0RsPfv#Q_U0s>hG;Fmy51By5f3{Hm%06qIJ z%>$Fa%`pw=^M5hSe@yh>%m2fI|6}>T4gB}={~tEjt-&y$ftow}0O+MwfB{7qaQeZ% z8nraWVAyP6nS7nVZWArNk!6cCGhHS?I6*`2sKL&5F7atU+c_c!ENzA&;7bXCQFZ;& zH3DRxo&ZjsL=ysKXpTteQdJq9A+o~a(ny%(1)>Hl$W0hHb){B2FlHlkvWG$7-dnCw zQqESLTW7NI({ekzo>3ZMK}Bt1*bO^j&{eBekn;&}p^r7vBQ;<7{ryry$d%8HFVL3C zBo+OJ?*+MZ8d;S?QT>+1n>j4_jUQzKZG({a4-yb>WtYwlLWCMoAVEaL}jJ z_;tA6LO zW&sAGw#Z~m3#;h#m}`DvB%4e+@zY+p;xm7Z*O{WB^*dQ(>ECELH>?qUabI2l2paFE z;q{0#)QX+>qo_g$)7dRCn65;!JdXm&nn#6v^ffCeGf8(ad^*WF*EXAF9WZ0uV3D*Rr8YDqrM!*lv9q?pR@`z;XLLpYc_FQd3T)mABL*;#(kQ%mDimJ zpFaZn=IFhkvVvglEP0#|EV*_=;Q89KlEZ_24-YyDS{J{Lwl|V@1soZqr(>jDeB;5R F{{uzF(gXki literal 9913 zcmaJ`byQT}+CFqimw-%Ho%-M7HyWiaVeV!AkrJ+np%t#CX0I8~qf;IqPVZh%Zg!tgM(N6Fp zcp-9CF>nI_66%`|7LcBK8vux3*vZRlY1z8CySUl9xZYKjm%r=!-o@I^(Fy>(rn6o_ z^b;|3((@QAa$UK}-KrGFV1S(iO4vtX@Qva#VE%!EO13*Jf>@V^mNHXCrz>QfSS2fB zDfa=)=GmtR!zi6MqA1px!dibH^v=%t#Ch|2=K95u_b_=7CDpxzwQu%-n0ABKPfVTo<2!?8-voc*+Ute2UT(e$xL?3p4yK>ldVV7pxo4;y~#>NFG zG=|aBrmL$69M@i~N{=>&Vk2N$7qFc_H5Nn?c&kMbLXYTA-t{uDHk1HqOj9KTn>J1CL zjD0w=^t9>?H|?iA{YaP=`-@)h2JHj|wx3B$R2zX$_E?iIi4q~C0Q93KT%(Slw%-vR zfWpF#BGVuB1Y`pac%m6e5&#ODr%$}WY)foAjgx(h1q`O-F9SgH-`j7BzR;`p5CVWg zZt$bZX9Ty}X`pbj%y#BxI6byGzJly6PPin69R5ns9pbOIlbh&$=2E6F zQq;5yh?1@^P`wG>a;3*NyPe%}yZIv#?z28ZYI8R62uh3CN%kQ^`m|VFc5{`dpM&!6 zZbZ<$Wbf{KpO0NEXP;oK!m-cuo<=O@jqF)GvhVJbPZyt>l?A>8|9FY>2irrop@^07 zQ%|nji2GA=&q8$ZFAI6H4^F(g?6IBvb2Nk3W zPyVZX=}`*1O!a$P@lHSIRtSFtLGPv{)W?&@Ykofe*|}0rBi$ znN{5HIZx!$a!Xzg7H9tmuN!Y`^M@g&`(fTZ=3*E()GGUMJQB(F<#$V*Lh{R@Jlcx4buqj(#1HZOo1+A2}W79no*15$F+C5&oxy!to4_0-~0?1M!xB9a8OJBfB3K zizxeT8xy*0^F~zj?!)e(!flp?yy&H^p)PkUpik$lW*j8VE$p5k^Sko9S6UwqesM^* zZXBr@a~~M!w4=R=}tgZ5pTA*x111qj#^B58MiXTGy3a_$}-BjJTsi;X_jc>9*#addgVMVuzj&j zyq&&{zaw^Re#~|3bUe&FaEFQ+A>l6J_uk!Oz|+ySc`JYMX=ia)ap#7f4U^4Rx2yvp z`U181eySAD6#7?Ag`WzYbA0-fRvA%^qqSp4c^OR^Gi6gwe`W`yy8TPfU+`uy{WR{B zLO(m)#po}+8(7XN%qZ+Qh+pS3@iZ|oId5Untj@fbjo^3cLv|T0wDkL$iAzgaoegc^ zNcTu%=lJA=w-&Ur&r7v(1Rw&^0tha$&n3?KFXK+y7QOfB_B8O!u-dU!v08!|gR5~I za9DBEaK94>;l+rj@%zL~6kLKG6kEzt41PDL7-pojyYQi!h7Ukm-zn;GQ}Q zf-?5wFyTB!fJ?!t`o=&VVZ?&6V+4%Vjv{ zv3qgF(G3zv`?~j@Hc)#d!&C33 zc*MSBe#y+!Cbdhhc|5^i|Daye`tjpL(iQJDr(aBo;lD5|9H(vvNLt4*^^v?9?Q$(L zI(5FH$6iLajl5tgEh>h81m~@PI*zDU^blSF zW9`PbUUs{q{{6Q7KawxCmh`oC_U*lA_G7g}N56lUe;lIsG^zN@&wl6fL&FA3TJxm0 zI%xZpaU^_cS*~b_F`6VfBV;bLV>D0)MectU&O7$W3N-H5y(}xO zZ=Jd~jcA*N_#TjjGSf=Tp}%Z5*FN^rb7)cYKXM*Lh0Mk=S}--Xtp&`&lp&hk*>S$# zeF=^g(OdTJE{-!5ZEZh@oV0~wSX9JaS2KcKrZaZZA+@fCkH|Wnt+wBvFYxnS*82N( zsB@-sa6T=t{)li(#ryH7c$){5C(kKY>T3)7Z**Q3vk9|uYyEWqT434IqgN^>R_A!pLRI3e&%%Ct2=(_+m?91U(jbW)B~Cn>d-^HO}#FLHBGk z)jQvty#wQFJUa0_-l2yOqts`Ned4?-E?TEAHwn(jHv?;~s;uBn3nyl9v*Atyax@uH zc=pwo>#^{~QRM;UaSkPpn7AxfRwh!$mi@OwiHn6l3aN*G1?XOTZ@HDO&tEQ`s}1X4 zOzx7LMh&->dlw(PN0$~?i1%{zvNjKSOYIe0lno*M(J*x5d~XYD+Jg((E3Jc(Gt1t> z-jnUL@B_f6832f<0sy_s zXVY#a0AN~ERe1K=YkGUu+wb*J%k`cf9aX9$?vE-wep$L>_IFs8{TAPo6Q92Qm|fKL`r84r6><=g~x|yN9}xAFxGmQUG&=TMS%jfeqeXyr*Xz zvzCq5xK~+ps?QJe$2`Mz))S(xkI4z=_XHa+9bmsW)#Fix6#}HQMYSe{H&f37oWFN)5Tw=nd^f6>+xRnF;mweSBmnI9s3)EYpD#P_qcZ!u7 zwV_`l&*GiQF*>?^u~^5D%4K0tjlM1e(n994^8@yiTdeCF)fz@Nt zc((3?>k3e;aDB-L_J%XT6J_6tOn5+OT`5kIj!up`1`hiVU)~5|K-FW-gQtWaP>BU2 zIO*FtO$jo^smF$#741|s4zUF9zajbA$X>lQQ>qGsnS5(L+4?D+$ zXGqtzk!7w^!ZpxlNz2R6!5QDV6=?sp??5s`JNi*4N?8k}K@7Y1S zD|TW<{CxaGuZ8__tCf`~|5^^97J}PvvD{YQ)M84}h**>v3Xglf>9t>~-CAP%r(Q`R zKZT@AT@8t{LJGngQc)f*bvOyke~$Hx`NuYi{TwqsF)X5Z@<{|Hel|6gk4fEOm4q-< zVtbLo?uk8K=L&2c`T8t)#=l+P#Ndlk&jWOOc4m_NdtI^$|JhbSHh$oVl46zfOGbz( ze{%fY!4*o%jh#iZIfB@3fRy>d@v-$BMEOET1R&h2asnt~Fk*k%5W}7jWBz4w6g;}F z?YD<+d|CirC7FJ5X41hYnYoqRAb=$;ql@-o74y|+qOa{)h(>mdK^|@-LmnsRK3$iZe81E2t!w0 z1a)CfmJ41{#px0~)|PKBZ>skN-}$tDYFg`nsms2m_L7G0AlI@b4a&H(>6q|3%c!Sm z{?EQszd%lVV1D;A@5IpIekT2lz=+`X-~m?Z!B2Lb46IUr^G&Ktem>K&JRllY4#Q70 z)*f~+O%a$_&P(&V?bf=M z=y5TwojQNy`)E?%67TAwbhX~z_vhY`ADZx7l%*e(SR5g!a*+N`zLqaHiOSH?Fn(ug zk*dxK-`#49x;ysbi>DVQ_kO5t8a&-Up-A@~VwiHyss85l!Qh&AI5BGbv(G)nutq~n z#_{Vtg@Es+b8{c9_4;sDUQesW)jph2gu2QEr5RmGTT^7tTCxsb3n`i@#axpKnj+}~ z$MMD#10L^UTkmCbXdLH6r2VS9Be>aeW77{M0?RxN7kG-W@D_5pldUN<(7QB#wwBq{ z_=kicGAvD`ciQZ-{CS<8@cvBP=g8_X_p>v#!do^QUlv~riNXB*Spdi|<1FuC9gR-n zX#gd|J9B2wF>*2@d-{_h1k6|OWI^MKv~bkvsynz7SQ!_}`5n3d#Y|6FLFWvYeEj;6 zcxStjurP_#V3Sv6uIDV)gAf;MAO|O~6Ph^30P0>Xe0h7|@3H#813wpC{qs2zNo1&p z??5SDIP561ixcrxMZ+0jcX@-932c=L?|)OpQfC zOA4&luDRk=Uw*yOy)wG=+!AAgO&Qj-XSqNQPf5jc*$S!<$b%P}>FP=_owU$S8?RP0 znw7@{#xx{fN-Xd!ucxhrida00l*&nrj2kuVp<UjxiwexK2y^7C|YVtw!hKSQZ+FaT*Ohw1X$%6knVL*CV&Yc zhsfl7vee;qonZ)MUyfc>ba)TWo=)1XH8>HRtf%E2n$v_eg;Oo~$TTN|UBjJf4HlLy z4p2R}EdkWkTN$RP5(6>tFlvTsrO;91XHN3W#RV>^u?c~_L+B&u$F;|1Iz}IMBAu!w480{M1{zb-Y(oNjirQ(c z3!3O&{Ze6kZYYP#N>eNIZh!poNK*fEb{h+rn#{3|B1ixHLr!V#58iosV!rygs-Xl_ zE+mU*X?bsqA0-{<`5EeJIxBLZ(G{y^iHKzMr=s6xC9!v;igU!gs6weZO<< z3wP#qt^D!r(~TyzU;At4jq+)JT8q4RJ~wC39`a|oMcIY!wbtBB$FCaw3b&~&iw?O6 zauO$zYNr0~OB(<9}0wx;kC^D60f(dL=Z*}=!0nV_n%srU1`j*Z<1o9R=Pr9Z}8=aIj+ z4Ucv=?Kt#JU-w@kpQokWexa^U*j?+X>%zmv_B6G$Fy?QEP2JQR;U5KKw1&MrVm%k< z2-?@1I1j$L(rbDry}00%$WdO8vGF^+%gZS70dkD^3(x$J^MYwe!q-7`I;{FzR8Kdo z+|4)RKFZF_^{z~gbTiTr6{V!q$U8pCTqaqaH)G?#FracNAdlbB;{aA=lTtr-&sZbZD*o+*@+>0j!w*1$!gc>y*hS# z+-gyldNElo;cer=8{giIgu=E$1ZJwdO$+mQFypDoHhPV#q1f0khvVBl9_F>;O?kD( zqT%8A0%Fo3wAW1;slm@?0_JQdIs_yhF;3Q0Bx^>I=kVta`3IcIv+i(IlurqX4rRIR zPV>0X$AjmOxpkw%#`MdC-ikmzl^7dHOxFGV$5R%A#%)g1l^VXlCx@Lk)n9|QURffg za$eclfZRZ&7j2RJ-RxKvhh2uvh4xHyg3y8i87h8Z|_Gn-IyI!4e^}jVPT-^ z;yCE3dh4g2Vsbr<98@`F8hXLmRuVaGq^1%Xx3HgYyT6(4z1gp=y~N=K9zDdR+v>4Z z?*dWJvXPz(9}IO~kUg0{AprN1c(7LY(^@CgTv;74c6;VP0ap$AygB6#K@-;p$ecx+ zb*SA}5z*NB&x<2*n3rHSHX+_O4pB2wzU(*da#`afTZ`$xf6%wiWkvP%UmIqLeTTR#2*Pn20tkYt%M5c^MF-OPp7)gs zPApbv#;l%ZCEa*uc>943xF1f`dKHF}_WC|Gd6Ozde8gR#n?uG71cl*qIOjFAtxxh!)+wGtl z8Q^yY%1kx?0|WVUpNB6lvRzDIhL`jo=VpGSDp*1H&d{n)zglB2uauI$Ec=Xn7ftJh+Ky8X?R_RQCk>uEYQb9ucSG3L-|U+H&4|x>J@bV z@UvzIWzZFLR}0sF0aLE53hVr51j%x%_i`i=iMeu8)`#C_pj$c+IN@p6DUuWDl{dTi z1CwC{GLJp89$a9!itl@nny#o5V$>Jx%w*zY8h9S3>P!VVn)W|!QYeCxZN=s>5-cn^mm1q=gKj)zEQxOZ3fIaJx!+ej~B$ksM5uY#e{Ny1h-0iKuuC=B?Xvm<*JNwJ%4S7ScG7+ z=r2^P&k#$I%`Md-vqGMDO@tKuiyLJ_Z8D!4I1H85N=#x5J|CGk&ri%SfgOw2us!L0 zoF>2RMEfjtN9=&fP!A{g0bF}v6EbAfJV!DU+i;{}YqE=PBu60VScrpjo5>Pj-KwO%Z5wuUDWyL__9ob1^w_>sWWoCJqzoRfq;Wg1 ze=laK^R)jvwJNiH9(1IA+HW>qSwTY+rfgo0V;Z?3j8>;~CAIcH+9f+a0KtD%YWY=z zY?QAi?p!bBQ=EgK9IQwwt%+G3UGnYR$^l~>eo%N17aH32C}5>&r8dzmCYn} zt9lQr1u%L!cwTiOB9@IKdW%h4^QInB4Hfv>h*vIG;Ia2HjFo(+`s3uAgB;5ad8BcZ z``oqBg(diYs(*CJAh}>y3 zOe24*n;2KO^02e}KbYx+B1#Hvg4_gVx8@uP)*$~t2=&s(yH!q))}DY+-y+T_EEU-g z!puTnsM$3xY`}+?@dnS{uLS9m!r4o#2j#WZlZHI%3JPbMF!}SXehmRxW%_Hwjf;S_ zs}d&QBpv+(POR?Y-^X^REyWLlz!SV$AX^Yzkee`gW_?Brs$2o|gJ3d*7zE{;L*zj` zoPD)d5al0gHO}=BDyGC3m*A%h6)ebPKrD6Zr=3ZFFzw&JYok{sQ6BI4nNO-y;+?Qf zI?s>LcCyCgfAA)qYR@VTB{v=psJA@=f%omoye1hSa-`1FA>#ZN#DOs`BH}Q{^_u2{ zvY>x*tQ$@MKTR!vJM3g6e#26j;aBl=xW8+Xm?!>S>VGk#2tQ*fBC%$m(*0hJyx%v zkRSKX)MKYtx5z(|VYe>!SVXOXSoHrz6YkCB{t(2DP$tI;xo|pJcypt5z^Nye16@80 ze^TmfPa4FOqc@Vt!zEIAH+uO)7oLbox0I5)`TG%R`4CqugKu0jM48Y^hcZD0>0rM> zhfnN-6=jL|*=gyY?;Mv-W92+(pfv)I|82&SmIV(}6_}I@c~E4#&_4XB!BOrOiT1LA zj6J{U9npb_RZ_QS48b zpv14!)#!w`oTOG@BkrfItI2vtBqD`wUwS8c_`qQs1;zJxp zknPdyiFri@8q_Gg`}d5N=7z9+c^+|nux=G{$$}#yB07u}6mI@z;$dV^m9woJc1rvv z=MfKP;9X-k8F{O&uswJP4cHk4ox71g0l`%@du;eA4v99{mJfb3w%(ZPjMXJAqNaQa zQ*-gWa;=s#4$TV#_df$sHiQsn_8|{j2yB-E%m9#bnfl!Fia(sBtHcXGh|qoC42q0+F!Nm`gNF9`b3fc0a>Gtu5IpAcUEn}hvOz*t?ZJV5w-N1cO^Odj%JEf#-su#M@n!w*+&VAjjnFh-xazk z3{XR`0#j*de~phR0j~4Sd(c51E7QTW@%Ne_ZA&136E@77#HY9b__S%O@q&GK8|*C= z5EsxK2SNzfWoQ*hQ0QkEm4x2AS$1x_wB#Nr@}}v%*E@Lw^}uQrrq_9QU8nsk!^n%h z?dITW5L)JT&J;=>{C;%llkE$V*g=M;??2}-Fyn3{VNXv_yVIO~1qtp%A4{;y;%v&F zTR)D5RcaJ=WIY%C6w$X)h~7pI0y(r}^*jpV@anR88==5;WmNWTvU? z=+fAi2y|6`)FSUC@_6RWaG?@V53J+hl!2UsF4*5lW3mc0G73WfseY4fvV{p*=}N4= z?lC#8)cHjo!u99W$Jqq;a>-XiAfMnIxm0zkR{nq7D(Uw&-JQSDwl~ zVowNDuy61w{N7zsn0mOnLVnK2^BZzf&P42dt8Fz-M#a8_|~`K zR0k)>+9|t;@Z%O$8ScIE_zUhA=CJGYfrQtS%#M?UKmn*^a@)BiUeFovIMs9~R8%-KfRPiEy&ar+H$$V<^-*fPYf3JH z;b~Ce`~FlG)}ekG4Xy`Tf-^o*W2nX4;NfW{^1V$vK1Dj(l&=B6;M&vRk{y$6gG(n(&u==T5lUwJh|1e@8|f9=JltvNL4vrL*A>?7k1ci%~W@tw85|=a@Qg zm{-odGxh@Q&GVh~ft&B06)RSdaOYdR>Raz67#3?<+PcHjT-Ef+(#h$5^tTj~Ril9- zj2^TXZ4f9fNNPKBqeWAhSPskiw=dV{It*h=0}En>Ah-TbbyQ1uyLhbt6XpKYw*nH> zKg%+IYa7ec=VA(HW}|LC32x0S4VpXoo|RfCz9BEq`z;Dat<){^^nN59NTqNZ8`*BT z3NlDT^`<&(4g-N$hEm5Q*qdc-!}tYebhVU}30HI|l3r4)Mc7yA`ck#l2?xNr1NwaZ zO;7fuLN~8&d3eq2>wq(puVsK@ Xn+&$9^GF@=?I574sG(3UXBP55+E<+Q From 35c60c325339bc1e2416a2123beb794a6ae0169e Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 5 Nov 2015 09:37:56 +0800 Subject: [PATCH 005/132] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E4=BD=9C=E5=93=81=E4=BF=A1=E6=81=AF=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/index.html.erb | 27 +++++++++++++++---- app/views/users/_course_homework.html.erb | 18 ++++++------- .../users/_user_homework_detail.html.erb | 20 +++++++------- public/stylesheets/courses.css | 5 +++- public/stylesheets/new_user.css | 7 +++-- 5 files changed, 50 insertions(+), 27 deletions(-) diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 78f11737b..8f1f0033e 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -120,14 +120,31 @@
- + <% if @homework.homework_detail_manual%> - <% if @homework.homework_detail_manual.comment_status == 1%> - 未开启匿评 + <% if @homework.homework_detail_manual.comment_status == 0 %> + 未发布 + <% elsif @homework.homework_detail_manual.comment_status == 1%> + <% if @homework.anonymous_comment == 0%> + 未开启匿评 + <% else %> + 匿评已禁用 + <% end %> + 作品提交中 <% elsif @homework.homework_detail_manual.comment_status == 2%> - 匿评中 + <% if @homework.anonymous_comment == 0%> + 匿评中 + <% else %> + 匿评已禁用 + <% end %> + 教师评阅中 <% elsif @homework.homework_detail_manual.comment_status == 3%> - 匿评已结束 + <% if @homework.anonymous_comment == 0%> + 匿评已结束 + <% else %> + 匿评已禁用 + <% end %> + 教师评阅中 <% end%> <% end%> [ 隐藏作业信息 ] diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index be7945cc0..f442e34e4 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -19,25 +19,25 @@ <% if activity.homework_detail_manual%> <% if activity.homework_detail_manual.comment_status == 1%> <% if activity.anonymous_comment == 0%> - 未开启匿评 + 未开启匿评 <% else %> - 匿评已禁用 + 匿评已禁用 <% end %> - 作品提交中 + 作品提交中 <% elsif activity.homework_detail_manual.comment_status == 2%> <% if activity.anonymous_comment == 0%> - 匿评中 + 匿评中 <% else %> - 匿评已禁用 + 匿评已禁用 <% end %> - 教师评阅中 + 教师评阅中 <% elsif activity.homework_detail_manual.comment_status == 3%> <% if activity.anonymous_comment == 0%> - 匿评已结束 + 匿评已结束 <% else %> - 匿评已禁用 + 匿评已禁用 <% end %> - 教师评阅中 + 教师评阅中 <% end%> <% end%>
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index f9743d7c3..1947c8ce8 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -16,28 +16,28 @@ <% if homework_common.homework_detail_manual%> <% if homework_common.homework_detail_manual.comment_status == 0 %> - 未发布 + 未发布 <% elsif homework_common.homework_detail_manual.comment_status == 1%> <% if homework_common.anonymous_comment == 0%> - 未开启匿评 + 未开启匿评 <% else %> - 匿评已禁用 + 匿评已禁用 <% end %> - 作品提交中 + 作品提交中 <% elsif homework_common.homework_detail_manual.comment_status == 2%> <% if homework_common.anonymous_comment == 0%> - 匿评中 + 匿评中 <% else %> - 匿评已禁用 + 匿评已禁用 <% end %> - 教师评阅中 + 教师评阅中 <% elsif homework_common.homework_detail_manual.comment_status == 3%> <% if homework_common.anonymous_comment == 0%> - 匿评已结束 + 匿评已结束 <% else %> - 匿评已禁用 + 匿评已禁用 <% end %> - 教师评阅中 + 教师评阅中 <% end%> <% end%> diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 22560f0aa..7a3d43469 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -178,7 +178,9 @@ a.f_grey:hover {color:#000000;} /*.upbtn{ margin:42px 0 0 10px; border:none; color:#999; width:150px;}*/ .red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} .green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} -.grey_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} +.green_homework_btn_cir{ background:#28be6c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} +.grey_btn_cir{ background:#b2b2b2; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} +.grey_homework_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} .blue_btn_cir{ background:#3498db; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} .orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} .sticky_btn_cir{ background:#269ac9; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} @@ -966,6 +968,7 @@ a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-r .ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; } .W50{ width:50px;} .W200{ width:200px;} +.m_w460{max-width: 460px;} .m_w505{max-width: 505px;} .m_w500{max-width: 500px;} .m_w530{max-width: 530px;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 061ad0561..0b45685ee 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -293,8 +293,10 @@ a:hover.bgreen_n_btn{background:#08a384;} .more_btn{-moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #9DCEFF; color:#9DCEFF; border-radius:3px; padding:0px 3px;} .upbtn{ margin:42px 0 0 10px; border:none; color:#999; width:150px;} .red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} -.green_btn_cir{ background:#28be6c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} -.grey_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} +.green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} +.green_homework_btn_cir{ background:#28be6c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} +.grey_btn_cir{ background:#b2b2b2; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} +.grey_homework_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} .blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} .orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} .sticky_btn_cir{ background:#269ac9; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} @@ -1073,6 +1075,7 @@ a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-r .ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; } .W50{ width:50px;} .W200{ width:200px;} +.m_w460{max-width: 460px;} .m_w505{max-width: 505px;} .m_w530{max-width: 530px;} .ProResultTable{ color:#888888;} From 48cef54b9e3ad59315863f41d03be2e1b5a4f01f Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 5 Nov 2015 10:40:24 +0800 Subject: [PATCH 006/132] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E6=97=B6=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E5=AD=A6=E7=94=9F=E7=9A=84=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_programing_work_show.html.erb | 32 ++++++++-------- app/views/student_work/_show.html.erb | 38 +++++++++---------- .../student_work/_student_work_list.html.erb | 10 ++++- app/views/student_work/show.js.erb | 4 +- 4 files changed, 46 insertions(+), 38 deletions(-) diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index b5ff8f064..dbf7291cb 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -3,21 +3,21 @@
  • 上交时间: - <%=format_time @work.created_at %> + <%=format_time work.created_at %>
  • - <% if @work.user == User.current && @homework.homework_detail_manual.comment_status == 1 %> + <% if work.user == User.current && @homework.homework_detail_manual.comment_status == 1 %>
  • - <%= link_to("", student_work_path(@work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %> + <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %>
  • <%= link_to "",new_student_work_path(:homework => @homework.id),:class => "pic_edit"%>
  • <% end%> - <% if @homework.homework_detail_manual.comment_status == 3 && @work.user != User.current%> + <% if @homework.homework_detail_manual.comment_status == 3 && work.user != User.current%> -
  • +
  • <%= render :partial => 'student_work_praise' %>
  • <% end%> @@ -26,7 +26,7 @@
  • 编程代码:
    - <%= text_format(@work.description) if @work.description%> + <%= text_format(work.description) if work.description%>
  • @@ -37,10 +37,10 @@ 测试结果:
    - <% @work.student_work_tests.each_with_index do |test, index| %> + <% work.student_work_tests.each_with_index do |test, index| %>

    - 第<%= @work.student_work_tests.count - index%>次测试 + 第<%= work.student_work_tests.count - index%>次测试

    <%= test.created_at.to_s(:db) %> @@ -79,24 +79,24 @@ <% end%>
  • - <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && @work.user != User.current )%> + <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%> -
    - <%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%> +
    + <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
    <% end%>
-
- <%@student_work_scores.each do |score|%> -
- <%= render :partial => 'student_work_score',:locals => {:score => score,:is_last => score == @student_work_scores.last}%> +
+ <%student_work_scores.each do |student_score|%> +
+ <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
<% end%>
- 收起 + 收起
\ No newline at end of file diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index cfc4129a8..1f3d44258 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -3,21 +3,21 @@
  • 上交时间: - <%=format_time @work.created_at %> + <%=format_time work.created_at %>
  • - <% if @work.user == User.current && @homework.homework_detail_manual.comment_status == 1 %> + <% if work.user == User.current && @homework.homework_detail_manual.comment_status == 1 %>
  • - <%= link_to("", student_work_path(@work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %> + <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %>
  • - <%= link_to "",edit_student_work_path(@work),:class => "pic_edit"%> + <%= link_to "",edit_student_work_path(work),:class => "pic_edit"%>
  • <% end%> - <% if @homework.homework_detail_manual.comment_status == 3 && @work.user != User.current%> + <% if @homework.homework_detail_manual.comment_status == 3 && work.user != User.current%> -
  • +
  • <%= render :partial => 'student_work_praise' %>
  • <% end%> @@ -25,50 +25,50 @@ - <% if @work.project%> + <% if work.project%>
  • 关联项目: - <%= link_to( @work.project.name, project_path(@work.project.id), :class => "linkBlue" )%> + <%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
  • <% end%>
  • 内容:
    - <%= text_format(@work.description) if @work.description%> + <%= text_format(work.description) if work.description%>
  • 附件: - <% if @work.attachments.empty?%> + <% if work.attachments.empty?%> 尚未提交附件 <% else%>
    - <%= render :partial => 'work_attachments_status', :locals => {:attachments => @work.attachments, :status => @homework.homework_detail_manual.comment_status} %> + <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments, :status => @homework.homework_detail_manual.comment_status} %>
    <% end%>
  • - <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && @work.user != User.current )%> + <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%> -
    - <%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%> +
    + <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
    <% end%>
-
- <%@student_work_scores.each do |score|%> -
- <%= render :partial => 'student_work_score',:locals => {:score => score,:is_last => score == @student_work_scores.last}%> +
+ <%student_work_scores.each do |student_score|%> +
+ <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
<% end%>
- 收起 + 收起
\ No newline at end of file diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index e23fcceda..c8248d86a 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -35,6 +35,14 @@ <%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work}%> <% end%>
-
+
+ <% if student_work.user == User.current %> + <% if @homework.homework_type == 2%> + <%=render :partial => 'programing_work_show', :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %> + <% else %> + <%=render :partial => 'show' , :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %> + <% end %> + <% end %> +
<% end%> \ No newline at end of file diff --git a/app/views/student_work/show.js.erb b/app/views/student_work/show.js.erb index e6b99c146..d61c4b9a1 100644 --- a/app/views/student_work/show.js.erb +++ b/app/views/student_work/show.js.erb @@ -3,9 +3,9 @@ if($("#about_hwork_<%= @work.id%>").children().length > 0){ } else{ <% if @homework.homework_type == 2%> - $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show') %>"); + $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>"); <% else%> - $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show') %>"); + $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>"); <% end%> $('#score_<%= @work.id%>').peSlider({range: 'min'}); } \ No newline at end of file From 59e95b08d7b462120c1b9e91b0d9cd3de85245e1 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 5 Nov 2015 13:49:27 +0800 Subject: [PATCH 007/132] feed_back --- config/locales/commons/zh.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/commons/zh.yml b/config/locales/commons/zh.yml index 3b5e9790e..ee361cc2f 100644 --- a/config/locales/commons/zh.yml +++ b/config/locales/commons/zh.yml @@ -354,7 +354,7 @@ zh: # 意见反馈 # label_feedback: 意见反馈 - label_feedback_tips: "欢迎反馈网站问题,课程中遇到的问题请反馈给相关老师!" + label_feedback_tips: "请在此提问平台问题,或直接加入师姐答疑群,谢谢!" label_technical_support: "QQ 在线支持:" label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!" label_feedback_value: "该帖来自用户反馈:)" From 223b17d8fe7ae109e54484ab6498210bd090451c Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 5 Nov 2015 14:45:22 +0800 Subject: [PATCH 008/132] =?UTF-8?q?=E6=99=AE=E9=80=9A=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E3=80=81=E7=B3=BB=E7=BB=9F=E8=AF=84=E5=88=86?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E3=80=81=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E6=A0=BC=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student_work/_evaluation_un_title.html.erb | 2 +- .../student_work/_student_work_list.html.erb | 2 +- db/schema.rb | 18 ++++++++++++++---- public/stylesheets/courses.css | 9 +++++---- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb index 26c69d225..4ed0a538a 100644 --- a/app/views/student_work/_evaluation_un_title.html.erb +++ b/app/views/student_work/_evaluation_un_title.html.erb @@ -1,6 +1,6 @@
  • <%= time_tag(ma.created_at).html_safe %>
  • @@ -314,7 +314,7 @@ <% end %>

    - 本次作业将在<%= ma.course_message.student_work.homework_common.homework_detail_manual.evaluation_end %>  24点结束匿评,到时您将可以看到所有其他同学的作品啦!大家可以进一步互相学习。 期待您取得更大的进步! + 本次作业将在<%= ma.course_message.student_work.homework_common.homework_detail_manual.evaluation_end %>  23:59结束匿评,到时您将可以看到所有其他同学的作品啦!大家可以进一步互相学习。 期待您取得更大的进步!

    <% end %> @@ -397,7 +397,7 @@
    • 课程名称:<%= ma.course_message.homework_common.course.name %>(<%= ma.course_message.homework_common.course.time.to_s + '年' + ma.course_message.homework_common.course.term %>)
    • 作业标题:<%= ma.course_message.homework_common.name %>
    • -
    • 提交截止:<%= ma.course_message.homework_common.end_time %> 24:00
    • +
    • 提交截止:<%= ma.course_message.homework_common.end_time %> 23:59
    • 提交时间:<%= format_time(ma.course_message.created_at) %>
    • 迟交扣分:<%= ma.course_message.homework_common.late_penalty %>分
    From 88dc0070119d7a97424d13feb7aaec5708545e00 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 6 Nov 2015 17:45:06 +0800 Subject: [PATCH 036/132] =?UTF-8?q?=E6=9F=90=E4=BA=9B=E8=BF=9F=E4=BA=A4?= =?UTF-8?q?=E7=9A=84=E4=BD=9C=E5=93=81=E4=B8=8D=E6=98=BE=E7=A4=BA=E2=80=9C?= =?UTF-8?q?[=E8=BF=9F=E4=BA=A4]=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_evaluation_un_work.html.erb | 2 +- app/views/student_work/_evaluation_work.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index 6996ed6a6..02e73aaab 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -28,7 +28,7 @@
  • <% if student_work.created_at && @homework.end_time%> <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  - <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> + <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> [迟交] <% end %> <% end %> diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index 4a6a4eb68..78114d62b 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -48,7 +48,7 @@
  • <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  - <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> + <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> [迟交] <% end %>
  • From 48547f3e113f844cf610d407cf936b089a8cdb8c Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 6 Nov 2015 17:47:56 +0800 Subject: [PATCH 037/132] =?UTF-8?q?1/=E6=B7=BB=E5=8A=A0members=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=202=E3=80=81=E8=BF=87=E6=BB=A4=E6=8E=89=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=BA=93identifier=E9=87=8D=E5=A4=8D=E5=80=BC?= =?UTF-8?q?=E7=9A=84=E7=89=88=E6=9C=AC=E5=BA=93=203=E3=80=81=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0puts=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/gitlab_to_git.rake | 11 +++++++++++ lib/tasks/sync_sigle_rep.rake | 26 +++++++++++++++++--------- lib/trustie/gitlab/sync.rb | 20 ++++++++++++++++++++ 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/lib/tasks/gitlab_to_git.rake b/lib/tasks/gitlab_to_git.rake index 8b7f7279e..c7b97e00d 100644 --- a/lib/tasks/gitlab_to_git.rake +++ b/lib/tasks/gitlab_to_git.rake @@ -8,4 +8,15 @@ namespace :rep_fault do rep.save end + desc "forge and ossean's members" + task :sync_members => :environment do + projects = [] + projects << Project.where("id =? ",2) + projects << Project.where("id =? ",299) + puts projects + s = Trustie::Gitlab::Sync.new + projects.each do |project| + s.only_members(project.first) + end + end end \ No newline at end of file diff --git a/lib/tasks/sync_sigle_rep.rake b/lib/tasks/sync_sigle_rep.rake index b99221c83..591dcce84 100644 --- a/lib/tasks/sync_sigle_rep.rake +++ b/lib/tasks/sync_sigle_rep.rake @@ -3,19 +3,27 @@ namespace :sync_rep do desc "sync some projects which just have sigle repository" task :sigle => :environment do - projects = Project.all + projects = Project.where("user_id !=?",12) projects.each do |project| # 针对类型为Git并且只有一个版本库的项目 if project.repositories && project.repositories.count == 1 && project.repositories.first.type == "Repository::Git" rep = project.repositories.first - s = Trustie::Gitlab::Sync.new - s.sync_project(project, path: rep.identifier, import_url: rep.url) - rep.type = 'Repository::Gitlab' - rep.save - puts "*************************************" - puts project.id - puts rep.id - puts rep.identifier + count = Repository.find_by_sql("SELECT * FROM `repositories` where identifier = '#{rep.identifier}'").count + puts count + unless count > 1 + rep.identifier + puts "################################" + puts project.id + puts rep.id + s = Trustie::Gitlab::Sync.new + s.sync_project(project, path: rep.identifier, import_url: rep.url) + rep.type = 'Repository::Gitlab' + rep.save + puts "*************************************" + puts project.id + puts rep.id + puts rep.identifier + end end end end diff --git a/lib/trustie/gitlab/sync.rb b/lib/trustie/gitlab/sync.rb index 8c84984ee..a303b22fb 100644 --- a/lib/trustie/gitlab/sync.rb +++ b/lib/trustie/gitlab/sync.rb @@ -69,6 +69,11 @@ module Trustie # import url http://xianbo_trustie2:1234@repository.trustie.net/xianbo/trustie2.git # can use password + puts "@@@@@@@@@@@@@@@@@@@@@@@" + puts path + puts project.description + puts gid + puts import_url gproject = self.g.create_project(path, path: path, description: project.description, @@ -81,6 +86,7 @@ module Trustie user_id: gid, import_url: import_url ) + puts "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" project.gpid = gproject.id project.save! puts "Successfully created #{project.name}" @@ -100,6 +106,20 @@ module Trustie end end + def only_members(project) + project.members.each do |m| + begin + gid = m.user.gid + unless gid + gid = sync_user(m.user).id + end + self.g.add_team_member(project.gpid, gid, UserLevel::DEVELOPER) + rescue => e + puts e + end + end + end + def remove_project end end From 4e62dd121978fea218a862eb75f890aab2314ed9 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 7 Nov 2015 19:58:19 +0800 Subject: [PATCH 038/132] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF=E7=9A=84=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/new_user_commit_homework.html.erb | 2 +- app/views/users/user_commit_homework.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/new_user_commit_homework.html.erb b/app/views/users/new_user_commit_homework.html.erb index c3a736058..0e2648509 100644 --- a/app/views/users/new_user_commit_homework.html.erb +++ b/app/views/users/new_user_commit_homework.html.erb @@ -112,7 +112,7 @@
    <% if test.status.to_i == -2 %> -
    <%= test.results.first %>
    +
    <%= test.results.first %>
    <% else %>
      diff --git a/app/views/users/user_commit_homework.html.erb b/app/views/users/user_commit_homework.html.erb index a7416cf40..6f14ce05d 100644 --- a/app/views/users/user_commit_homework.html.erb +++ b/app/views/users/user_commit_homework.html.erb @@ -86,7 +86,7 @@
    <% if test.status.to_i == -2 %> -
    <%= test.results.first %>
    +
    <%= test.results.first %>
    <% else %>
      From f229d18776be27caed0cdda006bd0797fce718c6 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 9 Nov 2015 10:03:06 +0800 Subject: [PATCH 039/132] =?UTF-8?q?=E5=9C=A8=E8=AF=BE=E7=A8=8B=20=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=20=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90=E5=90=8E?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=88=B0=E5=AF=B9=E5=BA=94=E7=9A=84=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=BA=93=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 6 +++ app/views/files/_upload_course_files.erb | 2 +- app/views/files/_upload_show_project.html.erb | 1 + app/views/files/create.js.erb | 45 +++++++++++-------- 4 files changed, 35 insertions(+), 19 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 1cd5b0f15..dd8dc84c4 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -332,6 +332,9 @@ class FilesController < ApplicationController #modify by nwb if @project @addTag=false + if params[:in_project_toolbar] + @in_project_toolbar = params[:in_project_toolbar] + end container = (params[:version_id].blank? ? @project : @project.versions.find_by_id(params[:version_id])) attachments = Attachment.attach_filesex(container, params[:attachments], params[:attachment_type]) render_attachment_warning_if_needed(container) @@ -363,6 +366,9 @@ class FilesController < ApplicationController end elsif @course @addTag=false + if params[:in_course_toolbar] + @in_course_toolbar = params[:in_course_toolbar] + end attachments = Attachment.attach_filesex(@course, params[:attachments], params[:attachment_type]) if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added') diff --git a/app/views/files/_upload_course_files.erb b/app/views/files/_upload_course_files.erb index 62d5c68e4..3578d4eb9 100644 --- a/app/views/files/_upload_course_files.erb +++ b/app/views/files/_upload_course_files.erb @@ -7,7 +7,7 @@ <%= form_tag(course_files_path(course), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> - +
      课件 |  diff --git a/app/views/files/_upload_show_project.html.erb b/app/views/files/_upload_show_project.html.erb index 8223f071e..53c57b3c6 100644 --- a/app/views/files/_upload_show_project.html.erb +++ b/app/views/files/_upload_show_project.html.erb @@ -8,6 +8,7 @@ <%= form_tag(project_files_path(project), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> + <%= render :partial => 'files/attachement_list',:locals => {:project => project} %>
      <%= l(:button_cancel)%> diff --git a/app/views/files/create.js.erb b/app/views/files/create.js.erb index f24d60811..9de7aa042 100644 --- a/app/views/files/create.js.erb +++ b/app/views/files/create.js.erb @@ -23,26 +23,35 @@ $("#upload_file_count").text("未上传文件"); $('#upload_file_div').slideToggle('slow'); <% if @project %> hideModal(); - $("#resource_list").html('<%= j(render partial: "project_file_new" ,locals: {project: @project}) %>'); - $("#project_files_count_info").html("<%= @all_attachments.count%>"); - $("#project_files_count_nav").html("(<%= @all_attachments.count%>)") -// 添加文件上传成功提示 - <% unless params[:attachments].nil? %> - var div = $('
      文件上传成功!
      '); - $("#course_list").prepend(div); - setTimeout( function(){div.remove();},3000) + <%if @in_project_toolbar%> + window.location.href = '<%= project_files_path(@project)%>' + <%else%> + + $("#resource_list").html('<%= j(render partial: "project_file_new" ,locals: {project: @project}) %>'); + $("#project_files_count_info").html("<%= @all_attachments.count%>"); + $("#project_files_count_nav").html("(<%= @all_attachments.count%>)") + // 添加文件上传成功提示 + <% unless params[:attachments].nil? %> + var div = $('
      文件上传成功!
      '); + $("#course_list").prepend(div); + setTimeout( function(){div.remove();},3000) + <% end %> <% end %> <%elsif @course%> - closeModal(); - $("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>'); - $("#courses_files_count_info").html("<%= @all_attachments.count%>"); - $("#courses_files_count_nav").html("(<%= @all_attachments.count%>)") - // 添加文件上传成功提示, - <% unless params[:attachments].nil? %> - var div = $('
      文件上传成功!
      '); - $("#course_list").prepend(div); - setTimeout( function(){div.remove();},3000) - <% end %> + hideModal(); + <%if @in_course_toolbar %> + window.location.href='<%= course_files_path(@course)%>' + <%else%> + $("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>'); + $("#courses_files_count_info").html("<%= @all_attachments.count%>"); + $("#courses_files_count_nav").html("(<%= @all_attachments.count%>)") + // 添加文件上传成功提示, + <% unless params[:attachments].nil? %> + var div = $('
      文件上传成功!
      '); + $("#course_list").prepend(div); + setTimeout( function(){div.remove();},3000) + <% end %> + <%end%> <% end %> <% end %> $(document).ready(img_thumbnails); From 8e66bb8fe166c4f9ead3c5be7b4f93c221564018 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 9 Nov 2015 10:07:12 +0800 Subject: [PATCH 040/132] =?UTF-8?q?=E5=9C=A8=E8=AF=BE=E7=A8=8B=20=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=20=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90=E5=90=8E?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=88=B0=E5=AF=B9=E5=BA=94=E7=9A=84=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=BA=93=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema.rb | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index b7e1bfa1c..11662fc7b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -528,26 +528,23 @@ ActiveRecord::Schema.define(:version => 20151102090519) do add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["project_id"], :name => "documents_project_id" - create_table "dts", :primary_key => "Num", :force => true do |t| - t.string "Defect", :limit => 50 - t.string "Category", :limit => 50 - t.string "File" - t.string "Method" - t.string "Module", :limit => 20 - t.string "Variable", :limit => 50 - t.integer "StartLine" - t.integer "IPLine" - t.string "IPLineCode", :limit => 200 - t.string "Judge", :limit => 15 - t.integer "Review", :limit => 1 + create_table "dts", :force => true do |t| + t.string "IPLineCode" t.string "Description" - t.text "PreConditions", :limit => 2147483647 - t.text "TraceInfo", :limit => 2147483647 - t.text "Code", :limit => 2147483647 + t.string "Num" + t.string "Variable" + t.string "TraceInfo" + t.string "Method" + t.string "File" + t.string "IPLine" + t.string "Review" + t.string "Category" + t.string "Defect" + t.string "PreConditions" + t.string "StartLine" t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "enabled_modules", :force => true do |t| @@ -817,6 +814,16 @@ ActiveRecord::Schema.define(:version => 20151102090519) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_details_copy", :force => true do |t| + t.integer "journal_id", :default => 0, :null => false + t.string "property", :limit => 30, :default => "", :null => false + t.string "prop_key", :limit => 30, :default => "", :null => false + t.text "old_value" + t.text "value" + end + + add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" From 4b272b6b9c622dbc009da3de584847ae3a1cc083 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 9 Nov 2015 11:14:24 +0800 Subject: [PATCH 041/132] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E6=89=A9=E5=A4=A7=E4=B8=BA40000=E4=B8=AA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/memo.rb | 2 +- app/views/forums/show.html.erb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/memo.rb b/app/models/memo.rb index 33b24db50..f6449a550 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -9,7 +9,7 @@ class Memo < ActiveRecord::Base # 若是主题帖,则内容可以是空 #validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? } validates_length_of :subject, maximum: 50 - validates_length_of :content, maximum: 5000 + validates_length_of :content, maximum: 40000 validate :cannot_reply_to_locked_topic, :on => :create acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC" diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 25a4fae46..3d239cff1 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -76,10 +76,10 @@ $("#error").html("主题 过长(最长为 50 个字符)").show(); return false; } -// if(memo_content.html().trim().length > 5000){ -// $("#error").html("内容 过长(最长为 5000 个字符)").show(); -// return false; -// } + if(memo_content.html().trim().length > 40000){ + $("#error").html("内容 过长(最长为 40000 个字符)").show(); + return false; + } return true; } From 1edd87f9e020cc69efd3f41d0689fd6baf76ba06 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 9 Nov 2015 11:15:01 +0800 Subject: [PATCH 042/132] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E6=89=A9=E5=A4=A7=E4=B8=BA20000=E4=B8=AA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/memo.rb | 2 +- app/views/forums/show.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/memo.rb b/app/models/memo.rb index f6449a550..94ff5cee2 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -9,7 +9,7 @@ class Memo < ActiveRecord::Base # 若是主题帖,则内容可以是空 #validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? } validates_length_of :subject, maximum: 50 - validates_length_of :content, maximum: 40000 + validates_length_of :content, maximum: 20000 validate :cannot_reply_to_locked_topic, :on => :create acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC" diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 3d239cff1..4bbf81668 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -76,8 +76,8 @@ $("#error").html("主题 过长(最长为 50 个字符)").show(); return false; } - if(memo_content.html().trim().length > 40000){ - $("#error").html("内容 过长(最长为 40000 个字符)").show(); + if(memo_content.html().trim().length > 20000){ + $("#error").html("内容 过长(最长为 20000 个字符)").show(); return false; } return true; From 463262e83819c9039f3adeac4765773a4ffdc777 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 9 Nov 2015 11:16:19 +0800 Subject: [PATCH 043/132] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E6=97=B6=E7=AB=8B=E9=A9=AC=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 12 ++++++++++++ app/views/student_work/edit.html.erb | 13 +++++++++++-- app/views/student_work/new.html.erb | 13 +++++++++++-- app/views/student_work/update.js.erb | 16 ++++++++++++++++ public/javascripts/course.js | 10 ++++++++-- public/javascripts/new_user.js | 10 ++++++++-- 6 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 app/views/student_work/update.js.erb diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index c36877092..9ad46cd69 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -221,24 +221,36 @@ class StudentWorkController < ApplicationController def update if params[:student_work] + @submit_result = true @work.name = params[:student_work][:name] @work.description = params[:student_work][:description] @work.project_id = params[:student_work][:project] @work.save_attachments(params[:attachments]) render_attachment_warning_if_needed(@work) if @work.save +=begin respond_to do |format| format.html { flash[:notice] = l(:notice_successful_edit) redirect_to student_work_index_url(:homework => @homework.id) } +=end + @student_work = @work + respond_to do |format| + format.js end return end end +=begin respond_to do |format| format.html{redirect_to edit_student_work_url(@work)} end +=end + @submit_result = false + respond_to do |format| + format.js + end end def show diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb index 25a65f039..517a238b0 100644 --- a/app/views/student_work/edit.html.erb +++ b/app/views/student_work/edit.html.erb @@ -26,7 +26,7 @@
      - <%= labelled_form_for @work,:html => { :multipart => true } do |f|%> + <%= labelled_form_for @work,:html => { :multipart => true },:remote=>true do |f|%>
      提示:作品名称和描述中不要出现真实的姓名信息
      @@ -52,7 +52,7 @@
      - 确定 + 确定 <%= link_to "取消", student_work_index_path(:homework => @homework), :class => "fr mr10 mt3"%>
      @@ -60,3 +60,12 @@ <% end%>
    + \ No newline at end of file diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index db83fd432..fdf1e31a3 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -111,11 +111,20 @@
    - 确定 + 确定 <%= link_to "取消", user_homeworks_user_path(User.current.id), :class => "fr mr10 mt3"%>
    <% end%>
    -
    \ No newline at end of file + + \ No newline at end of file diff --git a/app/views/student_work/update.js.erb b/app/views/student_work/update.js.erb new file mode 100644 index 000000000..79733db31 --- /dev/null +++ b/app/views/student_work/update.js.erb @@ -0,0 +1,16 @@ +<% if @submit_result%> +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_information') %>'); +showModal('ajax-modal', '500px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("" + + ""); +$('#ajax-modal').parent().css("top","").css("left",""); +$('#ajax-modal').parent().addClass("anonymos"); +<% else %> +window.location.href = '<%= edit_student_work_url(@work)%>'; +<% end %> + +function clickCanel() { + hideModal('#popbox02'); + window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>'; +} \ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 0c7f4156f..84e087c49 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -954,13 +954,19 @@ function regexStudentWorkDescription() function new_student_work() { if(regexStudentWorkName()&®exStudentWorkDescription()) - {$("#new_student_work").submit();} + { + $("#new_student_work").submit(); + $("#ajax-indicator").hide(); + } } function edit_student_work(id) { if(regexStudentWorkName()&®exStudentWorkDescription()) - {$("#edit_student_work_" + id).submit();} + { + $("#edit_student_work_" + id).submit(); + $("#ajax-indicator").hide(); + } } // diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index ca7b28ee7..a0647b592 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -250,13 +250,19 @@ function regex_evaluation_num(){ function new_student_work() { if(regexStudentWorkName()&®exStudentWorkDescription()) - {$("#new_student_work").submit();} + { + $("#new_student_work").submit(); + $("#ajax-indicator").hide(); + } } function edit_student_work(id) { if(regexStudentWorkName()&®exStudentWorkDescription()) - {$("#edit_student_work_" + id).submit();} + { + $("#edit_student_work_" + id).submit(); + $("#ajax-indicator").hide(); + } } //验证作品名称 From 2d321d2dbc2d11b9a79fe19c147400c424c849d4 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 9 Nov 2015 11:24:20 +0800 Subject: [PATCH 044/132] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E6=89=A9=E5=A4=A7=E4=B8=BA20000=E4=B8=AA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=EF=BC=8C=E8=B6=85=E8=BF=87=E4=B8=A4=E4=B8=87?= =?UTF-8?q?=E4=B8=AA=E5=AD=97=E7=AC=A6=E4=B8=8D=E5=85=81=E8=AE=B8=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 4bbf81668..8e5a6b8e0 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -76,7 +76,7 @@ $("#error").html("主题 过长(最长为 50 个字符)").show(); return false; } - if(memo_content.html().trim().length > 20000){ + if(memo_content.html().length > 20000){ $("#error").html("内容 过长(最长为 20000 个字符)").show(); return false; } From 2e092b0d04078f0a1c09f0dfcaf4d9c8d30fc71d Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 9 Nov 2015 11:27:05 +0800 Subject: [PATCH 045/132] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E6=89=A9=E5=A4=A7=E4=B8=BA30000=E4=B8=AA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=EF=BC=8C=E8=B6=85=E8=BF=87=E4=B8=A4=E4=B8=87?= =?UTF-8?q?=E4=B8=AA=E5=AD=97=E7=AC=A6=E4=B8=8D=E5=85=81=E8=AE=B8=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/memo.rb | 2 +- app/views/forums/show.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/memo.rb b/app/models/memo.rb index 94ff5cee2..7c4fbdcf1 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -9,7 +9,7 @@ class Memo < ActiveRecord::Base # 若是主题帖,则内容可以是空 #validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? } validates_length_of :subject, maximum: 50 - validates_length_of :content, maximum: 20000 + validates_length_of :content, maximum: 30000 validate :cannot_reply_to_locked_topic, :on => :create acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC" diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 8e5a6b8e0..523ab1300 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -76,8 +76,8 @@ $("#error").html("主题 过长(最长为 50 个字符)").show(); return false; } - if(memo_content.html().length > 20000){ - $("#error").html("内容 过长(最长为 20000 个字符)").show(); + if(memo_content.html().length > 30000){ + $("#error").html("内容 过长(最长为 30000 个字符)").show(); return false; } return true; From d461e1be0d95d785c54652a49d5e75215e2cb7c9 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 9 Nov 2015 11:54:33 +0800 Subject: [PATCH 046/132] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF=E2=80=9C=E6=82=A8?= =?UTF-8?q?=E5=B0=9A=E6=9C=AA=E6=8F=90=E4=BA=A4=E4=BD=9C=E5=93=81=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_student_work_list.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index d834bc845..64f097114 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -2,10 +2,10 @@ 作品 - (<%= @student_work_count%>) + (已有<%= @student_work_count%>人提交) <% if !@is_teacher && @stundet_works.empty?%> - 未提交 + 您尚未提交作品 <% end %> <%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%> From 157ba12513784cb6f9526c8cb2df64d4dd67e203 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 9 Nov 2015 14:04:51 +0800 Subject: [PATCH 047/132] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BA=93=E8=99=9A?= =?UTF-8?q?=E7=BA=BF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_resources_list.html.erb | 2 ++ public/stylesheets/new_user.css | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index 34d609487..6f47e3535 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -21,5 +21,7 @@
  • <%= format_date(attach.created_on) %>
  • <%= attach.id %>
  • +
      + <% end %> <% end %> diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 7263c2f58..a4b8da25f 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -401,7 +401,8 @@ a.resourcesBlack {font-size:12px; color:#4c4c4c;white-space: nowrap;text-align: a.resourcesBlack:hover {font-size:12px; color:#000000;} .resourcesListCheckbox {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle;} .resourcesCheckbox {padding:0px; margin:0px; margin-top:14px; width:12px; height:12px;} -.resourcesList {width:710px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px; margin-left:auto; margin-right:auto;} +.resourcesList {width:710px; height:39px; background-color:#ffffff; color:#9a9a9a; font-size:12px; margin-left:auto; margin-right:auto;} /*border-bottom:1px dashed #eaeaea;*/ +.resourcesListDashLine {width:710px;border-bottom:1px dashed #eaeaea !important; margin-left:auto; margin-right:auto; padding-bottom: 2px} /*border-bottom:1px dashed #eaeaea;*/ .resourcesListOption {width:710px; height:40px; line-height:40px; vertical-align:middle; margin-left:auto; margin-right:auto; background-color:#f6f6f6;} .resourcesCheckAll {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle; float:left;} .resourcesSelectSend {float:right;} From 0c202a47bb5436b3249996a1efb35efce4b1ace2 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 9 Nov 2015 14:35:12 +0800 Subject: [PATCH 048/132] =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E5=8F=96=E6=B6=88=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=A1=86=E7=9A=84=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blog_comments/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index 2d4754a0a..54c9541f2 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -164,7 +164,7 @@
      <%= form_for :blog_comment, :url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %> <%= render :partial => 'blog_comments/reply_form', :locals => {:f => f,:user=>@user,:article=>@article} %> - <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'canel_message_replay();', :class => " grey_btn fr c_white mt10 mr5" %> + <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %> <%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-right: 5px;" %> <% end %>
      From 0e42554ef9b706fbabbb8fae68543f2886327cf9 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 9 Nov 2015 14:58:01 +0800 Subject: [PATCH 049/132] =?UTF-8?q?=E5=BC=95=E7=94=A8=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=92=8C=20=E7=9B=B4=E6=8E=A5=E4=B8=8A=E4=BC=A0=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E7=9A=84=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E5=9C=A8=E5=90=8C=E4=B8=80=E5=88=97=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/import_resources_to_homework.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/import_resources_to_homework.js.erb b/app/views/users/import_resources_to_homework.js.erb index c929f48e5..804b4ec44 100644 --- a/app/views/users/import_resources_to_homework.js.erb +++ b/app/views/users/import_resources_to_homework.js.erb @@ -2,7 +2,7 @@ <% @attachments.each do |attachment| %> $("#attachments_fields").append( ''+ - '<%= text_field_tag("attachments[p#{attachment.id}][filename]", attachment.filename, :class => "filename link_file", :readonly=>"readonly")%>'+ + '<%= text_field_tag("attachments[p#{attachment.id}][filename]", attachment.filename, :class => "upload_filename link_file", :readonly=>"readonly")%>'+ '<%= text_field_tag("attachments[p#{attachment.id}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => "description", :style=>"display: inline-block;") %>'+ '<%= l(:field_is_public)%>:'+ '<%= check_box_tag("attachments[p#{attachment.id}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => "is_public")%>'+ From dc7a90cab5280ee9c17debb3cb531a44397648ee Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 9 Nov 2015 15:07:33 +0800 Subject: [PATCH 050/132] =?UTF-8?q?=E5=8A=A9=E6=95=99=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=AD=A6=E7=94=9F=E4=BD=9C=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_add_score.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/student_work/_add_score.html.erb b/app/views/student_work/_add_score.html.erb index 961f351de..0258b3b83 100644 --- a/app/views/student_work/_add_score.html.erb +++ b/app/views/student_work/_add_score.html.erb @@ -16,7 +16,7 @@ <%= render :partial => 'student_work/student_work_attachment_form', :locals => {:work => work,:score => score} %>
      <%end%> - 提交 + 提交
      <% end%> \ No newline at end of file From 20b49385de29a421d0ea8b6ce7cd0d6b238c7933 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 9 Nov 2015 15:36:32 +0800 Subject: [PATCH 051/132] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=97=B6=E5=8C=BA?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20=E4=BD=9C=E4=B8=9A=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=B7=BB=E5=8A=A0=E5=8F=91=E5=B8=83=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_message_course.html.erb | 1 + config/application.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index 41c7c1eee..eb15fa717 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -66,6 +66,7 @@
    • 课程名称:<%= ma.course_message.course.name %> (<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
    • 作业标题:<%= ma.course_message.name %>
    • +
    • 发布时间:<%= DateTime.parse(ma.course_message.created_at.to_s).strftime('%Y-%m-%d %H:%M:%S').to_s %>
    • 提交截止:<%= ma.course_message.end_time %>  23:59
    • 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %>  23:59
    • 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %>  23:59
    • diff --git a/config/application.rb b/config/application.rb index 90cc299c6..6e4a2983a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -41,7 +41,7 @@ module RedmineApp config.active_record.store_full_sti_class = true config.active_record.default_timezone = :local - + config.time_zone = 'Beijing' # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' From 7bd9c5b65cf0f1b05f34d1c1913cd52ee6ba0dad Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 9 Nov 2015 15:55:55 +0800 Subject: [PATCH 052/132] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=97=B6=E5=8C=BA?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20=E4=BD=9C=E4=B8=9A=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=B7=BB=E5=8A=A0=E5=8F=91=E5=B8=83=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_message_course.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index eb15fa717..384a91e54 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -66,10 +66,10 @@
    • 课程名称:<%= ma.course_message.course.name %> (<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
    • 作业标题:<%= ma.course_message.name %>
    • -
    • 发布时间:<%= DateTime.parse(ma.course_message.created_at.to_s).strftime('%Y-%m-%d %H:%M:%S').to_s %>
    • -
    • 提交截止:<%= ma.course_message.end_time %>  23:59
    • -
    • 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %>  23:59
    • -
    • 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %>  23:59
    • +
    • 发布时间:<%= DateTime.parse(ma.course_message.created_at.to_s).strftime('%Y-%m-%d %H:%M').to_s %>
    • +
    • 提交截止:<%= ma.course_message.end_time %> 23:59
    • +
    • 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 23:59
    • +
    • 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 23:59
    • 迟交扣分:<%= ma.course_message.late_penalty %>分
    • 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
    • @@ -382,7 +382,7 @@
    • <%= link_to image_tag(url_to_avatar(ma.course_message.homework_common.user), :width => "30", :height => "30"), user_path(ma.course_message.homework_common.user) %>
    • <%=link_to ma.course_message.homework_common.user.show_name, user_path(ma.course_message.homework_common.user), :class => "newsBlue homepageNewsPublisher" %> - ">发布的作业: + ">老师发布的作业:
    • <%= link_to "作业题目:" + ma.course_message.homework_common.name, student_work_index_path(:homework => ma.course_message.homework_common_id), From 3c93103bc75755f97c62806f6a9f95cf939476ff Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 9 Nov 2015 15:59:24 +0800 Subject: [PATCH 053/132] =?UTF-8?q?=E8=BF=9F=E4=BA=A4=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E8=80=81=E5=B8=88=E5=90=8D=E7=A7=B0=E8=A6=81=E7=BB=99?= =?UTF-8?q?=E7=A7=B0=E5=91=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_message_course.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index 384a91e54..da649663d 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -381,8 +381,8 @@ diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index 4a6a4eb68..253a6418a 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -1,62 +1,63 @@ - -
        - <% is_my_work = student_work.user == User.current%> -
      • -
          - <% if is_my_work%> -
        • - <%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %> -
        • -
        • - <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> -
          - <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%> -
          -
        • -
        • -
            -
          • - <%= student_work.user.show_name%> -
          • -
          • - <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> -
          • -
          -
        • - <% else%> -
        • - <%= image_tag(url_to_avatar(""),width:"40", height: "40") %> -
        • -
        • -
          - <%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%> -
          -
        • -
        • -
            -
          • - 匿名 -
          • -
          • - -- -
          • -
          -
        • - <% end%> - -
        -
      • -
      • - <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  - <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> - [迟交] - <% end %> -
      • - - - <% my_score = student_work_score(student_work,User.current) %> -
      • - <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%> -
      • -
      - + +
        + <% is_my_work = student_work.user == User.current%> +
      • +
          + <% if is_my_work%> +
        • + <%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %> +
        • +
        • + <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> +
          + <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%> +
          +
        • +
        • +
            +
          • + <%= student_work.user.show_name%> +
          • +
          • + <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> +
          • +
          +
        • + <% else%> +
        • + <%= image_tag(url_to_avatar(""),width:"40", height: "40") %> +
        • +
        • +
          + <%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%> +
          +
        • +
        • +
            +
          • + 匿名 +
          • +
          • + -- +
          • +
          +
        • + <% end%> + +
        +
      • +
      • + <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  + <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> + [迟交] + <% end %> +
      • + + + <% my_score = student_work_score(student_work,User.current) %> +
      • + <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%> +
      • +
      • 点击查看详情
      • +
      + diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 1cff7e07a..97af45fa2 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -43,10 +43,13 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} .pingBackTit{ float:left; width:573px; margin-left:10px; } .hworkUl{ height:30px; border-bottom:1px solid #eaeaea; line-height:30px; vertical-align:middle; background-color: #f6f6f6;} .hworkH30 {height:30px !important; line-height:30px !important;} -.hworkListRow {height:65px; border-bottom:1px dashed #eaeaea; line-height:65px; vertical-align:middle;} +.hworkListRow {height:65px; border-bottom:1px dashed #eaeaea; line-height:65px; vertical-align:middle; position: relative;} .hworkListRow:hover {background-color:#f6f6f7;} .hworkUl li{ float:left;} .hworkListRow li{ float:left;} +.hworkTip{position:absolute; padding:3px 5px; border:1px solid #eaeaea; display:block; right:-108px; top:20px; background-color:#ffffff; line-height:20px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);} +.hworkTip em {display:block; border-width:8px; position:absolute; bottom:4px; left:-16px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;} +.hworkTip span {display:block; border-width:8px; position:absolute; bottom:4px; left:-15px; border-style:dashed solid dashed dashed; border-color:transparent #FFF transparent transparent; font-size:0; line-height:0;} .hworkList340 {width:335px; text-align:left; height:50px; line-height:50px;padding-left:5px;} .hworkList80 {width:80px; text-align:center;} .hworkList50 {width:50px; text-align:center;} From 4adc6deabf8f0dbddceb0b2ff3683087589ea275 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 10 Nov 2015 14:18:39 +0800 Subject: [PATCH 056/132] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=BC=80=E8=AF=BE=E5=AD=A6=E6=9C=9F?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E6=9B=B4=E6=94=B9=EF=BC=8C=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E6=8F=90=E9=86=92=E7=94=A8=E6=88=B7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_term_select.html.erb | 41 +++++++++++++++++++++++++ app/views/courses/settings.html.erb | 19 ++++++++++-- public/stylesheets/courses.css | 7 +++++ 3 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 app/views/courses/_term_select.html.erb diff --git a/app/views/courses/_term_select.html.erb b/app/views/courses/_term_select.html.erb new file mode 100644 index 000000000..e295e7c94 --- /dev/null +++ b/app/views/courses/_term_select.html.erb @@ -0,0 +1,41 @@ +
      +
      +

      + 当前课程的学期信息不能修改。如果您希望为本课程新建学期,请根据需要执行以下两种操作之一(目前复制学期正在改进中,将尽快上线)。选择前请参考按钮右侧的说明: +

      +
      +
      + + 新建学期 + + 新建学期将为您创建一个新的课程学期,新学期不包括之前学期的任何内容。 +
      +
      +
      + +
      + 复制学期 + (开发中...) +
      + 复制学期将为您创建一个新的课程学期,新学期将继承本学期的相关资源,具体您稍后可以选择。 +
      +
      + +
      +
      + + \ No newline at end of file diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index a462db79d..a90be14ea 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -36,8 +36,8 @@
    • - <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {} %> - <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %> + <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {:id=>"time_selected"} %> + <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"term_selected"} %>
    • @@ -92,4 +92,17 @@ -
      \ No newline at end of file +
      + \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 8b5e2fba3..85d2e3334 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -492,6 +492,13 @@ a:hover.tijiao{ background:#0f99a9;} .ni_con_work p{ color:#808181; } a.xls{ margin-left:5px; color:#136b3b;} .grey_c{ color:#808181;} + +.disable_btn { height:46px; display:block; width:90px; color:#fff; background:#d0d2d0; text-align:center; padding-top:4px; margin-right:15px;} +a.term_btn{ height:38px; display:block; width:90px; color:#fff; background:#269ac9; text-align:center; padding-top:12px; margin-right:15px;} +a:hover.term_btn{ background:#297fb8;} +p.c_black{ color:#000000;} +a.exit { height:24px; display:block; width:80px; color:#000000; background:#c3c3c3; text-align:center; padding-top:4px;} +.lh22{ line-height: 22px;} /* 学生列表*/ .st_list{ width:670px;} .st_search{ } From 8d94f57ec33fd3a37eb47be8f9dc0bebf4aa2361 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 10 Nov 2015 14:33:46 +0800 Subject: [PATCH 057/132] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E8=BF=9B=E5=BA=A6=E6=9D=A1=E4=B8=8D=E8=A7=81=E4=BA=86?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 2 ++ public/stylesheets/new_user.css | 2 ++ public/stylesheets/project.css | 2 ++ 3 files changed, 6 insertions(+) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 8b5e2fba3..da4c03398 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -893,6 +893,8 @@ a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; f .c_w{ color:#fff;} .filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} +#attachments_fields .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} +#attachments_fields .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .upload_filename{ background: url(../images/pic_file.png) 0 -20px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .evaluation{position: relative;} .evaluation_submit{position: absolute;right: 0px;bottom: 0px;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index a4b8da25f..2ba5a7374 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1153,6 +1153,8 @@ img.ui-datepicker-trigger { text-overflow: ellipsis; margin-bottom: 3px; } +#attachments_fields .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} +#attachments_fields .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .upload_filename{ background: url(../images/pic_file.png) 0 -25px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .message_title{border: 1px solid #9C9C9C;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff; max-width:400px;word-wrap:break-word; word-break:break-all;} .message_title_red{border: 1px solid #484848;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff;background-image: -moz-linear-gradient(top, #fff, #E0E0E0);} diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 4594d0c51..6a4254046 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -369,6 +369,8 @@ span.add_attachment {font-size: 80%;line-height: 2.5em;} #attachments_fields .ajax-loading input.filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .reply_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #ccc; color:#999; border-radius:3px; padding:2px 10px; margin-bottom:10px;display: block;margin-left: 470px;} .reply_btn:hover{ background:#999; color:#fff; } +#attachments_fields .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} +#attachments_fields .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .upload_filename{ background: url(../images/pic_file.png) 0 -22px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .attachments_fields input.description {margin-left:4px; width:100px; } .attachments_fields span .boldSpan{display:block; white-space:nowrap; font-family:'微软雅黑';} From dcdffe5d04782f3e8dd4d0ba01fe0685e31e190b Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 10 Nov 2015 14:37:16 +0800 Subject: [PATCH 058/132] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E8=BF=9B=E5=BA=A6=E6=9D=A1=E4=B8=8D=E8=A7=81=E4=BA=86?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 2 ++ public/stylesheets/new_user.css | 2 ++ public/stylesheets/project.css | 2 ++ 3 files changed, 6 insertions(+) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 2fd06bf69..054dd5ffc 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -903,6 +903,8 @@ a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; f .c_w{ color:#fff;} .filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} +#attachments_fields .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} +#attachments_fields .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .upload_filename{ background: url(../images/pic_file.png) 0 -20px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .evaluation{position: relative;} .evaluation_submit{position: absolute;right: 0px;bottom: 0px;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 7263c2f58..2fbf79c30 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1152,6 +1152,8 @@ img.ui-datepicker-trigger { text-overflow: ellipsis; margin-bottom: 3px; } +#attachments_fields .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} +#attachments_fields .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .upload_filename{ background: url(../images/pic_file.png) 0 -25px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .message_title{border: 1px solid #9C9C9C;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff; max-width:400px;word-wrap:break-word; word-break:break-all;} .message_title_red{border: 1px solid #484848;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff;background-image: -moz-linear-gradient(top, #fff, #E0E0E0);} diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 4594d0c51..6a4254046 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -369,6 +369,8 @@ span.add_attachment {font-size: 80%;line-height: 2.5em;} #attachments_fields .ajax-loading input.filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .reply_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #ccc; color:#999; border-radius:3px; padding:2px 10px; margin-bottom:10px;display: block;margin-left: 470px;} .reply_btn:hover{ background:#999; color:#fff; } +#attachments_fields .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} +#attachments_fields .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .upload_filename{ background: url(../images/pic_file.png) 0 -22px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .attachments_fields input.description {margin-left:4px; width:100px; } .attachments_fields span .boldSpan{display:block; white-space:nowrap; font-family:'微软雅黑';} From 4be3b16b60f4d4acfca25b115dab9be49d8eac86 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 10 Nov 2015 14:51:44 +0800 Subject: [PATCH 059/132] =?UTF-8?q?=E9=9A=90=E8=97=8F=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_evaluation_un_work.html.erb | 2 +- app/views/student_work/_evaluation_work.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index 0d55cb130..ebe3d4cc6 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -80,6 +80,6 @@ <% end%>
    • -
    • 点击查看详情
    • + diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index aa6009466..81d868a50 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -48,7 +48,7 @@
    • <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  - <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> + <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> [迟交] <% end %>
    • @@ -58,6 +58,6 @@
    • <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
    • -
    • 点击查看详情
    • + From 82c377a60aa1988a562073bb088163e378f617f3 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 10 Nov 2015 15:18:13 +0800 Subject: [PATCH 060/132] =?UTF-8?q?=E5=9C=A8=E5=AF=BC=E8=88=AA=E5=A4=84?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E4=B8=8D=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../files/_new_style_attachment_list.html.erb | 82 +++++-------------- app/views/files/_upload_course_files.erb | 2 +- app/views/layouts/base_projects.html.erb | 2 +- .../_upload_project_files_list.html.erb | 35 ++++++++ .../_upload_project_files_on_navbar.html.erb | 30 +++++++ public/stylesheets/courses.css | 4 +- public/stylesheets/new_user.css | 4 +- public/stylesheets/project.css | 4 +- 8 files changed, 95 insertions(+), 68 deletions(-) create mode 100644 app/views/projects/_upload_project_files_list.html.erb create mode 100644 app/views/projects/_upload_project_files_on_navbar.html.erb diff --git a/app/views/files/_new_style_attachment_list.html.erb b/app/views/files/_new_style_attachment_list.html.erb index 022486413..af679c4d3 100644 --- a/app/views/files/_new_style_attachment_list.html.erb +++ b/app/views/files/_new_style_attachment_list.html.erb @@ -1,71 +1,33 @@ + <% checkBox = (@course.present? && @course.is_public?) ? 'public' : 'private'%> - -<% if @course %> - <%= file_field_tag 'attachments[dummy][file]', - :id => '_file', - :class => ie8? ? '':'file_selector', - :multiple => true, - :onchange => 'addInputFilesCourseSource(this,"'+ checkBox.to_s+'");', - :style => ie8? ? '': 'display:none', - :data => { - :max_file_size => Setting.attachment_max_size.to_i.kilobytes, - :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), - :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => uploads_path(:format => 'js'), - :description_placeholder => l(:label_optional_description), - :field_is_public => l(:field_is_public), - :are_you_sure => l(:text_are_you_sure), - :file_count => l(:label_file_count), - :delete_all_files => l(:text_are_you_sure_all) - } %> -<% else %> - <%= file_field_tag 'attachments[dummy][file]', - :id => '_file', - :class => ie8? ? '':'file_selector', - :multiple => true, - :onchange => 'addInputFiles(this);', - :style => ie8? ? '': 'display:none', - :data => { - :max_file_size => Setting.attachment_max_size.to_i.kilobytes, - :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), - :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => uploads_path(:format => 'js'), - :description_placeholder => l(:label_optional_description), - :field_is_public => l(:field_is_public), - :are_you_sure => l(:text_are_you_sure), - :file_count => l(:label_file_count), - :delete_all_files => l(:text_are_you_sure_all) - } %> -<% end %> - + + <%= file_field_tag 'attachments[dummy][file]', + :id => "_file#{container.id}", + :class => ie8? ? '':'file_selector', + :multiple => true, + :onchange => "addInputFiles_board(this, '#{container.id}');", + :style => ie8? ? '': 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js'), + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :delete_all_files => l(:text_are_you_sure_all) + } %> + - + <%= l(:label_no_file_uploaded)%> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
      - -<% if defined?(container) && container && container.saved_attachments %> - <% container.attachments.each_with_index do |attachment, i| %> - - <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> - <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> - <%= l(:field_is_public)%>: - <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> - <%= if attachment.id.nil? - #待补充代码 - else - link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') - end - %> - <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> - - <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> - - <% end %> -<% end %> +
      \ No newline at end of file diff --git a/app/views/files/_upload_course_files.erb b/app/views/files/_upload_course_files.erb index 3578d4eb9..9c7021383 100644 --- a/app/views/files/_upload_course_files.erb +++ b/app/views/files/_upload_course_files.erb @@ -19,7 +19,7 @@
      - <%= render :partial => 'files/new_style_attachment_list',:locals => {:course => course} %> + <%= render :partial => 'files/new_style_attachment_list',:locals => {:container => course} %>
      <%= l(:button_cancel)%> diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index e06db1d0f..d2186118d 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -226,7 +226,7 @@ function project_files_upload() { - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_show_project',:locals => {:project => @project}) %>'); + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/upload_project_files_on_navbar',:locals => {:container => @project}) %>'); showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); diff --git a/app/views/projects/_upload_project_files_list.html.erb b/app/views/projects/_upload_project_files_list.html.erb new file mode 100644 index 000000000..59da30012 --- /dev/null +++ b/app/views/projects/_upload_project_files_list.html.erb @@ -0,0 +1,35 @@ + +<% checkBox = (@course.present? && @course.is_public?) ? 'public' : 'private'%> + + <%= file_field_tag 'attachments[dummy][file]', + :id => "_file#{container.id}", + :class => ie8? ? '':'file_selector', + :multiple => true, + :onchange => "addInputFiles_board(this, '#{container.id}');", + :style => ie8? ? '': 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js'), + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :delete_all_files => l(:text_are_you_sure_all) + } %> + + + + + <%= l(:label_no_file_uploaded)%> + +(<%= l(:label_max_size) %>: +<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) +
      + +
      + + +
      +
      \ No newline at end of file diff --git a/app/views/projects/_upload_project_files_on_navbar.html.erb b/app/views/projects/_upload_project_files_on_navbar.html.erb new file mode 100644 index 000000000..591e159f1 --- /dev/null +++ b/app/views/projects/_upload_project_files_on_navbar.html.erb @@ -0,0 +1,30 @@ + +
      +
      +

      <%= l(:label_upload_files)%>

      +
      + <%= error_messages_for 'attachment' %> + + + <%= form_tag(project_files_path(container), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> + + + <%= render :partial => 'projects/upload_project_files_list',:locals => {:container => container} %> +
      + <%= l(:button_cancel)%> + <%= l(:button_confirm)%> + <% end %> +
      + +
      + <% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> + <% end %> +
      + + \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index da4c03398..342833981 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -893,8 +893,8 @@ a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; f .c_w{ color:#fff;} .filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} -#attachments_fields .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} -#attachments_fields .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} + .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} + .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .upload_filename{ background: url(../images/pic_file.png) 0 -20px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .evaluation{position: relative;} .evaluation_submit{position: absolute;right: 0px;bottom: 0px;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 2ba5a7374..f21a4b1fd 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1153,8 +1153,8 @@ img.ui-datepicker-trigger { text-overflow: ellipsis; margin-bottom: 3px; } -#attachments_fields .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} -#attachments_fields .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} + .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} + .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .upload_filename{ background: url(../images/pic_file.png) 0 -25px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .message_title{border: 1px solid #9C9C9C;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff; max-width:400px;word-wrap:break-word; word-break:break-all;} .message_title_red{border: 1px solid #484848;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff;background-image: -moz-linear-gradient(top, #fff, #E0E0E0);} diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 6a4254046..e7a24b151 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -369,8 +369,8 @@ span.add_attachment {font-size: 80%;line-height: 2.5em;} #attachments_fields .ajax-loading input.filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .reply_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #ccc; color:#999; border-radius:3px; padding:2px 10px; margin-bottom:10px;display: block;margin-left: 470px;} .reply_btn:hover{ background:#999; color:#fff; } -#attachments_fields .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} -#attachments_fields .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} + .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} + .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .upload_filename{ background: url(../images/pic_file.png) 0 -22px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .attachments_fields input.description {margin-left:4px; width:100px; } .attachments_fields span .boldSpan{display:block; white-space:nowrap; font-family:'微软雅黑';} From c20ff6980bd3aba176ec265608b08eb53d778560 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 10 Nov 2015 15:22:10 +0800 Subject: [PATCH 061/132] =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=9D=A1=E4=B8=8D?= =?UTF-8?q?=E8=A7=81=E4=BA=86bug=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 4 ++-- public/stylesheets/new_user.css | 4 ++-- public/stylesheets/project.css | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 054dd5ffc..48c6a2d88 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -903,8 +903,8 @@ a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; f .c_w{ color:#fff;} .filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} -#attachments_fields .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} -#attachments_fields .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} + .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} + .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .upload_filename{ background: url(../images/pic_file.png) 0 -20px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .evaluation{position: relative;} .evaluation_submit{position: absolute;right: 0px;bottom: 0px;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 2fbf79c30..11ce8e613 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1152,8 +1152,8 @@ img.ui-datepicker-trigger { text-overflow: ellipsis; margin-bottom: 3px; } -#attachments_fields .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} -#attachments_fields .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} + .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} + .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .upload_filename{ background: url(../images/pic_file.png) 0 -25px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .message_title{border: 1px solid #9C9C9C;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff; max-width:400px;word-wrap:break-word; word-break:break-all;} .message_title_red{border: 1px solid #484848;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff;background-image: -moz-linear-gradient(top, #fff, #E0E0E0);} diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 6a4254046..e7a24b151 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -369,8 +369,8 @@ span.add_attachment {font-size: 80%;line-height: 2.5em;} #attachments_fields .ajax-loading input.filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .reply_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #ccc; color:#999; border-radius:3px; padding:2px 10px; margin-bottom:10px;display: block;margin-left: 470px;} .reply_btn:hover{ background:#999; color:#fff; } -#attachments_fields .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} -#attachments_fields .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} + .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} + .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .upload_filename{ background: url(../images/pic_file.png) 0 -22px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .attachments_fields input.description {margin-left:4px; width:100px; } .attachments_fields span .boldSpan{display:block; white-space:nowrap; font-family:'微软雅黑';} From 6dd264990e08efaece2ee5605d9c9eeb98f7a43e Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 10 Nov 2015 15:27:59 +0800 Subject: [PATCH 062/132] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E2=80=9C=E7=82=B9=E5=87=BB=E6=9F=A5=E7=9C=8B=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student_work/_evaluation_un_work.html.erb | 15 ++++++++++++--- .../student_work/_evaluation_work.html.erb | 19 +++++++++++++------ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index ebe3d4cc6..2a0962244 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -5,7 +5,7 @@
    • <%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40"),user_activities_path(student_work.user)) %>
    • -
      +
    • <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
      @@ -25,7 +25,7 @@
    • -
    • +
    • <% if student_work.created_at && @homework.end_time%> <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> @@ -80,6 +80,15 @@
    • <% end%> - + + diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index 81d868a50..e336b0282 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -7,13 +7,13 @@
    • <%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %>
    • -
    • +
    • <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
      <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
    • -
    • +
      • <%= student_work.user.show_name%> @@ -27,12 +27,12 @@
      • <%= image_tag(url_to_avatar(""),width:"40", height: "40") %>
      • -
      • +
      • <%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
      • -
      • +
        • 匿名 @@ -46,7 +46,7 @@
      • -
      • +
      • <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> [迟交] @@ -58,6 +58,13 @@
      • <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
      • - +
      + From ef74d8d95693e50f4f69444c16c1680f27a5c119 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 10 Nov 2015 15:31:24 +0800 Subject: [PATCH 063/132] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BB=BB=E5=8A=A1--?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=94=A8=E6=88=B7=E5=90=8C=E6=AD=A5=E4=B8=8D?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/gitlab_to_git.rake | 22 ----------- lib/tasks/sync_gitlab_user.rake | 39 +++++++++++++++++++ lib/trustie/gitlab/helper.rb | 68 ++++++++++++++++----------------- 3 files changed, 73 insertions(+), 56 deletions(-) delete mode 100644 lib/tasks/gitlab_to_git.rake create mode 100644 lib/tasks/sync_gitlab_user.rake diff --git a/lib/tasks/gitlab_to_git.rake b/lib/tasks/gitlab_to_git.rake deleted file mode 100644 index c7b97e00d..000000000 --- a/lib/tasks/gitlab_to_git.rake +++ /dev/null @@ -1,22 +0,0 @@ -#coding=utf-8 - -namespace :rep_fault do - desc "set ossean's type value" - task :rep_update => :environment do - rep = Repository.find(400) - rep.type = "Repository::Git" - rep.save - end - - desc "forge and ossean's members" - task :sync_members => :environment do - projects = [] - projects << Project.where("id =? ",2) - projects << Project.where("id =? ",299) - puts projects - s = Trustie::Gitlab::Sync.new - projects.each do |project| - s.only_members(project.first) - end - end -end \ No newline at end of file diff --git a/lib/tasks/sync_gitlab_user.rake b/lib/tasks/sync_gitlab_user.rake new file mode 100644 index 000000000..c932ca36c --- /dev/null +++ b/lib/tasks/sync_gitlab_user.rake @@ -0,0 +1,39 @@ +#coding=utf-8 + +namespace :gitlab do + desc "sync gitlab's users which lost in last sync" + task :add_gid => :environment do + users = User.find_by_sql("select * from users where gid is null") + s = Trustie::Gitlab::Sync.new + g = Gitlab.client + users.each do |user| + us = g.get("/users?search=#{user.mail}") + puts user.mail + if us.blank? + puts "55555555555555555" + s.sync_user(user) + else + # 解决查询的时候出现多值的情况,比如:123@163.com和g123@163.com + puts "66666666666666666666" + puts user.id + if Array === us + us.each do |u| + if u.email == user.mail + user.gid = u.id + user.save + end + end + end + end + end + end + + task :sync_members => :environment do + projects = Project.all + s = Trustie::Gitlab::Sync.new + projects.each do |project| + puts project.id + s.only_members(project.first) + end + end +end \ No newline at end of file diff --git a/lib/trustie/gitlab/helper.rb b/lib/trustie/gitlab/helper.rb index 57c333875..61c1fbd17 100644 --- a/lib/trustie/gitlab/helper.rb +++ b/lib/trustie/gitlab/helper.rb @@ -3,46 +3,46 @@ module Trustie module Gitlab module Helper - def change_password(uid, en_pwd, salt) - return unless uid - options = {:encrypted_password=>en_pwd, :password_salt=>salt} - self.g.put("/users/ext/#{uid}", :body => options) - # g.edit_user(uid, :encrypted_password=>en_pwd, :password_salt=>salt) - end + def change_password(uid, en_pwd, salt) + return unless uid + options = {:encrypted_password=>en_pwd, :password_salt=>salt} + self.g.put("/users/ext/#{uid}", :body => options) + # g.edit_user(uid, :encrypted_password=>en_pwd, :password_salt=>salt) + end - def find_user(user) - us = self.g.get("/users?search=#{user.mail}") - if Array === us - us.each do |u| - return u if u.email == user.mail - end + def find_user(user) + us = self.g.get("/users?search=#{user.mail}") + if Array === us + us.each do |u| + return u if u.email == user.mail end - return nil end + return nil + end - def add_user(user) - u = nil - begin - u = find_user(user) - unless u - u = self.g.create_user(user.mail, - user.hashed_password, - name: user.show_name, - username: user.login, - confirm: "true") - user.gid = u.id - end - change_password(u.id, user.hashed_password, user.salt) - rescue => e - puts e - end - return u + def add_user(user) + u = nil + begin + u = find_user(user) + unless u + u = self.g.create_user(user.mail, + user.hashed_password, + name: user.show_name, + username: user.login, + confirm: "true") + user.gid = u.id + end + change_password(u.id, user.hashed_password, user.salt) + rescue => e + puts e end + return u + end - def del_user(user) - return unless user.gid - self.g.delete_user(user.gid) - end + def del_user(user) + return unless user.gid + self.g.delete_user(user.gid) + end end end From 463b6e91f5e5ebbf38ab0911fac13989eddb1685 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 10 Nov 2015 16:03:06 +0800 Subject: [PATCH 064/132] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/account/login.html.erb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb index fadf5e465..b316aa406 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -128,6 +128,11 @@ }); $mail.blur(function (event) { + if (/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(this.value) == false){ + $('#mail_req').html( '邮件格式不对').show(); + $mail_correct = false; + return ; + } if ($(this).is('#user_mail')) { $.get('<%=account_valid_ajax_path%>', { valid: "mail", From db0978c6571e5645fc5cc931d911e145b8fcc68a Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 10 Nov 2015 17:07:37 +0800 Subject: [PATCH 065/132] =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/show.html.erb | 118 +++++++++++++++++---------------- app/views/memos/edit.html.erb | 9 +-- public/javascripts/feedback.js | 38 ++++++++++- 3 files changed, 102 insertions(+), 63 deletions(-) diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 523ab1300..5bbc52db2 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -1,4 +1,56 @@ <%= javascript_include_tag 'new_user','/assets/kindeditor/pasteimg','/assets/kindeditor/kindeditor' %> + +
      + + +
      + <%= render :partial => 'show_topics',:locals => {:memos=>@memos}%> +
      +
        + <%= pagination_links_full @topic_pages, @topic_count ,:per_page_links => true, :remote => true, :flag => true %> +
      + + + + + + + + + + + +
      +
    • -
      - - -
      - <%= render :partial => 'show_topics',:locals => {:memos=>@memos}%> -
      -
        - <%= pagination_links_full @topic_pages, @topic_count ,:per_page_links => true, :remote => true, :flag => true %> -
      - - - - - - - - - - - -
      - \ No newline at end of file + \ No newline at end of file diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index d26ebdbf8..b2b7d73f0 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -7,10 +7,11 @@ $("#error").html('主题不能超过50个字符').show(); return; } -// if(memo_content.html().trim().length > 5000 ){ -// $("#error").html('内容不能超过5000个字符').show(); -// return; -// } + if(memo_content.html().length > 30000){ + $("#error").html("内容 过长(最长为 30000 个字符)").show(); + $("html,body").animate({scrollTop:$("#error").offset().top},1000) + return false; + } memo_content.sync(); $("#edit_memo").submit(); }else if($("textarea[name='memo[subject]']").val().trim() == "" && !memo_content.isEmpty() ){ diff --git a/public/javascripts/feedback.js b/public/javascripts/feedback.js index b30c8f91d..97209131e 100644 --- a/public/javascripts/feedback.js +++ b/public/javascripts/feedback.js @@ -1,5 +1,10 @@ (function($){ $.fn.fix = function(options){ + var u = navigator.userAgent; + if((u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 ||u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1)){ + $("#scrollsidebar").css("display","none"); + return; + } var defaults = { float : 'right', minStatue : true, @@ -73,6 +78,11 @@ function cookieget(n) $(function(){ + var u = navigator.userAgent; + if((u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 ||u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1)){ + $("#scrollsidebar").css("display","none"); + return; + } $(".closeSidebar").click(function(){ $(".show_btn").css("display","none"); $("#scrollsidebar").css("display","none"); @@ -109,4 +119,30 @@ $(function(){ $("#textCount").text(50-$("#subject").val().length) } }); -}); \ No newline at end of file +}); + +//var browser={ +// versions:function(){ +// var u = navigator.userAgent, app = navigator.appVersion; +// return {//移动终端浏览器版本信息 +// trident: u.indexOf('Trident') > -1, //IE内核 +// presto: u.indexOf('Presto') > -1, //opera内核 +// webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核 +// gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核 +// mobile: !!u.match(/AppleWebKit.*Mobile.*/)||!!u.match(/AppleWebKit/), //是否为移动终端 +// ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端 +// android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器 +// iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器 +// iPad: u.indexOf('iPad') > -1, //是否iPad +// webApp: u.indexOf('Safari') == -1 //是否web应该程序,没有头部与底部 +// }; +// }(), +// language:(navigator.browserLanguage || navigator.language).toLowerCase() +//} +//document.writeln("语言版本: "+browser.language); +//document.writeln(" 是否为移动终端: "+browser.versions.mobile); +//document.writeln(" ios终端: "+browser.versions.ios); +//document.writeln(" android终端: "+browser.versions.android); +//document.writeln(" 是否为iPhone: "+browser.versions.iPhone); +//document.writeln(" 是否iPad: "+browser.versions.iPad); +//document.writeln(navigator.userAgent); \ No newline at end of file From 2cf61ad74f9eb6a0f05cd5645bc805107b15a3fe Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 10 Nov 2015 17:34:18 +0800 Subject: [PATCH 066/132] =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/show.html.erb | 4 ++-- app/views/memos/edit.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 5bbc52db2..05c086ed4 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -128,8 +128,8 @@ $("#error").html("主题 过长(最长为 50 个字符)").show(); return false; } - if(memo_content.html().length > 30000){ - $("#error").html("内容 过长(最长为 30000 个字符)").show(); + if(memo_content.html().length > 20000){ + $("#error").html("内容 过长(最长为 20000 个字符)").show(); $("html,body").animate({scrollTop:$("#error").offset().top},1000) return false; } diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index b2b7d73f0..cace5bcc8 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -7,8 +7,8 @@ $("#error").html('主题不能超过50个字符').show(); return; } - if(memo_content.html().length > 30000){ - $("#error").html("内容 过长(最长为 30000 个字符)").show(); + if(memo_content.html().length > 20000){ + $("#error").html("内容 过长(最长为 20000 个字符)").show(); $("html,body").animate({scrollTop:$("#error").offset().top},1000) return false; } From d8dc7786ca2a8adda01992f91e6f8c3096e4cb50 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 11 Nov 2015 10:25:24 +0800 Subject: [PATCH 067/132] =?UTF-8?q?fork=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/fork.html.erb | 0 lib/gitlab-cli/lib/gitlab/client/projects.rb | 6 ++++++ 2 files changed, 6 insertions(+) create mode 100644 app/views/repositories/fork.html.erb diff --git a/app/views/repositories/fork.html.erb b/app/views/repositories/fork.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/lib/gitlab-cli/lib/gitlab/client/projects.rb b/lib/gitlab-cli/lib/gitlab/client/projects.rb index 04ea682aa..476e88b72 100644 --- a/lib/gitlab-cli/lib/gitlab/client/projects.rb +++ b/lib/gitlab-cli/lib/gitlab/client/projects.rb @@ -222,6 +222,12 @@ class Gitlab::Client delete("/projects/#{project}/hooks/#{id}") end + # Forks a project into the user namespace of the authenticated user. + # @param [Integer] - The ID of the project to be forked + def fork(id) + post("/projects/fork/#{id}") + end + # Mark this project as forked from the other # # @example From 508ca7f823c474d756d002b437557633b3648a3e Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 11 Nov 2015 11:19:10 +0800 Subject: [PATCH 068/132] =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=9D=A1=20=E6=96=87=E4=BB=B6=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_form_course.html.erb | 3 ++- .../files/_new_style_attachment_list.html.erb | 3 ++- .../_upload_project_files_list.html.erb | 3 ++- public/javascripts/attachments.js | 17 ++++++++++++++--- public/stylesheets/courses.css | 3 ++- public/stylesheets/new_user.css | 3 ++- public/stylesheets/project.css | 4 ++-- 7 files changed, 26 insertions(+), 10 deletions(-) diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index b66632c7f..dddd0209e 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -60,7 +60,8 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), - :delete_all_files => l(:text_are_you_sure_all) + :delete_all_files => l(:text_are_you_sure_all), + :containerid => "#{container.id}" } %> <% if container.nil? %> <%= l(:label_no_file_uploaded)%> diff --git a/app/views/files/_new_style_attachment_list.html.erb b/app/views/files/_new_style_attachment_list.html.erb index af679c4d3..7147769da 100644 --- a/app/views/files/_new_style_attachment_list.html.erb +++ b/app/views/files/_new_style_attachment_list.html.erb @@ -16,7 +16,8 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), - :delete_all_files => l(:text_are_you_sure_all) + :delete_all_files => l(:text_are_you_sure_all), + :containerid => "#{container.id}" } %>
      diff --git a/app/views/projects/_upload_project_files_list.html.erb b/app/views/projects/_upload_project_files_list.html.erb index 59da30012..b072faa24 100644 --- a/app/views/projects/_upload_project_files_list.html.erb +++ b/app/views/projects/_upload_project_files_list.html.erb @@ -16,7 +16,8 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), - :delete_all_files => l(:text_are_you_sure_all) + :delete_all_files => l(:text_are_you_sure_all), + :containerid => "#{container.id}" } %> diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 813c10dee..424e0e572 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -178,6 +178,17 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { }) .done(function(result) { progressSpan.progressbar('value', 100).remove(); + var containerid = $(inputEl).data('containerid'); + console.log($(inputEl)) + if(containerid == undefined ){ + var count = $('#attachments_fields>span').length; + $('#upload_file_count').html("" + count + "" + $(inputEl).data('fileCount')); + } + else{ + var count = $('#attachments_fields' + containerid + '>span').length; + $('#upload_file_count' + containerid).html("" + count + "" + $(inputEl).data('fileCount')); + } + fileSpan.find('input.description, a').css('display', 'inline-block'); fileSpan.find('input.is_public_checkbox, a').css('display', 'inline-block'); }) @@ -202,7 +213,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { var containerid = $(inputEl).data('containerid'); if (containerid == undefined) { var count = $('#attachments_fields>span').length; - $('#upload_file_count').html("" + count + "" + $(inputEl).data('fileCount')); + //$('#upload_file_count').html("" + count + "" + $(inputEl).data('fileCount')); if (count >= 1) { var add_attachs = $('.add_attachment'); var delete_all = $('.remove_all'); @@ -216,7 +227,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { } } else { var count = $('#attachments_fields' + containerid + '>span').length; - $('#upload_file_count' + containerid).html("" + count + "" + $(inputEl).data('fileCount')); + //$('#upload_file_count' + containerid).html("" + count + "" + $(inputEl).data('fileCount')); if (count >= 1) { var add_attachs = $('.add_attachment').filter(function(index) { return $(this).data('containerid') == containerid; @@ -240,7 +251,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { } - var progressSpan = $('
      ').insertAfter(fileSpan.find('input.filename')); + var progressSpan = $('
      ').insertAfter(fileSpan.find('input.upload_filename')); progressSpan.progressbar(); fileSpan.addClass('ajax-waiting'); diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 48c6a2d88..71b473abe 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -905,7 +905,8 @@ a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; f .filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} -.upload_filename{ background: url(../images/pic_file.png) 0 -20px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} +div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; } +.upload_filename{ background: url(../images/pic_file.png) 0 -20px no-repeat;color: #7f7f7f;width: 270px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .evaluation{position: relative;} .evaluation_submit{position: absolute;right: 0px;bottom: 0px;} .student_work_search{background-color: #64bdd9;color: white !important;padding: 2px 7px;margin-left: 10px;cursor: pointer; } diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index f21a4b1fd..b9e7bf227 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1155,7 +1155,8 @@ img.ui-datepicker-trigger { } .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} -.upload_filename{ background: url(../images/pic_file.png) 0 -25px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} +div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; } +.upload_filename{ background: url(../images/pic_file.png) 0 -25px no-repeat;color: #7f7f7f;width: 270px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .message_title{border: 1px solid #9C9C9C;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff; max-width:400px;word-wrap:break-word; word-break:break-all;} .message_title_red{border: 1px solid #484848;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff;background-image: -moz-linear-gradient(top, #fff, #E0E0E0);} diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index e7a24b151..3dedf1396 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -371,10 +371,10 @@ span.add_attachment {font-size: 80%;line-height: 2.5em;} .reply_btn:hover{ background:#999; color:#fff; } .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;} -.upload_filename{ background: url(../images/pic_file.png) 0 -22px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} +.upload_filename{ background: url(../images/pic_file.png) 0 -22px no-repeat;color: #7f7f7f;width: 270px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .attachments_fields input.description {margin-left:4px; width:100px; } .attachments_fields span .boldSpan{display:block; white-space:nowrap; font-family:'微软雅黑';} -.attachments_fields div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; } +div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; } a.remove-upload:hover {text-decoration:none !important;} .attachments_fields input.is_public_checkbox {width:20px;} From d13205bd3de9e40c0a35d0eb2e545e69dedda452 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 11 Nov 2015 11:39:02 +0800 Subject: [PATCH 069/132] =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=AD=A3=E5=9C=A8?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_form.html.erb | 1 + app/views/attachments/_form_course.html.erb | 1 + app/views/attachments/_form_project.html.erb | 2 ++ app/views/attachments/_new_form.html.erb | 1 + app/views/blog_comments/_blog_attachments.erb | 1 + app/views/files/_attachement_list.html.erb | 2 ++ app/views/files/_new_style_attachment_list.html.erb | 1 + app/views/forums/_file_form.html.erb | 1 + app/views/projects/_upload_project_files_list.html.erb | 1 + app/views/student_work/_student_work_attachment_form.html.erb | 1 + app/views/users/_attachment_list.html.erb | 1 + app/views/users/_user_homework_attachment.html.erb | 1 + config/locales/projects/zh.yml | 1 + public/javascripts/attachments.js | 4 ++-- 14 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 3dbc8d8ba..ab8b80dcb 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -62,6 +62,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index dddd0209e..ef5385647 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -61,6 +61,7 @@ :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), :delete_all_files => l(:text_are_you_sure_all), + :lebel_file_uploding => l(:lebel_file_uploding), :containerid => "#{container.id}" } %> <% if container.nil? %> diff --git a/app/views/attachments/_form_project.html.erb b/app/views/attachments/_form_project.html.erb index d1cdf8cc9..a9cb068ad 100644 --- a/app/views/attachments/_form_project.html.erb +++ b/app/views/attachments/_form_project.html.erb @@ -60,7 +60,9 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all), + :lebel_file_uploding => l(:lebel_file_uploding), :containerid => "#{container.id}" } %> <%= l(:label_no_file_uploaded)%> diff --git a/app/views/attachments/_new_form.html.erb b/app/views/attachments/_new_form.html.erb index 47f6fd202..75efb448e 100644 --- a/app/views/attachments/_new_form.html.erb +++ b/app/views/attachments/_new_form.html.erb @@ -42,6 +42,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> diff --git a/app/views/blog_comments/_blog_attachments.erb b/app/views/blog_comments/_blog_attachments.erb index 48fe91099..dd8be659b 100644 --- a/app/views/blog_comments/_blog_attachments.erb +++ b/app/views/blog_comments/_blog_attachments.erb @@ -62,6 +62,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> diff --git a/app/views/files/_attachement_list.html.erb b/app/views/files/_attachement_list.html.erb index 01e5dca5f..c5a3b9af0 100644 --- a/app/views/files/_attachement_list.html.erb +++ b/app/views/files/_attachement_list.html.erb @@ -17,6 +17,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> <% else %> @@ -35,6 +36,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> <% end %> diff --git a/app/views/files/_new_style_attachment_list.html.erb b/app/views/files/_new_style_attachment_list.html.erb index 7147769da..174a05047 100644 --- a/app/views/files/_new_style_attachment_list.html.erb +++ b/app/views/files/_new_style_attachment_list.html.erb @@ -17,6 +17,7 @@ :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), :delete_all_files => l(:text_are_you_sure_all), + :lebel_file_uploding => l(:lebel_file_uploding), :containerid => "#{container.id}" } %> diff --git a/app/views/forums/_file_form.html.erb b/app/views/forums/_file_form.html.erb index 560afc6d9..2510952f1 100644 --- a/app/views/forums/_file_form.html.erb +++ b/app/views/forums/_file_form.html.erb @@ -63,6 +63,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> diff --git a/app/views/projects/_upload_project_files_list.html.erb b/app/views/projects/_upload_project_files_list.html.erb index b072faa24..c399bf210 100644 --- a/app/views/projects/_upload_project_files_list.html.erb +++ b/app/views/projects/_upload_project_files_list.html.erb @@ -16,6 +16,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all), :containerid => "#{container.id}" } %> diff --git a/app/views/student_work/_student_work_attachment_form.html.erb b/app/views/student_work/_student_work_attachment_form.html.erb index 265ff9be7..d82aea7f9 100644 --- a/app/views/student_work/_student_work_attachment_form.html.erb +++ b/app/views/student_work/_student_work_attachment_form.html.erb @@ -19,6 +19,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all), :containerid => "#{work.id}" } %> diff --git a/app/views/users/_attachment_list.html.erb b/app/views/users/_attachment_list.html.erb index 33e944498..3d44fa267 100644 --- a/app/views/users/_attachment_list.html.erb +++ b/app/views/users/_attachment_list.html.erb @@ -18,6 +18,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %> diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb index 9b7c6c06a..24d37ae63 100644 --- a/app/views/users/_user_homework_attachment.html.erb +++ b/app/views/users/_user_homework_attachment.html.erb @@ -40,6 +40,7 @@ :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), :delete_all_files => l(:text_are_you_sure_all) } %>
      diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml index 88a710633..1a18e5a14 100644 --- a/config/locales/projects/zh.yml +++ b/config/locales/projects/zh.yml @@ -183,6 +183,7 @@ zh: label_optional_description: 可选的描述 label_file_count: "个文件已上传" + lebel_file_uploding: "个文件正在上传" # diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 424e0e572..5718983fa 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -213,7 +213,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { var containerid = $(inputEl).data('containerid'); if (containerid == undefined) { var count = $('#attachments_fields>span').length; - //$('#upload_file_count').html("" + count + "" + $(inputEl).data('fileCount')); + $('#upload_file_count').html("" + count + "" + $(inputEl).data('lebelFileUploding')); if (count >= 1) { var add_attachs = $('.add_attachment'); var delete_all = $('.remove_all'); @@ -227,7 +227,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { } } else { var count = $('#attachments_fields' + containerid + '>span').length; - //$('#upload_file_count' + containerid).html("" + count + "" + $(inputEl).data('fileCount')); + $('#upload_file_count' + containerid).html("" + count + "" + $(inputEl).data('lebelFileUploding')); if (count >= 1) { var add_attachs = $('.add_attachment').filter(function(index) { return $(this).data('containerid') == containerid; From cc0afa7d9b735ee5056cc5b60049435703c10900 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 11 Nov 2015 12:43:59 +0800 Subject: [PATCH 070/132] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E7=89=88=E6=9C=AC=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/sync_sigle_rep.rake | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/tasks/sync_sigle_rep.rake b/lib/tasks/sync_sigle_rep.rake index 591dcce84..4ed360426 100644 --- a/lib/tasks/sync_sigle_rep.rake +++ b/lib/tasks/sync_sigle_rep.rake @@ -27,4 +27,30 @@ namespace :sync_rep do end end end + + task :delete_rep => :environment do + projects = Project.where("user_id !=?",12) + projects.each do |project| + # 针对类型为Git并且只有一个版本库的项目 + if project.repositories && project.repositories.count == 1 && project.repositories.first.type == "Repository::Git" + rep = project.repositories.first + count = Repository.find_by_sql("SELECT * FROM `repositories` where identifier = '#{rep.identifier}'").count + puts count + unless count > 1 + rep.identifier + puts "################################" + puts project.id + puts rep.id + s = Trustie::Gitlab::Sync.new + s.sync_project(project, path: rep.identifier, import_url: rep.url) + rep.type = 'Repository::Gitlab' + rep.save + puts "*************************************" + puts project.id + puts rep.id + puts rep.identifier + end + end + end + end end \ No newline at end of file From 16c31e254e5f21a9f63be6c149b90964d886bb9e Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 11 Nov 2015 15:33:43 +0800 Subject: [PATCH 071/132] =?UTF-8?q?=E5=8C=BA=E5=88=86Gitlab=E5=85=AC?= =?UTF-8?q?=E5=BC=80=E9=A1=B9=E7=9B=AE=E5=92=8C=E7=A7=81=E6=9C=89=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/trustie/gitlab/sync.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/trustie/gitlab/sync.rb b/lib/trustie/gitlab/sync.rb index a303b22fb..ac01a44ec 100644 --- a/lib/trustie/gitlab/sync.rb +++ b/lib/trustie/gitlab/sync.rb @@ -10,6 +10,9 @@ module Trustie DEVELOPER = 30 MASTER = 40 OWNER = 50 + # 项目公开和私有 + PUBLIC = 20 + PRIVATE = 0 end class Sync @@ -45,7 +48,8 @@ module Trustie issues_enabled: false, snippets_enabled: false, public: false, - user_id: gid + user_id: gid, + visibility_level: project.is_public? ? UserLevel::PUBLIC : UserLevel::PRIVATE ) project.gpid = gproject.id project.save! @@ -84,7 +88,8 @@ module Trustie merge_requests_enabled: true, public: false, user_id: gid, - import_url: import_url + import_url: import_url, + visibility_level: project.is_public? ? UserLevel::PUBLIC : UserLevel::PRIVATE ) puts "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" project.gpid = gproject.id From b8999e1c6edca3e74b87f584f8c4f1a4b5674a26 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 11 Nov 2015 15:35:47 +0800 Subject: [PATCH 072/132] =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=E5=AE=BD=E5=BA=A6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blog_comments/_edit.html.erb | 2 +- app/views/blog_comments/_new.html.erb | 2 +- public/stylesheets/new_user.css | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/blog_comments/_edit.html.erb b/app/views/blog_comments/_edit.html.erb index d56557ce7..375c948d4 100644 --- a/app/views/blog_comments/_edit.html.erb +++ b/app/views/blog_comments/_edit.html.erb @@ -3,7 +3,7 @@
      - +

      diff --git a/app/views/blog_comments/_new.html.erb b/app/views/blog_comments/_new.html.erb index 2a2281a40..48f152c4e 100644 --- a/app/views/blog_comments/_new.html.erb +++ b/app/views/blog_comments/_new.html.erb @@ -3,7 +3,7 @@
      - +

      - <%= l(:button_cancel)%> - <%= l(:button_confirm)%> + <%= l(:button_cancel)%> + + <%= submit_tag '确定',:onclick=>'submit_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %> <% end %>
      diff --git a/app/views/files/_upload_show.html.erb b/app/views/files/_upload_show.html.erb index 21cd94d8d..dbd0277d7 100644 --- a/app/views/files/_upload_show.html.erb +++ b/app/views/files/_upload_show.html.erb @@ -11,7 +11,8 @@ <%= render :partial => 'attachement_list',:locals => {:course => course} %>
      <%= l(:button_cancel)%> - <%= l(:button_confirm)%> + + <%= submit_tag '确定',:onclick=>'submit_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %> <% end %>
      diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index fdf1e31a3..b71d36f97 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -95,7 +95,7 @@
      - <%= render :partial => 'users/user_homework_attachment', :locals => {:container => @student_work, :has_program=>false} %> + <%= render :partial => 'users/special_user_homework_attachment', :locals => {:container => @student_work, :has_program=>false} %>
      @@ -111,9 +111,11 @@
      - 确定 + + <%= submit_tag '确定',:onclick=>'popupRegex();new_student_work();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText fr' %> - <%= link_to "取消", user_homeworks_user_path(User.current.id), :class => "fr mr10 mt3"%> + <%#= link_to "取消", user_homeworks_user_path(User.current.id), :class => "fr mr10 mt3"%> + <%= l(:button_cancel)%>
      <% end%> diff --git a/app/views/users/_attachment_list.html.erb b/app/views/users/_attachment_list.html.erb index 3d44fa267..939513627 100644 --- a/app/views/users/_attachment_list.html.erb +++ b/app/views/users/_attachment_list.html.erb @@ -7,7 +7,7 @@ :id => '_file', :class => ie8? ? '':'file_selector', :multiple => true, - :onchange => 'addInputFiles(this);', + :onchange => 'addInputFiles(this,"'+'upload_files_submit_btn'+'");', :style => ie8? ? '': 'display:none', :data => { :max_file_size => Setting.attachment_max_size.to_i.kilobytes, diff --git a/app/views/users/_special_user_homework_attachment.html.erb b/app/views/users/_special_user_homework_attachment.html.erb new file mode 100644 index 000000000..2f5a4e8e3 --- /dev/null +++ b/app/views/users/_special_user_homework_attachment.html.erb @@ -0,0 +1,61 @@ +
      + + <% if defined?(container) && container && container.saved_attachments %> + <% container.attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= l(:field_is_public)%>: + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> + <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + +
      + <% end %> + <% container.saved_attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= l(:field_is_public)%>: + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> + <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + +
      + <% end %> + <% end %> +
      + <%= file_field_tag 'attachments[dummy][file]', + :id => '_file', + :class => ie8? ? '' : 'file_selector', + :multiple => true, + :onchange => 'addInputFiles(this,"'+'upload_files_submit_btn'+'");', + :style => ie8? ? '' : 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js',:project =>nil), + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), + :delete_all_files => l(:text_are_you_sure_all) + } %> +
      +
      + +
      + + 上传附件 + <%= link_to "资源库",{:controller => 'users',:action=>'user_import_resource',:id=>User.current.id,:homework_id=>container.id},:class => "FilesBtn fl mt3 mr20",:remote => true%> + <% if defined?(has_program) && has_program %> + 编程 + + <% end %> +
      + +<% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> +<% end %> \ No newline at end of file diff --git a/app/views/users/_upload_resource.html.erb b/app/views/users/_upload_resource.html.erb index d73b2986a..c973217f6 100644 --- a/app/views/users/_upload_resource.html.erb +++ b/app/views/users/_upload_resource.html.erb @@ -45,9 +45,9 @@
      - <%= submit_tag '确定',:onclick=>'submit_files();',:onfocus=>'this.blur()',:class=>'sendSourceText' %> + <%= submit_tag '确定',:onclick=>'submit_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %>
      - +
      <% end %>
      diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 5718983fa..20e845424 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -22,7 +22,7 @@ function reload(fileSpan) { } -function addFile_board(inputEl, file, eagerUpload, id) { +function addFile_board(inputEl, file, eagerUpload, id,btnId) { var attachments_frame = '#attachments_fields' + id; if ($(attachments_frame).children().length < 30) { @@ -80,7 +80,7 @@ function addFile_board(inputEl, file, eagerUpload, id) { ).appendTo(attachments_frame); if (eagerUpload) { - ajaxUpload(file, attachmentId, fileSpan, inputEl); + ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId); } return attachmentId; @@ -88,7 +88,7 @@ function addFile_board(inputEl, file, eagerUpload, id) { return null; } -function addFile(inputEl, file, eagerUpload) { +function addFile(inputEl, file, eagerUpload,btnId) { var attachments_frame = '#attachments_fields'; if ($(attachments_frame).children().length < 30) { @@ -145,7 +145,7 @@ function addFile(inputEl, file, eagerUpload) { ).appendTo('#attachments_fields'); if (eagerUpload) { - ajaxUpload(file, attachmentId, fileSpan, inputEl); + ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId); } return attachmentId; @@ -154,7 +154,7 @@ function addFile(inputEl, file, eagerUpload) { } addFile.nextAttachmentId = 1; -function ajaxUpload(file, attachmentId, fileSpan, inputEl) { +function ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId) { function onLoadstart(e) { fileSpan.removeClass('ajax-waiting'); @@ -168,7 +168,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { } } - function actualUpload(file, attachmentId, fileSpan, inputEl) { + function actualUpload(file, attachmentId, fileSpan, inputEl,btnId) { ajaxUpload.uploading++; @@ -182,9 +182,15 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { console.log($(inputEl)) if(containerid == undefined ){ var count = $('#attachments_fields>span').length; + $('#'+btnId).removeAttr("disabled"); + $('#'+btnId).val('确定') + $('#'+btnId).css('background-color','#269ac9') $('#upload_file_count').html("" + count + "" + $(inputEl).data('fileCount')); } else{ + $('#'+btnId).removeAttr("disabled"); + $('#'+btnId).val('确定') + $('#'+btnId).css('background-color','#269ac9') var count = $('#attachments_fields' + containerid + '>span').length; $('#upload_file_count' + containerid).html("" + count + "" + $(inputEl).data('fileCount')); } @@ -213,6 +219,9 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { var containerid = $(inputEl).data('containerid'); if (containerid == undefined) { var count = $('#attachments_fields>span').length; + $('#'+btnId).attr("disabled",true); + $('#'+btnId).val('提交中'); + $('#'+btnId).css('background-color','#c1c1c1') $('#upload_file_count').html("" + count + "" + $(inputEl).data('lebelFileUploding')); if (count >= 1) { var add_attachs = $('.add_attachment'); @@ -227,6 +236,9 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { } } else { var count = $('#attachments_fields' + containerid + '>span').length; + $('#'+btnId).attr("disabled",true); + $('#'+btnId).val('提交中'); + $('#'+btnId).css('background-color','#c1c1c1') $('#upload_file_count' + containerid).html("" + count + "" + $(inputEl).data('lebelFileUploding')); if (count >= 1) { var add_attachs = $('.add_attachment').filter(function(index) { @@ -258,7 +270,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { var maxSyncUpload = $(inputEl).data('max-concurrent-uploads'); if (maxSyncUpload == null || maxSyncUpload <= 0 || ajaxUpload.uploading < maxSyncUpload) - actualUpload(file, attachmentId, fileSpan, inputEl); + actualUpload(file, attachmentId, fileSpan, inputEl,btnId); else $(inputEl).parents('form').queue('upload', actualUpload.bind(this, file, attachmentId, fileSpan, inputEl)); } @@ -323,11 +335,11 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) { }); } -function addInputFiles(inputEl) { +function addInputFiles(inputEl,btnId) { // var clearedFileInput = $(inputEl).clone().val(''); if (inputEl.files) { // upload files using ajax - uploadAndAttachFiles(inputEl.files, inputEl); + uploadAndAttachFiles(inputEl.files, inputEl,btnId); // $(inputEl).remove(); } else { // browser not supporting the file API, upload on form submission @@ -349,12 +361,12 @@ function addInputFiles(inputEl) { //clearedFileInput.insertAfter('#attachments_fields'); } -function addInputFiles_board(inputEl, id) { +function addInputFiles_board(inputEl, id,btnId) { // var clearedFileInput = $(inputEl).clone().val(''); if (inputEl.files) { // upload files using ajax - uploadAndAttachFiles_board(inputEl.files, inputEl, id); + uploadAndAttachFiles_board(inputEl.files, inputEl, id,btnId); // $(inputEl).remove(); } else { // browser not supporting the file API, upload on form submission @@ -374,7 +386,7 @@ function addInputFiles_board(inputEl, id) { //clearedFileInput.insertAfter('#attachments_fields'); } -function uploadAndAttachFiles(files, inputEl) { +function uploadAndAttachFiles(files, inputEl,btnId) { var maxFileSize = $(inputEl).data('max-file-size'); var maxFileSizeExceeded = $(inputEl).data('max-file-size-message'); @@ -389,12 +401,12 @@ function uploadAndAttachFiles(files, inputEl) { window.alert(maxFileSizeExceeded); } else { $.each(files, function() { - addFile(inputEl, this, true); + addFile(inputEl, this, true,btnId); }); } } -function uploadAndAttachFiles_board(files, inputEl, id) { +function uploadAndAttachFiles_board(files, inputEl, id,btnId) { var maxFileSize = $(inputEl).data('max-file-size'); var maxFileSizeExceeded = $(inputEl).data('max-file-size-message'); @@ -409,7 +421,7 @@ function uploadAndAttachFiles_board(files, inputEl, id) { window.alert(maxFileSizeExceeded); } else { $.each(files, function() { - addFile_board(inputEl, this, true, id); + addFile_board(inputEl, this, true, id,btnId); }); } } @@ -482,10 +494,11 @@ $(function() { //课程课件 function addInputFilesCourseSource(inputEl) { checkBox = arguments[1] == 'public' ? false : true; + btnId = arguments[2]; // var clearedFileInput = $(inputEl).clone().val(''); if (inputEl.files) { // upload files using ajax - uploadAndAttachFilesCourseSource(inputEl.files, inputEl,checkBox); + uploadAndAttachFilesCourseSource(inputEl.files, inputEl,checkBox,btnId); // $(inputEl).remove(); } else { // browser not supporting the file API, upload on form submission @@ -507,7 +520,7 @@ function addInputFilesCourseSource(inputEl) { //clearedFileInput.insertAfter('#attachments_fields'); } -function uploadAndAttachFilesCourseSource(files, inputEl,checkBox) { +function uploadAndAttachFilesCourseSource(files, inputEl,checkBox,btnId) { var maxFileSize = $(inputEl).data('max-file-size'); var maxFileSizeExceeded = $(inputEl).data('max-file-size-message'); @@ -522,12 +535,12 @@ function uploadAndAttachFilesCourseSource(files, inputEl,checkBox) { window.alert(maxFileSizeExceeded); } else { $.each(files, function() { - addFileCourseSource(inputEl, this, true,checkBox); + addFileCourseSource(inputEl, this, true,checkBox,btnId); }); } } -function addFileCourseSource(inputEl, file, eagerUpload,checkBox) { +function addFileCourseSource(inputEl, file, eagerUpload,checkBox,btnId) { var attachments_frame = '#attachments_fields'; if ($(attachments_frame).children().length < 30) { @@ -606,7 +619,7 @@ function addFileCourseSource(inputEl, file, eagerUpload,checkBox) { } if (eagerUpload) { - ajaxUpload(file, attachmentId, fileSpan, inputEl); + ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId); } return attachmentId; diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 71b473abe..0cb6e203f 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1128,3 +1128,15 @@ a.postRouteLink:hover {text-decoration:underline;} .syllabusSettingIcon:hover {cursor: pointer} .pic_files{display:block; background:url(../images/public_icon.png) 0px -578px no-repeat; width:20px; height:15px;} + +/*确定按钮*/ +input.sendSourceText { + font-size: 14px; + color: #ffffff; + background-color: #269ac9; + cursor: pointer; + outline: none; + border: none; + width: 50px; + height: 25px; +} From 84348d15ea0341d25cffbafaa6249daa2d1da895 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 11 Nov 2015 16:32:13 +0800 Subject: [PATCH 074/132] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E7=9A=84=20=E7=A1=AE=E5=AE=9A=E6=8C=89=E9=92=AE=E7=9A=84?= =?UTF-8?q?=E8=81=94=E5=8A=A8=20=E4=BD=9C=E4=B8=9A=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/new.html.erb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index b71d36f97..fdf1e31a3 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -95,7 +95,7 @@
      - <%= render :partial => 'users/special_user_homework_attachment', :locals => {:container => @student_work, :has_program=>false} %> + <%= render :partial => 'users/user_homework_attachment', :locals => {:container => @student_work, :has_program=>false} %>
      @@ -111,11 +111,9 @@
      - - <%= submit_tag '确定',:onclick=>'popupRegex();new_student_work();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText fr' %> + 确定 - <%#= link_to "取消", user_homeworks_user_path(User.current.id), :class => "fr mr10 mt3"%> - <%= l(:button_cancel)%> + <%= link_to "取消", user_homeworks_user_path(User.current.id), :class => "fr mr10 mt3"%>
      <% end%> From 3aa73fba35712f916d3e2e1d56886648d371295e Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 11 Nov 2015 16:33:09 +0800 Subject: [PATCH 075/132] =?UTF-8?q?Gitlab=E6=9D=83=E9=99=90=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E6=9B=B4=E6=96=B0=E9=A1=B9=E7=9B=AEGitlab=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 9 +++++++++ lib/gitlab-cli/lib/gitlab/client/projects.rb | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index d26e465ba..58dea46b7 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -607,6 +607,15 @@ class ProjectsController < ApplicationController @project.organization_id = params[:organization_id] params[:project][:is_public] ? @project.is_public = 1 : @project.is_public = 0 params[:project][:hidden_repo] ? @project.hidden_repo = 1 : @project.hidden_repo = 0 + # 更新公开私有时同步gitlab公开私有 + g = Gitlab.client + gproject = g.project(@project.gpid) + if params[:project][:is_public] + g.edit_project(gproject.id, 20) + else + g.edit_project(gproject.id, 0) + end + # end if validate_parent_id && @project.save @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') if params[:project][:is_public] == '0' diff --git a/lib/gitlab-cli/lib/gitlab/client/projects.rb b/lib/gitlab-cli/lib/gitlab/client/projects.rb index 04ea682aa..6247294f3 100644 --- a/lib/gitlab-cli/lib/gitlab/client/projects.rb +++ b/lib/gitlab-cli/lib/gitlab/client/projects.rb @@ -72,6 +72,23 @@ class Gitlab::Client post(url, :body => {:name => name}.merge(options)) end + # Updates a project team member to a specified access level. + # id (required) - The ID of a project + # name (optional) - project name + # path (optional) - repository name for project + # description (optional) - short project description + # default_branch (optional) + # issues_enabled (optional) + # merge_requests_enabled (optional) + # wiki_enabled (optional) + # snippets_enabled (optional) + # public (optional) - if true same as setting visibility_level = 20 + # visibility_level (optional) + + def edit_project(id, visibility_level) + put("/projects/#{id}", :body => {:visibility_level => visibility_level}) + end + # Deletes a project. # # @example From 2596f0a78844af5dbbaec1031be71610884a3f5f Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 11 Nov 2015 16:39:05 +0800 Subject: [PATCH 076/132] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9D=83=E9=99=90?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 58dea46b7..065adf596 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -608,12 +608,10 @@ class ProjectsController < ApplicationController params[:project][:is_public] ? @project.is_public = 1 : @project.is_public = 0 params[:project][:hidden_repo] ? @project.hidden_repo = 1 : @project.hidden_repo = 0 # 更新公开私有时同步gitlab公开私有 - g = Gitlab.client - gproject = g.project(@project.gpid) - if params[:project][:is_public] - g.edit_project(gproject.id, 20) - else - g.edit_project(gproject.id, 0) + unless @project.gpid.nil? + g = Gitlab.client + gproject = g.project(@project.gpid) + params[:project][:is_public] ? g.edit_project(gproject.id, 20) : g.edit_project(gproject.id, 0) end # end if validate_parent_id && @project.save From 7dd299255bc8edf11fd0f11c2a81ba1287ab9817 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 11 Nov 2015 17:16:19 +0800 Subject: [PATCH 077/132] =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blog_comments/show.html.erb | 4 ++-- app/views/blogs/_article_list.html.erb | 2 +- public/stylesheets/new_user.css | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index 54c9541f2..cf24f0f2d 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -28,7 +28,7 @@ showNormalImage('message_description_<%= @article.id %>'); }); -
      +
      <%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %> @@ -165,7 +165,7 @@ <%= form_for :blog_comment, :url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %> <%= render :partial => 'blog_comments/reply_form', :locals => {:f => f,:user=>@user,:article=>@article} %> <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %> - <%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-right: 5px;" %> + <%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'submit_message_replay();', :class => "blue_btn fr c_white mt10 mb10", :style => "margin-right: 5px;" %> <% end %>
      diff --git a/app/views/blogs/_article_list.html.erb b/app/views/blogs/_article_list.html.erb index e397da2cc..b8bcc9ad0 100644 --- a/app/views/blogs/_article_list.html.erb +++ b/app/views/blogs/_article_list.html.erb @@ -32,7 +32,7 @@ <%#end%> -
      +
      <%= @user.name%>的博客 diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index ea45fdbd0..7d8944094 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -261,7 +261,7 @@ a:hover.grey_n_btn{ background:#717171; color:#fff;} .green_btn{ background:#28be6c; color:#fff; font-weight:normal;padding:2px 10px; text-align:center;} a.green_btn{background:#28be6c;color:#fff; font-weight:normal; padding:2px 10px; text-align:center;} a:hover.green_btn{ background:#14ad5a;} -.blue_btn{ background:#64bdd9; color:#fff; font-size:14px; font-weight:normal;padding:2px 8px; text-align:center;} +.blue_btn{ background:#64bdd9; color:#fff; font-weight:normal;padding:2px 8px; text-align:center;} a.blue_btn{background:#64bdd9;color:#fff; font-weight:normal; padding:2px 10px; text-align:center;} a:hover.blue_btn{ background:#329cbd;} a.orange_btn{ background:#ff5722;color:#fff; font-weight:normal; padding:2px 10px; text-align:center; } From a3443ba968934dc56ac703c11bf00558f6893508 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 12 Nov 2015 09:32:00 +0800 Subject: [PATCH 078/132] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org_document_comment.js.coffee | 3 + app/assets/javascripts/org_member.js.coffee | 3 + app/assets/javascripts/org_projects.js.coffee | 3 + .../stylesheets/org_document_comment.css.scss | 3 + app/assets/stylesheets/org_member.css.scss | 3 + app/assets/stylesheets/org_projects.css.scss | 3 + .../org_document_comments_controller.rb | 54 +++++++++ app/controllers/org_member_controller.rb | 53 +++++++++ app/controllers/org_projects_controller.rb | 18 +++ app/controllers/organizations_controller.rb | 19 ++- app/controllers/projects_controller.rb | 28 ++++- app/helpers/org_document_comment_helper.rb | 2 + app/helpers/org_member_helper.rb | 16 +++ app/helpers/org_projects_helper.rb | 2 + app/helpers/organizations_helper.rb | 1 + app/models/org_activity.rb | 5 + app/models/org_document_comment.rb | 16 +++ app/models/org_project.rb | 5 + app/views/layouts/base_org.html.erb | 91 ++------------- app/views/my/account.html.erb | 10 +- app/views/org_document_comments/_new.html.erb | 40 +++++++ .../org_document_comments/add_reply.js.erb | 3 + .../org_document_comments/destroy.js.erb | 1 + .../org_document_comments/index.html.erb | 26 +++++ app/views/org_document_comments/new.html.erb | 40 +++++++ app/views/org_document_comments/show.html.erb | 0 app/views/org_projects/create.js.erb | 4 + app/views/org_projects/destroy.js.erb | 2 + app/views/organization/_form.html.erb | 21 ---- app/views/organization/edit.html.erb | 25 ---- app/views/organization/index.html.erb | 31 ----- app/views/organization/new.html.erb | 18 --- .../organizations/_show_org_document.html.erb | 90 +++++++++++++++ .../organizations/autocomplete_search.js.erb | 13 +++ app/views/organizations/set_homepage.js.erb | 1 + app/views/organizations/setting.html.erb | 3 +- app/views/organizations/show.html.erb | 7 +- app/views/projects/settings.html.erb | 6 + .../projects/settings/_added_orgs.html.erb | 9 ++ .../projects/settings/_join_org.html.erb | 108 ++++++++++++++++++ config/routes.rb | 30 +++++ ...1104020233_create_org_document_comments.rb | 13 +++ ..._column_to_entity_org_document_comments.rb | 6 + .../20151104032831_create_org_activity.rb | 16 +++ .../20151104070007_create_org_projects.rb | 11 ++ ...455_delete_column_role_from_org_members.rb | 8 ++ ...04073902_rename_column_for_org_activity.rb | 6 + .../20151104090032_create_org_member_roles.rb | 11 ++ .../20151110011003_add_time_to_org_project.rb | 5 + db/schema.rb | 7 +- public/stylesheets/org.css | 13 ++- .../org_document_comment_controller_spec.rb | 5 + .../controllers/org_member_controller_spec.rb | 5 + .../org_projects_controller_spec.rb | 5 + spec/factories/org_activities.rb | 6 + spec/factories/org_document_comments.rb | 11 ++ spec/models/org_activity_spec.rb | 5 + spec/models/org_document_comment_spec.rb | 5 + 58 files changed, 761 insertions(+), 193 deletions(-) create mode 100644 app/assets/javascripts/org_document_comment.js.coffee create mode 100644 app/assets/javascripts/org_member.js.coffee create mode 100644 app/assets/javascripts/org_projects.js.coffee create mode 100644 app/assets/stylesheets/org_document_comment.css.scss create mode 100644 app/assets/stylesheets/org_member.css.scss create mode 100644 app/assets/stylesheets/org_projects.css.scss create mode 100644 app/controllers/org_document_comments_controller.rb create mode 100644 app/controllers/org_member_controller.rb create mode 100644 app/controllers/org_projects_controller.rb create mode 100644 app/helpers/org_document_comment_helper.rb create mode 100644 app/helpers/org_member_helper.rb create mode 100644 app/helpers/org_projects_helper.rb create mode 100644 app/models/org_activity.rb create mode 100644 app/models/org_document_comment.rb create mode 100644 app/models/org_project.rb create mode 100644 app/views/org_document_comments/_new.html.erb create mode 100644 app/views/org_document_comments/add_reply.js.erb create mode 100644 app/views/org_document_comments/destroy.js.erb create mode 100644 app/views/org_document_comments/index.html.erb create mode 100644 app/views/org_document_comments/new.html.erb create mode 100644 app/views/org_document_comments/show.html.erb create mode 100644 app/views/org_projects/create.js.erb create mode 100644 app/views/org_projects/destroy.js.erb delete mode 100644 app/views/organization/_form.html.erb delete mode 100644 app/views/organization/edit.html.erb delete mode 100644 app/views/organization/index.html.erb delete mode 100644 app/views/organization/new.html.erb create mode 100644 app/views/organizations/_show_org_document.html.erb create mode 100644 app/views/organizations/autocomplete_search.js.erb create mode 100644 app/views/organizations/set_homepage.js.erb create mode 100644 app/views/projects/settings/_added_orgs.html.erb create mode 100644 app/views/projects/settings/_join_org.html.erb create mode 100644 db/migrate/20151104020233_create_org_document_comments.rb create mode 100644 db/migrate/20151104024335_add_locked_and_sticky_column_to_entity_org_document_comments.rb create mode 100644 db/migrate/20151104032831_create_org_activity.rb create mode 100644 db/migrate/20151104070007_create_org_projects.rb create mode 100644 db/migrate/20151104070455_delete_column_role_from_org_members.rb create mode 100644 db/migrate/20151104073902_rename_column_for_org_activity.rb create mode 100644 db/migrate/20151104090032_create_org_member_roles.rb create mode 100644 db/migrate/20151110011003_add_time_to_org_project.rb create mode 100644 spec/controllers/org_document_comment_controller_spec.rb create mode 100644 spec/controllers/org_member_controller_spec.rb create mode 100644 spec/controllers/org_projects_controller_spec.rb create mode 100644 spec/factories/org_activities.rb create mode 100644 spec/factories/org_document_comments.rb create mode 100644 spec/models/org_activity_spec.rb create mode 100644 spec/models/org_document_comment_spec.rb diff --git a/app/assets/javascripts/org_document_comment.js.coffee b/app/assets/javascripts/org_document_comment.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/org_document_comment.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/javascripts/org_member.js.coffee b/app/assets/javascripts/org_member.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/org_member.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/javascripts/org_projects.js.coffee b/app/assets/javascripts/org_projects.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/org_projects.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/org_document_comment.css.scss b/app/assets/stylesheets/org_document_comment.css.scss new file mode 100644 index 000000000..9359415ae --- /dev/null +++ b/app/assets/stylesheets/org_document_comment.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the org_document_comment controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/org_member.css.scss b/app/assets/stylesheets/org_member.css.scss new file mode 100644 index 000000000..4bab7e008 --- /dev/null +++ b/app/assets/stylesheets/org_member.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the OrgMember controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/org_projects.css.scss b/app/assets/stylesheets/org_projects.css.scss new file mode 100644 index 000000000..12f4fef6a --- /dev/null +++ b/app/assets/stylesheets/org_projects.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the org_projects controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb new file mode 100644 index 000000000..325a5ff85 --- /dev/null +++ b/app/controllers/org_document_comments_controller.rb @@ -0,0 +1,54 @@ +class OrgDocumentCommentsController < ApplicationController + before_filter :find_organization, :only => [:new, :create, :show, :index] + + layout 'base_org' + + def new + @org_document_comment = OrgDocumentComment.new + end + + def create + @org_document_comment = OrgDocumentComment.new(:organization_id => @organization.id, :creator_id => User.current.id) + @org_document_comment.title = params[:org_document_comment][:title] + @org_document_comment.content = params[:org_document_comment][:content] + if @org_document_comment.save + #flash[:notice] = 'success' + OrgActivity + redirect_to organization_org_document_comments_path(@organization) + else + redirect_to new_org_document_comment_path(:organization_id => @organization.id) + end + end + def show + + end + + def index + @documents = @organization.org_document_comments.where("parent_id is null").order("created_at desc") + end + def update + + end + + def add_reply + @document = OrgDocumentComment.find(params[:id]).root + @comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id]) + @comment.content = params[:org_content] + @document.children << @comment + @document.save + end + + def find_organization + @organization = Organization.find(params[:organization_id]) + end + + def destroy + @org_document_comment = OrgDocumentComment.find(params[:id]) + org = @org_document_comment.organization + if @org_document_comment.destroy + if @org_document_comment.id == org.id + org.home_id == nil + end + end + end +end diff --git a/app/controllers/org_member_controller.rb b/app/controllers/org_member_controller.rb new file mode 100644 index 000000000..18724882c --- /dev/null +++ b/app/controllers/org_member_controller.rb @@ -0,0 +1,53 @@ +class OrgMemberController < ApplicationController + + def org_member_autocomplete + @org = Organization.find(params[:org]) + @flag = params[:flag] || false + respond_to do |format| + format.js + end + end + + def create + @org = Organization.find(params[:org]) + member_ids = params[:membership][:user_ids] + role_id = params[:orgRole] + member_ids.each do |user_id| + member = OrgMember.create(:user_id=>user_id) + @org.org_members << member + OrgMemberRole.create(:org_member_id => member.id, :role_id => role_id) + end + respond_to do |format| + format.js + end + end + + def update + @member = OrgMember.find(params[:id]) + #@member.change_role params[:org_member][:role_ids] + @member_role = @member.org_member_roles[0] + @member_role.role_id = params[:org_member][:role_ids][0] + @member_role.save + @org = @member.organization + respond_to do |format| + format.js + end + end + + def new + + end + + def destroy + member = OrgMember.find(params[:id]) + @org = member.organization + member.destroy + respond_to do |format| + format.js + end + end + + def index + + end +end diff --git a/app/controllers/org_projects_controller.rb b/app/controllers/org_projects_controller.rb new file mode 100644 index 000000000..e11005b4a --- /dev/null +++ b/app/controllers/org_projects_controller.rb @@ -0,0 +1,18 @@ +class OrgProjectsController < ApplicationController + def create + org_ids = params[:orgNames] + @project = Project.find(params[:project_id]) + org_ids.each do |org_id| + OrgProject.create(:organization_id => org_id.to_i, :project_id => params[:project_id].to_i, :created_at => Time.now) + p 1 + end + respond_to do |format| + format.js + end + end + def destroy + @project = Project.find(params[:project_id]) + @org_project = OrgProject.find(params[:id]) + @org_project.destroy + end +end diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index a51093ad9..fbe3814a4 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -1,6 +1,6 @@ # encoding: utf-8 class OrganizationsController < ApplicationController - # before_filter :find_organization, :except => [:show,:new,:index,:create] + before_filter :find_organization, :only => [:show] layout 'base_org' def index @@ -26,7 +26,8 @@ class OrganizationsController < ApplicationController def show @organization = Organization.find(params[:id]) - @activities = OrgActivity.where('(org_act_id = ? and org_act_type = ?)', @organization.id, 'CreateOrganization ') + @activities = OrgActivity.where('(org_act_id = ? and org_act_type = ?) || (container_id =? and org_act_type =? and org_act_id !=?)', + @organization.id, 'CreateOrganization ', @organization.id, 'OrgDocumentComment', @organization.home_id).order('updated_at desc') @activities = paginateHelper @activities, 10 end @@ -67,4 +68,18 @@ class OrganizationsController < ApplicationController def clear_org_avatar_temp end + + def set_homepage + org = Organization.find(params[:id]) + org.home_id = params[:home_id] + org.save + end + + def autocomplete_search + @project = Project.find(params[:project_id]) + #@flag = params[:flag] || false + respond_to do |format| + format.js + end + end end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index d26e465ba..a55251d5b 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -69,6 +69,24 @@ class ProjectsController < ApplicationController ### added by william include ActsAsTaggableOn::TagsHelper + #查找组织 + def search_public_orgs_not_in_project + condition = '%%' + if !params[:name].nil? + condition = "%#{params[:name].strip}%".gsub(" ","") + end + project_org_ids = OrgProject.find_by_sql("select distinct organization_id from org_projects where project_id = #{params[:id]}").map(&:organization_id) + if project_org_ids.empty? + @orgs_not_in_project = Organization.where("is_public = 1").where("name like ?", condition).page((params[:page].to_i || 1)-1).per(10) + @org_count = Organization.where("is_public = 1").where("name like ?", condition).count + else + project_org_ids = "(" + project_org_ids.join(',') + ")" + @orgs_not_in_project = Organization.where("id not in #{project_org_ids} and is_public = 1").where("name like ?", condition).page((params[:page].to_i || 1)-1).per(10) + @org_count = Organization.where("id not in #{project_org_ids} and is_public = 1").where("name like ?", condition) + end + render :json => {:orgs => @orgs_not_in_project, :count => @org_count}.to_json + end + def index render_404 end @@ -338,6 +356,15 @@ class ProjectsController < ApplicationController @wiki ||= @project.wiki @select_tab = params[:tab] + #找出所有不属于项目的公共组织 + project_org_ids = OrgProject.find_by_sql("select distinct organization_id from org_projects where project_id = #{@project.id}") + if project_org_ids.empty? + @orgs_not_in_project = Organization.where("is_public = 1") + else + project_org_ids = "(" + project_org_ids.join(',') + ")" + @orgs_not_in_project = Organization.where("id not in #{project_org_ids} and is_public = 1") + end + # 处理从新建版本库返回来的错误信息 if !params[:repository_error_message].to_s.blank? html = "" @@ -826,5 +853,4 @@ class ProjectsController < ApplicationController end #gcmend - end diff --git a/app/helpers/org_document_comment_helper.rb b/app/helpers/org_document_comment_helper.rb new file mode 100644 index 000000000..b430114f2 --- /dev/null +++ b/app/helpers/org_document_comment_helper.rb @@ -0,0 +1,2 @@ +module OrgDocumentCommentHelper +end diff --git a/app/helpers/org_member_helper.rb b/app/helpers/org_member_helper.rb new file mode 100644 index 000000000..08313f4e9 --- /dev/null +++ b/app/helpers/org_member_helper.rb @@ -0,0 +1,16 @@ +module OrgMemberHelper + include ApplicationHelper + def find_user_not_in_current_org_by_name org + if params[:q] && params[:q].lstrip.rstrip != "" + scope = Principal.active.sorted.not_member_of_org(org).like(params[:q]) + else + scope = [] + end + principals = paginateHelper scope,10 + s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals') + links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options| + link_to text, org_member_autocomplete_org_member_index_path(parameters.merge(:q => params[:q],:flag => true,:org=> org, :format => 'js')), :remote => true + } + s + content_tag('ul', links,:class => 'wlist', :id => "org_member_pagination_links" ) + end +end diff --git a/app/helpers/org_projects_helper.rb b/app/helpers/org_projects_helper.rb new file mode 100644 index 000000000..f3a7025bd --- /dev/null +++ b/app/helpers/org_projects_helper.rb @@ -0,0 +1,2 @@ +module OrgProjectsHelper +end diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index e10d4026d..33d5dea6e 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -16,4 +16,5 @@ module OrganizationsHelper } s + content_tag('ul', links,:class => 'wlist', :id => "org_member_pagination_links" ) end + end diff --git a/app/models/org_activity.rb b/app/models/org_activity.rb new file mode 100644 index 000000000..c48ebdf8e --- /dev/null +++ b/app/models/org_activity.rb @@ -0,0 +1,5 @@ +class OrgActivity < ActiveRecord::Base + # attr_accessible :title, :body + belongs_to :org_act ,:polymorphic => true + belongs_to :container,:polymorphic => true +end diff --git a/app/models/org_document_comment.rb b/app/models/org_document_comment.rb new file mode 100644 index 000000000..2b3c9132a --- /dev/null +++ b/app/models/org_document_comment.rb @@ -0,0 +1,16 @@ +class OrgDocumentComment < ActiveRecord::Base + attr_accessible :content, :creator_id, :organization_id, :parent_id, :reply_id, :title,:sticky,:locked + include Redmine::SafeAttributes + belongs_to :organization + belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id' + + acts_as_tree :order => "#{OrgDocumentComment.table_name}.sticky asc, #{OrgDocumentComment.table_name}.created_at desc" + has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy + after_create :document_save_as_org_activity + + def document_save_as_org_activity + if(self.parent().nil?) + self.org_acts << OrgActivity.new(:user_id => User.current.id, :container_id => self.organization.id, :container_type => 'Organization') + end + end +end diff --git a/app/models/org_project.rb b/app/models/org_project.rb new file mode 100644 index 000000000..ec01013fc --- /dev/null +++ b/app/models/org_project.rb @@ -0,0 +1,5 @@ +class OrgProject < ActiveRecord::Base + # attr_accessible :title, :body + belongs_to :organization + belongs_to :project +end diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index d84bd5e8c..88acb59f6 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -14,6 +14,7 @@ <%= heads_for_theme %> <%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','org' %> <%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','org'%> + <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> @@ -30,7 +31,6 @@ <% end %>
      - <% @organization = Organization.find(params[:id])%>
      @@ -50,11 +50,15 @@ <% end %> <% end%>
      -
      组织id:<%= @organization.id %>
      +
      组织id:<%= @organization.id %>
      配置
      -
      文章 ( 3 ) | 成员 ( 10 )
      +
      + <%= link_to '文章', organization_org_document_comments_path(@organization) %> (  + <%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %> +  ) | 成员 ( <%= @organization.org_members.count %>  ) +
      @@ -77,90 +81,9 @@ <%= call_hook :view_layouts_base_content %>
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      -
      <%= render :partial => 'layouts/footer' %> diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index be178607f..3bf109f37 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -581,10 +581,7 @@ } }); - //查询学校 - $("input[name='province']").on('input', function (e) { - throttle(shcool_search_fn,window,e); - }); + function throttle(method,context,e){ clearTimeout(method.tId); @@ -606,7 +603,10 @@ type: 'post', success: function (data) { schoolsResult = data.schools; - count = data.count; + count = data.count; //查询学校 + $("input[name='province']").on('input', function (e) { + throttle(shcool_search_fn,window,e); + }); maxPage = Math.ceil(count/100) //最大页码值 if(schoolsResult.length != undefined && schoolsResult.length != 0) { var i = 0; diff --git a/app/views/org_document_comments/_new.html.erb b/app/views/org_document_comments/_new.html.erb new file mode 100644 index 000000000..f47048bf9 --- /dev/null +++ b/app/views/org_document_comments/_new.html.erb @@ -0,0 +1,40 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%> + +<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %> +
      +
      + +
      +
      + +
      +<% end %> \ No newline at end of file diff --git a/app/views/org_document_comments/add_reply.js.erb b/app/views/org_document_comments/add_reply.js.erb new file mode 100644 index 000000000..930c8ebb0 --- /dev/null +++ b/app/views/org_document_comments/add_reply.js.erb @@ -0,0 +1,3 @@ +$("#organization_document_<%= @document.id %>").html(""); +$("#organization_document_<%= @document.id %>").html("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document}) %>"); +init_activity_KindEditor_data(<%= @document.id %>,"","87%"); \ No newline at end of file diff --git a/app/views/org_document_comments/destroy.js.erb b/app/views/org_document_comments/destroy.js.erb new file mode 100644 index 000000000..bcebe9d37 --- /dev/null +++ b/app/views/org_document_comments/destroy.js.erb @@ -0,0 +1 @@ +location.reload(); \ No newline at end of file diff --git a/app/views/org_document_comments/index.html.erb b/app/views/org_document_comments/index.html.erb new file mode 100644 index 000000000..8915e020c --- /dev/null +++ b/app/views/org_document_comments/index.html.erb @@ -0,0 +1,26 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %> + +<%= render :partial => 'new' %> +<% unless @documents.nil? %> + <% @documents.each do |document| %> + +
      + <%= render :partial => 'organizations/show_org_document', :locals => {:document => document} %> +
      + <% end %> +<% end %> \ No newline at end of file diff --git a/app/views/org_document_comments/new.html.erb b/app/views/org_document_comments/new.html.erb new file mode 100644 index 000000000..11a7e9359 --- /dev/null +++ b/app/views/org_document_comments/new.html.erb @@ -0,0 +1,40 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%> + +<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %> +
      +
      + +
      +
      + +
      +<% end %> \ No newline at end of file diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/org_projects/create.js.erb b/app/views/org_projects/create.js.erb new file mode 100644 index 000000000..cadad16b2 --- /dev/null +++ b/app/views/org_projects/create.js.erb @@ -0,0 +1,4 @@ + +$("#search_orgs_result_list").next().html(""); +$("#added_orgs").html(""); +$("#added_orgs").html('<%= escape_javascript(render :partial => "projects/settings/added_orgs", :locals => {:orgs => @project.organizations, :project_id => @project.id}) %>') \ No newline at end of file diff --git a/app/views/org_projects/destroy.js.erb b/app/views/org_projects/destroy.js.erb new file mode 100644 index 000000000..ee3c67bbd --- /dev/null +++ b/app/views/org_projects/destroy.js.erb @@ -0,0 +1,2 @@ +$("#added_orgs").html(""); +$("#added_orgs").html('<%= escape_javascript(render :partial => "projects/settings/added_orgs", :locals => {:orgs => @project.organizations, :project_id => @project.id}) %>') \ No newline at end of file diff --git a/app/views/organization/_form.html.erb b/app/views/organization/_form.html.erb deleted file mode 100644 index 80cc76850..000000000 --- a/app/views/organization/_form.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<%= error_messages_for 'project' %> - -<% unless @organizations.new_record? %> -

      - <%= render :partial=>"avatar/avatar_form",:locals=> {source:@organizations} %> -

      -<% end %> -

      - - <%= f.text_field :name, :required => true, :size => 60, :style => "width:290px;" %> -

      - - - <%#= l(:field_description)%> - - - - diff --git a/app/views/organization/edit.html.erb b/app/views/organization/edit.html.erb deleted file mode 100644 index 60b7c06a0..000000000 --- a/app/views/organization/edit.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -<%= form_for(@organization) do |f|%> -

      - <%=l(:label_organization_edit)%> -

      -
      - <%= error_messages_for 'project' %> -

      - <%= render :partial=>"avatar/avatar_form",:locals=> {source:@organization} %> -

      -

      - - <%= f.text_field :name, :required => true, :size => 60, :style => "width:290px;" %> -

      - - <%= submit_tag l(:button_create), :class => "enterprise"%> - -
      - <%#= submit_tag l(:button_create_and_continue), :name => 'continue' %> - <%= javascript_tag "$('#project_name').focus();" %> -<% end %> - -<% html_title(l(:label_organization_edit)) -%> \ No newline at end of file diff --git a/app/views/organization/index.html.erb b/app/views/organization/index.html.erb deleted file mode 100644 index f1c50d6ab..000000000 --- a/app/views/organization/index.html.erb +++ /dev/null @@ -1,31 +0,0 @@ - - <%= l(:label_all_enterprises) %> - -
      -
      - <%= l(:label_all_enterprises) %> -
      -
      - <% if @organizations.empty? %> -

      - <%= l(:label_enterprise_nil) %> -

      - <% else %> - <% @organizations.each do |organization| %> - <% unless organization.name.blank? %> -
        -
      • - <%= organization.name%> - <%= link_to organization.name, home_path(:organization => organization.id) %> -
      • -
      - <% end %> - <% end %> - <% end %> -
      -
      -
      -
      -
        -
        -<% html_title(l(:label_enterprise_all)) -%> diff --git a/app/views/organization/new.html.erb b/app/views/organization/new.html.erb deleted file mode 100644 index 163f4a5f5..000000000 --- a/app/views/organization/new.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -<%= form_for(@organizations, :method => :post, - :name => 'new_form', - :url => {:controller => 'organization', - :action => 'create'}) do |f|%> -

        - <%=l(:label_organization_new)%> -

        -
        - <%= render :partial => 'form', :locals => { :f => f } %> - - <%= submit_tag l(:button_create), :class => "enterprise"%> - -
        - <%#= submit_tag l(:button_create_and_continue), :name => 'continue' %> - <%= javascript_tag "$('#project_name').focus();" %> -<% end %> - -<% html_title(l(:label_organization_new)) -%> \ No newline at end of file diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb new file mode 100644 index 000000000..102867ce0 --- /dev/null +++ b/app/views/organizations/_show_org_document.html.erb @@ -0,0 +1,90 @@ +
        +
        +
        + <%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %> +
        +
        +
        + <%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %> + TO<%= link_to document.organization.name, organization_path(document.organization) %> | 组织 +
        +
        <%= document.title %>
        +
        + 发帖时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
        + <% unless document.content.blank? %> +
        + <%= document.content.html_safe %> +
        + <% end %> +
        +
          +
        • +
            +
          • + <%= form_for('new_form',:url => {:controller => 'organizations',:action => 'set_homepage',:id => document.organization_id, :home_id => document.id},:method => "put",:remote => true) do |f|%> + 设为首页 + <% end %> +
          • +
          • 编辑文章
          • +
          • + <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',:remote => true, :class => 'postOptionLink' %> +
          • +
          +
        • +
        +
        +
        +
        +
        +<% comments_for_doc = document.children.reorder("created_at desc") %> +
        +
        +
        回复(<%= document.children.count() %>)
        + <% if count > 3 %> + + <% end %> + + +
        + <% comments_for_doc.each do |comment| %> +
        <%= image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像") %>
        +
        +
        + <%= link_to User.find(comment.creator_id), user_path(comment.creator_id), :class => "newsBlue mr10 f14" %> + <%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %> +
        + <% unless comment.content.blank? %> +
        <%= comment.content.html_safe %>
        + <% end %> +
        +
        + <% end %> +
        +
        +
        + <%= image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像") %> +
        +
        +
        + <%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id), :method => "post", :remote => true) do |f| %> + + + +
        + + +
        +

        + <% end %> +
        +
        +
        +
        +
        +
        +
        +
        \ No newline at end of file diff --git a/app/views/organizations/autocomplete_search.js.erb b/app/views/organizations/autocomplete_search.js.erb new file mode 100644 index 000000000..357ef668c --- /dev/null +++ b/app/views/organizations/autocomplete_search.js.erb @@ -0,0 +1,13 @@ +<% if @project%> +var checked = $("#not_org_members input:checked").size(); +if(checked > 0) +{ + alert('翻页或搜索后将丢失当前选择的用户数据!'); +} +<% if @flag == "true"%> +$('#new_orgs_for_project').html('<%= escape_javascript(search_public_orgs_not_in_project(@project.id)) %>'); +<% else%> +$('#new_orgs_for_project').html('<%= escape_javascript(search_public_orgs_not_in_project(@project.id)) %>'); +<% end%> + +<%end%> diff --git a/app/views/organizations/set_homepage.js.erb b/app/views/organizations/set_homepage.js.erb new file mode 100644 index 000000000..bcebe9d37 --- /dev/null +++ b/app/views/organizations/set_homepage.js.erb @@ -0,0 +1 @@ +location.reload(); \ No newline at end of file diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 61e6b1534..e203b5eed 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -89,7 +89,8 @@ <%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript org_member_autocomplete_org_member_index_path(:org=>@organization, :format => 'js') }')" %>
        <%= find_user_not_in_current_org_by_name(@project) %> -
        +
        +
        • 角色
        • diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index 2f25ae8a3..2c94ed163 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -1,5 +1,7 @@ <%= javascript_include_tag "jquery.infinitescroll.js" %> - +<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 %> + <%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id)} %> + <% end %>
          最新动态
            @@ -28,6 +30,9 @@
        <% end %> + <% if act.org_act_type == 'OrgDocumentComment' %> + <%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %> + <% end %> <% end %>
          <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> diff --git a/app/views/projects/settings.html.erb b/app/views/projects/settings.html.erb index 3fc9a89d6..76258b9e9 100644 --- a/app/views/projects/settings.html.erb +++ b/app/views/projects/settings.html.erb @@ -12,6 +12,7 @@ project_setting(6); $("#pro_st_edit_ku").toggle(); <%else%> + project_setting(5); <% end%> <% end%> $("div[nhname='pro_setting']").show(); @@ -36,6 +37,7 @@ <% if User.current.allowed_to?(:manage_members, @project) %>
        • 成员
        • <% end %> +
        • 组织
        • <% if User.current.allowed_to?(:manage_versions, @project) %>
        • 版本
        • <% end %> @@ -63,6 +65,7 @@ <%= render :partial=>"projects/settings/new_members" if User.current.allowed_to?(:manage_members, @project)%>
        +
        <%= render :partial=>"projects/settings/new_versions" if User.current.allowed_to?(:manage_versions, @project)%>
        @@ -70,6 +73,9 @@ +
        + <%= render :partial=>"projects/settings/join_org" %> +
        <%= render :partial=>"projects/settings/new_repositories" if User.current.allowed_to?(:manage_repository, @project)%> diff --git a/app/views/projects/settings/_added_orgs.html.erb b/app/views/projects/settings/_added_orgs.html.erb new file mode 100644 index 000000000..06d3ae439 --- /dev/null +++ b/app/views/projects/settings/_added_orgs.html.erb @@ -0,0 +1,9 @@ +
          +
        • 名称操作
        • + <% orgs.each do |org| %> +
        • <%= org.name %> + <%= link_to "取消关联", org_project_path(:id => OrgProject.where(:organization_id => org.id, :project_id => project_id).first.id, :project_id => project_id), + :method => 'delete',:remote => true, :class => "relatedListOption fl linkGrey3" %> +
        • + <% end %> +
        \ No newline at end of file diff --git a/app/views/projects/settings/_join_org.html.erb b/app/views/projects/settings/_join_org.html.erb new file mode 100644 index 000000000..b7e58ee4c --- /dev/null +++ b/app/views/projects/settings/_join_org.html.erb @@ -0,0 +1,108 @@ + + + + + + + +<%= stylesheet_link_tag 'org' %> + +
          +
        • 组织
        • +
        • +
          +
        +
        +
        + 关联组织 +
        + <%= form_tag url_for(:controller => 'org_projects', :action => 'create', :project_id => @project.id), :id => 'join_orgs_for_project', :remote => true %> + +
        +
          +
        + 关联 + 取消 +
        +
        +
        + 已关联组织 +
        + <%= render :partial => 'projects/settings/added_orgs', :locals => {:orgs => @project.organizations, :project_id => params[:id]} %> +
        +
        +
        +
        +
        +
        + + \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 639056b94..fc7b74cd8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -35,9 +35,19 @@ RedmineApp::Application.routes.draw do member do get 'setting'#, :action => 'settings', :as => 'settings' get 'clear_org_avatar_temp' + put 'set_homepage' end collection do get 'check_uniq' + get 'autocomplete_search' + end + resources :org_document_comments do + member do + + end + collection do + + end end end @@ -50,6 +60,25 @@ RedmineApp::Application.routes.draw do end end + resources :org_document_comments do + member do + post 'add_reply' + end + collection do + + end + end + + resources :org_projects do + member do + + end + collection do + + end + end + #match '/organizations/:organization_id/org_document_comments/new', :to => 'org_document_comments#new', :as => 'new_org_documents', :via => [:get, :post] + #match '/organizations/:organization_id/org_document_comments/create', :to => 'org_document_comments#create', :as => 'create_org_documents', :via => [:post] resources :homework_users resources :no_uses delete 'no_uses', :to => 'no_uses#delete' @@ -493,6 +522,7 @@ RedmineApp::Application.routes.draw do post 'unarchive' post 'close' post 'reopen' + post 'search_public_orgs_not_in_project' match 'copy', :via => [:get, :post] end diff --git a/db/migrate/20151104020233_create_org_document_comments.rb b/db/migrate/20151104020233_create_org_document_comments.rb new file mode 100644 index 000000000..e300785aa --- /dev/null +++ b/db/migrate/20151104020233_create_org_document_comments.rb @@ -0,0 +1,13 @@ +class CreateOrgDocumentComments < ActiveRecord::Migration + def change + create_table :org_document_comments do |t| + t.string :title + t.text :content + t.integer :organization_id + t.integer :creator_id + t.integer :parent_id + t.integer :reply_id + t.timestamps + end + end +end diff --git a/db/migrate/20151104024335_add_locked_and_sticky_column_to_entity_org_document_comments.rb b/db/migrate/20151104024335_add_locked_and_sticky_column_to_entity_org_document_comments.rb new file mode 100644 index 000000000..313800985 --- /dev/null +++ b/db/migrate/20151104024335_add_locked_and_sticky_column_to_entity_org_document_comments.rb @@ -0,0 +1,6 @@ +class AddLockedAndStickyColumnToEntityOrgDocumentComments < ActiveRecord::Migration + def change + add_column :org_document_comments,:locked,:boolean,:default => false + add_column :org_document_comments,:sticky,:integer,:default => 0 + end +end diff --git a/db/migrate/20151104032831_create_org_activity.rb b/db/migrate/20151104032831_create_org_activity.rb new file mode 100644 index 000000000..8d78102b3 --- /dev/null +++ b/db/migrate/20151104032831_create_org_activity.rb @@ -0,0 +1,16 @@ +class CreateOrgActivity < ActiveRecord::Migration + def up + create_table :org_activities do |t| + t.integer :user_id + t.integer :act_id + t.string :act_type + t.integer :container_id + t.string :container_type + + t.timestamps + end + end + + def down + end +end diff --git a/db/migrate/20151104070007_create_org_projects.rb b/db/migrate/20151104070007_create_org_projects.rb new file mode 100644 index 000000000..db83f9632 --- /dev/null +++ b/db/migrate/20151104070007_create_org_projects.rb @@ -0,0 +1,11 @@ +class CreateOrgProjects < ActiveRecord::Migration + def up + create_table :org_projects do |t| + t.integer :organization_id + t.integer :project_id + end + end + + def down + end +end diff --git a/db/migrate/20151104070455_delete_column_role_from_org_members.rb b/db/migrate/20151104070455_delete_column_role_from_org_members.rb new file mode 100644 index 000000000..2e986dd9b --- /dev/null +++ b/db/migrate/20151104070455_delete_column_role_from_org_members.rb @@ -0,0 +1,8 @@ +class DeleteColumnRoleFromOrgMembers < ActiveRecord::Migration + def up + remove_column :org_members, :role + end + + def down + end +end diff --git a/db/migrate/20151104073902_rename_column_for_org_activity.rb b/db/migrate/20151104073902_rename_column_for_org_activity.rb new file mode 100644 index 000000000..e644c16cb --- /dev/null +++ b/db/migrate/20151104073902_rename_column_for_org_activity.rb @@ -0,0 +1,6 @@ +class RenameColumnForOrgActivity < ActiveRecord::Migration + def change + rename_column :org_activities,:act_id,:org_act_id + rename_column :org_activities,:act_type,:org_act_type + end +end diff --git a/db/migrate/20151104090032_create_org_member_roles.rb b/db/migrate/20151104090032_create_org_member_roles.rb new file mode 100644 index 000000000..d97d6eda7 --- /dev/null +++ b/db/migrate/20151104090032_create_org_member_roles.rb @@ -0,0 +1,11 @@ +class CreateOrgMemberRoles < ActiveRecord::Migration + def up + create_table :org_member_roles do |t| + t.integer :org_member_id + t.integer :role_id + end + end + + def down + end +end diff --git a/db/migrate/20151110011003_add_time_to_org_project.rb b/db/migrate/20151110011003_add_time_to_org_project.rb new file mode 100644 index 000000000..dfe370103 --- /dev/null +++ b/db/migrate/20151110011003_add_time_to_org_project.rb @@ -0,0 +1,5 @@ +class AddTimeToOrgProject < ActiveRecord::Migration + def change + add_column :org_projects, :created_at, :timestamp + end +end diff --git a/db/schema.rb b/db/schema.rb index d75b4f7a4..90f58aa3c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20151104090032) do +ActiveRecord::Schema.define(:version => 20151110011003) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1209,8 +1209,9 @@ ActiveRecord::Schema.define(:version => 20151104090032) do end create_table "org_projects", :force => true do |t| - t.integer "organization_id" - t.integer "project_id" + t.integer "organization_id" + t.integer "project_id" + t.datetime "created_at" end create_table "organizations", :force => true do |t| diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 8d9275f31..3857b53e2 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -30,4 +30,15 @@ a.saveBtn:hover {background-color:#297fb8;} .upbtn { margin: 40px 0px 0px 15px; display: block; padding: 2px 5px; - border: 1px solid #EAEAEA;} \ No newline at end of file + border: 1px solid #EAEAEA;} + +/*项目关联css*/ +.relateOrg {width:335px;} +.relatedList {width:335px;} +.searchOrg {height:24px; width:200px; color:#9b9b9b9; border:1px solid #15bccf;} +a.cancelBtn {padding:3px 5px; background-color:#D9D9D9; color:#656565;} +a.cancelBtn:hover {background-color:#717171; color:#ffffff;} +.relatedList ul li {border-bottom:1px solid #e4e4e4; width:320px; height:22px; vertical-align:middle; line-height:22px;} +.relatedListName {width:240px; text-align:left; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;} +.relatedListOption {width:80px; text-align:center;} +.relateOrgName {width:240px; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;color:#656565;} \ No newline at end of file diff --git a/spec/controllers/org_document_comment_controller_spec.rb b/spec/controllers/org_document_comment_controller_spec.rb new file mode 100644 index 000000000..016416264 --- /dev/null +++ b/spec/controllers/org_document_comment_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe OrgDocumentCommentController, :type => :controller do + +end diff --git a/spec/controllers/org_member_controller_spec.rb b/spec/controllers/org_member_controller_spec.rb new file mode 100644 index 000000000..a116db00f --- /dev/null +++ b/spec/controllers/org_member_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe OrgMemberController, :type => :controller do + +end diff --git a/spec/controllers/org_projects_controller_spec.rb b/spec/controllers/org_projects_controller_spec.rb new file mode 100644 index 000000000..8adc91d66 --- /dev/null +++ b/spec/controllers/org_projects_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe OrgProjectsController, :type => :controller do + +end diff --git a/spec/factories/org_activities.rb b/spec/factories/org_activities.rb new file mode 100644 index 000000000..552ea70f9 --- /dev/null +++ b/spec/factories/org_activities.rb @@ -0,0 +1,6 @@ +FactoryGirl.define do + factory :org_activity do + + end + +end diff --git a/spec/factories/org_document_comments.rb b/spec/factories/org_document_comments.rb new file mode 100644 index 000000000..206c471aa --- /dev/null +++ b/spec/factories/org_document_comments.rb @@ -0,0 +1,11 @@ +FactoryGirl.define do + factory :org_document_comment do + title "MyString" +content "MyText" +organization_id 1 +creator_id 1 +parent_id 1 +reply_id 1 + end + +end diff --git a/spec/models/org_activity_spec.rb b/spec/models/org_activity_spec.rb new file mode 100644 index 000000000..e452fe172 --- /dev/null +++ b/spec/models/org_activity_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe OrgActivity, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/org_document_comment_spec.rb b/spec/models/org_document_comment_spec.rb new file mode 100644 index 000000000..ba5dd15a4 --- /dev/null +++ b/spec/models/org_document_comment_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe OrgDocumentComment, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end From 41751f08bac7c32866f75158c27fdd62f19cf87c Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 12 Nov 2015 11:31:35 +0800 Subject: [PATCH 079/132] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=8F=B3=E4=B8=8A=E8=A7=92=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=92=8C=E5=88=A0=E9=99=A4icon=E5=A2=9E=E5=8A=A0tip?= =?UTF-8?q?=EF=BC=8C=E4=B8=A4=E4=B8=AAicon=E7=9A=84=E8=B7=9D=E7=A6=BB?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_show.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index 286d5eb39..1b0202536 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -9,10 +9,10 @@ <% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
      • - <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %> + <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del",:title=>"删除") %>
      • -
      • - <%= link_to "",edit_student_work_path(work),:class => "pic_edit"%> +
      • + <%= link_to "",edit_student_work_path(work),:class => "pic_edit",:title => "修改"%>
      • <% end%> <% if @homework.homework_detail_manual.comment_status == 3 && work.user != User.current%> From 8fa790dd6b453255b297b043d3ed046eeeb494f4 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 12 Nov 2015 11:48:27 +0800 Subject: [PATCH 080/132] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E6=96=87=E5=AD=97=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_student_work_list.html.erb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index 64f097114..c18ec4c73 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -2,10 +2,14 @@ 作品 - (已有<%= @student_work_count%>人提交) + (<%= @student_work_count%>人已交) <% if !@is_teacher && @stundet_works.empty?%> 您尚未提交作品 + <% elsif !@is_teacher &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%> + 您已提交且不可再修改,因为截止日期已过 + <% elsif !@is_teacher &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%> + 您已提交,您还可以修改 <% end %> <%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%> From 3f60893591a4316c3d96956c09d45a0f37239dba Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 12 Nov 2015 14:53:12 +0800 Subject: [PATCH 081/132] =?UTF-8?q?=E7=A6=81=E7=94=A8=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E7=9A=84=E4=BD=9C=E4=B8=9A=E5=9C=A8=E6=88=AA=E6=AD=A2=E6=97=B6?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=8A=B6=E6=80=81=E5=8F=98=E4=B8=BA3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/homework_publishtime.rake | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/tasks/homework_publishtime.rake b/lib/tasks/homework_publishtime.rake index 4d79086d4..8e231fafd 100644 --- a/lib/tasks/homework_publishtime.rake +++ b/lib/tasks/homework_publishtime.rake @@ -1,7 +1,7 @@ #coding=utf-8 namespace :homework_publishtime do - desc "start publish homework" + desc "start publish homework and end homework" task :publish => :environment do homework_commons = HomeworkCommon.where("publish_time = '#{Date.today}'") homework_commons.each do |homework| @@ -20,4 +20,16 @@ namespace :homework_publishtime do end end end + + task :end => :environment do + homework_commons = HomeworkCommon.where("end_time < '#{Date.today}'") + homework_commons.each do |homework| + if homework.anonymous_comment == 1 + homework_detail_manual = homework.homework_detail_manual + if homework_detail_manual.comment_status == 1 + homework_detail_manual.update_column('comment_status', 3) + end + end + end + end end \ No newline at end of file From d508cfa381d3c1d8e28a8d021d05188ee87c01a3 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 12 Nov 2015 14:55:31 +0800 Subject: [PATCH 082/132] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org_document_comments_controller.rb | 7 ++ app/controllers/projects_controller.rb | 13 ++-- .../org_document_comments/index.html.erb | 1 + app/views/org_projects/create.js.erb | 4 +- app/views/org_projects/destroy.js.erb | 2 + .../organizations/_show_org_document.html.erb | 68 ++++++++++++------ app/views/organizations/show.html.erb | 24 +++++++ .../search_public_orgs_not_in_project.js.erb | 13 ++++ .../projects/settings/_join_org.html.erb | 71 +++++++++---------- config/routes.rb | 2 +- 10 files changed, 141 insertions(+), 64 deletions(-) create mode 100644 app/views/projects/search_public_orgs_not_in_project.js.erb diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index 325a5ff85..d9ed0f1f5 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -27,6 +27,13 @@ class OrgDocumentCommentsController < ApplicationController @documents = @organization.org_document_comments.where("parent_id is null").order("created_at desc") end def update + @org_document = OrgDocumentComment.find(params[:id]) + respond_to do |format| + # format.html {redirect_to :} + end + end + + def edit end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index a55251d5b..5e6a584c8 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -77,14 +77,19 @@ class ProjectsController < ApplicationController end project_org_ids = OrgProject.find_by_sql("select distinct organization_id from org_projects where project_id = #{params[:id]}").map(&:organization_id) if project_org_ids.empty? - @orgs_not_in_project = Organization.where("is_public = 1").where("name like ?", condition).page((params[:page].to_i || 1)-1).per(10) + @orgs_not_in_project = Organization.where("is_public = 1").where("name like ?", condition).page((params[:page].to_i || 1)).per(10) @org_count = Organization.where("is_public = 1").where("name like ?", condition).count else project_org_ids = "(" + project_org_ids.join(',') + ")" - @orgs_not_in_project = Organization.where("id not in #{project_org_ids} and is_public = 1").where("name like ?", condition).page((params[:page].to_i || 1)-1).per(10) - @org_count = Organization.where("id not in #{project_org_ids} and is_public = 1").where("name like ?", condition) + @orgs_not_in_project = Organization.where("id not in #{project_org_ids} and is_public = 1").where("name like ?", condition).page((params[:page].to_i || 1)).per(10) + @org_count = Organization.where("id not in #{project_org_ids} and is_public = 1").where("name like ?", condition).count + end + # @project_count = Project.project_entities.visible.like(params[:name]).page(params[:page]).count + @orgs_page = Paginator.new @org_count, 10,params[:page] + #render :json => {:orgs => @orgs_not_in_project, :count => @org_count}.to_json + respond_to do |format| + format.js end - render :json => {:orgs => @orgs_not_in_project, :count => @org_count}.to_json end def index diff --git a/app/views/org_document_comments/index.html.erb b/app/views/org_document_comments/index.html.erb index 8915e020c..a7340c08a 100644 --- a/app/views/org_document_comments/index.html.erb +++ b/app/views/org_document_comments/index.html.erb @@ -16,6 +16,7 @@ <% @documents.each do |document| %> diff --git a/app/views/org_projects/create.js.erb b/app/views/org_projects/create.js.erb index cadad16b2..545918c73 100644 --- a/app/views/org_projects/create.js.erb +++ b/app/views/org_projects/create.js.erb @@ -1,4 +1,6 @@ -$("#search_orgs_result_list").next().html(""); +$("#search_orgs_result_list").html(""); +//$("#search_orgs_result_list").append('
          '); $("#added_orgs").html(""); +$("#paginator").css("display", "none"); $("#added_orgs").html('<%= escape_javascript(render :partial => "projects/settings/added_orgs", :locals => {:orgs => @project.organizations, :project_id => @project.id}) %>') \ No newline at end of file diff --git a/app/views/org_projects/destroy.js.erb b/app/views/org_projects/destroy.js.erb index ee3c67bbd..45a014b23 100644 --- a/app/views/org_projects/destroy.js.erb +++ b/app/views/org_projects/destroy.js.erb @@ -1,2 +1,4 @@ $("#added_orgs").html(""); +$("#search_orgs_result_list").html(""); +$("#paginator").css("display", "none"); $("#added_orgs").html('<%= escape_javascript(render :partial => "projects/settings/added_orgs", :locals => {:orgs => @project.organizations, :project_id => @project.id}) %>') \ No newline at end of file diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index 102867ce0..db27cacc3 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -37,9 +37,10 @@
        <% comments_for_doc = document.children.reorder("created_at desc") %> -
        -
        -
        回复(<%= document.children.count() %>)
        +<% count = document.children.count() %> +
        +
        +
        回复(<%= count %>)
        <% if count > 3 %> <% end %> - - -
        - <% comments_for_doc.each do |comment| %> -
        <%= image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像") %>
        -
        -
        - <%= link_to User.find(comment.creator_id), user_path(comment.creator_id), :class => "newsBlue mr10 f14" %> - <%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %> -
        - <% unless comment.content.blank? %> -
        <%= comment.content.html_safe %>
        - <% end %> -
        -
        - <% end %> +
        +
        +
          + <% reply_id = 0 %> + <% comments_for_doc.each do |comment| %> + <% reply_id += 1 %> +
        • +
          <%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_path(comment.creator_id) %>
          +
          +
          + <%= link_to User.find(comment.creator_id), user_path(comment.creator_id), :class => "newsBlue mr10 f14" %> + <%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %> +
          + <% unless comment.content.blank? %> +
          <%= comment.content.html_safe %>
          + <% end %> +
          +
          +
        • + <% end %> +
        - <%= image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像") %> + <%=link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %>
        <%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id), :method => "post", :remote => true) do |f| %> - +
        @@ -87,4 +93,22 @@
        -
        \ No newline at end of file + + \ No newline at end of file diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index 2c94ed163..2f3610abc 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -1,5 +1,23 @@ <%= javascript_include_tag "jquery.infinitescroll.js" %> +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %> + <% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 %> + <%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id)} %> <% end %>
        @@ -31,6 +49,12 @@
        <% end %> <% if act.org_act_type == 'OrgDocumentComment' %> + <%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %> <% end %> <% end %> diff --git a/app/views/projects/search_public_orgs_not_in_project.js.erb b/app/views/projects/search_public_orgs_not_in_project.js.erb new file mode 100644 index 000000000..69005d304 --- /dev/null +++ b/app/views/projects/search_public_orgs_not_in_project.js.erb @@ -0,0 +1,13 @@ +$("#search_orgs_result_list").html(""); +$("#search_orgs_result_list").append('
          '); + <% @orgs_not_in_project.each do |org|%> + link = "
        • "; + $("#search_orgs_result_list").append(link ); + <%end %> +$("#search_orgs_result_list").append('
        ') +<% if @org_count > 10 %> +$("#paginator").html(' <%= pagination_links_full @orgs_page, @org_count ,:per_page_links => true,:remote =>true,:flag=>true%>'); +$("#paginator").css("display", "block"); +<% else %> +$("#paginator").css("display", "none"); +<% end %> diff --git a/app/views/projects/settings/_join_org.html.erb b/app/views/projects/settings/_join_org.html.erb index b7e58ee4c..57ae714bd 100644 --- a/app/views/projects/settings/_join_org.html.erb +++ b/app/views/projects/settings/_join_org.html.erb @@ -18,9 +18,8 @@
        <%= form_tag url_for(:controller => 'org_projects', :action => 'create', :project_id => @project.id), :id => 'join_orgs_for_project', :remote => true %> -
        -
          -
        +
        +
          关联 取消
          @@ -50,22 +49,22 @@ page = 1; $.ajax({ url: '<%= url_for(:controller => 'projects', :action => 'search_public_orgs_not_in_project') %>'+'?name='+ e.target.value+'&page='+page, - type:'post', - success: function(data){ - orgs = data.orgs; - count = data.count; - maxPage = Math.ceil(count/10); - $("#search_orgs_result_list").next().html(""); - if(orgs.length != undefined && orgs.length != 0){ - var i = 0; - for(; i" + orgs[i].organization.name + "
          "; - console.log(link) - $("#search_orgs_result_list").next().append(link ); - } - - } - } + type:'get' +// success: function(data){ +// orgs = data.orgs; +// count = data.count; +// maxPage = Math.ceil(count/10); +// $("#search_orgs_result_list").next().html(""); +// if(orgs.length != undefined && orgs.length != 0){ +// var i = 0; +// for(; i" + orgs[i].organization.name + "
          "; +// console.log(link) +// $("#search_orgs_result_list").next().append(link ); +// } +// +// } +// } }); } @@ -84,25 +83,25 @@ $(document).ready(function(){ $.ajax({ url: '<%= url_for(:controller => 'projects', :action => 'search_public_orgs_not_in_project') %>'+'?page=1', - type:'post', - success: function(data){ - orgs = data.orgs; - count = data.count; - maxPage = Math.ceil(count/10); - $("#search_orgs_result_list").next().html(""); - if(orgs.length != undefined && orgs.length != 0){ - var i = 0; - for(; i" + orgs[i].organization.name + "
          "; - console.log(link) - $("#search_orgs_result_list").next().append(link ); - } - - } - } + type:'get' +// success: function(data){ +// orgs = data.orgs; +// count = data.count; +// maxPage = Math.ceil(count/10); +// $("#search_orgs_result_list").next().html(""); +// if(orgs.length != undefined && orgs.length != 0){ +// var i = 0; +// for(; i" + orgs[i].organization.name + "
          "; +// console.log(link) +// $("#search_orgs_result_list").next().append(link ); +// } +// +// } +// } }); }); function cancel_join_orgs() { - $("#search_orgs_result_list").next().html(""); + $("#search_orgs_result_list").html(""); } \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index fc7b74cd8..44a65133b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -522,7 +522,7 @@ RedmineApp::Application.routes.draw do post 'unarchive' post 'close' post 'reopen' - post 'search_public_orgs_not_in_project' + get 'search_public_orgs_not_in_project' match 'copy', :via => [:get, :post] end From bf01994e4f47b468072cfd7affa885eb6476d577 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 12 Nov 2015 15:12:23 +0800 Subject: [PATCH 083/132] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_show_org_document.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index db27cacc3..e9bd6698b 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -6,7 +6,7 @@
          <%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %> - TO<%= link_to document.organization.name, organization_path(document.organization) %> | 组织 + TO  <%= link_to document.organization.name, organization_path(document.organization) %> | 组织
          <%= document.title %>
          From b52f4f80c4bbbe088241019b8b4b1974ba3d6a51 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 12 Nov 2015 15:31:47 +0800 Subject: [PATCH 084/132] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema.rb | 60 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 4aa12f627..b7e1bfa1c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20151020021234) do +ActiveRecord::Schema.define(:version => 20151102090519) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -144,6 +144,36 @@ ActiveRecord::Schema.define(:version => 20151020021234) do t.integer "open_anonymous_evaluation", :default => 1 end + create_table "blog_comments", :force => true do |t| + t.integer "blog_id", :null => false + t.integer "parent_id" + t.string "title", :default => "", :null => false + t.text "content" + t.integer "author_id" + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comment_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "blogs", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.integer "position", :default => 1 + t.integer "article_count", :default => 0, :null => false + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comments_id" + t.integer "parent_id" + t.integer "author_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "boards", :force => true do |t| t.integer "project_id", :null => false t.string "name", :default => "", :null => false @@ -413,6 +443,7 @@ ActiveRecord::Schema.define(:version => 20151020021234) do t.integer "is_public", :limit => 1, :default => 1 t.integer "inherit_members", :limit => 1, :default => 1 t.integer "open_student", :default => 0 + t.integer "outline", :default => 0 end create_table "custom_fields", :force => true do |t| @@ -621,12 +652,13 @@ ActiveRecord::Schema.define(:version => 20151020021234) do t.text "description" t.date "publish_time" t.date "end_time" - t.integer "homework_type", :default => 1 + t.integer "homework_type", :default => 1 t.string "late_penalty" t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "teacher_priority", :default => 1 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "teacher_priority", :default => 1 + t.integer "anonymous_comment", :default => 0 end create_table "homework_detail_manuals", :force => true do |t| @@ -1006,11 +1038,21 @@ ActiveRecord::Schema.define(:version => 20151020021234) do t.integer "project_id" end + create_table "org_members", :force => true do |t| + t.integer "user_id" + t.integer "organization_id" + t.string "role" + end + create_table "organizations", :force => true do |t| t.string "name" - t.string "logo_link" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.text "description" + t.integer "creator_id" + t.integer "home_id" + t.string "domain" + t.boolean "is_public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "phone_app_versions", :force => true do |t| @@ -1155,6 +1197,7 @@ ActiveRecord::Schema.define(:version => 20151020021234) do t.string "enterprise_name" t.integer "organization_id" t.integer "project_new_type" + t.integer "gpid" end add_index "projects", ["lft"], :name => "index_projects_on_lft" @@ -1571,6 +1614,7 @@ ActiveRecord::Schema.define(:version => 20151020021234) do t.string "identity_url" t.string "mail_notification", :default => "", :null => false t.string "salt", :limit => 64 + t.integer "gid" end add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" From 506709b4742176806663692ea2096ee36e26e585 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 12 Nov 2015 16:35:13 +0800 Subject: [PATCH 085/132] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=BA=93=EF=BC=8C=E8=AF=BE=E7=A8=8B=20=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=20=201.=E5=8D=95=E4=B8=AA?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=20=202.=E7=BB=99=E5=87=BA=E6=98=8E=E7=A1=AE?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=20=203.=E6=8C=89=E9=92=AE=E8=81=94?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/attachments.js | 91 +++++++++++++++++++------------ 1 file changed, 57 insertions(+), 34 deletions(-) diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 20e845424..d7b49c8be 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -155,13 +155,13 @@ function addFile(inputEl, file, eagerUpload,btnId) { addFile.nextAttachmentId = 1; function ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId) { - + //上传开始调用函数 function onLoadstart(e) { fileSpan.removeClass('ajax-waiting'); fileSpan.addClass('ajax-loading'); $('input:submit', $(this).parents('form')).attr('disabled', 'disabled'); } - + //更改progressbar的值 function onProgress(e) { if (e.lengthComputable) { this.progressbar('value', e.loaded * 100 / e.total); @@ -177,40 +177,43 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId) { progressEventHandler: onProgress.bind(progressSpan) }) .done(function(result) { - progressSpan.progressbar('value', 100).remove(); - var containerid = $(inputEl).data('containerid'); - console.log($(inputEl)) - if(containerid == undefined ){ - var count = $('#attachments_fields>span').length; - $('#'+btnId).removeAttr("disabled"); - $('#'+btnId).val('确定') - $('#'+btnId).css('background-color','#269ac9') - $('#upload_file_count').html("" + count + "" + $(inputEl).data('fileCount')); - } - else{ - $('#'+btnId).removeAttr("disabled"); - $('#'+btnId).val('确定') - $('#'+btnId).css('background-color','#269ac9') - var count = $('#attachments_fields' + containerid + '>span').length; - $('#upload_file_count' + containerid).html("" + count + "" + $(inputEl).data('fileCount')); - } - + progressSpan.progressbar('value', 100).remove(); //上传完成就去掉该文件名后的进度条 fileSpan.find('input.description, a').css('display', 'inline-block'); fileSpan.find('input.is_public_checkbox, a').css('display', 'inline-block'); }) .fail(function(result) { - progressSpan.text(result.statusText); - if ($("#network_issue")) { + progressSpan.text("网络错误"); + if ($("#network_issue")) { //在上传处都要给出一个network_issue的div用来显示错误 $("#network_issue").show(); } }).always(function() { ajaxUpload.uploading--; fileSpan.removeClass('ajax-loading'); + var containerid = $(inputEl).data('containerid');//多个上传控件需要的容器id + if(containerid == undefined ){ + var count = 1;//同步上传参数为1,所以不需要去获取正在上传的文件就知道是1 + $('#upload_file_count').html("" + count + "" + $(inputEl).data('lebelFileUploding')); + } + else{ + var count = 1; + $('#upload_file_count' + containerid).html("" + count + "" + $(inputEl).data('lebelFileUploding')); + } var form = fileSpan.parents('form'); - if (form.queue('upload').length == 0 && ajaxUpload.uploading == 0) { + if (form.queue('upload').length == 0 && ajaxUpload.uploading == 0) { //所有文件上传完毕,更改状态 $('input:submit', form).removeAttr('disabled'); + $('#' + btnId).removeAttr("disabled"); + $('#' + btnId).val('确定') + $('#' + btnId).css('background-color', '#269ac9') + if(containerid == undefined ){ + var count = $('#attachments_fields>span').length; + $('#upload_file_count').html("" + count + "" + $(inputEl).data('fileCount')); + }else{ + var count = $('#attachments_fields' + containerid + '>span').length; + $('#upload_file_count'+containerid).html("" + count + "" + $(inputEl).data('fileCount')); + } + } - form.dequeue('upload'); + form.dequeue('upload');//上传完成一个就退出一个 }); //gcm files count and add delete_all link @@ -222,7 +225,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId) { $('#'+btnId).attr("disabled",true); $('#'+btnId).val('提交中'); $('#'+btnId).css('background-color','#c1c1c1') - $('#upload_file_count').html("" + count + "" + $(inputEl).data('lebelFileUploding')); + $('#upload_file_count').html("1" + $(inputEl).data('lebelFileUploding'));//目前肯定是穿一个文件 if (count >= 1) { var add_attachs = $('.add_attachment'); var delete_all = $('.remove_all'); @@ -239,7 +242,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId) { $('#'+btnId).attr("disabled",true); $('#'+btnId).val('提交中'); $('#'+btnId).css('background-color','#c1c1c1') - $('#upload_file_count' + containerid).html("" + count + "" + $(inputEl).data('lebelFileUploding')); + $('#upload_file_count' + containerid).html("1" + $(inputEl).data('lebelFileUploding'));//目前肯定是穿一个文件 if (count >= 1) { var add_attachs = $('.add_attachment').filter(function(index) { return $(this).data('containerid') == containerid; @@ -262,17 +265,25 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId) { //gcm } - + //在插入文件名的后边插入div var progressSpan = $('
          ').insertAfter(fileSpan.find('input.upload_filename')); - progressSpan.progressbar(); - fileSpan.addClass('ajax-waiting'); - - var maxSyncUpload = $(inputEl).data('max-concurrent-uploads'); - + progressSpan.progressbar(); //将div处理成progress bar + fileSpan.addClass('ajax-waiting'); //添加文件正在上传的状态 + var containerid = $(inputEl).data('containerid');//多个上传控件需要的容器id + if(containerid == undefined ){ //选择了多少个文件也要显示,因为有时候文件过大,一时半会传不完,但还是显示文件没有选择 + var count = $('#attachments_fields>span').length; + $('#upload_file_count').html("" + count + "" + '个文件被选择'); + }else{ + var count = $('#attachments_fields' + containerid + '>span').length; + $('#upload_file_count'+containerid).html("" + count + "" + '个文件被选择'); + } + //最大的同步上传参数 + var maxSyncUpload = 1 //$(inputEl).data('max-concurrent-uploads'); + //如果没有指定同步上传参数 或者参数不对,或者需要上传的文件已经小于同步上传的个数,那么直接上传 if (maxSyncUpload == null || maxSyncUpload <= 0 || ajaxUpload.uploading < maxSyncUpload) actualUpload(file, attachmentId, fileSpan, inputEl,btnId); - else - $(inputEl).parents('form').queue('upload', actualUpload.bind(this, file, attachmentId, fileSpan, inputEl)); + else //否则就进行队列上传 + $(inputEl).parents('form').queue('upload', actualUpload.bind(this, file, attachmentId, fileSpan, inputEl,btnId)); } ajaxUpload.uploading = 0; @@ -338,6 +349,10 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) { function addInputFiles(inputEl,btnId) { // var clearedFileInput = $(inputEl).clone().val(''); if (inputEl.files) { +// if(inputEl.files.length >= 5){ +// alert('一次选择的文件不能超过5个') +// return; +// } // upload files using ajax uploadAndAttachFiles(inputEl.files, inputEl,btnId); // $(inputEl).remove(); @@ -365,6 +380,10 @@ function addInputFiles_board(inputEl, id,btnId) { // var clearedFileInput = $(inputEl).clone().val(''); if (inputEl.files) { +// if(inputEl.files.length >= 5){ +// alert('一次选择的文件不能超过5个') +// return; +// } // upload files using ajax uploadAndAttachFiles_board(inputEl.files, inputEl, id,btnId); // $(inputEl).remove(); @@ -497,6 +516,10 @@ function addInputFilesCourseSource(inputEl) { btnId = arguments[2]; // var clearedFileInput = $(inputEl).clone().val(''); if (inputEl.files) { +// if(inputEl.files.length >= 5){ +// alert('一次选择的文件不能超过5个') +// return; +// } // upload files using ajax uploadAndAttachFilesCourseSource(inputEl.files, inputEl,checkBox,btnId); // $(inputEl).remove(); From ab868d7b65654746ae12ea2d848a8184b7a9eef6 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 12 Nov 2015 16:52:42 +0800 Subject: [PATCH 086/132] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BD=AE=E9=A1=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/news_controller.rb | 4 ++-- app/models/news.rb | 2 +- app/views/news/_course_form.html.erb | 4 ++++ app/views/news/_course_news_list.html.erb | 3 +++ app/views/news/_course_show.html.erb | 3 +++ app/views/users/_course_news.html.erb | 6 +++++- db/migrate/20151112072948_add_news_sticky.rb | 9 +++++++++ db/schema.rb | 3 ++- public/stylesheets/courses.css | 2 +- public/stylesheets/new_user.css | 1 + 10 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20151112072948_add_news_sticky.rb diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 5d83c1320..be2b44c06 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -74,10 +74,10 @@ class NewsController < ApplicationController @q = params[:subject] if params[:subject].nil? || params[:subject].blank? scope_order = scope.all(:include => [:author, :course], - :order => "#{News.table_name}.created_on DESC") + :order => "#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC") else scope_order = scope.where("#{News.table_name}.title like '#{'%' << params[:subject].to_s << '%'}'").all(:include => [:author, :course], - :order => "#{News.table_name}.created_on DESC") + :order => "#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC") end # :offset => @offset, diff --git a/app/models/news.rb b/app/models/news.rb index a9e9d1d18..e9b8b5314 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -66,7 +66,7 @@ class News < ActiveRecord::Base scope :course_visible, lambda {|*args| includes(:course).where(Course.allowed_to_condition(args.shift || User.current, :view_course_news, *args)) } - safe_attributes 'title', 'summary', 'description' + safe_attributes 'title', 'summary', 'description', 'sticky' def visible?(user=User.current) !user.nil? && user.allowed_to?(:view_news, project) diff --git a/app/views/news/_course_form.html.erb b/app/views/news/_course_form.html.erb index 0a5488714..a51b85870 100644 --- a/app/views/news/_course_form.html.erb +++ b/app/views/news/_course_form.html.erb @@ -4,6 +4,10 @@

          +
        • + <%= f.check_box :sticky, :value => is_new ? 0 : @news.sticky %> + <%= label_tag 'news_sticky', l(:label_board_sticky) %> +
        • <% if is_new %> <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> diff --git a/app/views/news/_course_news_list.html.erb b/app/views/news/_course_news_list.html.erb index 74a70e33d..3db222f25 100644 --- a/app/views/news/_course_news_list.html.erb +++ b/app/views/news/_course_news_list.html.erb @@ -13,6 +13,9 @@ <%= l(:label_release_news) %>: <%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %> + <% if news.sticky == 1%> + 置顶 + <% end%> <%=link_to "#{news.comments.all.count}".html_safe, news_path(news.id), :class => "pro_mes_w" %>
          diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index 2d8dae59d..34e6e943f 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -8,6 +8,9 @@

          <%=h @news.title %>

          + <% if @news.sticky == 1%> + 置顶 + <% end%> <%= link_to(l(:button_edit), edit_news_path(@news), :class => 'talk_edit fr') if User.current.allowed_to?(:manage_news, @course) %> diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index f9087f057..475a982e5 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -12,9 +12,13 @@ <% end %> TO <%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %>
        • -
          + + <% if activity.sticky == 1%> + 置顶 + <% end%> +
          发布时间:<%= format_time(activity.created_on) %>
          diff --git a/db/migrate/20151112072948_add_news_sticky.rb b/db/migrate/20151112072948_add_news_sticky.rb new file mode 100644 index 000000000..85001debe --- /dev/null +++ b/db/migrate/20151112072948_add_news_sticky.rb @@ -0,0 +1,9 @@ +class AddNewsSticky < ActiveRecord::Migration + def up + add_column :news, :sticky, :integer, :default => 0 + end + + def down + remove_column :news, :sticky + end +end diff --git a/db/schema.rb b/db/schema.rb index 7898b3f4d..419b30c3e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20151109080256) do +ActiveRecord::Schema.define(:version => 20151112072948) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -953,6 +953,7 @@ ActiveRecord::Schema.define(:version => 20151109080256) do t.datetime "created_on" t.integer "comments_count", :default => 0, :null => false t.integer "course_id" + t.integer "sticky", :default => 0 end add_index "news", ["author_id"], :name => "index_news_on_author_id" diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 0cb6e203f..05bba54f6 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -555,7 +555,6 @@ a:hover.st_add{ color:#ff8e15;} a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} -.r_txt_tit{width:510px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#09658c; font-size:14px;} blockquote {background: #e8e8e8;padding: 10px;margin-bottom: 5px;word-break: break-all;word-wrap: break-word;} .respond-form{display: none;margin: auto;clear: both;} @@ -987,6 +986,7 @@ a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-r .m_w505{max-width: 505px;} .m_w500{max-width: 500px;} .m_w530{max-width: 530px;} +.m_w600{max-width: 600px;} .ProResultTable{ color:#888888;} .T_C{ text-align:center;} .SearchIcon{background:url(../images/homepage_icon2.png) 676px -393px no-repeat; } diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index ea45fdbd0..490de9e08 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1082,6 +1082,7 @@ a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-r .m_w460{max-width: 460px;} .m_w505{max-width: 505px;} .m_w530{max-width: 530px;} +.m_w600{max-width: 600px;} .ProResultTable{ color:#888888;} .T_C{ text-align:center;} .SearchIcon{background:url(../images/homepage_icon2.png) 676px -393px no-repeat; } From 7751dc9081113b382d4d5fc6aa27f9873a9d3d04 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 12 Nov 2015 17:00:35 +0800 Subject: [PATCH 087/132] =?UTF-8?q?=E7=BB=84=E7=BB=87=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org.html.erb | 186 +++++------ app/views/org_document_comments/_new.html.erb | 79 ++--- .../organizations/_show_org_document.html.erb | 226 ++++++------- db/schema.rb | 310 ------------------ 4 files changed, 246 insertions(+), 555 deletions(-) diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index 88acb59f6..ef65bf8b2 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -1,93 +1,93 @@ -<% @nav_dispaly_project_label = 1 - @nav_dispaly_forum_label = 1 %> -<%#@nav_dispaly_project_label = 1 %> - - - - - <%= h html_title %> - - - <%= csrf_meta_tag %> - <%= favicon %> - <%= javascript_heads %> - <%= heads_for_theme %> - <%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','org' %> - <%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','org'%> - - <%= call_hook :view_layouts_base_html_head %> - - <%= yield :header_tags -%> - - - - - - -
          -
          -
          -
          -
          - - - - -
          组织id:<%= @organization.id %>
          - 配置 - -
          -
          - <%= link_to '文章', organization_org_document_comments_path(@organization) %> (  - <%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %> -  ) | 成员 ( <%= @organization.org_members.count %>  ) -
          -
          - -
          -
          - <%= render_flash_messages %> - <%= yield %> - <%= call_hook :view_layouts_base_content %> -
          -
          -
          -
          - - -
          - <%= render :partial => 'layouts/footer' %> -
          - - - +<% @nav_dispaly_project_label = 1 + @nav_dispaly_forum_label = 1 %> +<%#@nav_dispaly_project_label = 1 %> + + + + + <%= h html_title %> + + + <%= csrf_meta_tag %> + <%= favicon %> + <%= javascript_heads %> + <%= heads_for_theme %> + <%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','org' %> + <%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','org'%> + + <%= call_hook :view_layouts_base_html_head %> + + <%= yield :header_tags -%> + + + + + + +
          +
          +
          +
          +
          + + + + +
          组织id:<%= @organization.id %>
          + 配置 + +
          +
          + <%= link_to '文章', organization_org_document_comments_path(@organization) %> (  + <%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %> +  ) | 成员 ( <%= @organization.org_members.count %>  ) +
          +
          + +
          +
          + <%= render_flash_messages %> + <%= yield %> + <%= call_hook :view_layouts_base_content %> +
          +
          +
          +
          + + +
          + <%= render :partial => 'layouts/footer' %> +
          + + + diff --git a/app/views/org_document_comments/_new.html.erb b/app/views/org_document_comments/_new.html.erb index f47048bf9..91bcad2a9 100644 --- a/app/views/org_document_comments/_new.html.erb +++ b/app/views/org_document_comments/_new.html.erb @@ -1,40 +1,41 @@ -<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%> - -<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %> -
          -
          - -
          -
          - -
          +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%> + +<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %> +
          +
          + +
          +
          +
          + +
          <% end %> \ No newline at end of file diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index e9bd6698b..a9802bf66 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -1,114 +1,114 @@ -
          -
          -
          - <%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %> -
          -
          -
          - <%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %> - TO  <%= link_to document.organization.name, organization_path(document.organization) %> | 组织 -
          -
          <%= document.title %>
          -
          - 发帖时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
          - <% unless document.content.blank? %> -
          - <%= document.content.html_safe %> -
          - <% end %> -
          -
            -
          • -
              -
            • - <%= form_for('new_form',:url => {:controller => 'organizations',:action => 'set_homepage',:id => document.organization_id, :home_id => document.id},:method => "put",:remote => true) do |f|%> - 设为首页 - <% end %> -
            • -
            • 编辑文章
            • -
            • - <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',:remote => true, :class => 'postOptionLink' %> -
            • -
            -
          • -
          -
          -
          -
          -
          -<% comments_for_doc = document.children.reorder("created_at desc") %> -<% count = document.children.count() %> -
          -
          -
          回复(<%= count %>)
          - <% if count > 3 %> - - <% end %> -
          -
          -
            - <% reply_id = 0 %> - <% comments_for_doc.each do |comment| %> - <% reply_id += 1 %> -
          • -
            <%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_path(comment.creator_id) %>
            -
            -
            - <%= link_to User.find(comment.creator_id), user_path(comment.creator_id), :class => "newsBlue mr10 f14" %> - <%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %> -
            - <% unless comment.content.blank? %> -
            <%= comment.content.html_safe %>
            - <% end %> -
            -
            -
          • - <% end %> -
          -
          -
          -
          - <%=link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %> -
          -
          -
          - <%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id), :method => "post", :remote => true) do |f| %> - - - -
          - - -
          -

          - <% end %> -
          -
          -
          -
          -
          -
          -
          - - \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 6aaa08ec4..7c2722e75 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,11 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -<<<<<<< HEAD -ActiveRecord::Schema.define(:version => 20151102090519) do -======= ActiveRecord::Schema.define(:version => 20151110011003) do ->>>>>>> bf01994e4f47b468072cfd7affa885eb6476d577 create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -297,16 +293,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.boolean "diff_all" end - create_table "columns_priv", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "Db", :limit => 64, :default => "", :null => false - t.string "User", :limit => 16, :default => "", :null => false - t.string "Table_name", :limit => 64, :default => "", :null => false - t.string "Column_name", :limit => 64, :default => "", :null => false - t.timestamp "Timestamp", :null => false - t.string "Column_priv", :limit => 0, :default => "", :null => false - end - create_table "comments", :force => true do |t| t.string "commented_type", :limit => 30, :default => "", :null => false t.integer "commented_id", :default => 0, :null => false @@ -505,33 +491,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" - create_table "db", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "Db", :limit => 64, :default => "", :null => false - t.string "User", :limit => 16, :default => "", :null => false - t.string "Select_priv", :limit => 1, :default => "N", :null => false - t.string "Insert_priv", :limit => 1, :default => "N", :null => false - t.string "Update_priv", :limit => 1, :default => "N", :null => false - t.string "Delete_priv", :limit => 1, :default => "N", :null => false - t.string "Create_priv", :limit => 1, :default => "N", :null => false - t.string "Drop_priv", :limit => 1, :default => "N", :null => false - t.string "Grant_priv", :limit => 1, :default => "N", :null => false - t.string "References_priv", :limit => 1, :default => "N", :null => false - t.string "Index_priv", :limit => 1, :default => "N", :null => false - t.string "Alter_priv", :limit => 1, :default => "N", :null => false - t.string "Create_tmp_table_priv", :limit => 1, :default => "N", :null => false - t.string "Lock_tables_priv", :limit => 1, :default => "N", :null => false - t.string "Create_view_priv", :limit => 1, :default => "N", :null => false - t.string "Show_view_priv", :limit => 1, :default => "N", :null => false - t.string "Create_routine_priv", :limit => 1, :default => "N", :null => false - t.string "Alter_routine_priv", :limit => 1, :default => "N", :null => false - t.string "Execute_priv", :limit => 1, :default => "N", :null => false - t.string "Event_priv", :limit => 1, :default => "N", :null => false - t.string "Trigger_priv", :limit => 1, :default => "N", :null => false - end - - add_index "db", ["User"], :name => "User" - create_table "delayed_jobs", :force => true do |t| t.integer "priority", :default => 0, :null => false t.integer "attempts", :default => 0, :null => false @@ -613,31 +572,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" - create_table "event", :id => false, :force => true do |t| - t.string "db", :limit => 64, :default => "", :null => false - t.string "name", :limit => 64, :default => "", :null => false - t.binary "body", :limit => 2147483647, :null => false - t.string "definer", :limit => 77, :default => "", :null => false - t.datetime "execute_at" - t.integer "interval_value" - t.string "interval_field", :limit => 18 - t.timestamp "created", :null => false - t.timestamp "modified", :null => false - t.datetime "last_executed" - t.datetime "starts" - t.datetime "ends" - t.string "status", :limit => 18, :default => "ENABLED", :null => false - t.string "on_completion", :limit => 8, :default => "DROP", :null => false - t.string "sql_mode", :limit => 0, :default => "", :null => false - t.string "comment", :limit => 64, :default => "", :null => false - t.integer "originator", :null => false - t.string "time_zone", :limit => 64, :default => "SYSTEM", :null => false - t.string "character_set_client", :limit => 32 - t.string "collation_connection", :limit => 32 - t.string "db_collation", :limit => 32 - t.binary "body_utf8", :limit => 2147483647 - end - create_table "first_pages", :force => true do |t| t.string "web_title" t.string "title" @@ -689,21 +623,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.integer "locked" end - create_table "func", :primary_key => "name", :force => true do |t| - t.boolean "ret", :default => false, :null => false - t.string "dl", :limit => 128, :default => "", :null => false - t.string "type", :limit => 9, :null => false - end - - create_table "general_log", :id => false, :force => true do |t| - t.timestamp "event_time", :null => false - t.text "user_host", :limit => 16777215, :null => false - t.integer "thread_id", :null => false - t.integer "server_id", :null => false - t.string "command_type", :limit => 64, :null => false - t.text "argument", :limit => 16777215, :null => false - end - create_table "groups_users", :id => false, :force => true do |t| t.integer "group_id", :null => false t.integer "user_id", :null => false @@ -711,35 +630,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true - create_table "help_category", :primary_key => "help_category_id", :force => true do |t| - t.string "name", :limit => 64, :null => false - t.integer "parent_category_id", :limit => 2 - t.text "url", :null => false - end - - add_index "help_category", ["name"], :name => "name", :unique => true - - create_table "help_keyword", :primary_key => "help_keyword_id", :force => true do |t| - t.string "name", :limit => 64, :null => false - end - - add_index "help_keyword", ["name"], :name => "name", :unique => true - - create_table "help_relation", :id => false, :force => true do |t| - t.integer "help_topic_id", :null => false - t.integer "help_keyword_id", :null => false - end - - create_table "help_topic", :primary_key => "help_topic_id", :force => true do |t| - t.string "name", :limit => 64, :null => false - t.integer "help_category_id", :limit => 2, :null => false - t.text "description", :null => false - t.text "example", :null => false - t.text "url", :null => false - end - - add_index "help_topic", ["name"], :name => "name", :unique => true - create_table "homework_attaches", :force => true do |t| t.integer "bid_id" t.integer "user_id" @@ -825,29 +715,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.datetime "updated_at", :null => false end - create_table "host", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "Db", :limit => 64, :default => "", :null => false - t.string "Select_priv", :limit => 1, :default => "N", :null => false - t.string "Insert_priv", :limit => 1, :default => "N", :null => false - t.string "Update_priv", :limit => 1, :default => "N", :null => false - t.string "Delete_priv", :limit => 1, :default => "N", :null => false - t.string "Create_priv", :limit => 1, :default => "N", :null => false - t.string "Drop_priv", :limit => 1, :default => "N", :null => false - t.string "Grant_priv", :limit => 1, :default => "N", :null => false - t.string "References_priv", :limit => 1, :default => "N", :null => false - t.string "Index_priv", :limit => 1, :default => "N", :null => false - t.string "Alter_priv", :limit => 1, :default => "N", :null => false - t.string "Create_tmp_table_priv", :limit => 1, :default => "N", :null => false - t.string "Lock_tables_priv", :limit => 1, :default => "N", :null => false - t.string "Create_view_priv", :limit => 1, :default => "N", :null => false - t.string "Show_view_priv", :limit => 1, :default => "N", :null => false - t.string "Create_routine_priv", :limit => 1, :default => "N", :null => false - t.string "Alter_routine_priv", :limit => 1, :default => "N", :null => false - t.string "Execute_priv", :limit => 1, :default => "N", :null => false - t.string "Trigger_priv", :limit => 1, :default => "N", :null => false - end - create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1077,15 +944,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" add_index "messages", ["parent_id"], :name => "messages_parent_id" - create_table "ndb_binlog_index", :primary_key => "epoch", :force => true do |t| - t.integer "Position", :limit => 8, :null => false - t.string "File", :null => false - t.integer "inserts", :limit => 8, :null => false - t.integer "updates", :limit => 8, :null => false - t.integer "deletes", :limit => 8, :null => false - t.integer "schemaops", :limit => 8, :null => false - end - create_table "news", :force => true do |t| t.integer "project_id" t.string "title", :limit => 60, :default => "", :null => false @@ -1180,12 +1038,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.integer "project_id" end -<<<<<<< HEAD - create_table "org_members", :force => true do |t| - t.integer "user_id" - t.integer "organization_id" - t.string "role" -======= create_table "org_activities", :force => true do |t| t.integer "user_id" t.integer "org_act_id" @@ -1223,7 +1075,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.integer "organization_id" t.integer "project_id" t.datetime "created_at" ->>>>>>> bf01994e4f47b468072cfd7affa885eb6476d577 end create_table "organizations", :force => true do |t| @@ -1244,10 +1095,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.datetime "updated_at", :null => false end - create_table "plugin", :primary_key => "name", :force => true do |t| - t.string "dl", :limit => 128, :default => "", :null => false - end - create_table "poll_answers", :force => true do |t| t.integer "poll_question_id" t.text "answer_text" @@ -1323,42 +1170,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.datetime "updated_at", :null => false end - create_table "proc", :id => false, :force => true do |t| - t.string "db", :limit => 64, :default => "", :null => false - t.string "name", :limit => 64, :default => "", :null => false - t.string "type", :limit => 9, :null => false - t.string "specific_name", :limit => 64, :default => "", :null => false - t.string "language", :limit => 3, :default => "SQL", :null => false - t.string "sql_data_access", :limit => 17, :default => "CONTAINS_SQL", :null => false - t.string "is_deterministic", :limit => 3, :default => "NO", :null => false - t.string "security_type", :limit => 7, :default => "DEFINER", :null => false - t.binary "param_list", :null => false - t.binary "returns", :limit => 2147483647, :null => false - t.binary "body", :limit => 2147483647, :null => false - t.string "definer", :limit => 77, :default => "", :null => false - t.timestamp "created", :null => false - t.timestamp "modified", :null => false - t.string "sql_mode", :limit => 0, :default => "", :null => false - t.text "comment", :null => false - t.string "character_set_client", :limit => 32 - t.string "collation_connection", :limit => 32 - t.string "db_collation", :limit => 32 - t.binary "body_utf8", :limit => 2147483647 - end - - create_table "procs_priv", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "Db", :limit => 64, :default => "", :null => false - t.string "User", :limit => 16, :default => "", :null => false - t.string "Routine_name", :limit => 64, :default => "", :null => false - t.string "Routine_type", :limit => 9, :null => false - t.string "Grantor", :limit => 77, :default => "", :null => false - t.string "Proc_priv", :limit => 0, :default => "", :null => false - t.timestamp "Timestamp", :null => false - end - - add_index "procs_priv", ["Grantor"], :name => "Grantor" - create_table "project_infos", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1433,18 +1244,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" - create_table "proxies_priv", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "User", :limit => 16, :default => "", :null => false - t.string "Proxied_host", :limit => 60, :default => "", :null => false - t.string "Proxied_user", :limit => 16, :default => "", :null => false - t.boolean "With_grant", :default => false, :null => false - t.string "Grantor", :limit => 77, :default => "", :null => false - t.timestamp "Timestamp", :null => false - end - - add_index "proxies_priv", ["Grantor"], :name => "Grantor" - create_table "queries", :force => true do |t| t.integer "project_id" t.string "name", :default => "", :null => false @@ -1558,17 +1357,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.integer "is_teacher_score", :default => 0 end - create_table "servers", :primary_key => "Server_name", :force => true do |t| - t.string "Host", :limit => 64, :default => "", :null => false - t.string "Db", :limit => 64, :default => "", :null => false - t.string "Username", :limit => 64, :default => "", :null => false - t.string "Password", :limit => 64, :default => "", :null => false - t.integer "Port", :default => 0, :null => false - t.string "Socket", :limit => 64, :default => "", :null => false - t.string "Wrapper", :limit => 64, :default => "", :null => false - t.string "Owner", :limit => 64, :default => "", :null => false - end - create_table "settings", :force => true do |t| t.string "name", :default => "", :null => false t.text "value" @@ -1589,20 +1377,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.string "description" end - create_table "slow_log", :id => false, :force => true do |t| - t.timestamp "start_time", :null => false - t.text "user_host", :limit => 16777215, :null => false - t.time "query_time", :null => false - t.time "lock_time", :null => false - t.integer "rows_sent", :null => false - t.integer "rows_examined", :null => false - t.string "db", :limit => 512, :null => false - t.integer "last_insert_id", :null => false - t.integer "insert_id", :null => false - t.integer "server_id", :null => false - t.text "sql_text", :limit => 16777215, :null => false - end - create_table "softapplications", :force => true do |t| t.string "name" t.text "description" @@ -1684,19 +1458,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.string "subject" end - create_table "tables_priv", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "Db", :limit => 64, :default => "", :null => false - t.string "User", :limit => 16, :default => "", :null => false - t.string "Table_name", :limit => 64, :default => "", :null => false - t.string "Grantor", :limit => 77, :default => "", :null => false - t.timestamp "Timestamp", :null => false - t.string "Table_priv", :limit => 0, :default => "", :null => false - t.string "Column_priv", :limit => 0, :default => "", :null => false - end - - add_index "tables_priv", ["Grantor"], :name => "Grantor" - create_table "taggings", :force => true do |t| t.integer "tag_id" t.integer "taggable_id" @@ -1746,32 +1507,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "time_entries", ["project_id"], :name => "time_entries_project_id" add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" - create_table "time_zone", :primary_key => "Time_zone_id", :force => true do |t| - t.string "Use_leap_seconds", :limit => 1, :default => "N", :null => false - end - - create_table "time_zone_leap_second", :primary_key => "Transition_time", :force => true do |t| - t.integer "Correction", :null => false - end - - create_table "time_zone_name", :primary_key => "Name", :force => true do |t| - t.integer "Time_zone_id", :null => false - end - - create_table "time_zone_transition", :id => false, :force => true do |t| - t.integer "Time_zone_id", :null => false - t.integer "Transition_time", :limit => 8, :null => false - t.integer "Transition_type_id", :null => false - end - - create_table "time_zone_transition_type", :id => false, :force => true do |t| - t.integer "Time_zone_id", :null => false - t.integer "Transition_type_id", :null => false - t.integer "Offset", :default => 0, :null => false - t.integer "Is_DST", :limit => 1, :default => 0, :null => false - t.string "Abbreviation", :limit => 8, :default => "", :null => false - end - create_table "tokens", :force => true do |t| t.integer "user_id", :default => 0, :null => false t.string "action", :limit => 30, :default => "", :null => false @@ -1790,51 +1525,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.integer "fields_bits", :default => 0 end - create_table "user", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "User", :limit => 16, :default => "", :null => false - t.string "Password", :limit => 41, :default => "", :null => false - t.string "Select_priv", :limit => 1, :default => "N", :null => false - t.string "Insert_priv", :limit => 1, :default => "N", :null => false - t.string "Update_priv", :limit => 1, :default => "N", :null => false - t.string "Delete_priv", :limit => 1, :default => "N", :null => false - t.string "Create_priv", :limit => 1, :default => "N", :null => false - t.string "Drop_priv", :limit => 1, :default => "N", :null => false - t.string "Reload_priv", :limit => 1, :default => "N", :null => false - t.string "Shutdown_priv", :limit => 1, :default => "N", :null => false - t.string "Process_priv", :limit => 1, :default => "N", :null => false - t.string "File_priv", :limit => 1, :default => "N", :null => false - t.string "Grant_priv", :limit => 1, :default => "N", :null => false - t.string "References_priv", :limit => 1, :default => "N", :null => false - t.string "Index_priv", :limit => 1, :default => "N", :null => false - t.string "Alter_priv", :limit => 1, :default => "N", :null => false - t.string "Show_db_priv", :limit => 1, :default => "N", :null => false - t.string "Super_priv", :limit => 1, :default => "N", :null => false - t.string "Create_tmp_table_priv", :limit => 1, :default => "N", :null => false - t.string "Lock_tables_priv", :limit => 1, :default => "N", :null => false - t.string "Execute_priv", :limit => 1, :default => "N", :null => false - t.string "Repl_slave_priv", :limit => 1, :default => "N", :null => false - t.string "Repl_client_priv", :limit => 1, :default => "N", :null => false - t.string "Create_view_priv", :limit => 1, :default => "N", :null => false - t.string "Show_view_priv", :limit => 1, :default => "N", :null => false - t.string "Create_routine_priv", :limit => 1, :default => "N", :null => false - t.string "Alter_routine_priv", :limit => 1, :default => "N", :null => false - t.string "Create_user_priv", :limit => 1, :default => "N", :null => false - t.string "Event_priv", :limit => 1, :default => "N", :null => false - t.string "Trigger_priv", :limit => 1, :default => "N", :null => false - t.string "Create_tablespace_priv", :limit => 1, :default => "N", :null => false - t.string "ssl_type", :limit => 9, :default => "", :null => false - t.binary "ssl_cipher", :null => false - t.binary "x509_issuer", :null => false - t.binary "x509_subject", :null => false - t.integer "max_questions", :default => 0, :null => false - t.integer "max_updates", :default => 0, :null => false - t.integer "max_connections", :default => 0, :null => false - t.integer "max_user_connections", :default => 0, :null => false - t.string "plugin", :limit => 64, :default => "" - t.text "authentication_string" - end - create_table "user_activities", :force => true do |t| t.string "act_type" t.integer "act_id" From 21275e8b7bd25ab33793a3c990b4cd61b9a8226b Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 12 Nov 2015 17:52:47 +0800 Subject: [PATCH 088/132] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=BC=BA=E9=99=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org_document_comments_controller.rb | 6 ++- app/controllers/organizations_controller.rb | 19 ++++++-- app/models/principal.rb | 16 +++---- app/models/user.rb | 15 ++++++ app/views/org_document_comments/edit.html.erb | 43 ++++++++++++++++++ .../organizations/_show_org_document.html.erb | 4 +- app/views/organizations/setting.html.erb | 18 ++++---- public/images/org_default.jpg | Bin 0 -> 1897 bytes 8 files changed, 96 insertions(+), 25 deletions(-) create mode 100644 app/views/org_document_comments/edit.html.erb create mode 100644 public/images/org_default.jpg diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index d9ed0f1f5..60522dc3f 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -28,13 +28,15 @@ class OrgDocumentCommentsController < ApplicationController end def update @org_document = OrgDocumentComment.find(params[:id]) + @org_document.update_attributes(:title => params[:org_document_comment][:title], :content => params[:org_document_comment][:content]) respond_to do |format| - # format.html {redirect_to :} + format.html {redirect_to organization_org_document_comments_path(:organization_id => @org_document.organization.id)} end end def edit - + @org_document = OrgDocumentComment.find(params[:id]) + @organization = Organization.find(params[:organization_id]) end def add_reply diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index fbe3814a4..25d0783fb 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -25,10 +25,14 @@ class OrganizationsController < ApplicationController end def show - @organization = Organization.find(params[:id]) - @activities = OrgActivity.where('(org_act_id = ? and org_act_type = ?) || (container_id =? and org_act_type =? and org_act_id !=?)', - @organization.id, 'CreateOrganization ', @organization.id, 'OrgDocumentComment', @organization.home_id).order('updated_at desc') - @activities = paginateHelper @activities, 10 + if User.current.admin? || User.current.member_of_org?(@organization) + @organization = Organization.find(params[:id]) + @activities = OrgActivity.where('(org_act_id = ? and org_act_type = ?) || (container_id =? and org_act_type =? and org_act_id !=?)', + @organization.id, 'CreateOrganization ', @organization.id, 'OrgDocumentComment', @organization.home_id).order('updated_at desc') + @activities = paginateHelper @activities, 10 + else + render_403 + end end def update @@ -61,7 +65,12 @@ class OrganizationsController < ApplicationController end def setting - @organization = Organization.find(params[:id]) + @organization = Organization.find(params[:id]) + + if User.current.admin? || User.current.admin_of_org?(@organization) + else + render_403 + end end diff --git a/app/models/principal.rb b/app/models/principal.rb index fc9c7cac4..dd376f609 100644 --- a/app/models/principal.rb +++ b/app/models/principal.rb @@ -88,14 +88,14 @@ class Principal < ActiveRecord::Base } scope :not_member_of_org, lambda {|org| - orgs = [org] unless org.is_a?(Array) - if orgs.empty? - where("1=0") - else - ids = orgs.map(&:id) - where("#{Principal.table_name}.id NOT IN (SELECT DISTINCT user_id FROM #{OrgMember.table_name} WHERE organization_id IN (?))", ids) - end - } + orgs = [org] unless org.is_a?(Array) + if orgs.empty? + where("1=0") + else + ids = orgs.map(&:id) + where("#{Principal.table_name}.id NOT IN (SELECT DISTINCT user_id FROM #{OrgMember.table_name} WHERE organization_id IN (?))", ids) + end + } scope :sorted, lambda { order(*Principal.fields_for_order_statement)} diff --git a/app/models/user.rb b/app/models/user.rb index 4c6449863..740523707 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -770,6 +770,21 @@ class User < Principal courses.to_a.include?(course) end + def member_of_org?(org) + OrgMember.where("user_id =? and organization_id =?", self.id, org.id).count > 0 + end + + def admin_of_org?(org) + if OrgMember.where("user_id =? and organization_id =?", self.id, org.id).count == 0 + return false + end + role = OrgMember.where("user_id =? and organization_id =?", self.id, org.id)[0].roles[0] + unless role.nil? + role.name == 'orgManager' ? true : false + else + false + end + end def member_of_course_group?(course_group) course_groups.to_a.include?(course_group) end diff --git a/app/views/org_document_comments/edit.html.erb b/app/views/org_document_comments/edit.html.erb new file mode 100644 index 000000000..ffa05ff61 --- /dev/null +++ b/app/views/org_document_comments/edit.html.erb @@ -0,0 +1,43 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%> + +
          +
          编辑文章
          +
          +<%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id),:method => 'put', :id => 'new_org_document_form' do |f| %> +
          +
          + +
          +
          +
          +
          + <%= kindeditor_tag 'org_document_comment[content]',@org_document.content, :editor_id => 'org_document_description_editor', :height => "150px" %> +
          +
          + + +

          +
          + +
          + 确定 + + 取消 +
          +
          + +
          +
          +<% end %> \ No newline at end of file diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index e9bd6698b..6641ae23d 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -25,7 +25,9 @@ 设为首页 <% end %> -
        • 编辑文章
        • +
        • + <%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :class => "postOptionLink" %> +
        • <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',:remote => true, :class => 'postOptionLink' %>
        • diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index e203b5eed..78cd21504 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -38,7 +38,7 @@
          - + <%#= form_for( @organization,{:controller => 'organizations',:action => 'update',:id=>@organization,:html=>{:id=>'update_org_form',:method=>'put'}}) do %> <%= labelled_form_for @organization do |f|%> @@ -55,14 +55,14 @@
          -
          组织URL: -
          https:// - - .trustie.net申请 -

          - -
          -
          + + + + + + + +
          公开 : class="ml3" />
          diff --git a/public/images/org_default.jpg b/public/images/org_default.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ad1b4f007d0c6141a10715ce46f447630e3ce376 GIT binary patch literal 1897 zcmbVMdr%W+5WmYoMM0Bb02^w&UPJ^Xm&=PJ8X+Wsq6GvLL9G~)10p6DFNY-9VzFw` zYN=8jTkErfD5%6LP{vk}D)_)^3yRP2i8ETo(V|wdq?ZUjW*q8M%0Kjz(B62CpszgzXO`tatS-8MJ zm{GgliedsG3QUZ$TlI!KoPx9P9Fs+b+&|EWz$T*#nITOOCRjCiuIZyf5>G8moMtG@ zGboHm)FgPKU1>L4%{Zlp?dJIwo6@dAJm5-t?N*}*>@lJ8REXNm3a2Mbg*60;!%~4b z!XU&jSSAx-5~)mvjfX`-OoR&QR~CUulv0^e6bbhWLbH*^Y-Nfzwx5gsQz89H6%-T* z3d90}%t0}QLgB^`i6Ur=2%Ez~>Fp5~8-D;ni`xvO$x4|B3+zVJXA$|73ZWx?k%HNp zknj@tt<^G{-FbPeZBz>WDvY;U+on0JIGTdnhGpR#=lNgU8M=S&T%1EzEs9FS6C*q-h~;j3o&(?5VHP^cH@NRES9> zLa|QxB5%1gMjIm$V;ZqGRv{EikbYm||EU>D2ZOqs>r9%I)9zz+gxVu%ey0ln!Z zpO=)dGiz&hfep<$&O7nXmnQFvZC+RLTk)0CrALpCd%%n!degg(6frLE?P)^~f7-lp z_JXTLWFt{iUz5vSzy{eYw)+$AP|n+z(vt7JCO-9!pZ$1sO=6u6+^Ei)P^NmAxT1nU z28F;m9qS+Lsi~OZKP+evZ)tRGzpsD9>Xo%svJ2K9>l-FDs~4BIZ~gB5r^+Wo#GMyK zBWGq79y(C_MY;4sP>a{n^U8@W2kT^3kAk$HrLBpj-8q&$hNK zKAAMPXj?*DdHb);;{vkpjxf~J&7ECRGWf{WlZnIchuiz)wQn9e+i|}k z&Z8#oLcfssGt%O^RN&ljyIgs1+ry3E-Y&=8!wwp+8Z;}=IIFXOM}J&)Q- zuNJ1QYnTED2B+Qx9**Xa86B+Z&2u)Yw*PSb)K^f~ja5Bet8)G>W`5n(x4d!UL+MV% OokfMWGD?bF=l=tIZIm|v literal 0 HcmV?d00001 From 2c5cd1a4b33a39c8884b05d7ef5f3dd0d22c6e15 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 12 Nov 2015 18:14:56 +0800 Subject: [PATCH 089/132] =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=88=AA=E6=AD=A2=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E5=92=8C=E5=8F=91=E5=B8=83=E6=97=A5=E6=9C=9Flabel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_homework_form.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 6d929ac5f..0baf31ab2 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -17,11 +17,13 @@
          <%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%> +
          <%= calendar_for('homework_end_time')%>
          -
          + +
          <%= calendar_for('homework_publish_time')%>
          From 368d755499e5cb34cd8ad5c150c14e09a6e933fd Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 12 Nov 2015 18:41:10 +0800 Subject: [PATCH 090/132] =?UTF-8?q?=E6=94=B9=E4=B8=BA=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_member_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/_org_member_list.html.erb b/app/views/organizations/_org_member_list.html.erb index 23a31fab3..3a27965c0 100644 --- a/app/views/organizations/_org_member_list.html.erb +++ b/app/views/organizations/_org_member_list.html.erb @@ -13,7 +13,7 @@ <% if User.current.language == "zh" %> <% if role.id == 11 %> - + <% elsif role.id == 12 %> <% end %> From 6fd76eb62282eebde06546379dce68d76714842c Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 12 Nov 2015 19:02:00 +0800 Subject: [PATCH 091/132] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=88=90=E5=91=98?= =?UTF-8?q?=E8=A6=81=E5=81=9A=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_member_list.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/organizations/_org_member_list.html.erb b/app/views/organizations/_org_member_list.html.erb index 3a27965c0..fdaf9ff8d 100644 --- a/app/views/organizations/_org_member_list.html.erb +++ b/app/views/organizations/_org_member_list.html.erb @@ -37,7 +37,8 @@
        • <% if ( (User.current.id == member.organization.creator_id || member.roles[0].name == "orgManager" ) && member.user_id != member.organization.creator_id )%> - 编辑 | <%= link_to '删除', org_member_path(member.id),:method=>'delete', :remote => true %><% end %> + 编辑 | + <%= link_to '删除', org_member_path(member.id),:method=>'delete',:confirm=>'您确定要删除么?', :remote => true %><% end %>
        • From b24fadea05ce2082e29963c19be8381e3ddc61ca Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 12 Nov 2015 19:15:35 +0800 Subject: [PATCH 092/132] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=20=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE=E5=81=9A=E6=88=90?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=80=E6=A0=B7=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- .../organizations/_org_member_list.html.erb | 8 +- app/views/organizations/setting.html.erb | 1 - db/schema.rb | 357 ++---------------- public/stylesheets/org.css | 4 +- 5 files changed, 40 insertions(+), 332 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index dbf246141..ec2f52779 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -52,7 +52,7 @@ module ApplicationHelper def get_org_member_role_name member case member.roles[0].name when 'orgManager' - '组织管理员' + '管理人员' when 'orgMember' '组织成员' end diff --git a/app/views/organizations/_org_member_list.html.erb b/app/views/organizations/_org_member_list.html.erb index fdaf9ff8d..46403094f 100644 --- a/app/views/organizations/_org_member_list.html.erb +++ b/app/views/organizations/_org_member_list.html.erb @@ -1,7 +1,7 @@ <% members.each do |member|%>
          <% end %> -
        • <% if ( (User.current.id == member.organization.creator_id || member.roles[0].name == "orgManager" ) && member.user_id != member.organization.creator_id )%> - 编辑 | - <%= link_to '删除', org_member_path(member.id),:method=>'delete',:confirm=>'您确定要删除么?', :remote => true %><% end %> -
        • + 编辑 + <%= link_to '删除', org_member_path(member.id),:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %><% end %>
          <% end %> \ No newline at end of file diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 78cd21504..82b28fb8a 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -74,7 +74,6 @@
          • 用户
          • 角色
          • -
          diff --git a/db/schema.rb b/db/schema.rb index 90f58aa3c..1f48eaf02 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -293,16 +293,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.boolean "diff_all" end - create_table "columns_priv", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "Db", :limit => 64, :default => "", :null => false - t.string "User", :limit => 16, :default => "", :null => false - t.string "Table_name", :limit => 64, :default => "", :null => false - t.string "Column_name", :limit => 64, :default => "", :null => false - t.timestamp "Timestamp", :null => false - t.string "Column_priv", :limit => 0, :default => "", :null => false - end - create_table "comments", :force => true do |t| t.string "commented_type", :limit => 30, :default => "", :null => false t.integer "commented_id", :default => 0, :null => false @@ -501,33 +491,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" - create_table "db", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "Db", :limit => 64, :default => "", :null => false - t.string "User", :limit => 16, :default => "", :null => false - t.string "Select_priv", :limit => 1, :default => "N", :null => false - t.string "Insert_priv", :limit => 1, :default => "N", :null => false - t.string "Update_priv", :limit => 1, :default => "N", :null => false - t.string "Delete_priv", :limit => 1, :default => "N", :null => false - t.string "Create_priv", :limit => 1, :default => "N", :null => false - t.string "Drop_priv", :limit => 1, :default => "N", :null => false - t.string "Grant_priv", :limit => 1, :default => "N", :null => false - t.string "References_priv", :limit => 1, :default => "N", :null => false - t.string "Index_priv", :limit => 1, :default => "N", :null => false - t.string "Alter_priv", :limit => 1, :default => "N", :null => false - t.string "Create_tmp_table_priv", :limit => 1, :default => "N", :null => false - t.string "Lock_tables_priv", :limit => 1, :default => "N", :null => false - t.string "Create_view_priv", :limit => 1, :default => "N", :null => false - t.string "Show_view_priv", :limit => 1, :default => "N", :null => false - t.string "Create_routine_priv", :limit => 1, :default => "N", :null => false - t.string "Alter_routine_priv", :limit => 1, :default => "N", :null => false - t.string "Execute_priv", :limit => 1, :default => "N", :null => false - t.string "Event_priv", :limit => 1, :default => "N", :null => false - t.string "Trigger_priv", :limit => 1, :default => "N", :null => false - end - - add_index "db", ["User"], :name => "User" - create_table "delayed_jobs", :force => true do |t| t.integer "priority", :default => 0, :null => false t.integer "attempts", :default => 0, :null => false @@ -565,26 +528,23 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["project_id"], :name => "documents_project_id" - create_table "dts", :primary_key => "Num", :force => true do |t| - t.string "Defect", :limit => 50 - t.string "Category", :limit => 50 - t.string "File" - t.string "Method" - t.string "Module", :limit => 20 - t.string "Variable", :limit => 50 - t.integer "StartLine" - t.integer "IPLine" - t.string "IPLineCode", :limit => 200 - t.string "Judge", :limit => 15 - t.integer "Review", :limit => 1 + create_table "dts", :force => true do |t| + t.string "IPLineCode" t.string "Description" - t.text "PreConditions", :limit => 2147483647 - t.text "TraceInfo", :limit => 2147483647 - t.text "Code", :limit => 2147483647 + t.string "Num" + t.string "Variable" + t.string "TraceInfo" + t.string "Method" + t.string "File" + t.string "IPLine" + t.string "Review" + t.string "Category" + t.string "Defect" + t.string "PreConditions" + t.string "StartLine" t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "enabled_modules", :force => true do |t| @@ -609,31 +569,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" - create_table "event", :id => false, :force => true do |t| - t.string "db", :limit => 64, :default => "", :null => false - t.string "name", :limit => 64, :default => "", :null => false - t.binary "body", :limit => 2147483647, :null => false - t.string "definer", :limit => 77, :default => "", :null => false - t.datetime "execute_at" - t.integer "interval_value" - t.string "interval_field", :limit => 18 - t.timestamp "created", :null => false - t.timestamp "modified", :null => false - t.datetime "last_executed" - t.datetime "starts" - t.datetime "ends" - t.string "status", :limit => 18, :default => "ENABLED", :null => false - t.string "on_completion", :limit => 8, :default => "DROP", :null => false - t.string "sql_mode", :limit => 0, :default => "", :null => false - t.string "comment", :limit => 64, :default => "", :null => false - t.integer "originator", :null => false - t.string "time_zone", :limit => 64, :default => "SYSTEM", :null => false - t.string "character_set_client", :limit => 32 - t.string "collation_connection", :limit => 32 - t.string "db_collation", :limit => 32 - t.binary "body_utf8", :limit => 2147483647 - end - create_table "first_pages", :force => true do |t| t.string "web_title" t.string "title" @@ -685,21 +620,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.integer "locked" end - create_table "func", :primary_key => "name", :force => true do |t| - t.boolean "ret", :default => false, :null => false - t.string "dl", :limit => 128, :default => "", :null => false - t.string "type", :limit => 9, :null => false - end - - create_table "general_log", :id => false, :force => true do |t| - t.timestamp "event_time", :null => false - t.text "user_host", :limit => 16777215, :null => false - t.integer "thread_id", :null => false - t.integer "server_id", :null => false - t.string "command_type", :limit => 64, :null => false - t.text "argument", :limit => 16777215, :null => false - end - create_table "groups_users", :id => false, :force => true do |t| t.integer "group_id", :null => false t.integer "user_id", :null => false @@ -707,35 +627,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true - create_table "help_category", :primary_key => "help_category_id", :force => true do |t| - t.string "name", :limit => 64, :null => false - t.integer "parent_category_id", :limit => 2 - t.text "url", :null => false - end - - add_index "help_category", ["name"], :name => "name", :unique => true - - create_table "help_keyword", :primary_key => "help_keyword_id", :force => true do |t| - t.string "name", :limit => 64, :null => false - end - - add_index "help_keyword", ["name"], :name => "name", :unique => true - - create_table "help_relation", :id => false, :force => true do |t| - t.integer "help_topic_id", :null => false - t.integer "help_keyword_id", :null => false - end - - create_table "help_topic", :primary_key => "help_topic_id", :force => true do |t| - t.string "name", :limit => 64, :null => false - t.integer "help_category_id", :limit => 2, :null => false - t.text "description", :null => false - t.text "example", :null => false - t.text "url", :null => false - end - - add_index "help_topic", ["name"], :name => "name", :unique => true - create_table "homework_attaches", :force => true do |t| t.integer "bid_id" t.integer "user_id" @@ -758,12 +649,13 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.text "description" t.date "publish_time" t.date "end_time" - t.integer "homework_type", :default => 1 + t.integer "homework_type", :default => 1 t.string "late_penalty" t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "teacher_priority", :default => 1 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "teacher_priority", :default => 1 + t.integer "anonymous_comment", :default => 0 end create_table "homework_detail_manuals", :force => true do |t| @@ -820,29 +712,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.datetime "updated_at", :null => false end - create_table "host", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "Db", :limit => 64, :default => "", :null => false - t.string "Select_priv", :limit => 1, :default => "N", :null => false - t.string "Insert_priv", :limit => 1, :default => "N", :null => false - t.string "Update_priv", :limit => 1, :default => "N", :null => false - t.string "Delete_priv", :limit => 1, :default => "N", :null => false - t.string "Create_priv", :limit => 1, :default => "N", :null => false - t.string "Drop_priv", :limit => 1, :default => "N", :null => false - t.string "Grant_priv", :limit => 1, :default => "N", :null => false - t.string "References_priv", :limit => 1, :default => "N", :null => false - t.string "Index_priv", :limit => 1, :default => "N", :null => false - t.string "Alter_priv", :limit => 1, :default => "N", :null => false - t.string "Create_tmp_table_priv", :limit => 1, :default => "N", :null => false - t.string "Lock_tables_priv", :limit => 1, :default => "N", :null => false - t.string "Create_view_priv", :limit => 1, :default => "N", :null => false - t.string "Show_view_priv", :limit => 1, :default => "N", :null => false - t.string "Create_routine_priv", :limit => 1, :default => "N", :null => false - t.string "Alter_routine_priv", :limit => 1, :default => "N", :null => false - t.string "Execute_priv", :limit => 1, :default => "N", :null => false - t.string "Trigger_priv", :limit => 1, :default => "N", :null => false - end - create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -945,6 +814,16 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_details_copy", :force => true do |t| + t.integer "journal_id", :default => 0, :null => false + t.string "property", :limit => 30, :default => "", :null => false + t.string "prop_key", :limit => 30, :default => "", :null => false + t.text "old_value" + t.text "value" + end + + add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" @@ -1072,15 +951,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" add_index "messages", ["parent_id"], :name => "messages_parent_id" - create_table "ndb_binlog_index", :primary_key => "epoch", :force => true do |t| - t.integer "Position", :limit => 8, :null => false - t.string "File", :null => false - t.integer "inserts", :limit => 8, :null => false - t.integer "updates", :limit => 8, :null => false - t.integer "deletes", :limit => 8, :null => false - t.integer "schemaops", :limit => 8, :null => false - end - create_table "news", :force => true do |t| t.integer "project_id" t.string "title", :limit => 60, :default => "", :null => false @@ -1204,8 +1074,10 @@ ActiveRecord::Schema.define(:version => 20151110011003) do end create_table "org_members", :force => true do |t| - t.integer "user_id" - t.integer "organization_id" + t.integer "user_id" + t.integer "organization_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "org_projects", :force => true do |t| @@ -1232,10 +1104,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.datetime "updated_at", :null => false end - create_table "plugin", :primary_key => "name", :force => true do |t| - t.string "dl", :limit => 128, :default => "", :null => false - end - create_table "poll_answers", :force => true do |t| t.integer "poll_question_id" t.text "answer_text" @@ -1311,42 +1179,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.datetime "updated_at", :null => false end - create_table "proc", :id => false, :force => true do |t| - t.string "db", :limit => 64, :default => "", :null => false - t.string "name", :limit => 64, :default => "", :null => false - t.string "type", :limit => 9, :null => false - t.string "specific_name", :limit => 64, :default => "", :null => false - t.string "language", :limit => 3, :default => "SQL", :null => false - t.string "sql_data_access", :limit => 17, :default => "CONTAINS_SQL", :null => false - t.string "is_deterministic", :limit => 3, :default => "NO", :null => false - t.string "security_type", :limit => 7, :default => "DEFINER", :null => false - t.binary "param_list", :null => false - t.binary "returns", :limit => 2147483647, :null => false - t.binary "body", :limit => 2147483647, :null => false - t.string "definer", :limit => 77, :default => "", :null => false - t.timestamp "created", :null => false - t.timestamp "modified", :null => false - t.string "sql_mode", :limit => 0, :default => "", :null => false - t.text "comment", :null => false - t.string "character_set_client", :limit => 32 - t.string "collation_connection", :limit => 32 - t.string "db_collation", :limit => 32 - t.binary "body_utf8", :limit => 2147483647 - end - - create_table "procs_priv", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "Db", :limit => 64, :default => "", :null => false - t.string "User", :limit => 16, :default => "", :null => false - t.string "Routine_name", :limit => 64, :default => "", :null => false - t.string "Routine_type", :limit => 9, :null => false - t.string "Grantor", :limit => 77, :default => "", :null => false - t.string "Proc_priv", :limit => 0, :default => "", :null => false - t.timestamp "Timestamp", :null => false - end - - add_index "procs_priv", ["Grantor"], :name => "Grantor" - create_table "project_infos", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1421,18 +1253,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" - create_table "proxies_priv", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "User", :limit => 16, :default => "", :null => false - t.string "Proxied_host", :limit => 60, :default => "", :null => false - t.string "Proxied_user", :limit => 16, :default => "", :null => false - t.boolean "With_grant", :default => false, :null => false - t.string "Grantor", :limit => 77, :default => "", :null => false - t.timestamp "Timestamp", :null => false - end - - add_index "proxies_priv", ["Grantor"], :name => "Grantor" - create_table "queries", :force => true do |t| t.integer "project_id" t.string "name", :default => "", :null => false @@ -1546,17 +1366,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.integer "is_teacher_score", :default => 0 end - create_table "servers", :primary_key => "Server_name", :force => true do |t| - t.string "Host", :limit => 64, :default => "", :null => false - t.string "Db", :limit => 64, :default => "", :null => false - t.string "Username", :limit => 64, :default => "", :null => false - t.string "Password", :limit => 64, :default => "", :null => false - t.integer "Port", :default => 0, :null => false - t.string "Socket", :limit => 64, :default => "", :null => false - t.string "Wrapper", :limit => 64, :default => "", :null => false - t.string "Owner", :limit => 64, :default => "", :null => false - end - create_table "settings", :force => true do |t| t.string "name", :default => "", :null => false t.text "value" @@ -1577,20 +1386,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.string "description" end - create_table "slow_log", :id => false, :force => true do |t| - t.timestamp "start_time", :null => false - t.text "user_host", :limit => 16777215, :null => false - t.time "query_time", :null => false - t.time "lock_time", :null => false - t.integer "rows_sent", :null => false - t.integer "rows_examined", :null => false - t.string "db", :limit => 512, :null => false - t.integer "last_insert_id", :null => false - t.integer "insert_id", :null => false - t.integer "server_id", :null => false - t.text "sql_text", :limit => 16777215, :null => false - end - create_table "softapplications", :force => true do |t| t.string "name" t.text "description" @@ -1672,19 +1467,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.string "subject" end - create_table "tables_priv", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "Db", :limit => 64, :default => "", :null => false - t.string "User", :limit => 16, :default => "", :null => false - t.string "Table_name", :limit => 64, :default => "", :null => false - t.string "Grantor", :limit => 77, :default => "", :null => false - t.timestamp "Timestamp", :null => false - t.string "Table_priv", :limit => 0, :default => "", :null => false - t.string "Column_priv", :limit => 0, :default => "", :null => false - end - - add_index "tables_priv", ["Grantor"], :name => "Grantor" - create_table "taggings", :force => true do |t| t.integer "tag_id" t.integer "taggable_id" @@ -1734,32 +1516,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do add_index "time_entries", ["project_id"], :name => "time_entries_project_id" add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" - create_table "time_zone", :primary_key => "Time_zone_id", :force => true do |t| - t.string "Use_leap_seconds", :limit => 1, :default => "N", :null => false - end - - create_table "time_zone_leap_second", :primary_key => "Transition_time", :force => true do |t| - t.integer "Correction", :null => false - end - - create_table "time_zone_name", :primary_key => "Name", :force => true do |t| - t.integer "Time_zone_id", :null => false - end - - create_table "time_zone_transition", :id => false, :force => true do |t| - t.integer "Time_zone_id", :null => false - t.integer "Transition_time", :limit => 8, :null => false - t.integer "Transition_type_id", :null => false - end - - create_table "time_zone_transition_type", :id => false, :force => true do |t| - t.integer "Time_zone_id", :null => false - t.integer "Transition_type_id", :null => false - t.integer "Offset", :default => 0, :null => false - t.integer "Is_DST", :limit => 1, :default => 0, :null => false - t.string "Abbreviation", :limit => 8, :default => "", :null => false - end - create_table "tokens", :force => true do |t| t.integer "user_id", :default => 0, :null => false t.string "action", :limit => 30, :default => "", :null => false @@ -1778,51 +1534,6 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.integer "fields_bits", :default => 0 end - create_table "user", :id => false, :force => true do |t| - t.string "Host", :limit => 60, :default => "", :null => false - t.string "User", :limit => 16, :default => "", :null => false - t.string "Password", :limit => 41, :default => "", :null => false - t.string "Select_priv", :limit => 1, :default => "N", :null => false - t.string "Insert_priv", :limit => 1, :default => "N", :null => false - t.string "Update_priv", :limit => 1, :default => "N", :null => false - t.string "Delete_priv", :limit => 1, :default => "N", :null => false - t.string "Create_priv", :limit => 1, :default => "N", :null => false - t.string "Drop_priv", :limit => 1, :default => "N", :null => false - t.string "Reload_priv", :limit => 1, :default => "N", :null => false - t.string "Shutdown_priv", :limit => 1, :default => "N", :null => false - t.string "Process_priv", :limit => 1, :default => "N", :null => false - t.string "File_priv", :limit => 1, :default => "N", :null => false - t.string "Grant_priv", :limit => 1, :default => "N", :null => false - t.string "References_priv", :limit => 1, :default => "N", :null => false - t.string "Index_priv", :limit => 1, :default => "N", :null => false - t.string "Alter_priv", :limit => 1, :default => "N", :null => false - t.string "Show_db_priv", :limit => 1, :default => "N", :null => false - t.string "Super_priv", :limit => 1, :default => "N", :null => false - t.string "Create_tmp_table_priv", :limit => 1, :default => "N", :null => false - t.string "Lock_tables_priv", :limit => 1, :default => "N", :null => false - t.string "Execute_priv", :limit => 1, :default => "N", :null => false - t.string "Repl_slave_priv", :limit => 1, :default => "N", :null => false - t.string "Repl_client_priv", :limit => 1, :default => "N", :null => false - t.string "Create_view_priv", :limit => 1, :default => "N", :null => false - t.string "Show_view_priv", :limit => 1, :default => "N", :null => false - t.string "Create_routine_priv", :limit => 1, :default => "N", :null => false - t.string "Alter_routine_priv", :limit => 1, :default => "N", :null => false - t.string "Create_user_priv", :limit => 1, :default => "N", :null => false - t.string "Event_priv", :limit => 1, :default => "N", :null => false - t.string "Trigger_priv", :limit => 1, :default => "N", :null => false - t.string "Create_tablespace_priv", :limit => 1, :default => "N", :null => false - t.string "ssl_type", :limit => 9, :default => "", :null => false - t.binary "ssl_cipher", :null => false - t.binary "x509_issuer", :null => false - t.binary "x509_subject", :null => false - t.integer "max_questions", :default => 0, :null => false - t.integer "max_updates", :default => 0, :null => false - t.integer "max_connections", :default => 0, :null => false - t.integer "max_user_connections", :default => 0, :null => false - t.string "plugin", :limit => 64, :default => "" - t.text "authentication_string" - end - create_table "user_activities", :force => true do |t| t.string "act_type" t.integer "act_id" diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 3857b53e2..46083ea08 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -20,8 +20,8 @@ a.saveBtn {padding:3px 5px; background-color:#269ac9; color:#ffffff;} a.saveBtn:hover {background-color:#297fb8;} .orgMemberList {width:410px; float:left;} .orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px;} -.orgListUser {width:125px; float:left;} -.orgListRole {width:285px; float:left;} +.orgListUser {width:119px; float:left;} +.orgListRole {width:180px; float:left;} .orgMemContainer {width:278px;} .orgMemberAdd {float:right; width:240px;} .orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;} From c2e783d78b73363c50fec4763dde37346607b475 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 12 Nov 2015 19:19:01 +0800 Subject: [PATCH 093/132] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=20=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE=E5=81=9A=E6=88=90?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=80=E6=A0=B7=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_member_list.html.erb | 4 ++-- public/stylesheets/org.css | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/organizations/_org_member_list.html.erb b/app/views/organizations/_org_member_list.html.erb index 46403094f..dcbd98451 100644 --- a/app/views/organizations/_org_member_list.html.erb +++ b/app/views/organizations/_org_member_list.html.erb @@ -25,10 +25,10 @@ <% end %> <%= hidden_field_tag 'membership[role_ids][]', '' %> diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 46083ea08..9b44be938 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -32,6 +32,8 @@ a.saveBtn:hover {background-color:#297fb8;} padding: 2px 5px; border: 1px solid #EAEAEA;} +a.org_member_btn{ padding:1px 5px; background:#15bccf; color:#fff;} + /*项目关联css*/ .relateOrg {width:335px;} .relatedList {width:335px;} From df0051cdd4ba33c98a88ab5838b0cb02a9e0cd0c Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 12 Nov 2015 19:26:39 +0800 Subject: [PATCH 094/132] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=20=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE=E5=81=9A=E6=88=90?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=80=E6=A0=B7=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_member_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/_org_member_list.html.erb b/app/views/organizations/_org_member_list.html.erb index dcbd98451..0ac43d12e 100644 --- a/app/views/organizations/_org_member_list.html.erb +++ b/app/views/organizations/_org_member_list.html.erb @@ -36,7 +36,7 @@ <% if ( (User.current.id == member.organization.creator_id || member.roles[0].name == "orgManager" ) && member.user_id != member.organization.creator_id )%> - 编辑 + 编辑 <%= link_to '删除', org_member_path(member.id),:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %><% end %>
          From f1b61c1581010fd3646575827316b3eb25f02897 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 12 Nov 2015 19:32:15 +0800 Subject: [PATCH 095/132] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=BF=BB=E9=A1=B5?= =?UTF-8?q?=E5=90=8E=E5=B0=86=E4=B8=A2=E5=A4=B1=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_member/org_member_autocomplete.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/org_member/org_member_autocomplete.js.erb b/app/views/org_member/org_member_autocomplete.js.erb index b1672038a..05cf3947c 100644 --- a/app/views/org_member/org_member_autocomplete.js.erb +++ b/app/views/org_member/org_member_autocomplete.js.erb @@ -1,5 +1,5 @@ <% if @org%> - var checked = $("#not_org_members input:checked").size(); + var checked = $("#principals_for_new_member input:checked").size(); if(checked > 0) { alert('翻页或搜索后将丢失当前选择的用户数据!'); From e265047ba96e1a81617fa4241d09fac393a47955 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 12 Nov 2015 19:37:28 +0800 Subject: [PATCH 096/132] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=88=90=E5=91=98?= =?UTF-8?q?=E7=BF=BB=E9=A1=B5=E9=9D=A0=E5=8F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/org_member_helper.rb | 2 +- app/helpers/organizations_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/org_member_helper.rb b/app/helpers/org_member_helper.rb index 08313f4e9..fd70a0516 100644 --- a/app/helpers/org_member_helper.rb +++ b/app/helpers/org_member_helper.rb @@ -11,6 +11,6 @@ module OrgMemberHelper links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options| link_to text, org_member_autocomplete_org_member_index_path(parameters.merge(:q => params[:q],:flag => true,:org=> org, :format => 'js')), :remote => true } - s + content_tag('ul', links,:class => 'wlist', :id => "org_member_pagination_links" ) + s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" ) end end diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 33d5dea6e..55a7a5d42 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -14,7 +14,7 @@ module OrganizationsHelper links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options| link_to text, org_member_autocomplete_org_member_index_path( parameters.merge(:q => params[:q],:flag => true,:org=>org, :format => 'js')), :remote => true } - s + content_tag('ul', links,:class => 'wlist', :id => "org_member_pagination_links" ) + s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" ) end end From 99637924b4ce69e17a052285ddd33f3446c7b7cf Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 12 Nov 2015 19:52:46 +0800 Subject: [PATCH 097/132] =?UTF-8?q?=E6=96=87=E7=AB=A0=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E9=99=90=E5=88=B6=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_document_comments/_new.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/org_document_comments/_new.html.erb b/app/views/org_document_comments/_new.html.erb index 91bcad2a9..b7a9b3a0f 100644 --- a/app/views/org_document_comments/_new.html.erb +++ b/app/views/org_document_comments/_new.html.erb @@ -15,7 +15,7 @@ <%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %>
          - +
          From b3a234cfc6086290ae591a7d7755fcd3c608a1db Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 12 Nov 2015 19:56:39 +0800 Subject: [PATCH 098/132] =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E4=B9=9F=E9=9C=80=E8=A6=81=E5=AF=B9=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E9=99=90=E5=88=B6=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_document_comments/edit.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/org_document_comments/edit.html.erb b/app/views/org_document_comments/edit.html.erb index ffa05ff61..ffb04a4f9 100644 --- a/app/views/org_document_comments/edit.html.erb +++ b/app/views/org_document_comments/edit.html.erb @@ -18,7 +18,7 @@ <%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id),:method => 'put', :id => 'new_org_document_form' do |f| %>
          - +
          From 6ec27761fbaa280a4a97234702249c6b8fa40fe8 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 12 Nov 2015 20:57:41 +0800 Subject: [PATCH 099/132] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=8F=8A=E7=BC=BA=E9=99=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 9 +++- app/models/org_member.rb | 1 + app/models/user.rb | 1 + app/views/layouts/_logined_header.html.erb | 3 ++ app/views/layouts/base_org.html.erb | 9 ++-- app/views/org_document_comments/_new.html.erb | 14 +++++- app/views/organizations/_org_members.html.erb | 26 +++++++++++ .../organizations/_show_org_document.html.erb | 44 ++++++++++--------- app/views/organizations/check_uniq.js.erb | 32 ++++++++------ app/views/organizations/members.html.erb | 1 + app/views/organizations/new.html.erb | 4 +- config/routes.rb | 1 + 12 files changed, 102 insertions(+), 43 deletions(-) create mode 100644 app/views/organizations/_org_members.html.erb create mode 100644 app/views/organizations/members.html.erb diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 25d0783fb..0356bd48c 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -1,6 +1,6 @@ # encoding: utf-8 class OrganizationsController < ApplicationController - before_filter :find_organization, :only => [:show] + before_filter :find_organization, :only => [:show, :members] layout 'base_org' def index @@ -25,7 +25,7 @@ class OrganizationsController < ApplicationController end def show - if User.current.admin? || User.current.member_of_org?(@organization) + if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) @organization = Organization.find(params[:id]) @activities = OrgActivity.where('(org_act_id = ? and org_act_type = ?) || (container_id =? and org_act_type =? and org_act_id !=?)', @organization.id, 'CreateOrganization ', @organization.id, 'OrgDocumentComment', @organization.home_id).order('updated_at desc') @@ -50,6 +50,7 @@ class OrganizationsController < ApplicationController def check_uniq @check = false; + @org_name = params[:org_name].strip @config_page = params[:config_page] sameName = @config_page ? Organization.where('name = ? and id != ?',params[:org_name],params[:org_id].to_i).count == 0 : Organization.where('name = ?',params[:org_name]).count == 0 if sameName == true @@ -91,4 +92,8 @@ class OrganizationsController < ApplicationController format.js end end + + def members + @members = OrgMember.where("organization_id =?", @organization.id) + end end diff --git a/app/models/org_member.rb b/app/models/org_member.rb index 091c20f22..a1c61f99d 100644 --- a/app/models/org_member.rb +++ b/app/models/org_member.rb @@ -1,6 +1,7 @@ class OrgMember < ActiveRecord::Base attr_accessible :organization_id, :role, :user_id belongs_to :organization + belongs_to :user has_many :roles ,:through => :org_member_roles,:foreign_key => 'role_id' has_many :org_member_roles,:dependent => :destroy diff --git a/app/models/user.rb b/app/models/user.rb index 740523707..79175f42e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -97,6 +97,7 @@ class User < Principal has_many :org_document_comments, :dependent =>:destroy has_one :api_token, :class_name => 'Token', :conditions => "action='api'" belongs_to :auth_source + has_many :org_members belongs_to :ucourse, :class_name => 'Course', :foreign_key => :id #huang ## added by xianbo for delete # has_many :biding_projects, :dependent => :destroy diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index c750ff3b5..ffda9c559 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -86,6 +86,9 @@
        • <%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
        • +
        • + <%= link_to "新建组织", new_organization_path, :class => "menuGrey"%> +
        • <%= link_to "退出",signout_path,:class => "menuGrey",:method => "post"%> diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index ef65bf8b2..6209ad260 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -55,13 +55,16 @@
          - <%= link_to '文章', organization_org_document_comments_path(@organization) %> (  + <%= link_to '文章', organization_org_document_comments_path(@organization) %> ( <%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %> -  ) | 成员 ( <%= @organization.org_members.count %>  ) + ) |  + <%= link_to '成员', members_organization_path(@organization.id ) %> (<%= @organization.org_members.count %> )
        • - +
          + <%= link_to "动态",organization_path(@organization), :class => "homepageMenuText" %> +
            diff --git a/app/views/org_document_comments/_new.html.erb b/app/views/org_document_comments/_new.html.erb index 91bcad2a9..6c4934f1b 100644 --- a/app/views/org_document_comments/_new.html.erb +++ b/app/views/org_document_comments/_new.html.erb @@ -1,14 +1,24 @@ <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%> @@ -30,7 +40,7 @@
            - 确定 + 确定 取消
            diff --git a/app/views/organizations/_org_members.html.erb b/app/views/organizations/_org_members.html.erb new file mode 100644 index 000000000..8f80b2997 --- /dev/null +++ b/app/views/organizations/_org_members.html.erb @@ -0,0 +1,26 @@ +<%= stylesheet_link_tag 'courses' %> +
            +

            组织成员

            +
            +
            +
            +
            + + <% members.each do |member| %> +
            + + <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %> + + <%= l(:label_username)%> + <%= link_to(member.user.show_name, user_path(member.user),:class => "ml10 c_blue02") %> + <%= member.user.admin_of_org?(organization)?"组织管理员":"组织成员" %> +
            +
            + <% end%> + +
              + <%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> +
            +
            +
            +
            \ No newline at end of file diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index 72b7e00dc..21e16549c 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -16,28 +16,32 @@ <%= document.content.html_safe %>
            <% end %> -
            -
              -
            • -
                -
              • - <%= form_for('new_form',:url => {:controller => 'organizations',:action => 'set_homepage',:id => document.organization_id, :home_id => document.id},:method => "put",:remote => true) do |f|%> - 设为首页 - <% end %> -
              • -
              • - <%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :class => "postOptionLink" %> -
              • -
              • - <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',:remote => true, :class => 'postOptionLink' %> + <% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id) || User.current.id == document.creator_id) %> +
                +
                  +
                • +
                    +
                  • + <%= form_for('new_form',:url => {:controller => 'organizations',:action => 'set_homepage',:id => document.organization_id, :home_id => document.id},:method => "put",:remote => true) do |f|%> + 设为首页 + <% end %> +
                  • +
                  • + <%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :class => "postOptionLink" %> +
                  • +
                  • + <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete', + :data => {:confirm => l(:text_are_you_sure)}, + :remote => true, :class => 'postOptionLink' %> +
                  • +
                -
              • -
              -
            -
          -
          -
          +
          +
          +
          +
          + <% end %> <% comments_for_doc = document.children.reorder("created_at desc") %> <% count = document.children.count() %> diff --git a/app/views/organizations/check_uniq.js.erb b/app/views/organizations/check_uniq.js.erb index 2d295c4d1..f38578025 100644 --- a/app/views/organizations/check_uniq.js.erb +++ b/app/views/organizations/check_uniq.js.erb @@ -1,18 +1,22 @@ -<%if @check == false %> - $checkName = false - <% if @config_page%> - $("#check_name_hint").html('名字不能重复').show(); - <% else%> - $("#organization_name_notice").html('名字不能重复').show(); +<% if !@org_name.blank? %> + <%if @check == false %> + $checkName = false + <% if @config_page%> + $("#check_name_hint").html('名字不能重复').show(); + <% else%> + $("#organization_name_notice").html('名字不能重复').show(); - <%end%> + <%end%> -<% else %> - $checkName = true; - <% if @config_page%> - $("#check_name_hint").html('名字可以使用').show(); - <% else%> + <% else %> + $checkName = true; + <% if @config_page%> + $("#check_name_hint").html('名字可以使用').show(); + <% else%> - $("#organization_name_notice").html('名字可以使用').show(); + $("#organization_name_notice").html('名字可以使用').show(); + <%end%> <%end%> -<%end%> \ No newline at end of file +<% else %> +$("#check_name_hint").html('名字不能为空').show(); +<% end %> \ No newline at end of file diff --git a/app/views/organizations/members.html.erb b/app/views/organizations/members.html.erb new file mode 100644 index 000000000..91e80b232 --- /dev/null +++ b/app/views/organizations/members.html.erb @@ -0,0 +1 @@ +<%= render :partial => 'org_members', :locals => {:members => @members, :organization => @organization} %> \ No newline at end of file diff --git a/app/views/organizations/new.html.erb b/app/views/organizations/new.html.erb index 2496ac133..08311d51b 100644 --- a/app/views/organizations/new.html.erb +++ b/app/views/organizations/new.html.erb @@ -48,8 +48,8 @@ <%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %>
          @@ -42,7 +48,7 @@
          确定 - 取消 + 取消
          diff --git a/app/views/org_member/create.js.erb b/app/views/org_member/create.js.erb index 868dd32b6..f1e48281f 100644 --- a/app/views/org_member/create.js.erb +++ b/app/views/org_member/create.js.erb @@ -3,4 +3,5 @@ <% else %> $("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>'); $("#principals_for_new_member").html(''); + $("#org_members_count_id").html("<%= @org.org_members.count %>"); <% end %> \ No newline at end of file diff --git a/app/views/org_member/destroy.js.erb b/app/views/org_member/destroy.js.erb index 8bd949fde..d87e62c17 100644 --- a/app/views/org_member/destroy.js.erb +++ b/app/views/org_member/destroy.js.erb @@ -1 +1,3 @@ +$("#org_members_count_id").html(""); +$("#org_members_count_id").html("<%= @org.org_members.count %>") $("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>'); \ No newline at end of file diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index 21e16549c..03e72263b 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -6,7 +6,12 @@
          <%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %> - TO  <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> | 组织 + TO  <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> | + <% if defined?(home_id) %> + 首页 + <% else %> + 组织 + <% end %>
          <%= document.title %>
          @@ -16,6 +21,9 @@ <%= document.content.html_safe %>
          <% end %> + <% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id) || User.current.id == document.creator_id) %>
            diff --git a/app/views/organizations/set_homepage.js.erb b/app/views/organizations/set_homepage.js.erb index bcebe9d37..b25c4c4d4 100644 --- a/app/views/organizations/set_homepage.js.erb +++ b/app/views/organizations/set_homepage.js.erb @@ -1 +1,2 @@ -location.reload(); \ No newline at end of file +//location.reload(); +window.location.href ='<%= organization_path(@org)%>' \ No newline at end of file diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index 2f3610abc..5f1d0e003 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -12,25 +12,29 @@ .homepagePostReplyInputContainer .ke-inline-block {display: none;} .homepagePostReplyInputContainer .ke-container {float: left;} -<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 %> - - <%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id)} %> - <% end %>
            最新动态
            -
              +
            + +<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 %> + +
            + <%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %> +
            +<% end %> + <% unless @activities.nil? %> <% @activities.each do |act| %> <% if act.org_act_type == 'CreateOrganization' %> @@ -51,11 +55,12 @@ <% if act.org_act_type == 'OrgDocumentComment' %> - <%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %> +
            + <%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %> +
            <% end %> <% end %>
              diff --git a/config/routes.rb b/config/routes.rb index 0cefe29b0..b7acc3bfa 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -87,9 +87,9 @@ RedmineApp::Application.routes.draw do resources :apply_project_masters delete 'apply_project_masters', :to => 'apply_project_masters#delete' - resources :organization, :except => [:show] do - - end + # resources :organization, :except => [:show] do + # + # end resources :school, :except => [:show] do collection do From 465bc9bd6c64d52eb6c5f0f70361df353874da20 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 13 Nov 2015 15:04:50 +0800 Subject: [PATCH 106/132] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=92=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=9A=84=E6=97=B6=E5=80=99=E6=95=B0=E6=8D=AE=E8=81=94?= =?UTF-8?q?=E5=8A=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_resource_create.js.erb | 2 +- app/views/users/user_resource_delete.js.erb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/users/user_resource_create.js.erb b/app/views/users/user_resource_create.js.erb index 2d6c4f4d8..f69057273 100644 --- a/app/views/users/user_resource_create.js.erb +++ b/app/views/users/user_resource_create.js.erb @@ -2,6 +2,6 @@ closeModal(); $("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>'); //这里不能将翻页的更新 -$("#res_all_count").html(parseInt($("#res_all_count").html())+1); +$("#res_all_count").html('<%= @atta_count%>'); $("#res_count").html(0); $("#checkboxAll").attr('checked',false); \ No newline at end of file diff --git a/app/views/users/user_resource_delete.js.erb b/app/views/users/user_resource_delete.js.erb index a956ed212..e16abf28d 100644 --- a/app/views/users/user_resource_delete.js.erb +++ b/app/views/users/user_resource_delete.js.erb @@ -1,2 +1,5 @@ $("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>'); -$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); \ No newline at end of file +$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); +$("#res_all_count").html('<%= @atta_count%>') +$("#res_count").html(0); +$("#checkboxAll").attr('checked',false); \ No newline at end of file From 78ebeaee3b98cdd4074da3c6934c11ec0c89c2a9 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 13 Nov 2015 15:38:16 +0800 Subject: [PATCH 107/132] =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_resource.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/user_resource.html.erb b/app/views/users/user_resource.html.erb index 3bd114e7c..4fd4d0cb9 100644 --- a/app/views/users/user_resource.html.erb +++ b/app/views/users/user_resource.html.erb @@ -288,7 +288,7 @@ function batch_delete(){ var data = $("#resources_list_form").serialize(); if($("input[type=checkbox][data-deleteble=N]:checked").length != 0){ - alert("含有上传者不是您的资源"); + alert("您只能删除自己上传的资源,请重新选择后再删除。"); return; } if(data != "" && confirm('确认要删除这些资源吗?')) { From 183f019c048737ef8c8757912ec4418d6b95ca3b Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 13 Nov 2015 15:55:29 +0800 Subject: [PATCH 108/132] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org.html.erb | 2 +- app/views/organizations/_org_members.html.erb | 53 ++++++++++--------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index 55fd13e7d..8e004d4cb 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -69,7 +69,7 @@ <%= link_to '文章', organization_org_document_comments_path(@organization) %> ( <%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %> ) |  - <%= link_to '成员', members_organization_path(@organization.id) %> (<%= link_to @organization.org_members.count, members_organization_path(@organization.id), :id => 'org_members_count_id' %>) + <%= link_to '成员', members_organization_path(@organization.id) %> (<%= link_to @organization.org_members.count, members_organization_path(@organization.id), :id => 'org_members_count_id', :class => "linkBlue" %>)
          diff --git a/app/views/organizations/_org_members.html.erb b/app/views/organizations/_org_members.html.erb index 8f80b2997..8719ad275 100644 --- a/app/views/organizations/_org_members.html.erb +++ b/app/views/organizations/_org_members.html.erb @@ -1,26 +1,29 @@ -<%= stylesheet_link_tag 'courses' %> -
          -

          组织成员

          -
          -
          -
          -
          - - <% members.each do |member| %> -
          - - <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %> - - <%= l(:label_username)%> - <%= link_to(member.user.show_name, user_path(member.user),:class => "ml10 c_blue02") %> - <%= member.user.admin_of_org?(organization)?"组织管理员":"组织成员" %> -
          -
          - <% end%> - -
            - <%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> -
          -
          -
          +<%= stylesheet_link_tag 'courses' %> +
          +
          +

          组织成员

          +
          +
          +
          + 加入时间 +
          + + <% members.each do |member| %> +
          + + <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %> + + <%= l(:label_username)%> + <%= link_to(member.user.show_name, user_path(member.user),:class => "ml5 c_blue02") %>
          + 身份:<%= member.user.admin_of_org?(organization)?"组织管理员":"组织成员" %> +
          +
          + <% end%> + +
            + <%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> +
          +
          +
          +
          \ No newline at end of file From 3451ced8881ec2374f1e82f869a2bb1e81337503 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 13 Nov 2015 16:34:00 +0800 Subject: [PATCH 109/132] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=91=E7=9A=84?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E9=A1=B5=E9=9D=A2=E5=8F=8A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 8 +++++ app/views/layouts/_logined_header.html.erb | 3 ++ app/views/layouts/base_org.html.erb | 22 ++++++------ .../organizations/_show_org_document.html.erb | 2 +- app/views/users/user_organizations.html.erb | 35 +++++++++++++++++++ config/routes.rb | 3 +- public/stylesheets/org.css | 8 ++++- 7 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 app/views/users/user_organizations.html.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0d9588d24..273d48ccf 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1910,6 +1910,14 @@ class UsersController < ApplicationController end end + def user_organizations + @user = User.current + @orgs = @user.organizations + respond_to do |format| + format.html {render :layout => 'static_base'} + end + end + private def find_user diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index ffda9c559..6e62e2d5e 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -86,6 +86,9 @@
        • <%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
        • +
        • + <%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%> +
        • <%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>
        • diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index 55fd13e7d..39a6e4fb4 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -76,17 +76,17 @@
          <%= link_to "动态",organization_path(@organization), :class => "homepageMenuText" %>
          - - + + + + + + + + + + +
          diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index 03e72263b..f1c633320 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -15,7 +15,7 @@
          <%= document.title %>
          - 发帖时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
          + 发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
          <% unless document.content.blank? %>
          <%= document.content.html_safe %> diff --git a/app/views/users/user_organizations.html.erb b/app/views/users/user_organizations.html.erb new file mode 100644 index 000000000..855dc9c95 --- /dev/null +++ b/app/views/users/user_organizations.html.erb @@ -0,0 +1,35 @@ +<%= stylesheet_link_tag 'pleft','header','new_user','repository','org' %> +<%#= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','org' %> +
          +
          +
          +
          + 组织列表 + +
          + + +
          +
          +
          + <% @orgs.each do |org| %> +
          +
          + <%= link_to image_tag(url_to_avatar(org), :width => '78', :height => '78', :alt => '组织logo'), :class => "linkGrey2" %> +
          +
          +
          + <%= link_to org.name, organization_path(org), :class => 'f16 linkBlue' %> +
          +
          <%= org.description %>
          +
          创建者:<%= link_to User.find(org.creator_id), user_path(org.creator_id), :class => 'linkGrey2', :target => '_blank' %>
          + +
          您的身份:<%= User.current.admin_of_org?(org) ? "组织管理员" : "组织成员" %>
          +
          + +
          +
          + <% end %> +
          +
          +
          \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index b7acc3bfa..1ea62752b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -439,6 +439,7 @@ RedmineApp::Application.routes.draw do post 'import_resources_to_homework' get 'dealwith_apply_request' get 'store_selected_resource' + get 'user_organizations' # end end #resources :blogs @@ -485,7 +486,7 @@ RedmineApp::Application.routes.draw do ################# added by william match 'users/tag_save', :via => :post, :as => 'tag' match 'users/tag_saveEx', :via => [:get, :post] - + #get 'users/:id/user_organizations', :to => 'users#user_organizations', :as => 'user_organizations' post 'watchers/watch', :to => 'watchers#watch', :as => 'watch' delete 'watchers/watch', :to => 'watchers#unwatch' get 'watchers/new', :to => 'watchers#new' diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 9b44be938..c8116003e 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -43,4 +43,10 @@ a.cancelBtn:hover {background-color:#717171; color:#ffffff;} .relatedList ul li {border-bottom:1px solid #e4e4e4; width:320px; height:22px; vertical-align:middle; line-height:22px;} .relatedListName {width:240px; text-align:left; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;} .relatedListOption {width:80px; text-align:center;} -.relateOrgName {width:240px; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;color:#656565;} \ No newline at end of file +.relateOrgName {width:240px; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;color:#656565;} + +/*组织列表*/ +.mt28 {margin-top:28px;} +.orgWrap {width:880px; float:left;} +.orgTitle {width:880px; max-width:880px; margin-bottom:5px;word-break: break-all; word-wrap:break-word; } +.orgIntro {width:880px; max-width:880px; margin-bottom:6px; color:#484848;} \ No newline at end of file From 022c656db6225733fc2da13e237f1c9f7b1212cf Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 13 Nov 2015 17:19:17 +0800 Subject: [PATCH 110/132] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=BB=84=E7=BB=87=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/org_projects_controller.rb | 13 ++++++++++++ app/controllers/projects_controller.rb | 8 ++++---- app/views/org_projects/destroy.js.erb | 20 ++++++++++++++++++- .../projects/settings/_added_orgs.html.erb | 2 +- app/views/users/user_organizations.html.erb | 2 +- 5 files changed, 38 insertions(+), 7 deletions(-) diff --git a/app/controllers/org_projects_controller.rb b/app/controllers/org_projects_controller.rb index e11005b4a..733df95b7 100644 --- a/app/controllers/org_projects_controller.rb +++ b/app/controllers/org_projects_controller.rb @@ -14,5 +14,18 @@ class OrgProjectsController < ApplicationController @project = Project.find(params[:project_id]) @org_project = OrgProject.find(params[:id]) @org_project.destroy + + condition = '%%' + project_org_ids = OrgProject.find_by_sql("select distinct organization_id from org_projects where project_id = #{params[:project_id]}").map(&:organization_id) + if project_org_ids.empty? + @orgs_not_in_project = Organization.where("(is_public or creator_id =?) = 1 and name like ?",User.current.id, condition).page( 1).per(10) + @org_count = Organization.where("is_public = 1 or creator_id =?", User.current.id).where("name like ?", condition).count + else + project_org_ids = "(" + project_org_ids.join(',') + ")" + @orgs_not_in_project = Organization.where("id not in #{project_org_ids} and (is_public = 1 or creator_id =?) and name like ?", User.current.id, condition).page( 1).per(10) + @org_count = Organization.where("id not in #{project_org_ids} and (is_public = 1 or creator_id =?)", User.current.id).where("name like ?", condition).count + end + # @project_count = Project.project_entities.visible.like(params[:name]).page(params[:page]).count + @orgs_page = Paginator.new @org_count, 10,1 end end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 5e6a584c8..0077bc378 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -77,12 +77,12 @@ class ProjectsController < ApplicationController end project_org_ids = OrgProject.find_by_sql("select distinct organization_id from org_projects where project_id = #{params[:id]}").map(&:organization_id) if project_org_ids.empty? - @orgs_not_in_project = Organization.where("is_public = 1").where("name like ?", condition).page((params[:page].to_i || 1)).per(10) - @org_count = Organization.where("is_public = 1").where("name like ?", condition).count + @orgs_not_in_project = Organization.where("(is_public or creator_id =?) = 1 and name like ?",User.current.id, condition).page((params[:page].to_i || 1)).per(10) + @org_count = Organization.where("is_public = 1 or creator_id =?", User.current.id).where("name like ?", condition).count else project_org_ids = "(" + project_org_ids.join(',') + ")" - @orgs_not_in_project = Organization.where("id not in #{project_org_ids} and is_public = 1").where("name like ?", condition).page((params[:page].to_i || 1)).per(10) - @org_count = Organization.where("id not in #{project_org_ids} and is_public = 1").where("name like ?", condition).count + @orgs_not_in_project = Organization.where("id not in #{project_org_ids} and (is_public = 1 or creator_id =?) and name like ?", User.current.id, condition).page((params[:page].to_i || 1)).per(10) + @org_count = Organization.where("id not in #{project_org_ids} and (is_public = 1 or creator_id =?)", User.current.id).where("name like ?", condition).count end # @project_count = Project.project_entities.visible.like(params[:name]).page(params[:page]).count @orgs_page = Paginator.new @org_count, 10,params[:page] diff --git a/app/views/org_projects/destroy.js.erb b/app/views/org_projects/destroy.js.erb index 45a014b23..49ea1dc33 100644 --- a/app/views/org_projects/destroy.js.erb +++ b/app/views/org_projects/destroy.js.erb @@ -1,4 +1,22 @@ +//$("#search_orgs_result_list").html(""); +////$("#paginator").css("display", "none"); $("#added_orgs").html(""); +$("#added_orgs").html('<%= escape_javascript(render :partial => "projects/settings/added_orgs", :locals => {:orgs => @project.organizations, :project_id => @project.id}) %>') +//$.ajax({ +// url: '<%#= url_for(:controller => 'projects', :action => 'search_public_orgs_not_in_project') %>'+'?page=1', +// type:'get' +//}); $("#search_orgs_result_list").html(""); +$("#search_orgs_result_list").append('
            '); +<% @orgs_not_in_project.each do |org|%> +link = "
          • "; +$("#search_orgs_result_list").append(link ); +<%end %> +$("#search_orgs_result_list").append('
          ') +<% if @org_count > 10 %> +$("#paginator").html(' <%= pagination_links_full @orgs_page, @org_count ,:per_page_links => true,:remote =>true,:flag=>true%>'); +$("#paginator").css("display", "block"); +<% else %> $("#paginator").css("display", "none"); -$("#added_orgs").html('<%= escape_javascript(render :partial => "projects/settings/added_orgs", :locals => {:orgs => @project.organizations, :project_id => @project.id}) %>') \ No newline at end of file +<% end %> + diff --git a/app/views/projects/settings/_added_orgs.html.erb b/app/views/projects/settings/_added_orgs.html.erb index 06d3ae439..d07ead277 100644 --- a/app/views/projects/settings/_added_orgs.html.erb +++ b/app/views/projects/settings/_added_orgs.html.erb @@ -1,7 +1,7 @@
          • 名称操作
          • <% orgs.each do |org| %> -
          • <%= org.name %> +
          • <%= org.name %> <%= link_to "取消关联", org_project_path(:id => OrgProject.where(:organization_id => org.id, :project_id => project_id).first.id, :project_id => project_id), :method => 'delete',:remote => true, :class => "relatedListOption fl linkGrey3" %>
          • diff --git a/app/views/users/user_organizations.html.erb b/app/views/users/user_organizations.html.erb index 855dc9c95..ec66358f5 100644 --- a/app/views/users/user_organizations.html.erb +++ b/app/views/users/user_organizations.html.erb @@ -15,7 +15,7 @@ <% @orgs.each do |org| %>
            - <%= link_to image_tag(url_to_avatar(org), :width => '78', :height => '78', :alt => '组织logo'), :class => "linkGrey2" %> + <%= link_to image_tag(url_to_avatar(org), :width => '78', :height => '78', :alt => '组织logo'), organization_path(org), :class => "linkGrey2" %>
            From a40e5c5b54cc416db6d5ed4bd33b8395a5b6b0cc Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 Nov 2015 17:30:14 +0800 Subject: [PATCH 111/132] =?UTF-8?q?frok=E5=8A=9F=E8=83=BD=E5=BC=80?= =?UTF-8?q?=E5=8F=91--=E6=9D=83=E9=99=90=E8=BF=98=E6=9C=AA=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 70 +++++++++++++++++++- app/helpers/repositories_helper.rb | 12 ++++ app/models/repository.rb | 10 ++- app/views/repositories/_breadcrumbs.html.erb | 4 +- app/views/repositories/fork.html.erb | 0 app/views/repositories/forked.html.erb | 10 +++ app/views/repositories/show.html.erb | 2 +- config/routes.rb | 2 + 8 files changed, 103 insertions(+), 7 deletions(-) delete mode 100644 app/views/repositories/fork.html.erb create mode 100644 app/views/repositories/forked.html.erb diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 1f252cc24..82f469259 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -31,10 +31,10 @@ class RepositoriesController < ApplicationController default_search_scope :changesets before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo] - before_filter :find_repository, :only => [:edit, :update, :destroy, :committers] + before_filter :find_repository, :only => [:edit, :update, :destroy, :committers, :forked] before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo,:to_gitlab] before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue] - before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab] + before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked] accept_rss_auth :revisions # hidden repositories filter // 隐藏代码过滤器 before_filter :check_hidden_repo, :only => [:show, :stats, :revisions, :revision, :diff ] @@ -63,6 +63,72 @@ class RepositoriesController < ApplicationController end + def forked + # REDO: 那些人有权限forked项目 + # g = Gitlab.client + # gproject = g.post ("/projects/fork/#{@project.gpid}") + if gproject + copy_project(@project, gproject) + end + # render :layout => 'base_projects' + end + + # copy a project for fork + def copy_project(project, gproject) + project = Project.new + project.name = @project.name + project.is_public = @project.is_public + project.status = @project.status + project.hidden_repo = @project.hidden_repo + project.user_id = User.current.id + project.project_type = 0 + project.project_new_type = @project.project_new_type + project.gpid = gproject.id + if project.save + r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first + m = Member.new(:user => User.current, :roles => [r]) + project_info = ProjectInfo.new(:user_id => User.current.id, :project_id => project.id) + user_grades = UserGrade.create(:user_id => User.current.id, :project_id => project.id) + Rails.logger.debug "UserGrade created: #{user_grades.to_json}" + project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0, :project_type => @project.project_type,:grade => 0) + Rails.logger.debug "ProjectStatus created: #{project_status.to_json}" + project.members << m + project.project_infos << project_info + repository = Repository.create(:project_id => project.id, :url =>'ddd222', :type => 'Repository::Gitlab', :identifier => 'ddd222', :is_default => true) + copy_repository(project, gproject) + respond_to do |format| + format.html { + flash[:notice] = l(:notice_successful_create) + if params[:continue] + attrs = {:parent_id => project.parent_id}.reject {|k,v| v.nil?} + redirect_to new_project_url(attrs, :course => '0') + else + redirect_to settings_project_url(project) + end + } + format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => project.id) } + format.js + end + else + respond_to do |format| + format.html { render :action => 'forked', :layout => 'base_projects'} + format.api { render_validation_errors(@project) } + end + end + end + + def copy_repository(project, gproject) + # 避免 + if is_sigle_identifier?(project.owner, gproject.name) + + end + repository = Repository.factory('Git') + repository.project_id = project.id + repository.type = 'Repository::Gitlab' + repository.url = gproject.name + repository.identifier = gproject.name + repository = repository.save + end def newrepo scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index f32bef51b..05403114d 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -27,6 +27,18 @@ module RepositoriesHelper REPO_IP_ADDRESS = Setting.host_repository REPO_GITLAB_ADDRESS = "git.trustie.net" + # 某个成员不能拥有同名版本库,不同的成员可以创建同名版本库 + def is_sigle_identifier?(user, iden) + projects = Project.where("user_id =?",user) + identifiers = [] + projects.each do |project| + # 只针对gitlab类型的,git类型的后期清掉 + repository = Repository.where("project_id =? and type =?", project.id, "Repository::Gitlab").first + identifiers << repository.identifier + end + identifiers + end + def format_revision(revision) if revision.respond_to? :format_identifier revision.format_identifier diff --git a/app/models/repository.rb b/app/models/repository.rb index 94b7905c6..f50f37f31 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -40,7 +40,8 @@ class Repository < ActiveRecord::Base validates_length_of :identifier, :maximum => IDENTIFIER_MAX_LENGTH, :allow_blank => true validates_presence_of :identifier#, :unless => Proc.new { |r| r.is_default? || r.set_as_default? } #validates_uniqueness_of :identifier, :scope => :project_id, :allow_blank => true - validates_uniqueness_of :identifier, :allow_blank => true + # 改成同一用户不能有两个相同名字的版本库 + # validates_uniqueness_of :identifier, :allow_blank => true validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph) # donwcase letters, digits, dashes, underscores but not digits only validates_format_of :identifier, :with => /^[a-z0-9_\-]+$/, :allow_blank => true @@ -52,7 +53,8 @@ class Repository < ActiveRecord::Base 'password', 'path_encoding', 'log_encoding', - 'is_default' + 'is_default', + 'type' safe_attributes 'url', :if => lambda {|repository, user| repository.new_record?} @@ -63,6 +65,10 @@ class Repository < ActiveRecord::Base end def repo_create_validation + # 之所以可以这样改,是因为Fork的时候不需要从Trustie创建版本库,只需从Gitlab关联即可 + if self.class.name.demodulize == "Repository" + return + end unless Setting.enabled_scm.include?(self.class.name.demodulize) errors.add(:type, :invalid) end diff --git a/app/views/repositories/_breadcrumbs.html.erb b/app/views/repositories/_breadcrumbs.html.erb index 84111afeb..2c675cc1e 100644 --- a/app/views/repositories/_breadcrumbs.html.erb +++ b/app/views/repositories/_breadcrumbs.html.erb @@ -1,12 +1,12 @@
            + <%=link_to @project.owner, user_path(@project.owner), :class => "repository-title-dec" %> + / <%= link_to @repository.identifier.present? ? h(@repository.identifier) : 'root', {:action => 'show', :id => @project, :repository_id => @repository.identifier_param, :path => nil, :rev => @rev }, :class => "repository-title-dec" %> - / - <%=link_to @project.owner, user_path(@project.owner), :class => "repository-title-dec" %>
            diff --git a/app/views/repositories/fork.html.erb b/app/views/repositories/fork.html.erb deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/views/repositories/forked.html.erb b/app/views/repositories/forked.html.erb new file mode 100644 index 000000000..2860b9898 --- /dev/null +++ b/app/views/repositories/forked.html.erb @@ -0,0 +1,10 @@ +
            +

            <%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>

            +
            +<%= form_for('forked',:url => {:controller => 'repositories', :action => 'forked'},:method => "post") do |f| %> + + +<% end %> +<%= @project.id %> +<%= @repository.id %> +<%= User.current %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 9601e5188..f210add24 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -25,7 +25,7 @@ -
            Fork 0
            +
            <% if @changesets && !@changesets.empty? %> diff --git a/config/routes.rb b/config/routes.rb index 6cf872180..6d754ffaf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -551,6 +551,7 @@ RedmineApp::Application.routes.draw do # get 'create', :via=>[:get, :post] end end + match 'wiki/index', :via => :get resources :wiki, :except => [:index, :new, :create], :as => 'wiki_page' do member do @@ -647,6 +648,7 @@ RedmineApp::Application.routes.draw do get 'projects/:id/repository/changes(/*path(.:ext))', :to => 'repositories#changes' + get 'projects/:id/repository/forked', :to => 'repositories#forked' get 'projects/:id/repository/revisions', :to => 'repositories#revisions' get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision' get 'projects/:id/repository/revision', :to => 'repositories#revision' From 82541cae1c01e88a39f196419034672a5ab0b0a4 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 13 Nov 2015 17:57:32 +0800 Subject: [PATCH 112/132] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=97=B6=E5=8E=BB=E6=8E=89=E5=8F=91=E5=B8=83=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E5=92=8C=E6=88=AA=E6=AD=A2=E6=97=A5=E6=9C=9F=E7=9A=84label?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_homework_form.html.erb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 0baf31ab2..efaed2d9d 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -17,12 +17,16 @@
            <%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%> - -
            + <% if edit_mode %> + + <% end %> +
            <%= calendar_for('homework_end_time')%>
            - + <% if edit_mode %> + + <% end %>
            <%= calendar_for('homework_publish_time')%> From ca770f2727b77a31e7531e2572a8a8085b91b245 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 13 Nov 2015 18:16:41 +0800 Subject: [PATCH 113/132] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=9A=84=E6=8F=90=E7=A4=BA=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/new.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/new.html.erb b/app/views/organizations/new.html.erb index 08311d51b..1ab3ad933 100644 --- a/app/views/organizations/new.html.erb +++ b/app/views/organizations/new.html.erb @@ -31,7 +31,7 @@
          • - (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。) + (打钩为公开,不打钩则不公开,若不公开,仅组织成员可见该组织。)
          • From e905489157df9de2c5cc8011905dfc2a8330be4f Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 13 Nov 2015 18:23:20 +0800 Subject: [PATCH 114/132] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A2=AB=E5=89=AA?= =?UTF-8?q?=E5=88=87=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 3bf109f37..be178607f 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -581,7 +581,10 @@ } }); - + //查询学校 + $("input[name='province']").on('input', function (e) { + throttle(shcool_search_fn,window,e); + }); function throttle(method,context,e){ clearTimeout(method.tId); @@ -603,10 +606,7 @@ type: 'post', success: function (data) { schoolsResult = data.schools; - count = data.count; //查询学校 - $("input[name='province']").on('input', function (e) { - throttle(shcool_search_fn,window,e); - }); + count = data.count; maxPage = Math.ceil(count/100) //最大页码值 if(schoolsResult.length != undefined && schoolsResult.length != 0) { var i = 0; From a5a413eda018b9231c86d67b5b26c934fdece9a1 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 13 Nov 2015 19:46:04 +0800 Subject: [PATCH 115/132] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=9F=A5=E8=AF=A2sql?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 0352d80f2..5f823ee3d 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -27,8 +27,9 @@ class OrganizationsController < ApplicationController def show if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) @organization = Organization.find(params[:id]) - @activities = OrgActivity.where('(org_act_id = ? and org_act_type = ?) || (container_id =? and org_act_type =? and org_act_id !=?)', - @organization.id, 'CreateOrganization ', @organization.id, 'OrgDocumentComment', @organization.home_id).order('updated_at desc') + @activities = OrgActivity.where('container_id =? and container_type =? ', + @organization.id, 'Organization ').order('updated_at desc') + @activities = paginateHelper @activities, 10 else render_403 From 4471b6c4856b9fa6a4a9c380f733873cd94819f5 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 13 Nov 2015 20:14:02 +0800 Subject: [PATCH 116/132] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=84=E7=BB=87bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_document_comments/index.html.erb | 4 ++-- app/views/organizations/_org_members.html.erb | 4 ++-- app/views/organizations/show.html.erb | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/org_document_comments/index.html.erb b/app/views/org_document_comments/index.html.erb index a7340c08a..a636b2ec8 100644 --- a/app/views/org_document_comments/index.html.erb +++ b/app/views/org_document_comments/index.html.erb @@ -20,8 +20,8 @@ init_activity_KindEditor_data(<%= document.id%>, null, "87%"); }); -
            +

            <%= render :partial => 'organizations/show_org_document', :locals => {:document => document} %> -

            +

            <% end %> <% end %> \ No newline at end of file diff --git a/app/views/organizations/_org_members.html.erb b/app/views/organizations/_org_members.html.erb index 8719ad275..3940a6576 100644 --- a/app/views/organizations/_org_members.html.erb +++ b/app/views/organizations/_org_members.html.erb @@ -1,11 +1,11 @@ <%= stylesheet_link_tag 'courses' %> -
            +

            组织成员

            - 加入时间 +
            <% members.each do |member| %> diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index 5f1d0e003..e77cc7d09 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -30,9 +30,9 @@ init_activity_KindEditor_data(<%= @organization.home_id%>, null, "87%"); }); -
            +

            <%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %> -

            +

            <% end %> <% unless @activities.nil? %> @@ -58,9 +58,9 @@ init_activity_KindEditor_data(<%= act.org_act.id%>, null, "87%"); }); -
            +

            <%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %> -

            +

            <% end %> <% end %>
              From 36b3d0b6368e494e9816f20ae4b37975cf956988 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 13 Nov 2015 20:22:13 +0800 Subject: [PATCH 117/132] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=81=AB=E7=8B=90?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E4=B8=8A=E5=8A=A8=E6=80=81=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E7=AB=A0=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_organizations.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/users/user_organizations.html.erb b/app/views/users/user_organizations.html.erb index ec66358f5..50fa03bbe 100644 --- a/app/views/users/user_organizations.html.erb +++ b/app/views/users/user_organizations.html.erb @@ -6,10 +6,10 @@
              组织列表 -
              - - -
              + + + +
              <% @orgs.each do |org| %> From ddbc9003c2a308fe5839259216fba08edff1919c Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 Nov 2015 20:24:30 +0800 Subject: [PATCH 118/132] =?UTF-8?q?=E6=AF=8F=E4=B8=AA=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E5=88=9B=E5=BB=BA=E5=90=8C=E5=90=8D=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=BA=93=20=E4=B8=8D=E5=90=8C=E7=9A=84=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=8F=AF=E4=BB=A5=E5=88=9B=E5=BB=BA=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=20=E6=9B=B4=E6=96=B0fork=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 68 +++++++++++++--------- app/helpers/repositories_helper.rb | 10 ++-- config/locales/projects/zh.yml | 2 + 3 files changed, 48 insertions(+), 32 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 82f469259..d1d8a961a 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -64,13 +64,18 @@ class RepositoriesController < ApplicationController end def forked - # REDO: 那些人有权限forked项目 - # g = Gitlab.client - # gproject = g.post ("/projects/fork/#{@project.gpid}") - if gproject - copy_project(@project, gproject) + # 被forked的标识如果不满足单个用户唯一性,则不执行fork + if is_sigle_identifier?(User.current, @repository.identifier) + # REDO: 那些人有权限forked项目 + g = Gitlab.client + gproject = g.post ("/projects/fork/#{@project.gpid}?user_id=#{User.current.id}") + if gproject + copy_project(@project, gproject) + end + else + flash[:notice] = l(:project_gitlab_fork_double_message) + redirect_to settings_project_url(@project, :tab => 'repositories') end - # render :layout => 'base_projects' end # copy a project for fork @@ -79,6 +84,7 @@ class RepositoriesController < ApplicationController project.name = @project.name project.is_public = @project.is_public project.status = @project.status + project.description = @project.description project.hidden_repo = @project.hidden_repo project.user_id = User.current.id project.project_type = 0 @@ -94,7 +100,6 @@ class RepositoriesController < ApplicationController Rails.logger.debug "ProjectStatus created: #{project_status.to_json}" project.members << m project.project_infos << project_info - repository = Repository.create(:project_id => project.id, :url =>'ddd222', :type => 'Repository::Gitlab', :identifier => 'ddd222', :is_default => true) copy_repository(project, gproject) respond_to do |format| format.html { @@ -119,15 +124,16 @@ class RepositoriesController < ApplicationController def copy_repository(project, gproject) # 避免 - if is_sigle_identifier?(project.owner, gproject.name) - + if is_sigle_identifier?(project.user_id, gproject.name) + repository = Repository.factory('Git') + repository.project_id = project.id + repository.type = 'Repository::Gitlab' + repository.url = gproject.name + repository.identifier = gproject.name + repository = repository.save + else + flash[:notice] = l(:project_gitlab_create_double_message) end - repository = Repository.factory('Git') - repository.project_id = project.id - repository.type = 'Repository::Gitlab' - repository.url = gproject.name - repository.identifier = gproject.name - repository = repository.save end def newrepo @@ -181,21 +187,27 @@ update } def create - attrs = pickup_extra_info - @repository = Repository.factory('Git') - @repository.safe_attributes = params[:repository] - if attrs[:attrs_extra].keys.any? - @repository.merge_extra_info(attrs[:attrs_extra]) - end - @repository.project = @project - @repository.type = 'Repository::Gitlab' - @repository.url = @repository.identifier - if request.post? && @repository.save - s = Trustie::Gitlab::Sync.new - s.create_project(@project, @repository) + # 判断版本库创建者是否有同名版本库,避免版本库路径一致问题 + unless is_sigle_identifier?(@project.user_id, params[:repository].first[1]) + flash[:notice] = l(:project_gitlab_create_double_message) redirect_to settings_project_url(@project, :tab => 'repositories') else - redirect_to settings_project_url(@project, :tab => 'repositories',:repository_error_message=>@repository.errors.full_messages) + attrs = pickup_extra_info + @repository = Repository.factory('Git') + @repository.safe_attributes = params[:repository] + if attrs[:attrs_extra].keys.any? + @repository.merge_extra_info(attrs[:attrs_extra]) + end + @repository.project = @project + @repository.type = 'Repository::Gitlab' + @repository.url = @repository.identifier + if request.post? && @repository.save + s = Trustie::Gitlab::Sync.new + s.create_project(@project, @repository) + redirect_to settings_project_url(@project, :tab => 'repositories') + else + redirect_to settings_project_url(@project, :tab => 'repositories',:repository_error_message=>@repository.errors.full_messages) + end end end diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 05403114d..ddabb5356 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -28,15 +28,17 @@ module RepositoriesHelper REPO_GITLAB_ADDRESS = "git.trustie.net" # 某个成员不能拥有同名版本库,不同的成员可以创建同名版本库 - def is_sigle_identifier?(user, iden) - projects = Project.where("user_id =?",user) + def is_sigle_identifier?(user_id, iden) + projects = Project.where("user_id =?",user_id) identifiers = [] projects.each do |project| # 只针对gitlab类型的,git类型的后期清掉 repository = Repository.where("project_id =? and type =?", project.id, "Repository::Gitlab").first - identifiers << repository.identifier + if repository + identifiers << repository.identifier + end end - identifiers + identifiers.include?(iden) ? false :true end def format_revision(revision) diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml index 1a18e5a14..aebdebd2c 100644 --- a/config/locales/projects/zh.yml +++ b/config/locales/projects/zh.yml @@ -89,6 +89,8 @@ zh: project_module_repository: 版本库 project_module_create_repository: 创建版本库 project_gitlab_create_repository: 新版本库 + project_gitlab_create_double_message: 亲,您已经创建了一个同名的版本库,换个特别点的名字同名的概率就会变小哦~ + project_gitlab_fork_double_message: 亲,您已经有了一个相同名字的版本库,所以不能fork改版本库~ label_project_more: 更多 From bee355e7478585b8c6946a9c600c75648c5cfaa8 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 14 Nov 2015 09:43:15 +0800 Subject: [PATCH 119/132] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=87=E7=AB=A0=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9B=20=E5=8A=A8=E6=80=81=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E4=B8=8D=E5=86=97=E4=BD=99=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_document_comments/edit.html.erb | 1 + app/views/org_document_comments/index.html.erb | 1 - app/views/organizations/show.html.erb | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/org_document_comments/edit.html.erb b/app/views/org_document_comments/edit.html.erb index ffb04a4f9..b4f8662a3 100644 --- a/app/views/org_document_comments/edit.html.erb +++ b/app/views/org_document_comments/edit.html.erb @@ -21,6 +21,7 @@
            +
            <%= kindeditor_tag 'org_document_comment[content]',@org_document.content, :editor_id => 'org_document_description_editor', :height => "150px" %> diff --git a/app/views/org_document_comments/index.html.erb b/app/views/org_document_comments/index.html.erb index a636b2ec8..d53ce543c 100644 --- a/app/views/org_document_comments/index.html.erb +++ b/app/views/org_document_comments/index.html.erb @@ -16,7 +16,6 @@ <% @documents.each do |document| %> diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index e77cc7d09..358b30c7d 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -52,7 +52,7 @@
            <% end %> - <% if act.org_act_type == 'OrgDocumentComment' %> + <% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %> -

            <%= render :partial => 'organizations/show_org_document', :locals => {:document => document} %> -

            <% end %> <% end %> \ No newline at end of file diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index f1c633320..700db0eeb 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -1,4 +1,4 @@ -
            +
            <%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %> diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index e77cc7d09..55d296cd1 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -30,9 +30,8 @@ init_activity_KindEditor_data(<%= @organization.home_id%>, null, "87%"); }); -

            + <%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %> -

            <% end %> <% unless @activities.nil? %> @@ -58,9 +57,7 @@ init_activity_KindEditor_data(<%= act.org_act.id%>, null, "87%"); }); -

            <%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %> -

            <% end %> <% end %>
              diff --git a/db/schema.rb b/db/schema.rb index 1f48eaf02..73924d83c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20151110011003) do +ActiveRecord::Schema.define(:version => 20151112072948) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -960,6 +960,7 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.datetime "created_on" t.integer "comments_count", :default => 0, :null => false t.integer "course_id" + t.integer "sticky", :default => 0 end add_index "news", ["author_id"], :name => "index_news_on_author_id" From e1a88dedbbe20cc0511cec88274da90763d71788 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 14 Nov 2015 09:58:53 +0800 Subject: [PATCH 121/132] =?UTF-8?q?=20=E9=A6=96=E9=A1=B5=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=20=E4=BC=9A=E5=8F=98=E6=88=90=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_show_org_document.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index 700db0eeb..b9c8c19aa 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -7,7 +7,7 @@
              <%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %> TO  <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> | - <% if defined?(home_id) %> + <% if document.organization.home_id == document.id %> 首页 <% else %> 组织 From f313509d991a170db68c27c4350cbe63b9ae965c Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 14 Nov 2015 10:01:30 +0800 Subject: [PATCH 122/132] =?UTF-8?q?=E7=BB=84=E7=BB=87id=E7=9A=84=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E6=98=BE=E7=A4=BA=E7=BB=84=E7=BB=87=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org.html.erb | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index 32ada4729..b1434bb0f 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -50,13 +50,9 @@ <% end %> <% end%>
              -
              组织id:<%= @organization.id %>
              - <% if User.current.admin_of_org?(@organization) %> - 配置 - <% end %> - -
              - <%= link_to l(:label_org_name)+"#{@organization.name}", organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %> + +
              + <%= link_to @organization.name, organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %> <% if @organization.is_public? %> <%= l(:label_public)%> <% else %> @@ -64,6 +60,19 @@ <% end %>
              + <% if User.current.admin_of_org?(@organization) %> + 配置 + <% end %> + + + + + + + + + +
              <%= link_to '文章', organization_org_document_comments_path(@organization) %> ( From 9bf8f6058faeb2d43af2588d537d6bcf22d59f60 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 14 Nov 2015 10:25:51 +0800 Subject: [PATCH 123/132] =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=92=8C=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organizations/_show_org_document.html.erb | 141 +++++++++--------- 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index b9c8c19aa..4177c3688 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -1,75 +1,76 @@
              -
              -
              - <%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %> -
              -
              -
              - <%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %> - TO  <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> | - <% if document.organization.home_id == document.id %> - 首页 - <% else %> - 组织 - <% end %> +
              +
              + <%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %>
              -
              <%= document.title %>
              -
              - 发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
              - <% unless document.content.blank? %> -
              - <%= document.content.html_safe %> -
              - <% end %> - - <% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id) || User.current.id == document.creator_id) %> -
              -
                -
              • -
                  -
                • - <%= form_for('new_form',:url => {:controller => 'organizations',:action => 'set_homepage',:id => document.organization_id, :home_id => document.id},:method => "put",:remote => true) do |f|%> - 设为首页 - <% end %> -
                • -
                • - <%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :class => "postOptionLink" %> -
                • -
                • - <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete', - :data => {:confirm => l(:text_are_you_sure)}, - :remote => true, :class => 'postOptionLink' %> -
                • -
                -
              • -
              -
              -
              -
              -
              - <% end %> -<% comments_for_doc = document.children.reorder("created_at desc") %> -<% count = document.children.count() %> - -
              -
              -
              回复(<%= count %>)
              - <% if count > 3 %> - - <% end %> + <% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id) || User.current.id == document.creator_id) %> +
              +
                +
              • +
                  +
                • + <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id}, :method => "put", :remote => true) do |f| %> + 设为首页 + <% end %> +
                • +
                • + <%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :class => "postOptionLink" %> +
                • +
                • + <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete', + :data => {:confirm => l(:text_are_you_sure)}, + :remote => true, :class => 'postOptionLink' %> +
                • +
                +
              • +
              +
              +
              + <% end %> +
              -
              + <% comments_for_doc = document.children.reorder("created_at desc") %> + <% count = document.children.count() %> + +
              +
              +
              回复(<%= count %>)
              + <% if count > 3 %> + + <% end %> +
              +
                <% reply_id = 0 %> <% comments_for_doc.each do |comment| %> <% reply_id += 1 %> -
              • +
              • <%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_path(comment.creator_id) %>
                @@ -87,12 +88,12 @@
                - <%=link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %> + <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %>
                <%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id), :method => "post", :remote => true) do |f| %> - +
                @@ -110,15 +111,15 @@
                + diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb new file mode 100644 index 000000000..ed80ba7b1 --- /dev/null +++ b/app/views/organizations/_org_project_issue.html.erb @@ -0,0 +1,136 @@ +
                +
                +
                + <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> +
                +
                +
                + <% if activity.try(:author).try(:realname) == ' ' %> + <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% end %> TO + <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> +
                +
                + <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %> + + <%#= get_issue_priority(activity.priority_id)[1] %> + +
                +
                +
                指派给   + <% unless activity.assigned_to_id.nil? %> + <% if activity.try(:assigned_to).try(:realname) == ' ' %> + <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% end %> + <% end %> +
                +
                + 时间: + <%=format_time(activity.created_on) %> +
                +
                +
                +
                + <% if activity.description? %> + <%= textAreailizable activity, :description, :attachments => activity.attachments %> + <% end %> +
                +
                +
                + + +
                +
                + <% if activity.attachments.any? %> + <% activity.attachments.each do |attachment| %> +
                + + + <%= link_to_short_attachment attachment,:length=> 58, :class => 'link_file_a fl newsBlue', :download => true -%> + + <% if attachment.is_text? %> + <%= link_to image_tag('magnifier.png'), + :controller => 'attachments', + :action => 'show', + :id => attachment, + :class => 'fl', + :filename => attachment.filename %> + <% end %> + + ( + <%= number_to_human_size attachment.filesize %>) + + + <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>, + <%= format_time(attachment.created_on) %> + +
                + <% end %> + <% end %> +
                +
                +
                +
                + <% count = activity.journals.count %> +
                +
                +
                +
                回复(<%= count %>)
                +
                <%#= format_date(activity.updated_on) %>
                + <% if count > 3 %> + + <% end %> +
                + + <% replies_all_i = 0 %> + <% if count > 0 %> +
                +
                  + <% activity.journals.reorder("created_on desc").each do |reply| %> + + <% replies_all_i=replies_all_i + 1 %> +
                • +
                  + <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %> +
                  +
                  +
                  + <% if reply.try(:user).try(:realname) == ' ' %> + <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> + <% end %> + <%= format_time(reply.created_on) %> +
                  +
                  + <% if reply.details.any? %> + <% details_to_strings(reply.details).each do |string| %> +

                  <%= string %>

                  + <% end %> + <% end %> +

                  <%= reply.notes %>

                  +
                  +
                  +
                  +
                • + <% end %> +
                +
                + <% end %> + + + +
                +
                diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index deaec4437..0b624d479 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -34,8 +34,8 @@ <%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %> <% end %> - <% unless @activities.nil? %> - <% @activities.each do |act| %> + <% unless @org_activities.nil? %> + <% @org_activities.each do |act| %> <% if act.org_act_type == 'CreateOrganization' %>
                @@ -60,10 +60,20 @@ <%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %> <% end %> <% end %> -
                  - <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> -
                + + <%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> + <% end %> + <%# @org_project_activties.each do |org_act|%> + <%= render :partial => 'organizations/org_project_activities', + :locals => {:org_project_activties =>@org_project_activties, + :page=>@page, + :org => @organization, + :org_act_count=>@org_activities.count, + :pro_act_count=>@org_project_activties.count}%> + <%# end %> + + diff --git a/app/views/organizations/show.js.erb b/app/views/organizations/show.js.erb new file mode 100644 index 000000000..b0a447910 --- /dev/null +++ b/app/views/organizations/show.js.erb @@ -0,0 +1,7 @@ +$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'organizations/org_project_activities', + :locals => {:org_project_activties =>@org_project_activties, + :page=>@page, + :org => @organization, + :org_act_count=>@org_activities.count, + :pro_act_count=>@org_project_activties.count} )%>"); + From 1e1c2109396bdcd00c092e7efc9da3b2d7bce42b Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 14 Nov 2015 14:57:49 +0800 Subject: [PATCH 128/132] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 2 +- .../_org_project_activities.html.erb | 8 +- .../organizations/_org_project_issue.html.erb | 2 +- .../organizations/_project_create.html.erb | 38 +++++++ .../organizations/_project_message.html.erb | 100 ++++++++++++++++++ 5 files changed, 143 insertions(+), 7 deletions(-) create mode 100644 app/views/organizations/_project_create.html.erb create mode 100644 app/views/organizations/_project_message.html.erb diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index daf443d07..cad617e47 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -60,7 +60,7 @@ class OrganizationsController < ApplicationController @org_activities_count = OrgActivity.where('container_id =? and container_type =? ', @organization.id, 'Organization ').order('updated_at desc').count project_ids = @organization.projects.map(&:id) - @org_project_activties = ForgeActivity.where('project_id in (?)',project_ids.join(',')).page(params[:page]).per(10) + @org_project_activties = ForgeActivity.where('project_id in (?) and forge_act_type in("Issue","Message","ProjectCreateInfo")',project_ids.join(',')).order("updated_at desc").page(params[:page] || 1).per(10) @org_project_activties_count = ForgeActivity.where('project_id in (?)',project_ids.join(',')).count #@org_activities = paginateHelper @org_activities, 10 @page = params[:page] diff --git a/app/views/organizations/_org_project_activities.html.erb b/app/views/organizations/_org_project_activities.html.erb index 0a6a8fae4..b46996661 100644 --- a/app/views/organizations/_org_project_activities.html.erb +++ b/app/views/organizations/_org_project_activities.html.erb @@ -1,17 +1,15 @@ <% org_project_activties.each do |act|%> <% if act %> - - <% unless act.forge_act_type == "ProjectCreateInfo" %> <% if act %> <% case act.forge_act_type.to_s %> <% when 'Issue' %> <%= render :partial => 'organizations/org_project_issue', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %> <% when 'Message' %> - <%= render :partial => 'users/project_message', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %> + <%= render :partial => 'organizations/project_message', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %> <% when 'ProjectCreateInfo'%> - <%= render :partial => 'users/project_create', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %> + <%= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %> <% end %> - <% end %><% end %> + <% end %> <% end %> <% end %> <% if org_act_count == 10 || pro_act_count == 10 %> diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb index ed80ba7b1..573429752 100644 --- a/app/views/organizations/_org_project_issue.html.erb +++ b/app/views/organizations/_org_project_issue.html.erb @@ -120,7 +120,7 @@

                <%= string %>

                <% end %> <% end %> -

                <%= reply.notes %>

                +

                <%= reply.notes.nil? ? "" : reply.notes.html_safe %>

                diff --git a/app/views/organizations/_project_create.html.erb b/app/views/organizations/_project_create.html.erb new file mode 100644 index 000000000..d966d8e18 --- /dev/null +++ b/app/views/organizations/_project_create.html.erb @@ -0,0 +1,38 @@ +<% project = Project.find(activity.project_id) %> +<% user = User.find(project.user_id)%> +
                +
                +
                + <%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像" %> +
                +
                +
                + <% if user.try(:realname) == ' ' %> + <%= link_to user, user_path(user), :class => "newsBlue mr15" %> + <% else %> + <%= link_to user.try(:realname), user_path(user), :class => "newsBlue mr15" %> + <% end %> + TO + <%= link_to project.to_s+" | 项目", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %> +
                +
                + <%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %> +
                +
                + 创建时间:<%= format_time(project.created_on) %> +
                + +
                +
                +
                +
                \ No newline at end of file diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb new file mode 100644 index 000000000..85ed08f2f --- /dev/null +++ b/app/views/organizations/_project_message.html.erb @@ -0,0 +1,100 @@ +
                +
                +
                + <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> +
                +
                +
                + <% if activity.try(:author).try(:realname) == ' ' %> + <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% end %> + TO + <%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%> + +
                +
                + <% if activity.parent_id.nil? %> + <%= link_to activity.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey" + %> + <% else %> + <%= link_to activity.parent.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey" + %> + <% end %> +
                +
                + 时间:<%= format_time(activity.created_on) %> +
                +
                +
                + <% if activity.parent_id.nil? %> + <%= activity.content.to_s.html_safe%> + <% else %> + <%= activity.parent.content.to_s.html_safe%> + <% end %> +
                +
                +
                + + +
                +
                +
                +
                + <% count = 0 %> + <% if activity.parent %> + <% count=activity.parent.children.count%> + <% else %> + <% count=activity.children.count%> + <% end %> +
                +
                +
                +
                回复( + <%=count %> + )
                +
                <%#=format_date(activity.updated_on)%>
                + <%if count>3 %> + + <% end %> +
                + + <% activity= activity.parent_id.nil? ? activity : activity.parent %> + <% replies_all_i = 0 %> + <% if count > 0 %> +
                +
                  + <% activity.children.reorder("created_on desc").each do |reply| %> + + <% replies_all_i=replies_all_i+1 %> +
                • +
                  + <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id), :alt => "用户头像" %> +
                  +
                  +
                  + <% if reply.try(:author).try(:realname) == ' ' %> + <%= link_to reply.try(:author), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> + <% end %> + <%= format_time(reply.created_on) %> +
                  +
                  + <%= reply.content.html_safe %>
                  +
                  +
                  +
                • + <% end %> +
                +
                + <% end %> + + +
                +
                \ No newline at end of file From c9a7a9476708916f5836309640f4ea82b3c6e863 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 14 Nov 2015 15:15:54 +0800 Subject: [PATCH 129/132] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index cad617e47..774cde02d 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -60,7 +60,7 @@ class OrganizationsController < ApplicationController @org_activities_count = OrgActivity.where('container_id =? and container_type =? ', @organization.id, 'Organization ').order('updated_at desc').count project_ids = @organization.projects.map(&:id) - @org_project_activties = ForgeActivity.where('project_id in (?) and forge_act_type in("Issue","Message","ProjectCreateInfo")',project_ids.join(',')).order("updated_at desc").page(params[:page] || 1).per(10) + @org_project_activties = ForgeActivity.where("project_id in (#{project_ids.join(',')}) and forge_act_type in('Issue','Message','ProjectCreateInfo')").order("updated_at desc").page(params[:page] || 1).per(10) @org_project_activties_count = ForgeActivity.where('project_id in (?)',project_ids.join(',')).count #@org_activities = paginateHelper @org_activities, 10 @page = params[:page] From f5460d11264d67a19809f229928f1dd02207efae Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 14 Nov 2015 15:19:49 +0800 Subject: [PATCH 130/132] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 774cde02d..b75742164 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -59,7 +59,7 @@ class OrganizationsController < ApplicationController @organization.id, 'Organization ').order('updated_at desc').page(params[:page]).per(10) @org_activities_count = OrgActivity.where('container_id =? and container_type =? ', @organization.id, 'Organization ').order('updated_at desc').count - project_ids = @organization.projects.map(&:id) + project_ids = @organization.projects.map(&:id) << 0 @org_project_activties = ForgeActivity.where("project_id in (#{project_ids.join(',')}) and forge_act_type in('Issue','Message','ProjectCreateInfo')").order("updated_at desc").page(params[:page] || 1).per(10) @org_project_activties_count = ForgeActivity.where('project_id in (?)',project_ids.join(',')).count #@org_activities = paginateHelper @org_activities, 10 From 50dfe5ce8bf0469bf78e597246b700d01187fe29 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 14 Nov 2015 15:20:29 +0800 Subject: [PATCH 131/132] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AEowner=E4=B8=BA=E5=BD=93=E5=89=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=EF=BC=8C=E5=90=8C=E6=AD=A5gitlab=E7=AB=AF=E7=94=A8?= =?UTF-8?q?=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 750a2d1b6..a7069e87e 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -68,7 +68,7 @@ class RepositoriesController < ApplicationController if is_sigle_identifier?(User.current, @repository.identifier) # REDO: 那些人有权限forked项目 g = Gitlab.client - gproject = g.post ("/projects/fork/#{@project.gpid}?user_id=#{User.current.id}") + gproject = g.post ("/projects/fork/#{@project.gpid}?user_id=#{User.current.gid}") if gproject copy_project(@project, gproject) end From 55d3b8abb3dcb64696f2866da4f7634b3e49ed28 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 16 Nov 2015 17:19:53 +0800 Subject: [PATCH 132/132] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E8=BF=87=E7=A8=8B=E4=B8=AD=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/sync_sigle_rep.rake | 30 ------------------------------ lib/trustie/gitlab/sync.rb | 6 ------ 2 files changed, 36 deletions(-) diff --git a/lib/tasks/sync_sigle_rep.rake b/lib/tasks/sync_sigle_rep.rake index 4ed360426..e68e37ee8 100644 --- a/lib/tasks/sync_sigle_rep.rake +++ b/lib/tasks/sync_sigle_rep.rake @@ -12,45 +12,15 @@ namespace :sync_rep do puts count unless count > 1 rep.identifier - puts "################################" - puts project.id - puts rep.id s = Trustie::Gitlab::Sync.new s.sync_project(project, path: rep.identifier, import_url: rep.url) rep.type = 'Repository::Gitlab' rep.save - puts "*************************************" - puts project.id - puts rep.id - puts rep.identifier end end end end task :delete_rep => :environment do - projects = Project.where("user_id !=?",12) - projects.each do |project| - # 针对类型为Git并且只有一个版本库的项目 - if project.repositories && project.repositories.count == 1 && project.repositories.first.type == "Repository::Git" - rep = project.repositories.first - count = Repository.find_by_sql("SELECT * FROM `repositories` where identifier = '#{rep.identifier}'").count - puts count - unless count > 1 - rep.identifier - puts "################################" - puts project.id - puts rep.id - s = Trustie::Gitlab::Sync.new - s.sync_project(project, path: rep.identifier, import_url: rep.url) - rep.type = 'Repository::Gitlab' - rep.save - puts "*************************************" - puts project.id - puts rep.id - puts rep.identifier - end - end - end end end \ No newline at end of file diff --git a/lib/trustie/gitlab/sync.rb b/lib/trustie/gitlab/sync.rb index ac01a44ec..1f6f7c146 100644 --- a/lib/trustie/gitlab/sync.rb +++ b/lib/trustie/gitlab/sync.rb @@ -73,11 +73,6 @@ module Trustie # import url http://xianbo_trustie2:1234@repository.trustie.net/xianbo/trustie2.git # can use password - puts "@@@@@@@@@@@@@@@@@@@@@@@" - puts path - puts project.description - puts gid - puts import_url gproject = self.g.create_project(path, path: path, description: project.description, @@ -91,7 +86,6 @@ module Trustie import_url: import_url, visibility_level: project.is_public? ? UserLevel::PUBLIC : UserLevel::PRIVATE ) - puts "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" project.gpid = gproject.id project.save! puts "Successfully created #{project.name}"