From d6e868b294971d2ebcfd124268e0bea2a8bd06d2 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 1 Dec 2016 10:59:41 +0800 Subject: [PATCH 01/41] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E8=BE=93=E5=87=BA=E6=94=B9=E4=B8=BA1000?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/homework.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index b868b25d0..26d1e5bd8 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -477,7 +477,7 @@ $(function(){ //注意\n\ //1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\ //2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\ - //3:该程序每次运行输出的结果最多显示100个字符(多余的不显示),每行末尾的所有空格用□表示\n\ + //3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\ import java.io.*;\n\ import java.util.*;\n\ \n\ @@ -501,7 +501,7 @@ class Main\n\ //注意\n\ //1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\ //2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\ - //3:该程序每次运行输出的结果最多显示100个字符(多余的不显示),每行末尾的所有空格用□表示\n\ + //3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\ #include \n\ int main()\n\ {\n\ @@ -521,7 +521,7 @@ int main()\n\ //注意\n\ //1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\ //2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\ - //3:该程序每次运行输出的结果最多显示100个字符(多余的不显示),每行末尾的所有空格用□表示\n\ + //3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\ #include \n\ using namespace std;\n\ \n\ @@ -543,7 +543,7 @@ int main()\n\ #注意\n\ #1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\ #2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\ - #3:该程序每次运行输出的结果最多显示100个字符(多余的不显示),空格用□表示\n\ + #3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),空格用□表示\n\ import sys \n\ \n\ #获取参数方式,使用raw_input\n\ From bbc8d11f8046c1b00af3a63ab3f026fac7dba0d5 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 1 Dec 2016 14:21:40 +0800 Subject: [PATCH 02/41] =?UTF-8?q?=E9=A1=B9=E7=9B=AEissue=E5=85=B3=E8=81=94?= =?UTF-8?q?commit(=E6=9C=AA=E5=AE=8C=E6=88=90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- app/controllers/issues_controller.rb | 15 +++++++++++ app/models/commit_issues.rb | 5 ++++ app/views/issues/_form.html.erb | 25 ++++++++++--------- app/views/issues/_issue_commits.html.erb | 0 app/views/issues/issue_commits.js.erb | 2 ++ config/routes.rb | 1 + .../20161201015458_create_commit_issues.rb | 11 ++++++++ public/stylesheets/css/moduel.css | 1 + spec/factories/commit_issues.rb | 8 ++++++ spec/models/commit_issues_spec.rb | 5 ++++ 11 files changed, 62 insertions(+), 13 deletions(-) create mode 100644 app/models/commit_issues.rb create mode 100644 app/views/issues/_issue_commits.html.erb create mode 100644 app/views/issues/issue_commits.js.erb create mode 100644 db/migrate/20161201015458_create_commit_issues.rb create mode 100644 spec/factories/commit_issues.rb create mode 100644 spec/models/commit_issues_spec.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 14d5961cd..0845a297e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -55,7 +55,7 @@ class ApplicationController < ActionController::Base include Redmine::Search::Controller include Redmine::MenuManager::MenuController helper Redmine::MenuManager::MenuHelper - + def user_agent logger.info "HTTP_USER_AGENT #{request.env["HTTP_USER_AGENT"]}" end diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index c6cb018a5..191465003 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -57,6 +57,21 @@ class IssuesController < ApplicationController helper :project_score include ApplicationHelper + # issue和代码提交id关联模块 --> over + # 获取某个项目的commit_ids + def issue_commits + project = Project.find(@issue.project_id) + begin + g = Gitlab.commits(project.gpid) + g_project = g.project(project.gpid) + @rev = params[:rev].nil? ? g_project.default_branch : params[:rev] + @commits = g.g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s, ref_name:rev) + rescue Exception => e + puts e + end + end + # over + def index # 顶部导航 @project_menu_type = 2 diff --git a/app/models/commit_issues.rb b/app/models/commit_issues.rb new file mode 100644 index 000000000..fc56465f9 --- /dev/null +++ b/app/models/commit_issues.rb @@ -0,0 +1,5 @@ +class CommitIssues < ActiveRecord::Base + attr_accessible :commit_id, :issue_id, :project_id + # 之所以没建立关联表,主要是应为commit_id是直接通过api获取的,不存在trustie端 + has_many :issues +end diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 94b55f3e2..9208638c4 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -74,28 +74,28 @@ <% end %> -
  • +
  • <% if @issue.safe_attribute? 'assigned_to_id' %> <%= f.select :assigned_to_id, assigned_options_for_select(@issue.assignable_users, @issue.assigned_to), {:required => @issue.required_attribute?('assigned_to_id'), :no_label => true}, {:onchange => "change_assigned_tip();",:class => "w150"} %> <% end %>
  • -
  • +
  • <%= @issue.assigned_to.nil? ? "未指派" : "已指派" %>
  • -
  • +
  • <%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version), {:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true}, {:onchange => "change_milestone_tip();", :class => "w150"} %>
  • -
  • +
  • <%= @issue.fixed_version.nil? ? "未选择里程碑" : "已选择里程碑" %> <% if params[:action] == "new" %> <%= link_to "", new_project_version_path(@project, :is_issue => true, :issue_project_id => @project.id), :class => "pic_add mt5 ml5 fr", :remote => true %> <% end %>
  • -
  • +
  • <% if @issue.safe_attribute? 'start_date' %> <%= f.text_field :start_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true, :required => @issue.required_attribute?('start_date'), :onchange => "issue_start_date_change();", @@ -103,10 +103,10 @@ <%= calendar_for('issue_start_date', 'start_date') if @issue.leaf? %> <% end %>
  • -
  • +
  • <%= @issue.start_date.nil? ? "未选择开始日期" : "已选择开始日期" %>
  • -
  • +
  • <% if @issue.safe_attribute? 'due_date' %> <%= f.text_field :due_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true, @@ -115,26 +115,27 @@ <%= calendar_for('issue_due_date', 'start_date') if @issue.leaf? %> <% end %>
  • -
  • +
  • <%= @issue.due_date.nil? ? "未选择结束日期" : "已选择结束日期" %>
  • -
  • +
  • <% if @issue.safe_attribute? 'estimated_hours' %> <%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true, :required => @issue.required_attribute?('estimated_hours'), :placeholder => "请填写预计工时" %> <% end %>
  • -
  • <%= l(:field_estimated_hours) %>
  • +
  • <%= l(:field_estimated_hours) %>
  • -
  • +
  • <% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %> <%= f.select :done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), {:required => @issue.required_attribute?('done_ratio'), :no_label => true}, :onchange => "PrecentChange(this.value)", :class => "w150" %> <% end %> -
  • 完成度
  • +
  • 完成度
  • +
  • 关联Commit<%= link_to "+".html_safe, issue_commits_issues_path %>
  • <% end %> - \ No newline at end of file diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 278b545a5..c2fc649c1 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -27,6 +27,18 @@
    {{issue.project_name}} - 项目问题{{issue.created_on}}
    + + + + +
    +
    + +
    +
    + 状   态:{{issue.issue_status}} 优先级:{{issue.issue_priority}}
    指派给:{{issue.issue_assigned_to}} @@ -114,7 +126,7 @@
    - +
    @@ -124,4 +136,15 @@
    - \ No newline at end of file + + + +
    +
    +
    + +
    +
      +
    • {{person.name}}

      ({{person.login}})

    • +
    +
    diff --git a/public/images/wechat/w-icons-file.png b/public/images/wechat/w-icons-file.png new file mode 100644 index 0000000000000000000000000000000000000000..c5b8be58ba671da9ef4ea5f09e416b983836b714 GIT binary patch literal 19066 zcmeI3c{r5a`@kRjQY2Z5WQ_Dyj4{kuCi|{zSw|(tm|>VLGu9&NRZ191k|jl1l2Tbx zmR5y`BB3l<5~2kW^&M0+_0I3TuJ8A{e*esKT{F+z=RWs+pYyrTx#v88JV$J;&4dJ{ z1OWgLvM@KcW8BT>KK#6lZ^w~qW{jHv#oUDo04vaQAC4ToY&-x6TH%e1Y;C>CG&0qj zOaWOK8G$H%WE`G=1%RNoH2XkQ!lZ<5=OlK8lVR&vVG|1Bb_ ze?Kxx&`C^uWvaR3y#vjH=4nwq85>Kz430+ah<4ni`A)VYyC^hdbY$eq^DnmsQU_-0 zgBw$yWHG(<~o62S@df>V=Hirz1{t| z0mA5~`{%y;j*-E-a_>98-a5v~4TxAbjJCP;^|f$OsyVLsSNi7e1lpVc@6IV#wRVAw z9fD6nrlNy2XY|*lpS69cEwff|*|HG@kF(_}ucLLpsdbaPqQfQ_+OO>)W5Ax%`pK87 zG7rw~L6ZUs>|zIMxeZ~Y$pQJV)sg#WV>dPSzzcUNi64EBI#Oy2wyF-kVHa;K_b9PP zba21wd)bq-0ttaaK>i_{D(hmtqFO>#*gFo+Xkk=S0H7cC5pqmwSv(-(1y>E81b~Ff zsW^Q_4&ZT8)@uN`^=9?1oD-6k5BLGVI3r^76$8HIx5e_Sgi~+J+^Uk~MDrT!FJE7! zEn>*q8@^WX?CO&SYaFVOt=vUdxTG>xp6(X8ejBDKG|(lwD`JQu$?Lv4{m$xJhXl9{ z9`dh3%ORsydc?MZ>-i;Fp0esz+yz-ZF!oh`73)>lvrN{*4@2siO}vsEsuE3fJ(H=X@KbuCLPxFFu#uxb2NU z4G29NiwSRp3FD5vK<_$s*u?z^N@_#31f~y#aEe1_3mp6#cIPi}LXORKg%HuHdqEz^LORMcf5SVub#mzn zyZ;hi<(6Q+Uii`RUTZ-)1-h!mG7Dexc5_IUeU@&M2tL(v!w{YL=v6QO)$n{!QhW)0 z1>NTOmq&MdOT>`(qk1d_&aJo0Iw86hfz|8dK7U5lFgYV{`{Ug7XZ(3l$TK@Eh#3L4 zQ2WEVtKj~p6&|NZ7}aJ$GMk^A#(Uu>y`h7&GJ%%|*O??eNow+a!#6lEc<@u;a-l;) z2dm9JHm>nqvv*DQ>XJ3kWXlUYPm_`#I;cEXl}`3Lwc-@n5w&?@^FHzT8qq{#qElj6 z;y|8*Bh^u_IXG{b!$rpx7k4{_UNCjMX8Sr<;F-k5=3E)ao4M)*^>%@FakdTH-7+iO zW)DnbgsvWnG|f0(pnEOt zji`CJd|W&(t$)vB4&eudU1M4=Qn%L2)eF_{g>XUiAcZYHmvEQDE@`xdv{kfujQEX6 zj10An`cu;M)0EQ2kwoOAzd)IK+4i!?vUdN5x4KU;L&1Xr<2B>LgD)G+#)+RY$0gs6 zwv0B)YN){Z)#+;pFip%@9Ub$=_Y}UgaqREzoRziSW%2jCGaD^3|0><^?y%QuM3AH| zE}y*CBOm?>+u^H?_Q0#QXWh%X-&?Wi@d@A4xU$CUPib{^50yIdTk{_c$7(gF`lh2R zUfgP*iHSUKl6rq@w0d;)$+naGYI#mtot(@+<)rHr>@@E5Jl~>a*O1Z>vBjBSEA5=J zJO!CjTby$#<_%&_3_>0#axtqJsm!US=mL8fl4s7%Wi z+LnEOH2=B)0_E0FRyX`^?!DZ*gU(*kUT3Lk9}$ulw$W=vlLC???TOh(vq@({Y7_gU z-jy{KJsr&=>_rG%Q~I=p%=ecDW^z3a=oiFYVc`n64kS(?sZyrO7@+P^a1GZ zfZZ;;zm%`Dxt6*iy+wuiu>Ic7uJYQw?nqr7>~#Ggm+k{y&NCrr4p&^L0C(zC$cMFr zC5Q3Nq<`5mT{|21xw1R>gT#Al9(Ru09DN++5mFJ?xO}-}xs$oi^C5U*cy97Sm+Oif zE*B7Tk@ZU;S4n=5p2DbgcqyH36tCe=6W<{{tx~taa$U>H*h3Bcog!i63saVZb;bNq zU1o%+Qd#_(WXY*eu}zy*^OWCiziv<4Lz`4;$?tXf;#D5|J}&pzjVdVL2$hPKevHhtM7E16Xv{!WRsF{wBgb8dTKN$FPY-@*7_4c>&Qnk$NIE(@qF~^19-4 zm6DAmHaJDa1fkyGeqxPu!r_|9Uim5N$98c-q-A5~b-MyvVF^oUj$+Wx)jNYq&CAVq zJX7n$eSJG6zwCg-zH<5%+tMr7T1$gm-gkj3O>RoaN83vVD#Kju$~=ScV@;v8-nCax z&f4~%>>NM%1b2LhwL92!{=AXm0cUt(?ukdWq=HX7ZeYaGiJp$5K1t0xo%U~*Omxeq z2_)9!Pkd z?U|jPX0505EV(0i(sCx**LAyVxtCExx}GHMon?vJ=4AFT8K!px=m_R!JN(X!6!a@pjKGx}d`KQ>NdsK|~7U7zzN|dO;L4#urNi zd0@TpBpvYR%}Ou`@2LZJMp&s>QH-$Oc=HfHtbK^J117{5qvZ+K(-qVXLNXi>u{1O& zh)5t&kwH4(dA~@;@403u7&PC7=BooXmeA z4JDAO3Jd{NQG=?fKvdO`a1|t674-cA>k2Y{Y5RHNkaotV-@`E^9k4fzMnOWMfq{X_ zfojTRKQAauOG^u?q6$@2g)n+RsKF!}ItW6d$}c$i;l~(D#rWYVG(4FEn)8eHAp6sF zz~H$+KdQ+KoLE`?+4#qJiNrsKrqWCT7zn;2{Uz)VOR7UK1q-#qQpx^) z7_3PEV=D50nmrAVTTIR`p5`?FICg9h{vXWdGz(_)OJN~H+Kjm(jr_1^8rjc*OeW|q ztg^+YC&t6m+^Pa?bjFiB$$`{O+E8Yb#e6S%!y2P$SY3vtIs~Q)QBie(!I3JONHtAG z#D^+Ach#>Qe2@3_%tqM(Qvv zb#;iUGHj`vCH?;B$C!-qpW7Y=Bn+0yNGf$nvKc9#F93#UuU}h#C9k$OY7pWn9cCNr}N(-Sn$8Z{GVe4dSgkfYR!VH`Ck9*gi6NI z0?~e0124wz`8Q>7!RxPP%m6 zM8|leNnTh_UFeSm{G;LDWo{v#zwWFbyY=^-s6F>jjb!X%#)?AE?;b{(`mJp-@8gGY$JD&UYVJU>@NZ|&IQwFC z8IxmfV(x8=55f{q#(2g*6m_neXfUG8+b}EsXz21!hD#LR4Hpu%Lr z8~XF?{acm%S;PL9KNe^7zx2xFiyeds2y2mzi!~o6EgKgT5Y{3a7i&IDS~e~wAgo0; zF4laQv}{~VKv;`xT&(#pY1z1#fUp+XxLEUH(z0WBk<6_N+ zNz2B?1cbH7#>JWsla`H(2?%SEjf*uOCM_Em6A;!S8y9OnOj7VgkZiWaDDZhe^xE#RP=4 z$i~H*50jRSiwOv8k&TNrA0{mu7ZVWHA{!TLK1^CRE+!zXMK&(he3-OsTueY%i!5;o zF22o*B{5!M4P?BlO7MB<#(2*agfX|X0)P+&00=(_08`%>_dx*gR{?;x?u=JtPXT}= z`MBGCQvl%3vM@Gq2x=Qn4UH1RuC3M^a6S3FXDj_k@)7Zu;YlaT^{pb4UWpsJI%T{{ z6Es^{*SVd~31qOEcUJ8iw?V*=tAz>Ozuy3*ks&62`by8Tb$p4gm%ZNR2ELl8o+&OK ze39lg(ML)Ptx(xtSEtr6ysv+9LR;;cf3hWS=FDlV$ZCCFItToq&&DFIb}O6e(OXj9 ze8_OV2v`@GNMQy?Byo^gsVePdwa8l0|$h!EPTA`4!wAi zD>@>+lxqh!LBto|;$10Y&T%;0au>wApw#-WD|YheU7WgH)8Q+&#^^K)z7cdU(#P}l zd$0W%gW9GycFp6P2gi)S*ifI~8|x#AL*Y|WBWB@g`p}H62^IqNDeHyh#+g03>N|$LmuGBA1Atki+sCVUozwBF9YVwZY zYThnzBS&m(PkQN9Lr|bMsuSFm%{ee_nE$T&VK_nK<>s(mZs1R(81*j-trJ|8n)v~buaC|OJo0h110BK^E%ON767gICHI!pj@X^je zzg7|G3+&Q~@YCOZ?b$Zow)HNMv-r?WU9N+&UGOVrchASSCelwy3OpIEs_^&APB5HB zAF=Z8c=3`G3zX(~KTUmYxC}9^y~#Et0&{eBZ^R0&yRntw2s`pffw4rbQ%PLZHwio5 z)uPl+o|#;4YTBpgJRJqe%>e?Zv8Ytvaf1Wp|PAtZt(`r>9xE&yCFvNuhb@n}Zo~XC&Mz z_){Gnif?Z&-u`-@ebe*gsCR0c3`$UsH`#vv%Aq}|)k1O5FUmr@pBFryoG?+u-RgC7 zP=VJL?Yc_ATu+{7hiyz%;?a@kHKjgzHF5-cll(=UDr(irhQbY*0J2M~WfJX`av@u) z@0rZ)Zu$T!cz}K^I`Sc)8onIF<-MWVU1TO9#*OP8$L@)>zHS{5Z`~{K232SSOrVRy z{Yk)6$eyB%n-LnDh|{GU`@_DzD&;8S*nbtWru)>oF2#1MzamoniZ4fHM(aqg6xKg8 zfI9QK!L6vDa7M;V-zxD9+*(;;tv;FO6~7iP|0KYJh}GMfBXyh1Tc3=4C4w6 zZpN!UQwguhT{kl@@d9f(S*3YDqsxJ;F-Cu|T4_sNlum{$=a5FN-7)L?jrXTFb}HVU z-NOxEUx>SUFN`+=vggvl;_gcRwgWwDoTKVF_;jkLRo_MS2)JAqn}BVDv>3eXF+KP> z0i%PNM!6c@Lo+&Lm}^2W$aYJa(mw90=3Vbr#c3-oNh}#8>;)pmkcKZ kYv$^LC*y|5tK1){ + console.log(g_redirect_path); $location.path(g_redirect_path); g_redirect_path = null; } diff --git a/public/javascripts/wechat/controllers/issue.js b/public/javascripts/wechat/controllers/issue.js index b580da465..fa13d3c58 100644 --- a/public/javascripts/wechat/controllers/issue.js +++ b/public/javascripts/wechat/controllers/issue.js @@ -1,4 +1,54 @@ -app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'common', function($scope, $http, $routeParams, auth, common){ +app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'common', + function($scope, $http, $routeParams, auth, common){ + + var vm = $scope; + vm.previewImgUrls = []; + vm.showAtDialog = false; + + var parseAtPersons = function (comment) { + var selectedPersons = []; + var ss = comment.match(/@(.+?)\s+/g); + + for(var i in ss){ + var personName = ss[i].substr(1, ss[i].length-2); + console.log(personName); + + for(var j in vm.at_persons){ + var person = vm.at_persons[j]; + if(person.name == personName){ + selectedPersons.push(person); + } + } + } + + for(var i in selectedPersons){ + var person = selectedPersons[i]; + comment = comment.replace('@'+person.name+' ', + '@'+person.name+'('+person.login+')'+' ' + ); + } + return comment; + }; + + vm.onPostChange = function (newValue, oldValue) { + if(newValue.length > oldValue.length && newValue.match(/@$/)=='@'){ + console.log('@ fire'); + vm.showAtDialog = true; + if(!vm.at_persons){ + $http.get('/at/'+$routeParams.id+'.json?type=Issue').then(function (response) { + vm.at_persons = response.data; + }); + } + } + console.log(vm.issue.comment); + }; + + vm.selectAtPerson = function (index) { + var person = vm.at_persons[index]; + vm.showAtDialog = false; + vm.issue.comment += person.name + ' '; + }; common.init({ id: $routeParams.id, @@ -18,11 +68,29 @@ app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'c replytype = data.type; page = data.page; + + var parseImgAttachment = function(attachments){ + var urls = []; + if(!attachments){ + return urls; + } + + for(var i = attachments.length-1; i>=0; i--){ + if(attachments[i].filename.match('.jpg$')=='.jpg' || attachments[i].filename.match('.png$')=='.png'){ + urls.push(attachments[i].download_url); + attachments.splice(i, 1); + } + } + urls.push('http://imgsrc.baidu.com/baike/pic/item/f9198618367adab43246bfa18ed4b31c8601e4ba.jpg'); + return urls; + }; + if (replytype == 0){ if (page == 0){ $scope.issue = data.data; $scope.page = 0; $scope.is_public = data.is_public; + $scope.previewImgUrls = parseImgAttachment($scope.issue.attachments); } else{ $scope.issue.all_children = $scope.issue.all_children.concat(data.data.all_children); @@ -42,6 +110,17 @@ app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'c } }, replyCallback: function(){ + }, + beforeReplay: function(data){ + return parseAtPersons(data); } }); + + $scope.previewImg = function(index){ + console.log(index); + wx.previewImage({ + current: $scope.previewImgUrls[index], // 当前显示图片的http链接 + urls: $scope.previewImgUrls // 需要预览的图片http链接列表 + }); + } }]); \ No newline at end of file diff --git a/public/javascripts/wechat/others/factory.js b/public/javascripts/wechat/others/factory.js index 190dd36b4..daf8a45f8 100644 --- a/public/javascripts/wechat/others/factory.js +++ b/public/javascripts/wechat/others/factory.js @@ -94,24 +94,17 @@ app.factory('rms', function(){ }); app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$location', function($http, auth, $routeParams,rms,config,wx,$location){ - var addCommonReply = function(id, type, data,args,reply_type, cb){ - //先判断有没有绑定 -// $http.post( -// '/wechat/is_bind', -// {} ///不用传code了,都由服务器来处理 -// ).then(function(response){ -// console.log(response.data); -// if(response.data.status != 0){ -// $location.path("/login_tip"); -// } -// }); - + var addCommonReply = function(id, type, data,args,reply_type, beforeReply, cb){ if(!data.comment || data.comment.length<=0){ return; } var temp = data.comment.replace(/\n/g,'
    '); + if(typeof beforeReply==='function'){ + temp = beforeReply(temp); + } + var userInfo = { type: type, content: temp, @@ -121,6 +114,8 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc //回复按钮禁用 data.disabled = true; + console.log(userInfo); + $http({ method: 'POST', url: apiUrl+ "new_comment/"+id, @@ -308,7 +303,8 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc loadData(args.id,0,0); args.scope.addReply = function(data,reply_type){ console.log(data.comment); - addCommonReply(data.act_id, args.replyType, data,args,reply_type, function(subscribe){ + + addCommonReply(data.act_id, args.replyType, data,args, reply_type, args.beforeReplay, function(subscribe){ // args.scope.formData = {comment: ''}; if(subscribe == 0){ $location.path("/login_tip"); diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index aa4cff972..a485d94bb 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -1,6 +1,8 @@ @charset "utf-8"; /* CSS Document */ +html, body{ margin:0; height:100%; } + /*基本样式*/ body,table,input,textarea,select,button { font-family: "微软雅黑","宋体","Helvetica Neue", Helvetica, Arial, sans-serif;} body, ul, h1,h2,h3,h4,h5,p,pre,input {padding:0px; margin:0px;} @@ -263,4 +265,22 @@ a.underline {text-decoration:underline;} /*资料修改*/ .blank-row {width:100%; height:38px; line-height:38px; vertical-align:middle;} .upload-input-container {width:30px; height:30px; border:1px solid #ddd; position:relative;} -.upload-input {width:30px; height:30px; position:absolute; z-index:1; opacity:0;} \ No newline at end of file +.upload-input {width:30px; height:30px; position:absolute; z-index:1; opacity:0;} +.select-container {position:relative; padding-left:62px;} +.select-text {position:absolute; left:15px;} +.select-model {width:100%; border:none; color:#999; margin-top:8px;} + + +/*附件显示 20161202byLB*/ +.clear:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden} +.clear{clear:both;zoom:1} +.weixin-files{ width:100%; word-break:break-all; word-wrap: break-word;} +.weixin-files ol{-webkit-padding-start: 0px;} +.weixin-files-img{ border:1px solid #eee; padding:2px; width:50px; margin-bottom:5px;} +/*所有人 20161202byLB*/ +.weixin-users-all{ width:100%; background:#fff;} +.weixin-users-all li{ height:40px; line-height:40px; font-size:14px; color:#888; padding:0 15px; border-bottom:1px solid #ccc;} +.weixin-users-all li:hover{ background:#f4f4f4;} + +/*弹出@选择对话框 guange*/ +.wechat-at {position: fixed; top: 0; left:0; width: 100%; height: 100%; background-color: #ffffff;} \ No newline at end of file From 6c37645c9e32bbd3699fa5d7bd6e9d06a09feed9 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 5 Dec 2016 09:30:39 +0800 Subject: [PATCH 08/41] =?UTF-8?q?at=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 --- public/javascripts/wechat/controllers/issue.js | 1 - 1 file changed, 1 deletion(-) diff --git a/public/javascripts/wechat/controllers/issue.js b/public/javascripts/wechat/controllers/issue.js index fa13d3c58..40a2f0589 100644 --- a/public/javascripts/wechat/controllers/issue.js +++ b/public/javascripts/wechat/controllers/issue.js @@ -81,7 +81,6 @@ app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'c attachments.splice(i, 1); } } - urls.push('http://imgsrc.baidu.com/baike/pic/item/f9198618367adab43246bfa18ed4b31c8601e4ba.jpg'); return urls; }; From 6775c902f30fe356c47049e3b90804beed6925de Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 5 Dec 2016 09:37:37 +0800 Subject: [PATCH 09/41] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E5=A6=82=E9=A2=98=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_student_work_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 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 e45e6e9a2..59b8d0ab2 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -17,7 +17,7 @@ <%=link_to "提交作品", new_student_work_url_without_domain(@homework.id),:class => 'blueCir ml5 f12' %> <% end %> <% elsif !@is_teacher && my_work &&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 && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%> <% if @homework.homework_type == 3 %> 组长已提交,组长还可修改 From 5bc4c779eade2c43d23740fc9176aad50d70e3f6 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 5 Dec 2016 11:07:41 +0800 Subject: [PATCH 10/41] =?UTF-8?q?issue=E5=92=8Ccommit=5Fid=E5=85=B3?= =?UTF-8?q?=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 10 +- app/models/issue.rb | 2 + app/views/issues/_form.html.erb | 4 +- app/views/issues/_issue_commits.html.erb | 140 +++++++++++++++++++++++ app/views/issues/issue_commits.js.erb | 2 +- public/javascripts/application.js | 2 + public/stylesheets/css/moduel.css | 2 +- 7 files changed, 155 insertions(+), 7 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 191465003..367f14dd9 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -22,9 +22,9 @@ class IssuesController < ApplicationController before_filter :authorize1, :only => [:show] before_filter :find_issue, :only => [:show, :edit, :update,:add_journal, :add_journal_in_org] before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy] - before_filter :find_project, :only => [:new, :create, :update_form] + before_filter :find_project, :only => [:new, :create, :update_form, :issue_commits] #before_filter :authorize, :except => [:index, :show] - before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply] + before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply, :issue_commits] before_filter :find_optional_project, :only => [:index] before_filter :check_for_default_issue_status, :only => [:new, :create] @@ -60,12 +60,14 @@ class IssuesController < ApplicationController # issue和代码提交id关联模块 --> over # 获取某个项目的commit_ids def issue_commits - project = Project.find(@issue.project_id) begin - g = Gitlab.commits(project.gpid) + return render_404 if @project.gpid.nil? + g = Gitlab.client g_project = g.project(project.gpid) @rev = params[:rev].nil? ? g_project.default_branch : params[:rev] @commits = g.g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s, ref_name:rev) + @commits_count = params[:commit_count].to_i + @commits_pages = Redmine::Pagination::Paginator.new @commits_count,limit,params[:page] rescue Exception => e puts e end diff --git a/app/models/issue.rb b/app/models/issue.rb index 46a42cb34..b46e29104 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -56,6 +56,8 @@ class Issue < ActiveRecord::Base has_one :praise_tread_cache, as: :object, dependent: :destroy # ForgeMessage虚拟关联(多态) has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_message ,:dependent => :destroy + # 该关联不能关联删除,因为commit记录没有存在Trustie数据库中 + has_many :commit_issueses has_many :at_messages, class_name: 'AtMessage', as: :at_message ,:dependent => :destroy diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 9208638c4..bc5063f19 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -135,7 +135,9 @@ <% end %>
  • 完成度
  • -
  • 关联Commit<%= link_to "+".html_safe, issue_commits_issues_path %>
  • + <% if @project.gpid %> +
  • 关联Commit<%= link_to "+".html_safe, issue_commits_issues_path(:project_id => @project), :remote => true %>
  • + <% end %> <% end %> \ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 779b8805c..d9b1226c6 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -1446,7 +1446,7 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { } : function (name) { return getComputedStyle(elem, null)[name]; }, - minHeight = parseFloat(getFirstStyle('height')) + minHeight = parseFloat(getFirstStyle('height')); elem.style.resize = 'none'; elem2.style.resize = 'none'; @@ -1474,8 +1474,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { style2.overflowY = 'auto'; } else { height = elem.scrollHeight - padding; - style.overflowY = 'hidden'; - style2.overflowY = 'hidden'; }; style.height = height + extra + 'px'; style2.height = height + extra + 'px'; @@ -1491,8 +1489,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { style2.overflowY = 'auto'; } else { height = elem2.scrollHeight - padding; - style.overflowY = 'hidden'; - style2.overflowY = 'hidden'; }; style.height = height + extra + 'px'; style2.height = height + extra + 'px'; diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index 916481818..600662ab1 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -632,7 +632,7 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { } : function (name) { return getComputedStyle(elem, null)[name]; }, - minHeight = parseFloat(getFirstStyle('height')) + minHeight = parseFloat(getFirstStyle('height')); elem.style.resize = 'none'; elem2.style.resize = 'none'; @@ -660,8 +660,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { style2.overflowY = 'auto'; } else { height = elem.scrollHeight - padding; - style.overflowY = 'hidden'; - style2.overflowY = 'hidden'; }; style.height = height + extra + 'px'; style2.height = height + extra + 'px'; @@ -677,8 +675,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { style2.overflowY = 'auto'; } else { height = elem2.scrollHeight - padding; - style.overflowY = 'hidden'; - style2.overflowY = 'hidden'; }; style.height = height + extra + 'px'; style2.height = height + extra + 'px'; From 9e9f1d44a1fba07cecea8b2ea86cb28194e74f86 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 6 Dec 2016 10:00:18 +0800 Subject: [PATCH 17/41] =?UTF-8?q?=E5=85=B7=E4=BD=93=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E9=A1=B5=E9=87=8C=E7=9A=84=E7=8F=AD=E7=BA=A7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E9=9C=80=E8=A6=81=E6=98=BE=E7=A4=BA=E7=8F=AD?= =?UTF-8?q?=E7=BA=A7=E5=90=8D=E7=A7=B0=EF=BC=8C=E7=9B=B4=E6=8E=A5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=A0=8F=E7=9B=AE=E5=90=8D=E7=A7=B0=E5=B0=B1=E5=8F=AF?= =?UTF-8?q?=E3=80=81=E5=85=B7=E4=BD=93=E4=BD=9C=E4=B8=9A=E7=9A=84=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=EF=BC=8C=E4=B9=9F=E4=B8=8D=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=8F=AD=E7=BA=A7=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/comments/create.js.erb | 4 ++-- app/views/courses/_course_activity.html.erb | 8 ++++---- app/views/student_work/_homework_post_brief.html.erb | 2 -- app/views/users/_course_attachment.html.erb | 2 +- app/views/users/_course_create.html.erb | 3 ++- app/views/users/_course_homework.html.erb | 6 +++--- app/views/users/_course_journalsformessage.html.erb | 3 ++- app/views/users/_course_message.html.erb | 3 ++- app/views/users/_course_news.html.erb | 3 ++- app/views/users/_course_poll.html.erb | 3 ++- 10 files changed, 20 insertions(+), 17 deletions(-) diff --git a/app/views/comments/create.js.erb b/app/views/comments/create.js.erb index 0814b5f50..970fded22 100644 --- a/app/views/comments/create.js.erb +++ b/app/views/comments/create.js.erb @@ -1,8 +1,8 @@ <% if @course %> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); + $("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_news_post_reply', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); <% elsif @project %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); <% else %> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); + $("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'organizations/course_news_post_reply', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); <% end %> sd_create_editor_from_data('<%= @user_activity_id%>',"","100%", "UserActivity"); diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb index a7f99f2b0..8ad3323f6 100644 --- a/app/views/courses/_course_activity.html.erb +++ b/app/views/courses/_course_activity.html.erb @@ -62,17 +62,17 @@ <% when 'HomeworkCommon' %> <%= render :partial => 'users/course_homework', :locals => {:activity => act, :user_activity_id => activity.id, :hw_status => 2} %> <% when 'News' %> - <%= render :partial => 'users/course_news', :locals => {:activity => act, :user_activity_id => activity.id} %> + <%= render :partial => 'users/course_news', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %> <% when 'Message' %> <%= render :partial => 'users/course_message', :locals => {:activity => act, :user_activity_id => activity.id,:is_course=>1,:is_board=>0} %> <% when 'Poll' %> - <%= render :partial => 'users/course_poll', :locals => {:activity => act, :user_activity_id => activity.id} %> + <%= render :partial => 'users/course_poll', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %> <% when 'JournalsForMessage' %> - <%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => activity.id} %> + <%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %> <% when 'Attachment' %> <%= render :partial => 'users/course_attachment', :locals => {:activity => act, :user_activity_id => activity.id} %> <% when 'Course' %> - <%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => activity.id} %> + <%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %> <% end %> <% end %> <% end %> diff --git a/app/views/student_work/_homework_post_brief.html.erb b/app/views/student_work/_homework_post_brief.html.erb index d2041bfbb..12fba5d71 100644 --- a/app/views/student_work/_homework_post_brief.html.erb +++ b/app/views/student_work/_homework_post_brief.html.erb @@ -4,8 +4,6 @@
    <%= link_to homework.user.show_name, user_activities_path(homework.user_id), :class => "newsBlue mr15"%> - TO - <%= link_to homework.course.name, course_path(homework.course_id), :class => "newsBlue"%>
    <%= link_to activity.filename, course_files_path(activity.course), :class => "postGrey" %> diff --git a/app/views/users/_course_create.html.erb b/app/views/users/_course_create.html.erb index 51b198209..f63471201 100644 --- a/app/views/users/_course_create.html.erb +++ b/app/views/users/_course_create.html.erb @@ -12,7 +12,8 @@ <%= link_to activity.try(:teacher).try(:realname), user_path(activity.teacher), :class => "newsBlue mr15" %> <% end %> TO - <%= link_to activity.name.to_s+" | 班级", course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue" %> + <% str = defined?(is_course) && is_course == 1 ? "班级" : "#{activity.name.to_s} | 班级" %> + <%= link_to str, course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
    <%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %> diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 0a95b4bf1..b7ed168f4 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -9,10 +9,10 @@
    <%= link_to activity.user.show_name, user_path(activity.user,:host=>Setting.host_user), :class => "newsBlue mr15" %> TO - <% if hw_status == 3 || hw_status == 5 %> - <%= link_to activity.course.name, course_path(activity.course_id), :class => "newsBlue"%> + <% if hw_status == 3 || hw_status == 2 %> + <%= link_to "班级作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%> <% else %> - <%= link_to activity.course.name.to_s+" | 班级作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue"%> + <%= link_to activity.course.name.to_s+" | 班级作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%> <% end %>
    diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 61c33f67e..37b9f98c9 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -8,7 +8,8 @@
    <%= link_to activity.author.show_name, user_path(activity.author), :class => "newsBlue mr15" %> TO - <%= link_to activity.course.name.to_s+" | 班级通知", course_news_index_path(activity.course), :class => "newsBlue" %> + <% str = defined?(is_course) && is_course == 1 ? "班级通知" : "#{activity.course.name.to_s} | 班级通知" %> + <%= link_to str, course_news_index_path(activity.course), :class => "newsBlue ml15" %>
    From 098d42cbd14ac3f51a34aa815e92479e3ec36147 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 6 Dec 2016 14:47:17 +0800 Subject: [PATCH 18/41] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E6=88=AA=E6=AD=A2=E6=97=A5=E6=9C=9F=E6=97=B6=E4=B9=9F?= =?UTF-8?q?=E5=BA=94=E9=87=8D=E6=96=B0=E5=88=A4=E6=96=AD=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E8=BF=9F=E4=BA=A4=E3=80=81=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?id=E4=B8=BA4198=E7=9A=84=E4=BD=9C=E5=93=81=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 21 +++++++++++++++++++ ...0161206061652_update_student_work_score.rb | 19 +++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 db/migrate/20161206061652_update_student_work_score.rb diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 3234d15c0..b7e4b9efd 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -82,6 +82,27 @@ class HomeworkCommonController < ApplicationController @homework.publish_time = params[:homework_common][:publish_time] end homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new + param_end_time = Time.parse(params[:homework_common][:end_time]).strftime("%Y-%m-%d") + homework_end_time = Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") + if homework_end_time != param_end_time + if homework_end_time > param_end_time + @homework.student_works.where("work_status = 1").each do |st| + if param_end_time < Time.parse(st.commit_time.to_s).strftime("%Y-%m-%d") + st.late_penalty = @homework.late_penalty + st.work_status = 2 + st.save + end + end + else + @homework.student_works.where("work_status = 2").each do |st| + if param_end_time >= Time.parse(st.commit_time.to_s).strftime("%Y-%m-%d") + st.late_penalty = 0 + st.work_status = 1 + st.save + end + end + end + end @homework.end_time = params[:homework_common][:end_time] || Time.now @homework.course_id = params[:course_id] if params[:homework_type] && params[:homework_type].to_i != @homework.homework_type diff --git a/db/migrate/20161206061652_update_student_work_score.rb b/db/migrate/20161206061652_update_student_work_score.rb new file mode 100644 index 000000000..4fcd374ca --- /dev/null +++ b/db/migrate/20161206061652_update_student_work_score.rb @@ -0,0 +1,19 @@ +class UpdateStudentWorkScore < ActiveRecord::Migration + def up + homework = HomeworkCommon.where("id = 4198").first + unless homework.nil? + homework.student_works.each do |st| + if st.late_penalty != 0 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") > Time.parse(st.commit_time.to_s).strftime("%Y-%m-%d") + if st.work_status == 2 + st.work_status = 1 + end + st.late_penalty = 0 + st.save + end + end + end + end + + def down + end +end From 5a6e64beb2c69449dcb3049005e96c375abfccf6 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 6 Dec 2016 15:02:32 +0800 Subject: [PATCH 19/41] =?UTF-8?q?Revert=20"=E6=B5=8B=E9=AA=8C=E5=A4=B4?= =?UTF-8?q?=E9=83=A8=E5=92=8C=E6=96=B0=E5=BB=BA=E9=A2=98=E7=9B=AE=E7=9A=84?= =?UTF-8?q?=E6=94=B9=E7=89=88"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c33bf1b1637096d6a65f8aed3a694280c58f1573. Conflicts: public/stylesheets/css/courses.css --- app/controllers/exercise_controller.rb | 4 +- app/helpers/exercise_helper.rb | 39 --------- app/views/exercise/_edit_head.html.erb | 14 ++-- app/views/exercise/_exercise_form.html.erb | 57 +++---------- app/views/exercise/_new_MC.html.erb | 80 +++++++++---------- app/views/exercise/_new_MCQ.html.erb | 53 ++++++------ app/views/exercise/_new_question.html.erb | 6 +- app/views/exercise/_new_single.html.erb | 16 ++-- app/views/exercise/_show_head.html.erb | 9 +-- .../20161129084352_add_column_to_exercises.rb | 6 -- db/schema.rb | 8 +- public/stylesheets/css/courses.css | 7 -- 12 files changed, 100 insertions(+), 199 deletions(-) delete mode 100644 db/migrate/20161129084352_add_column_to_exercises.rb diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index 02ee909b7..02a8400a7 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -132,9 +132,7 @@ class ExerciseController < ApplicationController @exercise.time = params[:exercise][:time].blank? ? -1 : params[:exercise][:time] @exercise.end_time = Time.at(params[:exercise][:end_time].to_time.to_i + 16*60*60 -1) @exercise.publish_time = params[:exercise][:publish_time] - @exercise.show_result = params[:show_result].blank? ? 1 : params[:show_result] - @exercise.question_random = params[:question_random] - @exercise.choice_random = params[:choice_random] + @exercise.show_result = params[:exercise][:show_result].blank? ? 1 : params[:exercise][:show_result] if @exercise.save respond_to do |format| format.js diff --git a/app/helpers/exercise_helper.rb b/app/helpers/exercise_helper.rb index 47fccefff..6dadf92b5 100644 --- a/app/helpers/exercise_helper.rb +++ b/app/helpers/exercise_helper.rb @@ -175,43 +175,4 @@ module ExerciseHelper standard_answer end - # 问题随机的下拉列表 - def question_random_select - type = [] - option1 = [] - option1 << "题目不随机打乱" - option1 << 0 - type << option1 - option2 = [] - option2 << "题目随机打乱" - option2 << 1 - type << option2 - end - - # 选项随机的下拉列表 - def choice_random_select - type = [] - option1 = [] - option1 << "选项不随机打乱" - option1 << 0 - type << option1 - option2 = [] - option2 << "选项随机打乱" - option2 << 1 - type << option2 - end - - #允许学生查看结果的下拉列表 - def show_result_select - type = [] - option1 = [] - option1 << "允许学生查看测验结果" - option1 << 1 - type << option1 - option2 = [] - option2 << "不允许学生查看测验结果" - option2 << 0 - type << option2 - end - end \ No newline at end of file diff --git a/app/views/exercise/_edit_head.html.erb b/app/views/exercise/_edit_head.html.erb index e23f3134a..a071904ce 100644 --- a/app/views/exercise/_edit_head.html.erb +++ b/app/views/exercise/_edit_head.html.erb @@ -16,13 +16,13 @@
    - diff --git a/app/views/exercise/_exercise_form.html.erb b/app/views/exercise/_exercise_form.html.erb index c2c01ac25..cb41cf26b 100644 --- a/app/views/exercise/_exercise_form.html.erb +++ b/app/views/exercise/_exercise_form.html.erb @@ -168,54 +168,16 @@ $("#edit_poll_questions_"+question_id).show(); $("#poll_questions_title_"+question_id).focus(); } - // 选项的选择 - function toggle_select(doc, type){ - if(doc.hasClass("question_choice_blue")){ - doc.removeClass("question_choice_blue").addClass("question_choice_white"); - if(type == "1"){ - $("#question_standard_answer").html("请点击选项"); - $("#exercise_choice").val(""); - }else{ - var eles = doc.parent().parent().find("a.question_choice_blue"); - var str = ""; - if(eles.length > 0){ - for(var i=0; i" + - ""+ + var li = doc.parent().after("
  • " + + ""+ "
  • "); - var select_items =$("li.new_answer",li.parent()); - li.prev().prev().find("a.question_choice_white").html(String.fromCharCode(64 + select_items.length)); - doc.prev("a.question_choice_dash").html(String.fromCharCode(64 + select_items.length + 1)); + var select_items =$("label[name='select_items']",li.parent()); + for(var i=0; i:   "); + } } function add_candidate_answer(doc) { @@ -252,11 +214,10 @@ { var parent = doc.parent().parent(); doc.parent().remove(); - - var select_items =$("li.ur_item",parent); + var select_items =$("label[name='select_items']",parent); var candiate_items =$("label[name='candiate_items']",parent); for(var i=0; i:   "); } for(var i=0; i:   "); diff --git a/app/views/exercise/_new_MC.html.erb b/app/views/exercise/_new_MC.html.erb index 6ebf3bd40..054285825 100644 --- a/app/views/exercise/_new_MC.html.erb +++ b/app/views/exercise/_new_MC.html.erb @@ -3,14 +3,6 @@ :url=>create_exercise_question_exercise_path(exercise.id), :remote=>true ) do |f| %>
    -
    - <% score = exercise.exercise_questions.where("question_type=1").last.nil? ? "": exercise.exercise_questions.where("question_type=1").last.question_score %> - - 分 - 请点击选项 - 标准答案: -
    -
    @@ -18,44 +10,52 @@
      +
    • + <% score = exercise.exercise_questions.where("question_type=1").last.nil? ? "": exercise.exercise_questions.where("question_type=1").last.question_score %> + + 分 +
    • +
      - -
    • - A - - -
    • -
      -
    • - B - - -
    • -
      -
    • - C - - -
    • -
      -
    • - D - - -
    • -
      -
    • - E -
      新建选项
      -
    • -
      +
    • + + + + +
    • +
      +
    • + + + + +
    • +
      +
    • + + + + +
    • +
      +
    • + + + + +
    • +
    • + + +
    • +
    diff --git a/app/views/exercise/_new_MCQ.html.erb b/app/views/exercise/_new_MCQ.html.erb index 965772051..d8dbf0adb 100644 --- a/app/views/exercise/_new_MCQ.html.erb +++ b/app/views/exercise/_new_MCQ.html.erb @@ -3,14 +3,6 @@ :url=>create_exercise_question_exercise_path(exercise.id), :remote=>true ) do |f| %>
    -
    - <% score = exercise.exercise_questions.where("question_type=2").last.nil? ? "": exercise.exercise_questions.where("question_type=2").last.question_score %> - - 分 - 请点击选项 - 标准答案: -
    -
    @@ -18,43 +10,52 @@
      +
    • + <% score = exercise.exercise_questions.where("question_type=2").last.nil? ? "": exercise.exercise_questions.where("question_type=2").last.question_score %> + + 分 +
    • +
      - -
    • - A - +
    • + + +
    • -
    • - B - +
    • + + +
    • -
    • - C - +
    • + + +
    • -
    • - D - +
    • + + +
    • - E -
      新建选项
      + +
    • -
      +
    diff --git a/app/views/exercise/_new_question.html.erb b/app/views/exercise/_new_question.html.erb index 23aae4cb3..faadb08a9 100644 --- a/app/views/exercise/_new_question.html.erb +++ b/app/views/exercise/_new_question.html.erb @@ -14,7 +14,7 @@ alert("请先保存正在编辑的题目再新建。"); } else{ $("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC', :locals => {:exercise=>exercise}) %>"); - $("#question_score").focus(); + $("#poll_questions_title").focus(); } } @@ -26,7 +26,7 @@ alert("请先保存正在编辑的题目再新建。"); } else{ $("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MCQ', :locals => {:exercise=>exercise}) %>"); - $("#question_score").focus(); + $("#poll_questions_title").focus(); } } @@ -38,7 +38,7 @@ alert("请先保存正在编辑的题目再新建。"); } else{ $("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_single', :locals => {:exercise=>exercise}) %>"); - $("#question_score").focus(); + $("#poll_questions_title").focus(); } } diff --git a/app/views/exercise/_new_single.html.erb b/app/views/exercise/_new_single.html.erb index 669a1b8db..d0fce87c8 100644 --- a/app/views/exercise/_new_single.html.erb +++ b/app/views/exercise/_new_single.html.erb @@ -3,12 +3,6 @@ :url=>create_exercise_question_exercise_path(exercise.id), :remote=>true ) do |f| %>
    -
    - <% score = exercise.exercise_questions.where("question_type=3").last.nil? ? "": exercise.exercise_questions.where("question_type=3").last.question_score %> - - 分 -
    -
    @@ -16,6 +10,12 @@
      +
    • + <% score = exercise.exercise_questions.where("question_type=3").last.nil? ? "": exercise.exercise_questions.where("question_type=3").last.question_score %> + + 分 +
    • +
    • @@ -42,8 +42,8 @@
    diff --git a/app/views/exercise/_show_head.html.erb b/app/views/exercise/_show_head.html.erb index b59eb11c7..4cc5a6cf8 100644 --- a/app/views/exercise/_show_head.html.erb +++ b/app/views/exercise/_show_head.html.erb @@ -1,5 +1,5 @@ -
    - +
    +

    <%= exercise.exercise_name%>

    @@ -12,10 +12,5 @@ <% end %>
    <%= exercise.exercise_description.nil? ? "" :exercise.exercise_description.html_safe%>
    -
    \ No newline at end of file diff --git a/db/migrate/20161129084352_add_column_to_exercises.rb b/db/migrate/20161129084352_add_column_to_exercises.rb deleted file mode 100644 index ea3d01667..000000000 --- a/db/migrate/20161129084352_add_column_to_exercises.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddColumnToExercises < ActiveRecord::Migration - def change - add_column :exercises, :question_random, :integer, :default => 0 - add_column :exercises, :choice_random, :integer, :default => 0 - end -end diff --git a/db/schema.rb b/db/schema.rb index 9109f785d..bd3645e2c 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 => 20161129084352) do +ActiveRecord::Schema.define(:version => 20161128072528) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -820,13 +820,11 @@ ActiveRecord::Schema.define(:version => 20161129084352) do t.integer "exercise_status" t.integer "user_id" t.integer "time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.datetime "publish_time" t.datetime "end_time" t.integer "show_result" - t.integer "question_random", :default => 0 - t.integer "choice_random", :default => 0 end create_table "first_pages", :force => true do |t| diff --git a/public/stylesheets/css/courses.css b/public/stylesheets/css/courses.css index c0bb5343d..97ba3801f 100644 --- a/public/stylesheets/css/courses.css +++ b/public/stylesheets/css/courses.css @@ -604,10 +604,3 @@ a:hover.ex_icon_edit{ background:url(/images/course/icons.png) -21px -276px no- .archive_course_notice {width:220px; position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-265px; top:-15px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);} .archive_course_notice em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;} .archive_course_notice span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;} - -/* 新版测验 */ -.blue_select{ background: #3b94d6; font-size: 12px; color: #fff; padding: 5px 10px;} -.grey_select{ background: #c3c3c3; font-size: 12px; color: #fff; padding: 5px 10px;} -a.question_choice_white{ background: #fff; color: #000000; width: 34px; height: 30px; border: 1px solid #ddd; text-align: center; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} -a.question_choice_blue{ background: #3b94d6; color: #fff; width: 34px; height: 30px; border: 1px solid #ddd; text-align: center; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} -.question_choice_dash{ background: #fff; color: #000000; width: 34px; height: 30px; border: 1px dashed #ddd; text-align: center; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} From 494946c70e201a355480dbf26676c50e1029482a Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 6 Dec 2016 16:13:04 +0800 Subject: [PATCH 20/41] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E5=90=8E=E6=8F=90=E4=BA=A4=E7=9A=84=E4=BD=9C=E5=93=81=E4=B9=9F?= =?UTF-8?q?=E5=BA=94=E8=AE=A1=E7=AE=97=E7=BC=BA=E8=AF=84=E6=89=A3=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 8 ++++++++ app/controllers/users_controller.rb | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 596775045..3c0469e9b 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -587,6 +587,14 @@ class StudentWorkController < ApplicationController if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") student_work.late_penalty = @homework.late_penalty student_work.work_status = 2 + # 缺评扣分 + if @homework.homework_detail_manual.no_anon_penalty == 0 && @homework.homework_detail_manual.comment_status == 3 && @homework.anonymous_comment == 0 + work_ids = "(" + @homework.student_works.has_committed.map(&:id).join(",") + ")" + all_dis_eva = StudentWorksEvaluationDistribution.where("student_work_id IN #{work_ids}") + has_sw_count = all_dis_eva.select("distinct user_id").count + anon_count = all_dis_eva.count / has_sw_count + student_work.absence_penalty = @homework.homework_detail_manual.absence_penalty * anon_count + end else student_work.late_penalty = 0 student_work.work_status = 1 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index da7cfd849..93ae61d6a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1186,10 +1186,18 @@ class UsersController < ApplicationController student_work = StudentWork.where(homework_common_id: homework.id, user_id: User.current.id).first if student_work - #提交作品时,计算是否迟交 + # 提交作品时,计算是否迟交 if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") student_work.late_penalty = homework.late_penalty student_work.work_status = 2 + # 缺评扣分 + if homework.homework_detail_manual.no_anon_penalty == 0 && homework.homework_detail_manual.comment_status == 3 && homework.anonymous_comment == 0 + work_ids = "(" + homework.student_works.has_committed.map(&:id).join(",") + ")" + all_dis_eva = StudentWorksEvaluationDistribution.where("student_work_id IN #{work_ids}") + has_sw_count = all_dis_eva.select("distinct user_id").count + anon_count = all_dis_eva.count / has_sw_count + student_work.absence_penalty = homework.homework_detail_manual.absence_penalty * anon_count + end else student_work.late_penalty = 0 student_work.work_status = 1 From 33a4186e69f111ec1575d31eaff87de9dc3d43e6 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 6 Dec 2016 17:37:07 +0800 Subject: [PATCH 21/41] =?UTF-8?q?=E5=AE=8C=E6=88=90issue=E5=92=8Ccommit?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=88=9B=E5=BB=BA=E3=80=82=E5=8E=BB=E9=87=8D?= =?UTF-8?q?=EF=BC=8C=E5=8F=8A=E7=9B=B8=E5=85=B3=E5=B1=80=E9=83=A8=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 30 +++++-- app/views/issues/_form.html.erb | 41 ++++++++-- app/views/issues/_issue_commit_ids.html.erb | 10 +++ app/views/issues/_issue_commits.html.erb | 80 ++++++------------- app/views/issues/_issue_commits_list.html.erb | 41 ++++++++++ app/views/issues/commit_for_issue.js.erb | 1 + app/views/issues/issue_commits.js.erb | 5 ++ app/views/issues/show.html.erb | 9 +++ config/routes.rb | 3 +- public/stylesheets/css/project.css | 4 +- 10 files changed, 153 insertions(+), 71 deletions(-) create mode 100644 app/views/issues/_issue_commit_ids.html.erb create mode 100644 app/views/issues/_issue_commits_list.html.erb create mode 100644 app/views/issues/commit_for_issue.js.erb diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index e3e501975..3765b9920 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -22,9 +22,9 @@ class IssuesController < ApplicationController before_filter :authorize1, :only => [:show] before_filter :find_issue, :only => [:show, :edit, :update,:add_journal, :add_journal_in_org] before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy] - before_filter :find_project, :only => [:new, :create, :update_form, :issue_commits] + before_filter :find_project, :only => [:new, :create, :update_form, :issue_commits, :commit_for_issue] #before_filter :authorize, :except => [:index, :show] - before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply, :issue_commits] + before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply, :issue_commits, :commit_for_issue] before_filter :find_optional_project, :only => [:index] before_filter :check_for_default_issue_status, :only => [:new, :create] @@ -62,17 +62,28 @@ class IssuesController < ApplicationController def issue_commits begin return render_404 if @project.gpid.nil? + @issue_commit_ids = params[:issue_commit_ids].split(",") + search = params[:search].to_s.lstrip.rstrip + @type = params[:type] limit = 20 g = Gitlab.client g_project = g.project(@project.gpid) - rev = params[:rev].nil? ? g_project.default_branch : params[:rev] - @commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s, ref_name:rev) + rev = params[:branch].nil? ? g_project.default_branch : params[:branch] + @commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s, ref_name:rev).select{|commit| commit.title.include?("#{search}")} + @project_branches = g.branches(@project.gpid) + @branch_names = @project_branches.map{|b| b.name} + @default_branch = g_project.default_branch @commits_count = g.user_static(@project.gpid, :rev => rev).count @commits_pages = Redmine::Pagination::Paginator.new @commits_count, limit, params[:page] rescue Exception => e puts e end end + + def commit_for_issue + history_commit_ids = params[:issue_commit_ids] + @issue_commit_ids = (history_commit_ids.blank? ? params[:checkbox1] : params[:checkbox1] | history_commit_ids).uniq + end # over def index @@ -181,13 +192,13 @@ class IssuesController < ApplicationController def show # 顶部导航 @project_menu_type = 2 - # 打开编辑内容 @is_edit = true unless params[:edit].nil? - # 当前用户查看指派给他的缺陷消息,则设置消息为已读 query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first query.update_attribute(:viewed, true) unless query.nil? + # issue 关联的commit + @commits = CommitIssues.where(:issue_id => @issue.id, :project_id => @issue.project_id) # issue 新建的at消息 User.current.at_messages.unviewed('Issue', @issue.id).each {|x| x.viewed!} @@ -256,6 +267,13 @@ class IssuesController < ApplicationController @issue.fixed_version_id = nil if @issue.fixed_version_id == 0 @issue.assigned_to_id = nil if @issue.assigned_to_id == 0 if @issue.save + # 关联commmit + commits = params[:had_commits] + if commits + commits.each do |commit| + CommitIssues.create(:commit_id => commit.id, :project_id => @issue.project_id, :issue_id => @issue.id) + end + end #params[:issue][:assigned_to_id] = nil if params[:issue][:assigned_to_id].to_i == 0 senduser = User.find(params[:issue][:assigned_to_id]) issue_id = @issue.id diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index bc5063f19..07bd12602 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -110,8 +110,8 @@ <% if @issue.safe_attribute? 'due_date' %> <%= f.text_field :due_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true, - :required => @issue.required_attribute?('due_date'), :onchange => "issue_end_date_change();", - :class => "fl calendar_input",:style => "width: 170px;", :placeholder => "请选择结束日期" %> + :required => @issue.required_attribute?('due_date'), :onchange => "issue_end_date_change();", + :class => "fl calendar_input",:style => "width: 170px;", :placeholder => "请选择结束日期" %> <%= calendar_for('issue_due_date', 'start_date') if @issue.leaf? %> <% end %> @@ -121,7 +121,7 @@
  • <% if @issue.safe_attribute? 'estimated_hours' %> <%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true, - :required => @issue.required_attribute?('estimated_hours'), :placeholder => "请填写预计工时" %> + :required => @issue.required_attribute?('estimated_hours'), :placeholder => "请填写预计工时" %> <% end %>
  • <%= l(:field_estimated_hours) %>
  • @@ -129,18 +129,45 @@
  • <% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %> <%= f.select :done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), - {:required => @issue.required_attribute?('done_ratio'), :no_label => true}, - :onchange => "PrecentChange(this.value)", - :class => "w150" %> + {:required => @issue.required_attribute?('done_ratio'), :no_label => true}, + :onchange => "PrecentChange(this.value)", + :class => "w150" %> <% end %>
  • 完成度
  • <% if @project.gpid %> -
  • 关联Commit<%= link_to "+".html_safe, issue_commits_issues_path(:project_id => @project), :remote => true %>
  • + +
  • 关联Commit + + + + +
  • +
    + <%= render :partial => "issues/issue_commit_ids" %> +
    <% end %> <% end %> \ No newline at end of file diff --git a/app/views/issues/_issue_commits_list.html.erb b/app/views/issues/_issue_commits_list.html.erb new file mode 100644 index 000000000..312d27da8 --- /dev/null +++ b/app/views/issues/_issue_commits_list.html.erb @@ -0,0 +1,41 @@ +<%= form_tag(url_for(:controller => 'issues', :action => 'commit_for_issue', :project_id => @project.id, :issue_commit_ids => @issue_commit_ids), :remote => true, :method => 'get', :id => 'commit_for_issue', :class => "fl") do %> + + + + + + + + + + + + <% @commits.each do |commit| %> + + + + + + + + <% end %> + +
     修订号描述提交者提交日期
    + <%= link_to commit.id[0,8], {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank" %> +

    <%= commit.title %>

    <%= link_to_user_mail(commit.author_email) %><%= format_date(commit.created_at) %>
    +
    + +
    +
    +
      + <%= pagination_links_full @commits_pages, @commits_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %> +
    +
    +
    +
    +
    +
    +<% end %> \ No newline at end of file diff --git a/app/views/issues/commit_for_issue.js.erb b/app/views/issues/commit_for_issue.js.erb new file mode 100644 index 000000000..0a368159a --- /dev/null +++ b/app/views/issues/commit_for_issue.js.erb @@ -0,0 +1 @@ +$("#issue_commit_ids").html('<%= escape_javascript(render :partial => 'issues/issue_commit_ids') %>'); \ No newline at end of file diff --git a/app/views/issues/issue_commits.js.erb b/app/views/issues/issue_commits.js.erb index b227b2cb3..ed25846b2 100644 --- a/app/views/issues/issue_commits.js.erb +++ b/app/views/issues/issue_commits.js.erb @@ -1,2 +1,7 @@ +<% if @type %> +$("#issue_commit_list").html('<%= escape_javascript(render :partial => 'issues/issue_commits_list') %>'); +<% else %> var htmlvalue = "<%= escape_javascript(render :partial => 'issues/issue_commits') %>"; pop_box_new(htmlvalue,760,860); +<% end %> + diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index fc572c9c4..0d4917fe3 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -86,6 +86,15 @@ <%= @issue.done_ratio %>% <% end %> +
  • 关联Commit +
    + <% if @commit_ids %> + <% @commit_ids.each do |commit_id| %> + + <% end %> + <% end %> +
    +
  • diff --git a/config/routes.rb b/config/routes.rb index 6fbdb581d..12e857a43 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -952,7 +952,8 @@ RedmineApp::Application.routes.draw do collection do match 'bulk_edit', :via => [:get, :post] post 'bulk_update' - get 'issue_commits' + post 'issue_commits' + get 'commit_for_issue' end member do post 'add_journal' diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index 79722a53c..9f12f8188 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -788,6 +788,7 @@ a:hover.issues_list_title{color:#3b94d6;} .hw_search_box{ position:relative; } .hw_search_box input.hw_search-input{ width:293px; height:28px; border:none; border:1px solid #e7e7e7; background:#fff; padding-left:5px;padding-right: 25px;} .hw_search_box a.hw_btn_search{display:block; width:20px; height:20px; background:url(/images/hw/icons_hw.png) 0 -57px no-repeat; position:absolute; right:5px; top:5px; cursor:pointer;} +.hw_search_box input.hw_btn_search{display:block; width:20px; height:20px; background:url(/images/hw/icons_hw.png) 0 -57px no-repeat; position:absolute; right:5px; top:5px; cursor:pointer;} .hw_search_box a:hover.hw_btn_search{background:url(/images/hw/icons_hw.png) -40px -57px no-repeat;} .hw_files_icon{display:block; width:17px; height:14px; background:url(../images/hw/icons_hw.png) 0 -135px no-repeat;} /* 编辑删除 与课程相同 */ @@ -1056,4 +1057,5 @@ table.text-file{} .old{ background:#ffecec; } .old:hover{ background:#fffaf1; } .new{ background: #eaffea;} -.new:hover{ background:#fffaf1; } \ No newline at end of file +.new:hover{ background:#fffaf1; } +.commit_id_value{color: white !important;} \ No newline at end of file From 378427d0704cd210d6ac3a3c36c3b4c32616fb49 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 7 Dec 2016 10:53:36 +0800 Subject: [PATCH 22/41] =?UTF-8?q?issue=20=E5=85=B3=E8=81=94commit=20?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=8F=8A=E6=95=B0=E6=8D=AE=E5=88=9B=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 12 ++++++------ app/views/issues/_form.html.erb | 21 ++++++++++++++++++--- app/views/issues/show.html.erb | 6 +----- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 3765b9920..67d5aed65 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -198,8 +198,8 @@ class IssuesController < ApplicationController query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first query.update_attribute(:viewed, true) unless query.nil? # issue 关联的commit - @commits = CommitIssues.where(:issue_id => @issue.id, :project_id => @issue.project_id) - + commit_issues = CommitIssues.where(:issue_id => @issue.id, :project_id => @issue.project_id) + @issue_commit_ids = commit_issues.map{|commit_issue| commit_issue.commit_id} # issue 新建的at消息 User.current.at_messages.unviewed('Issue', @issue.id).each {|x| x.viewed!} # 回复的at消息 @@ -268,10 +268,10 @@ class IssuesController < ApplicationController @issue.assigned_to_id = nil if @issue.assigned_to_id == 0 if @issue.save # 关联commmit - commits = params[:had_commits] - if commits - commits.each do |commit| - CommitIssues.create(:commit_id => commit.id, :project_id => @issue.project_id, :issue_id => @issue.id) + commit_ids = params[:commit_ids] + unless commit_ids.blank? + commit_ids.split(",").each do |commit_id| + CommitIssues.create(:commit_id => commit_id, :project_id => @issue.project_id, :issue_id => @issue.id) end end #params[:issue][:assigned_to_id] = nil if params[:issue][:assigned_to_id].to_i == 0 diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 07bd12602..ef0d741ad 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -63,7 +63,7 @@ <% end %> - +
      @@ -136,19 +136,34 @@
    • 完成度
    • <% if @project.gpid %> - + <%#= hidden_field_tag @issue_commit_ids %> +
    • 关联Commit +
    • - <%= render :partial => "issues/issue_commit_ids" %> + <%= render :partial => "issues/issue_commit_ids", :locals => {:f => f} %>
      <% end %>
    <% end %> - +
    -
    - <%= render :partial => 'issues/edit'%> -
    • 当前状态 From c088af4ea87ca5a47f99ee428eaab9472a8460ad Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 7 Dec 2016 15:57:51 +0800 Subject: [PATCH 26/41] =?UTF-8?q?=E6=88=90=E7=BB=A9=E4=BB=85=E5=AF=B9?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E5=8F=AF=E8=A7=81=EF=BC=9A=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E5=8C=BF=E8=AF=84=EF=BC=8C=E8=AF=84=E5=88=86=E8=80=85?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E4=B9=9F=E7=9C=8B=E4=B8=8D=E5=88=B0=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_student_work_score.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/student_work/_student_work_score.html.erb b/app/views/student_work/_student_work_score.html.erb index a8facff30..954dc79d5 100644 --- a/app/views/student_work/_student_work_score.html.erb +++ b/app/views/student_work/_student_work_score.html.erb @@ -1,7 +1,7 @@
        <% show_real_name = @is_teacher || score.user == User.current || score.reviewer_role != 3 %> <%= link_to image_tag(url_to_avatar(show_real_name ? score.user : ""), :width => "34", :height => "34"), show_real_name ? user_path(score.user) : "javascript:void(0)",:class => "ping_pic fl" %> - <% show_real_score = @homework.score_open == 1 || @is_teacher || score.student_work.user == User.current %> + <% show_real_score = @homework.score_open == 1 || @is_teacher || score.student_work.user == User.current || score.user == User.current %>
        <%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "linkBlue fl" %> From c24f9b8c3bb6fb851e1360c43b549ee0c524757f Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 7 Dec 2016 17:23:52 +0800 Subject: [PATCH 27/41] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E5=B0=8F?= =?UTF-8?q?=E9=BD=BF=E8=BD=AE=E8=8F=9C=E5=8D=95=E5=A2=9E=E5=8A=A0=E2=80=9C?= =?UTF-8?q?=E5=90=AF=E7=94=A8=E5=8C=BF=E8=AF=84=E2=80=9D=E7=9A=84=E9=80=89?= =?UTF-8?q?=E9=A1=B9=EF=BC=8C=E5=90=8C=E6=97=B6=E6=9B=B4=E6=96=B0=E2=80=9C?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E5=8C=BF=E8=AF=84=E2=80=9D=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BF=A1=E6=81=AF=E3=80=81=E7=A6=81=E7=94=A8=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E7=9A=84=E4=BD=9C=E4=B8=9A=E6=88=AA=E6=AD=A2=E5=90=8E?= =?UTF-8?q?=E4=B9=9F=E5=8F=AF=E4=BB=A5=E7=BC=96=E8=BE=91=E2=80=9C=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=90=AF=E7=94=A8=E5=8C=BF=E8=AF=84=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 2 +- app/helpers/application_helper.rb | 4 ++- .../alert_forbidden_anonymous_comment.js.erb | 8 ++--- .../_alert_forbidden_anonymous.html.erb | 33 ++++++++++--------- .../forbidden_anonymous_comment.js.erb | 8 +++++ app/views/users/_homework_base_info.html.erb | 5 +++ lib/tasks/homework_publishtime.rake | 30 ++++++++--------- 7 files changed, 52 insertions(+), 38 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 3c0469e9b..d11259f15 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -1060,7 +1060,7 @@ class StudentWorkController < ApplicationController end def forbidden_anonymous_comment - @homework.update_column('anonymous_comment', 1) + @homework.update_column('anonymous_comment', @homework.anonymous_comment == 0 ? 1 : 0) homework_detail_manual = @homework.homework_detail_manual homework_detail_programing = @homework.homework_detail_programing if homework_detail_programing diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 75a0eb3f1..2b1f3fbb9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3710,7 +3710,9 @@ def get_hw_status homework_common end if Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") str += '作品提交中' - elsif Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") + elsif Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && homework_common.anonymous_comment == 1 && User.current.allowed_to?(:as_teacher, homework_common.course) + str += '教师评阅中' + else str += '作品补交中' end elsif homework_common.homework_detail_manual.comment_status == 2 diff --git a/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb b/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb index 354f217e2..a19815ca3 100644 --- a/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb +++ b/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb @@ -1,6 +1,2 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>'); -showModal('ajax-modal', '500px'); -$('#ajax-modal').siblings().remove(); -$('#ajax-modal').before("" + - ""); -$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9"); \ No newline at end of file +var htmlvalue = "<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>"; +pop_box_new(htmlvalue, 400, 178); \ No newline at end of file diff --git a/app/views/student_work/_alert_forbidden_anonymous.html.erb b/app/views/student_work/_alert_forbidden_anonymous.html.erb index d1cdd8d57..328386a04 100644 --- a/app/views/student_work/_alert_forbidden_anonymous.html.erb +++ b/app/views/student_work/_alert_forbidden_anonymous.html.erb @@ -1,16 +1,19 @@ -
        -
        -

        禁用匿评

        -

        - 禁用匿评后学生将不能对作品进行互评,且匿评不能再开启,是否确定禁用匿评? -

        - +
        +
        +

        + 提示 +

        + +
        -
        \ No newline at end of file +
        +

        评分比例将恢复默认值,您可以在评分设置中进行修改

        + <% if @homework.anonymous_comment == 0%> +

        是否确定禁用匿评

        + <% else %> +

        是否确定启用匿评

        + <% end %> + 确定 + 取消 +
        +
        diff --git a/app/views/student_work/forbidden_anonymous_comment.js.erb b/app/views/student_work/forbidden_anonymous_comment.js.erb index 2dd4a88a4..729776685 100644 --- a/app/views/student_work/forbidden_anonymous_comment.js.erb +++ b/app/views/student_work/forbidden_anonymous_comment.js.erb @@ -3,4 +3,12 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(r sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); <% else %> sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); +<% end %> +<% if @homework.anonymous_comment == 0 %> + var htmlvalue = '

        提示

        '+ + '

        将于7天后自动启动该作业的匿评

        您可以在匿评设置中进行修改

        ' + + '知道啦
        '; + pop_box_new(htmlvalue, 400, 178); +<% else %> + hideModal(); <% end %> \ No newline at end of file diff --git a/app/views/users/_homework_base_info.html.erb b/app/views/users/_homework_base_info.html.erb index 40381e686..53f968328 100644 --- a/app/views/users/_homework_base_info.html.erb +++ b/app/views/users/_homework_base_info.html.erb @@ -111,6 +111,11 @@ <%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id),:class => "wpostOptionLink", :title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%> + <% elsif activity.anonymous_comment == 1 %> +
      • + <%= link_to("启用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id),:class => "wpostOptionLink", + :title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%> +
      • <% end %> <% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %>
      • diff --git a/lib/tasks/homework_publishtime.rake b/lib/tasks/homework_publishtime.rake index dac3c11af..c18d529e1 100644 --- a/lib/tasks/homework_publishtime.rake +++ b/lib/tasks/homework_publishtime.rake @@ -41,19 +41,19 @@ namespace :homework_publishtime do puts "--------------------------------homework_publish end" end - task :end => :environment do - puts "--------------------------------homework_publish_end start" - Rails.logger.info("log--------------------------------homework_publish_end start") - 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 - Rails.logger.info("log--------------------------------homework_publish_end end") - puts "--------------------------------homework_publish_end end" - end + # task :end => :environment do + # puts "--------------------------------homework_publish_end start" + # Rails.logger.info("log--------------------------------homework_publish_end start") + # 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 + # Rails.logger.info("log--------------------------------homework_publish_end end") + # puts "--------------------------------homework_publish_end end" + # end end \ No newline at end of file From 8ba747e1952be803154a9af3f06f1827ee5db18b Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 8 Dec 2016 09:16:14 +0800 Subject: [PATCH 28/41] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93diff=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=88Issue=E5=92=8Ccommit=E5=85=B3=E8=81=94?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/changes.html.erb | 12 +++++++++++- app/views/repositories/commit_diff.html.erb | 18 ++++++++++++------ public/stylesheets/css/moduel.css | 1 + public/stylesheets/css/project.css | 4 ++-- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/app/views/repositories/changes.html.erb b/app/views/repositories/changes.html.erb index a305b9ec5..d4758d55a 100644 --- a/app/views/repositories/changes.html.erb +++ b/app/views/repositories/changes.html.erb @@ -14,9 +14,19 @@ <% commits.each do |commit| %>
      • <%= time_tag(commit.created_at) %>前 - <%= link_to get_user_by_mail(commit.author_email).show_name, user_path(get_user_by_mail(commit.author_email)), :target => "_blank", :class => "pullreques_pull_name fl ml10" %> + <%= link_to_user_mail(commit.author_email, "pullreques_pull_name fl ml10") %>

        <%= commit.title %>

        <%= link_to truncate(commit.short_id, :length => 20), {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank", :class => "fr mr15 c_grey" %> + <% get_commit_issues(commit.short_id, @project.id, 0).each do |issue_id| %> +
        + <% if issue_id == "more" %> + <%= link_to "更多", {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank", :class => "commit_id_value mr5" %> + <% else %> + <%= link_to "##{issue_id}", issue_path(issue_id), :target => "_blank", :class => "commit_id_value mr5" %> + <% end %> +
        + <% end %> +
      • <% end %>
      diff --git a/app/views/repositories/commit_diff.html.erb b/app/views/repositories/commit_diff.html.erb index 913561bc2..2d0442a74 100644 --- a/app/views/repositories/commit_diff.html.erb +++ b/app/views/repositories/commit_diff.html.erb @@ -8,12 +8,18 @@

      <%= @commit_details.message %>

      - - - - - - +
      +

      关联Issue:

      + <% get_commit_issues(@commit_details.short_id, @project.id, 1).each do |issue_id| %> +
      + <% if issue_id == "more" %> + <%= link_to "更多", {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => @commit_details.id}, :target => "_blank", :class => "commit_id_value mr5" %> + <% else %> + <%= link_to "##{issue_id}", issue_path(issue_id), :target => "_blank", :class => "commit_id_value mr5" %> + <% end %> +
      + <% end %> +
    • <%= render :partial => 'commit_details', :locals => {:changeset => @commit_details} %>
    • diff --git a/public/stylesheets/css/moduel.css b/public/stylesheets/css/moduel.css index ea2beb1b8..16a08deb3 100644 --- a/public/stylesheets/css/moduel.css +++ b/public/stylesheets/css/moduel.css @@ -20,6 +20,7 @@ input.radio-width90{ width: 90px; } .muban_icons_blue{font-size: 12px;padding: 0 5px;border-radius: 3px;line-height: 14px;color: #3b94d6;border: 1px solid #3b94d6;} /*模板buttons 20161013byLB*/ .btn{display: inline-block;border:none; padding:0 10px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 30px;line-height: 30px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; } +.btn-commit-issue{display: inline-block;border:none; padding:0 5px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 20px;line-height: 20px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; margin-top: 6px;} .btn-commit{display: inline-block;border:none; padding:0 10px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 20px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; } .btn:hover{background: #c3c3c3; color: #333;} .btn-grey{background: #d9d9d9; color: #656565;} diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index 9f12f8188..a2506fe3f 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -1002,8 +1002,8 @@ a.pullreques_reply_name{ font-weight: bold; color: #333;} .pullreques_reply_txt{ width: 900px;color: #666;} .pullreques_pull_top { width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;} a.pullreques_pull_name{display: block; margin-left: 5px;max-width:80px; color:#3b94d6 !important; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} -.pullreques_pull_list li{ height: 30px; line-height: 30px; } -.pullreques_pull_txt{display: block; margin-left: 10px;max-width:740px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} +.pullreques_pull_list li{ height: 35px; line-height: 35px; } +.pullreques_pull_txt{display: block; margin-left: 10px;max-width:640px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} .pullreques_change_list li{height: 40px; line-height: 40px;border-bottom:1px solid #e1e1e1; } .pullreques_change_list li:last-child{ border-bottom: none;} .pullreques_icons_add{background: url(/images/new_project/icons_issue.png) 0 -374px no-repeat; display: inline-block; width: 19px; height: 16px;} From c84d17bd6ac0fc44abebfb3dde3cda31afef21c7 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 8 Dec 2016 09:36:01 +0800 Subject: [PATCH 29/41] =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E6=B2=A1=E6=B3=A8=E5=86=8C=E6=97=B6=E5=80=99=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=82=AE=E7=AE=B1=E6=96=B9=E6=B3=95=E5=B0=81?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e55320eb3..86c30cadc 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -78,14 +78,14 @@ module ApplicationHelper user.nil? ? mail : user.try(:show_name) end - def link_to_user_mail(mail, options={}) + def link_to_user_mail(mail, css_class) user = User.find_by_mail(mail) user = user.nil? ? mail : user if user.is_a?(User) name = user.show_name - link_to name, {:controller=> 'users', :action => 'show', id: user.id}, :class => user.css_classes + link_to name, {:controller=> 'users', :action => 'show', id: user.id}, :class => css_class, :target => "_blank" else - h(user.to_s) + "#{h(user.to_s)}".html_safe end end From a1a96e4667bc0c57fffe2d7a808226fd69d92da5 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 8 Dec 2016 09:55:41 +0800 Subject: [PATCH 30/41] =?UTF-8?q?issue=E7=BC=96=E8=BE=91=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E6=80=A7=E8=83=BD=E7=AE=80=E5=8D=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 3 +++ app/helpers/repositories_helper.rb | 15 +++++++++++++++ app/views/issues/_form.html.erb | 2 +- app/views/issues/_issue_commits_list.html.erb | 2 +- config/routes.rb | 2 +- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 22efcf775..bb1e359ca 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -320,6 +320,9 @@ class IssuesController < ApplicationController def edit # 修改实例变量的值 return unless update_issue_from_params + # issue 关联的commit + commit_issues = CommitIssues.where(:issue_id => @issue.id, :project_id => @issue.project_id) + @issue_commit_ids = commit_issues.map{|commit_issue| commit_issue.commit_id} respond_to do |format| format.html {render :layout => 'base_projects' }#added by young diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index e6603070d..e8cbcadf7 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -27,6 +27,21 @@ module RepositoriesHelper REPO_IP_ADDRESS = Setting.host_repository REPO_GITLAB_ADDRESS = "git.trustie.net" + # 获取某次提交的关联Issue + # REDO:一次关联查询 + # type为true则为详情页面,全部显示 + def get_commit_issues commit_id, project_id, type + commit_issues = CommitIssues.where(:commit_id => commit_id, :project_id => project_id) + unless commit_issues.blank? + if commit_issues.count > 2 && type != 1 + result = commit_issues.map{|commit_issue| commit_issue.issue_id}.first(2) << "more" + else + result = commit_issues.map{|commit_issue| commit_issue.issue_id} + end + end + return result unless result.blank? + end + # 因为gitlab的提交总数不是实时同步的,说以取总数用两种方法 def choise_commit_count git_count, pro_count git_count > pro_count ? git_count : pro_count diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index ef0d741ad..9af36164c 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -175,7 +175,7 @@ } $.ajax({ url: '<%= url_for(:controller => 'issues', :action => 'issue_commits') %>', - type:'post', + type:'get', data:{ project_id: project_id, issue_commit_ids: str diff --git a/app/views/issues/_issue_commits_list.html.erb b/app/views/issues/_issue_commits_list.html.erb index 312d27da8..e61b92eed 100644 --- a/app/views/issues/_issue_commits_list.html.erb +++ b/app/views/issues/_issue_commits_list.html.erb @@ -17,7 +17,7 @@ <%= link_to commit.id[0,8], {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank" %>

      <%= commit.title %>

      - <%= link_to_user_mail(commit.author_email) %> + <%= link_to_user_mail(commit.author_email, "") %> <%= format_date(commit.created_at) %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index c7e254ff5..6d96eb82b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -952,7 +952,7 @@ RedmineApp::Application.routes.draw do collection do match 'bulk_edit', :via => [:get, :post] post 'bulk_update' - post 'issue_commits' + get 'issue_commits' get 'commit_for_issue' get 'issue_commit_delete' end From 0785c71308acbbe893e228b674ca89fac979c965 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 8 Dec 2016 11:26:37 +0800 Subject: [PATCH 31/41] =?UTF-8?q?issue=E5=92=8Ccommit=E5=85=B3=E8=81=94?= =?UTF-8?q?=E7=9A=84=E4=B8=80=E4=BA=9B=E4=BF=AE=E6=94=B9=E5=92=8C=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 4 ++-- app/views/issues/_issue_commits.html.erb | 6 ++--- app/views/issues/_issue_commits_list.html.erb | 24 ++++++++++++++++--- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index bb1e359ca..96ea2a84e 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -62,7 +62,7 @@ class IssuesController < ApplicationController def issue_commits begin return render_404 if @project.gpid.nil? - @issue_commit_ids = params[:issue_commit_ids].split(",") + @issue_commit_ids = (params[:issue_commit_ids].is_a?(Array) ? params[:issue_commit_ids] : params[:issue_commit_ids].split(",")) unless params[:issue_commit_ids].nil? search = params[:search].to_s.lstrip.rstrip @type = params[:type] limit = 20 @@ -82,7 +82,7 @@ class IssuesController < ApplicationController # 选择对应的Commit def commit_for_issue - history_commit_ids = params[:issue_commit_ids] + history_commit_ids = params[:issue_for_commit_ids].split(",") unless params[:issue_for_commit_ids].nil? @issue_commit_ids = (history_commit_ids.blank? ? params[:checkbox1] : params[:checkbox1] | history_commit_ids).uniq end diff --git a/app/views/issues/_issue_commits.html.erb b/app/views/issues/_issue_commits.html.erb index 5a666ea8e..3190cda41 100644 --- a/app/views/issues/_issue_commits.html.erb +++ b/app/views/issues/_issue_commits.html.erb @@ -1,4 +1,4 @@ -
      +

      关联Commit

      @@ -13,11 +13,11 @@
      <%= form_tag(url_for(:controller => 'issues', :action => 'issue_commits', :project_id => @project.id, :type => "search"), :remote => true, :method => 'get', :id => 'issue_commit_form', :class => "fl") do %> -
        +
        •  分支  :  <%= select_tag :branch, options_for_select(["#{@default_branch}"]+ @branch_names, @rev), - :class => "fl newupload_select", :style => "width:180px;", + :class => "fl newupload_select", :style => "width:180px;height:28px;", :onchange => "$('#issue_commit_form').submit();" %>
        diff --git a/app/views/issues/_issue_commits_list.html.erb b/app/views/issues/_issue_commits_list.html.erb index e61b92eed..10cfe57ca 100644 --- a/app/views/issues/_issue_commits_list.html.erb +++ b/app/views/issues/_issue_commits_list.html.erb @@ -1,4 +1,4 @@ -<%= form_tag(url_for(:controller => 'issues', :action => 'commit_for_issue', :project_id => @project.id, :issue_commit_ids => @issue_commit_ids), :remote => true, :method => 'get', :id => 'commit_for_issue', :class => "fl") do %> +<%= form_tag(url_for(:controller => 'issues', :action => 'commit_for_issue', :project_id => @project.id), :remote => true, :method => 'get', :id => 'commit_for_issue', :class => "fl") do %> @@ -22,10 +22,11 @@ <% end %> +
        @@ -38,4 +39,21 @@
        -<% end %> \ No newline at end of file +<% end %> + + \ No newline at end of file From abdbfd87b0018665a3d9a5da80abd4142f88301e Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 8 Dec 2016 13:40:11 +0800 Subject: [PATCH 32/41] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E7=9A=84=E9=82=80?= =?UTF-8?q?=E8=AF=B7=E7=A0=81=E5=A2=9E=E5=8A=A0=E2=80=9C=E5=81=9C=E7=94=A8?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E5=90=AF=E7=94=A8=E2=80=9D=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E5=81=9C=E7=94=A8=E7=9A=84=E9=82=80=E8=AF=B7?= =?UTF-8?q?=E7=A0=81=E4=B8=8D=E5=85=81=E8=AE=B8=E7=94=A8=E6=88=B7=E4=B8=BB?= =?UTF-8?q?=E5=8A=A8=E5=8A=A0=E5=85=A5=E7=8F=AD=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 7 ++++ app/services/courses_service.rb | 2 + .../courses/_join_private_course.html.erb | 18 ++++++--- .../courses/join_course_multi_role.js.erb | 37 +++++++++++-------- app/views/courses/set_invite_code_halt.js.erb | 2 + app/views/layouts/_course_base_info.html.erb | 23 ++++++++---- app/views/layouts/base_courses.html.erb | 11 +++++- config/routes.rb | 1 + .../20161208015939_add_column_to_course.rb | 5 +++ db/schema.rb | 25 ++++++++++--- public/javascripts/application.js | 2 +- public/stylesheets/css/common.css | 16 ++++++++ public/stylesheets/syllabus.css | 3 +- 13 files changed, 115 insertions(+), 37 deletions(-) create mode 100644 app/views/courses/set_invite_code_halt.js.erb create mode 100644 db/migrate/20161208015939_add_column_to_course.rb diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 5e0ef4638..fe707ac5b 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -32,6 +32,13 @@ class CoursesController < ApplicationController before_filter :require_login, :only => [:join, :unjoin] #before_filter :allow_join, :only => [:join] + # 邀请码停用/启用 + def set_invite_code_halt + if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? + @course.update_attribute('invite_code_halt', @course.invite_code_halt == 0 ? 1 : 0) + end + end + #查找组织 def search_public_orgs_not_in_course condition = '%%' diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 43bdf9e09..c1c5f4f9f 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -584,6 +584,8 @@ class CoursesService @state = 2 elsif course[:is_delete] == 1 @state = 11 + elsif course[:invite_code_halt] == 1 + @state = 14 else if current_user.member_of_course?(course) #如果已经是成员 @state = 3 diff --git a/app/views/courses/_join_private_course.html.erb b/app/views/courses/_join_private_course.html.erb index a159886fd..ff094c1ff 100644 --- a/app/views/courses/_join_private_course.html.erb +++ b/app/views/courses/_join_private_course.html.erb @@ -10,7 +10,6 @@
      • -
      • @@ -18,14 +17,13 @@ 教师 助教 学生 -
      • -
      • +

        请至少选择一个身份

        +
      • - 确  定 + 确  定 取  消 -
      @@ -33,6 +31,16 @@
      \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 98c12d83b..026e65846 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1253,6 +1253,7 @@ RedmineApp::Application.routes.draw do post 'add_members' get 'delete_member' get 'archive_course' + get 'set_invite_code_halt' end collection do match 'join_private_courses', :via => [:get, :post] diff --git a/db/migrate/20161208015939_add_column_to_course.rb b/db/migrate/20161208015939_add_column_to_course.rb new file mode 100644 index 000000000..f336a90c0 --- /dev/null +++ b/db/migrate/20161208015939_add_column_to_course.rb @@ -0,0 +1,5 @@ +class AddColumnToCourse < ActiveRecord::Migration + def change + add_column :courses, :invite_code_halt, :integer, :limit => 1, :default => 0 + end +end diff --git a/db/schema.rb b/db/schema.rb index bd3645e2c..6dd41fa00 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 => 20161128072528) do +ActiveRecord::Schema.define(:version => 20161208015939) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -629,6 +629,7 @@ ActiveRecord::Schema.define(:version => 20161128072528) do t.string "invite_code" t.string "qrcode" t.integer "qrcode_expiretime", :default => 0 + t.integer "invite_code_halt", :limit => 1, :default => 0 end add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true @@ -820,11 +821,13 @@ ActiveRecord::Schema.define(:version => 20161128072528) do t.integer "exercise_status" t.integer "user_id" t.integer "time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.datetime "publish_time" t.datetime "end_time" t.integer "show_result" + t.integer "question_random", :default => 0 + t.integer "choice_random", :default => 0 end create_table "first_pages", :force => true do |t| @@ -864,6 +867,7 @@ ActiveRecord::Schema.define(:version => 20161128072528) do t.datetime "updated_at", :null => false t.string "secret_key" t.integer "status" + t.integer "operate_user_id" end add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" @@ -939,6 +943,7 @@ ActiveRecord::Schema.define(:version => 20161128072528) do t.integer "quotes", :default => 0 t.integer "is_open", :default => 0 t.datetime "simi_time" + t.integer "score_open", :default => 1 end add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" @@ -964,6 +969,7 @@ ActiveRecord::Schema.define(:version => 20161128072528) do t.integer "homework_common_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.integer "no_anon_penalty", :default => 1 end create_table "homework_detail_programings", :force => true do |t| @@ -1538,6 +1544,12 @@ ActiveRecord::Schema.define(:version => 20161128072528) do t.datetime "updated_at", :null => false end + create_table "professional_levels", :force => true do |t| + t.string "level" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "project_infos", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1628,8 +1640,11 @@ ActiveRecord::Schema.define(:version => 20161128072528) do t.integer "pull_request_id" t.integer "gpid" t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 0 + t.integer "project_id" + t.string "title" end create_table "quality_analyses", :force => true do |t| diff --git a/public/javascripts/application.js b/public/javascripts/application.js index c3bd332a9..03b6e6c20 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1715,7 +1715,7 @@ function expand_course_list(id, target, btnid, count) { //点击删除时的确认弹框 function delete_confirm_box(url, str){ var htmlvalue = '

      提示

      '+ - '

      ' + str + '

      确定'+ + '

      ' + str + '

      确定'+ '取消
      '; pop_box_new(htmlvalue, 300, 140); } diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index 931aeb39e..4998fb966 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -174,6 +174,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .mr100 {margin-right:100px !important;} .mr118 {margin-right:118px !important;} .mr130 {margin-right:130px;} +.mr135 {margin-right:135px;} .mr150 {margin-right:150px;} .mw15{margin:0 15px;} .mr90 {margin-right:90px;} @@ -673,6 +674,21 @@ a.sy_btn_grey_mini{ border-radius:3px; } a:hover.sy_btn_grey_mini{ background: #c3c3c3;} +a.btn_grey_mid{ + display:inline-block; + color: #565656; + background: #eaeaea; + text-align: center; + font-size: 12px; + padding:0 10px; + height: 26px; + line-height: 26px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + -o-border-radius:3px; + border-radius:3px; +} +a:hover.btn_grey_mid{ background: #c8c8c8;} a.sy_btn_green{ display:inline-block; color: #fff; diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css index 499e4a336..c38e1bd79 100644 --- a/public/stylesheets/syllabus.css +++ b/public/stylesheets/syllabus.css @@ -289,11 +289,10 @@ a.sy_class_option:hover { } .sy_class_id{ width:94px; - height:70px; + height:94px; border:1px solid #f1f1f1; background:#fff; text-align:center; - padding-top:24px; } .sy_class_id p{ font-size:16px; From 9ca4001c8cbd21512913347c466da6d3d41be1d0 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 8 Dec 2016 15:29:51 +0800 Subject: [PATCH 33/41] =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 1 + .../_programing_work_show.html.erb | 9 ++----- .../student_work/_revise_attachment.html.erb | 12 +++++---- app/views/student_work/_show.html.erb | 9 ++----- .../student_work/_upload_attachment.html.erb | 25 ++++++++++--------- .../_work_attachments_status.html.erb | 2 +- public/stylesheets/css/moduel.css | 6 ++--- public/stylesheets/css/public.css | 2 ++ 8 files changed, 30 insertions(+), 36 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 3c0469e9b..3646adec6 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -1092,6 +1092,7 @@ class StudentWorkController < ApplicationController respond_to do |format| format.js end + @homework = @work.homework_common end def new_student_work_project diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index 93493b5b4..b7fba9d8f 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -121,13 +121,8 @@ <% end %> }); function show_upload(){ - $("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>'); - showModal('ajax-modal', '452px'); - $('#ajax-modal').siblings().remove(); - $('#ajax-modal').before(""); - $('#ajax-modal').parent().css("top","40%").css("left","46%"); - $('#ajax-modal').parent().addClass("resourceUploadPopup"); - $('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); + var htmlvalue = "<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>"; + pop_box_new(htmlvalue, 500, 230); } function regex_des() { if ($.trim($("#attachment_des").val()) == "") { diff --git a/app/views/student_work/_revise_attachment.html.erb b/app/views/student_work/_revise_attachment.html.erb index 6d32975c7..2b6054718 100644 --- a/app/views/student_work/_revise_attachment.html.erb +++ b/app/views/student_work/_revise_attachment.html.erb @@ -1,31 +1,33 @@ <% revise_attachment = work.attachments.where("attachtype = 7").first %> <% if @homework.end_time < Date.today %> - <% if revise_attachment && @is_teacher %> + <% if revise_attachment && work.user != User.current %>
      - 追加修订附件 + 作业修订附件
      追加附件: <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %> - 追加时间:<%=format_time revise_attachment.created_on.to_s %>  (<%=revise_attachment_status @homework,revise_attachment %>)
      <% unless revise_attachment.description == "" %> 追加理由:

      <%=revise_attachment.description %>

      <% end %>
      +
      注意:此处的附件是在作业截止日期过后提交的
      +
      <% end %> <% if work.user == User.current && !User.current.allowed_to?(:as_teacher, @homework.course) %>
      - 追加修订附件 + 作业修订附件
      <% if revise_attachment %>
      追加附件: <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %> - 追加时间:<%=format_time revise_attachment.created_on.to_s %>
      <% unless revise_attachment.description == "" %> 追加理由:

      <%=revise_attachment.description %>

      <% end %> +
      +
      注意:此处的附件是在作业截止日期过后提交的
      <% end %>
      diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index 185f6520b..5653c3a1d 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -125,13 +125,8 @@ <% end %> }); function show_upload(){ - $("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>'); - showModal('ajax-modal', '452px'); - $('#ajax-modal').siblings().remove(); - $('#ajax-modal').before(""); - $('#ajax-modal').parent().css("top","40%").css("left","46%"); - $('#ajax-modal').parent().addClass("resourceUploadPopup"); - $('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); + var htmlvalue = "<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>"; + pop_box_new(htmlvalue, 500, 230); } function regex_des() { if ($.trim($("#attachment_des").val()) == "") { diff --git a/app/views/student_work/_upload_attachment.html.erb b/app/views/student_work/_upload_attachment.html.erb index 02f05c4df..904c3ad54 100644 --- a/app/views/student_work/_upload_attachment.html.erb +++ b/app/views/student_work/_upload_attachment.html.erb @@ -1,7 +1,12 @@ - -上传附件 - -
      +
      +
      +

      + 上传附件 +

      + +
      +
      +
      <%= form_tag(revise_attachment_student_work_path(work.id), :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
      @@ -43,15 +48,11 @@

      -
      -
      - 确定 - <%#= submit_tag '确定',:onclick=>'submit_revise_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %> -
      -
      - 取消 -
      + <% end %>
      +
      \ No newline at end of file diff --git a/app/views/student_work/_work_attachments_status.html.erb b/app/views/student_work/_work_attachments_status.html.erb index 79f14aae5..17a897f04 100644 --- a/app/views/student_work/_work_attachments_status.html.erb +++ b/app/views/student_work/_work_attachments_status.html.erb @@ -5,7 +5,7 @@ <%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw360', :download => true -%> - <%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author && status != 2 %> + <%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author && status != 2 && @homework.end_time < Date.today %> (<%= number_to_human_size attachment.filesize %>) <%= format_time(attachment.created_on) %> diff --git a/public/stylesheets/css/moduel.css b/public/stylesheets/css/moduel.css index 2161753b1..b13b4fd5d 100644 --- a/public/stylesheets/css/moduel.css +++ b/public/stylesheets/css/moduel.css @@ -4,11 +4,9 @@ .muban_popup_top h3{ font-size:16px; color:#fff; font-weight:normal; line-height:40px; padding-left:10px; } a.muban_icons_close{width:20px; height:20px;display:block;background: url(/images/sy/sy_icons_close.png) 0 0px no-repeat; margin:8px 10px 0 0;} a:hover.muban_icons_close{background: url(/images/sy/sy_icons_close.png) -40px 0px no-repeat;} -#muban_popup_box input,#muban_popup_box select{ border:1px solid #c8c8c8; height: 28px; color: #888;} -#muban_popup_box label.pop_box_label{width: 100px; text-align: right; display: inline-block;} +.muban_popup_box input,#muban_popup_box select{ border:1px solid #c8c8c8; height: 28px; color: #888;} +.muban_popup_box label.pop_box_label{width: 100px; text-align: right; display: inline-block;} input.radio-width90{ width: 90px; } -#muban_popup_box input,#muban_popup_box select{ border:1px solid #c8c8c8; height: 28px; color: #888;} -#muban_popup_box label.pop_box_label {width: 100px; text-align: right; display: inline-block;} /*模板表格 20161013byLB*/ .muban_table{ width:100%; background:#fff; border:1px solid #e5e5e5; border-bottom: none; } .muban_table thead tr{ height:40px; line-height:40px;} diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index 7215604c2..2061638e1 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -1548,3 +1548,5 @@ a.syllabusbox_a_blue{ .pages_new_404{ margin:160px 209px 0px 209px; height: 580px;} .pages_new_404_txt{ font-size: 16px; color: #888; text-align: center;} .feedbackText{box-shadow:none; width:550px; height:80px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;overflow:auto; background-attachment:fixed;border-style:solid;} + +._notice_box{border:solid 1px #f6d0b1; background:#fff9e9; padding:4px; color:#ee4a20;} \ No newline at end of file From 92871ff925609e0f81851eba87c31e78fc4d4067 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 8 Dec 2016 16:24:17 +0800 Subject: [PATCH 34/41] =?UTF-8?q?=E5=BC=B9=E6=A1=86=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E3=80=81=E4=BD=9C=E4=B8=9A=E6=88=AA=E6=AD=A2?= =?UTF-8?q?=E5=90=8E=E9=99=84=E4=BB=B6=E4=B8=8D=E8=83=BD=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_work_attachments_status.html.erb | 4 +++- public/stylesheets/css/moduel.css | 6 ++++-- public/stylesheets/css/structure.css | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/views/student_work/_work_attachments_status.html.erb b/app/views/student_work/_work_attachments_status.html.erb index 17a897f04..5abb347f6 100644 --- a/app/views/student_work/_work_attachments_status.html.erb +++ b/app/views/student_work/_work_attachments_status.html.erb @@ -5,7 +5,9 @@ <%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw360', :download => true -%> - <%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author && status != 2 && @homework.end_time < Date.today %> + <% if attachment.id && User.current == attachment.author && (attachment.attachtype == 7 || @homework.end_time >= Date.today) %> + <%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) %> + <% end %> (<%= number_to_human_size attachment.filesize %>) <%= format_time(attachment.created_on) %> diff --git a/public/stylesheets/css/moduel.css b/public/stylesheets/css/moduel.css index b13b4fd5d..2161753b1 100644 --- a/public/stylesheets/css/moduel.css +++ b/public/stylesheets/css/moduel.css @@ -4,9 +4,11 @@ .muban_popup_top h3{ font-size:16px; color:#fff; font-weight:normal; line-height:40px; padding-left:10px; } a.muban_icons_close{width:20px; height:20px;display:block;background: url(/images/sy/sy_icons_close.png) 0 0px no-repeat; margin:8px 10px 0 0;} a:hover.muban_icons_close{background: url(/images/sy/sy_icons_close.png) -40px 0px no-repeat;} -.muban_popup_box input,#muban_popup_box select{ border:1px solid #c8c8c8; height: 28px; color: #888;} -.muban_popup_box label.pop_box_label{width: 100px; text-align: right; display: inline-block;} +#muban_popup_box input,#muban_popup_box select{ border:1px solid #c8c8c8; height: 28px; color: #888;} +#muban_popup_box label.pop_box_label{width: 100px; text-align: right; display: inline-block;} input.radio-width90{ width: 90px; } +#muban_popup_box input,#muban_popup_box select{ border:1px solid #c8c8c8; height: 28px; color: #888;} +#muban_popup_box label.pop_box_label {width: 100px; text-align: right; display: inline-block;} /*模板表格 20161013byLB*/ .muban_table{ width:100%; background:#fff; border:1px solid #e5e5e5; border-bottom: none; } .muban_table thead tr{ height:40px; line-height:40px;} diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css index b86068a33..0e12ebc27 100644 --- a/public/stylesheets/css/structure.css +++ b/public/stylesheets/css/structure.css @@ -119,7 +119,7 @@ div#menu ul ul ul li a{ width:185px; overflow:hidden; white-space: nowrap; text- .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%;} div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; } -.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;} +.upload_filename{ background: url(/images/pic_file.png) 0 -22px no-repeat;color: #7f7f7f;width: 270px;border: none !important; 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);} From d98b1e17ccd8adfeb136b596ee341e5f534e5ede Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 8 Dec 2016 16:36:11 +0800 Subject: [PATCH 35/41] =?UTF-8?q?Gitlab=E6=8F=90=E4=BE=9B=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=8E=A5=E5=8F=A3=EF=BC=8Ccommit=20=E5=85=B3=E8=81=94?= =?UTF-8?q?=E6=8F=90=E4=BE=9B=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=E5=8F=8A?= =?UTF-8?q?=E5=B1=80=E9=83=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 19 ++++++++++++++----- app/views/issues/_issue_commits_list.html.erb | 2 +- app/views/issues/issue_commits.js.erb | 2 +- .../lib/gitlab/client/repositories.rb | 1 + 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 96ea2a84e..2f0b1d45e 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -63,18 +63,27 @@ class IssuesController < ApplicationController begin return render_404 if @project.gpid.nil? @issue_commit_ids = (params[:issue_commit_ids].is_a?(Array) ? params[:issue_commit_ids] : params[:issue_commit_ids].split(",")) unless params[:issue_commit_ids].nil? - search = params[:search].to_s.lstrip.rstrip + search = params[:search].to_s.strip @type = params[:type] - limit = 20 + limit = 15 g = Gitlab.client g_project = g.project(@project.gpid) rev = params[:branch].nil? ? g_project.default_branch : params[:branch] - @commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s, ref_name:rev).select{|commit| commit.title.include?("#{search}")} @project_branches = g.branches(@project.gpid) @branch_names = @project_branches.map{|b| b.name} @default_branch = g_project.default_branch - @commits_count = g.user_static(@project.gpid, :rev => rev).count - @commits_pages = Redmine::Pagination::Paginator.new @commits_count, limit, params[:page] + # 搜索的分页需要单独处理,因为搜索不容易获取总数 + if search.present? + @commits = g.commits(@project.gpid, ref_name:rev, :search => search) + @commits_count = @commits.count + @commits_pages = Paginator.new @commits_count, limit, params['page'] || 1 + @offset ||= @commits_pages.offset + @commits = paginateHelper @commits,limit + else + @commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s, ref_name:rev, :search => search) + @commits_count = g.user_static(@project.gpid, :rev => rev).count + @commits_pages = Redmine::Pagination::Paginator.new @commits_count, limit, params[:page] + end rescue Exception => e puts e end diff --git a/app/views/issues/_issue_commits_list.html.erb b/app/views/issues/_issue_commits_list.html.erb index 10cfe57ca..b6fc888a1 100644 --- a/app/views/issues/_issue_commits_list.html.erb +++ b/app/views/issues/_issue_commits_list.html.erb @@ -25,7 +25,7 @@
      -
      + diff --git a/app/views/issues/issue_commits.js.erb b/app/views/issues/issue_commits.js.erb index ed25846b2..b995d9f49 100644 --- a/app/views/issues/issue_commits.js.erb +++ b/app/views/issues/issue_commits.js.erb @@ -2,6 +2,6 @@ $("#issue_commit_list").html('<%= escape_javascript(render :partial => 'issues/issue_commits_list') %>'); <% else %> var htmlvalue = "<%= escape_javascript(render :partial => 'issues/issue_commits') %>"; -pop_box_new(htmlvalue,760,860); +pop_box_new(htmlvalue,760,600); <% end %> diff --git a/lib/gitlab-cli/lib/gitlab/client/repositories.rb b/lib/gitlab-cli/lib/gitlab/client/repositories.rb index 60c58ef98..4b458ecee 100644 --- a/lib/gitlab-cli/lib/gitlab/client/repositories.rb +++ b/lib/gitlab-cli/lib/gitlab/client/repositories.rb @@ -52,6 +52,7 @@ class Gitlab::Client # @option options [String] :ref_name The branch or tag name of a project repository. # @option options [Integer] :page The page number. # @option options [Integer] :per_page The number of results per page. + # @option options [String] :search The obj of results's search value. # @return [Array] def commits(project, options={}) get("/projects/#{project}/repository/commits", :query => options) From 9b155c9573b903c99e6bad1a34373616afef8431 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 9 Dec 2016 09:40:39 +0800 Subject: [PATCH 36/41] =?UTF-8?q?mini=20profiler=E5=8F=AA=E5=9C=A8dev?= =?UTF-8?q?=E4=B8=8B=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/initializers/mini_profiler.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/initializers/mini_profiler.rb b/config/initializers/mini_profiler.rb index 48fbe1423..ecd0fc45c 100644 --- a/config/initializers/mini_profiler.rb +++ b/config/initializers/mini_profiler.rb @@ -1,2 +1,4 @@ -Rack::MiniProfiler.config.position = 'right' -Rack::MiniProfiler.config.start_hidden = true \ No newline at end of file +if Rails.env.development? + Rack::MiniProfiler.config.position = 'right' + Rack::MiniProfiler.config.start_hidden = true +end \ No newline at end of file From 67d23a2161f3cb7030cebc659699f3ffa4352827 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Dec 2016 10:01:53 +0800 Subject: [PATCH 37/41] =?UTF-8?q?=E5=A4=9A=E7=BA=A7=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/_project_issue_contents.html.erb | 23 +++++++++++----- .../_project_message_contents.html.erb | 23 +++++++++++----- app/views/users/_message_contents.html.erb | 26 ++++++++++++------- app/views/users/_news_contents.html.erb | 26 ++++++++++++------- public/stylesheets/css/public.css | 2 +- 5 files changed, 65 insertions(+), 35 deletions(-) diff --git a/app/views/projects/_project_issue_contents.html.erb b/app/views/projects/_project_issue_contents.html.erb index 87e977024..a7ea27f9a 100644 --- a/app/views/projects/_project_issue_contents.html.erb +++ b/app/views/projects/_project_issue_contents.html.erb @@ -7,17 +7,26 @@ <% parents_rely = get_reply_parents parents_rely, comment %> <% length = parents_rely.length %>
      - <% if length <= 2 %> + <% if length <= 5 %> <%=render :partial => 'projects/project_issue_comments_reply', :locals => {:comment => comment.parent, :user_activity_id => user_activity_id, :parent_id => comment.id} %> <% else %>
      - <%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id, :parent_id => comment.id} %> -
      -
      - - 已经隐藏<%=(length - 2).to_s %>个楼层 - <%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => 'is_project_issue', :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %> +
      +
      +
      + <%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id, :parent_id => comment.id} %> +
      +
      + + 已经隐藏<%=(length - 5).to_s %>个楼层 + <%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => 'is_project_issue', :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %> +
      + <%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[3], :user_activity_id => user_activity_id, :parent_id => comment.id} %> +
      + <%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[2], :user_activity_id => user_activity_id, :parent_id => comment.id} %> +
      + <%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
      <%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[0], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
      diff --git a/app/views/projects/_project_message_contents.html.erb b/app/views/projects/_project_message_contents.html.erb index 9d99e4c83..e1bcedc51 100644 --- a/app/views/projects/_project_message_contents.html.erb +++ b/app/views/projects/_project_message_contents.html.erb @@ -7,17 +7,26 @@ <% parents_rely = get_reply_parents_no_root parents_rely, comment %> <% length = parents_rely.length %>
      - <% if length <= 2 %> + <% if length <= 5 %> <%=render :partial => 'projects/journal_comment_reply', :locals => {:comment => comment.parent, :user_activity_id => user_activity_id, :parent_id => comment.id} %> <% else %>
      - <%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id, :parent_id => comment.id} %> -
      -
      - - 已经隐藏<%=(length - 2).to_s %>个楼层 - <%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => 'is_project_message', :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %> +
      +
      +
      + <%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id, :parent_id => comment.id} %> +
      +
      + + 已经隐藏<%=(length - 5).to_s %>个楼层 + <%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => 'is_project_message', :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %> +
      + <%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[3], :user_activity_id => user_activity_id, :parent_id => comment.id} %> +
      + <%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[2], :user_activity_id => user_activity_id, :parent_id => comment.id} %> +
      + <%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
      <%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[0], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
      diff --git a/app/views/users/_message_contents.html.erb b/app/views/users/_message_contents.html.erb index 52ebc9577..265a4ab0e 100644 --- a/app/views/users/_message_contents.html.erb +++ b/app/views/users/_message_contents.html.erb @@ -7,20 +7,26 @@ <% parents_rely = get_reply_parents_no_root parents_rely, comment %> <% length = parents_rely.length %>
      - <% if length <= 2 %> + <% if length <= 5 %> <%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %> <% else %>
      - - - - <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %> -
      -
      - - 已经隐藏<%=(length - 2).to_s %>个楼层 - <%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => user_activity_id, :parent_id => comment.id),:remote=>true, :class => 'linkBlue2' %> +
      +
      +
      + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %> +
      +
      + + 已经隐藏<%=(length - 5).to_s %>个楼层 + <%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => user_activity_id, :parent_id => comment.id),:remote=>true, :class => 'linkBlue2' %> +
      + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[3], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %> +
      + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[2], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %> +
      + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
      <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
      diff --git a/app/views/users/_news_contents.html.erb b/app/views/users/_news_contents.html.erb index 6db9170d8..e421fd442 100644 --- a/app/views/users/_news_contents.html.erb +++ b/app/views/users/_news_contents.html.erb @@ -7,20 +7,26 @@ <% parents_rely = get_reply_parents parents_rely, comment %> <% length = parents_rely.length %>
      - <% if length <= 2 %> + <% if length <= 5 %> <%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %> <% else %>
      - - - - <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %> -
      -
      - - 已经隐藏<%=(length - 2).to_s %>个楼层 - <%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %> +
      +
      +
      + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %> +
      +
      + + 已经隐藏<%=(length - 5).to_s %>个楼层 + <%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => user_activity_id, :parent_id => comment.id),:remote=>true, :class => 'linkBlue2' %> +
      + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[3], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %> +
      + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[2], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %> +
      + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
      <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
      diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index 986ebfbdf..5db18ec57 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -1402,7 +1402,7 @@ a:hover.comment_ding_link{ color:#269ac9;} .orig_textarea{width:90%; margin-bottom:10px;} .orig_sub{ float:right; background-color:#269ac9; color:#fff; height:25px; line-height:25px; text-align:center; width:80px; border:none;} .orig_sub:hover{ background:#297fb8;} -.orig_cont_hide{ text-align:center; width:632px; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:5px 0;} +.orig_cont_hide{ text-align:center; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:5px 0;} .orig_cont_hide_issue{ text-align:center; width:882px; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:5px 0;} .orig_icon{ color:#888; margin-right:10px; font-size:14px; font-weight:bold;} From b0559788db550a806f7bde6b2b131ff55e0273dc Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Dec 2016 10:12:05 +0800 Subject: [PATCH 38/41] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E5=B7=A6=E4=BE=A7=E2=80=9C=E7=8F=AD=E7=BA=A7=E6=B4=BB?= =?UTF-8?q?=E8=B7=83=E5=BA=A6=E2=80=9D=E3=80=81=E2=80=9C=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E8=8B=B1=E9=9B=84=E6=A6=9C=E2=80=9D=E2=80=9C=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E6=8E=A8=E8=8D=90=E2=80=9D=E4=BF=AE=E6=94=B9=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course_activity_users.html.erb | 4 ++-- app/views/courses/_course_heroes.html.erb | 4 ++-- app/views/layouts/base_courses.html.erb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/courses/_course_activity_users.html.erb b/app/views/courses/_course_activity_users.html.erb index cffd383e6..692be98e9 100644 --- a/app/views/courses/_course_activity_users.html.erb +++ b/app/views/courses/_course_activity_users.html.erb @@ -4,9 +4,9 @@

        <% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %> - <%= link_to "班级活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => 'fontGrey3' %> + <%= link_to "活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => 'fontGrey3' %> <% else %> - 班级活跃度 + 活跃度 <% end %> 积分规则
        diff --git a/app/views/courses/_course_heroes.html.erb b/app/views/courses/_course_heroes.html.erb index b6bf0daa0..4f89bde76 100644 --- a/app/views/courses/_course_heroes.html.erb +++ b/app/views/courses/_course_heroes.html.erb @@ -3,9 +3,9 @@

          <% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %> - <%= link_to "班级英雄榜", course_member_path(course, :role => 2), :class => 'fontGrey3' %> + <%= link_to "英雄榜", course_member_path(course, :role => 2), :class => 'fontGrey3' %> <% else %> - 班级英雄榜 + 英雄榜 <% end %> 积分规则

          diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index d7d2daf0d..9ede327af 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -147,7 +147,7 @@ <%# 课程英雄榜 %> <%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
          -

          班级推荐

          +

          推荐

          <%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
          <%# 更新访问数,刷新的时候更新访问次数 %> From 0b217b9998115963f797401e279c03939655b2ab Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Dec 2016 16:39:24 +0800 Subject: [PATCH 39/41] =?UTF-8?q?=E5=9F=BA=E4=BA=8E=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E5=88=86=E5=81=9A=E4=BD=9C=E4=B8=9A=EF=BC=8C=E5=85=B3?= =?UTF-8?q?=E8=81=94=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E2=80=9C=E6=9B=B4=E6=8D=A2=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E2=80=9D=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 22 ++++++- .../student_work/_change_project.html.erb | 64 +++++++++++++++++++ .../student_work/_relate_project.html.erb | 33 ++++++---- .../student_work/_relate_projects.html.erb | 24 +++++-- app/views/student_work/change_project.js.erb | 17 +++++ app/views/student_work/index.html.erb | 6 +- .../new_student_work_project.js.erb | 7 +- .../student_work/search_user_projects.js.erb | 4 +- config/routes.rb | 1 + public/stylesheets/css/common.css | 2 + 10 files changed, 152 insertions(+), 28 deletions(-) create mode 100644 app/views/student_work/_change_project.html.erb create mode 100644 app/views/student_work/change_project.js.erb diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index d11259f15..dd471811b 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -7,7 +7,7 @@ class StudentWorkController < ApplicationController require "base64" before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:program_test_ex, :set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project, - :search_course_students,:work_canrepeat,:add_group_member] + :search_course_students,:work_canrepeat,:add_group_member,:change_project] before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work,:revise_attachment] before_filter :member_of_course, :only => [:new, :create, :show, :add_score, :praise_student_work] before_filter :author_of_work, :only => [:edit, :update, :destroy] @@ -1138,6 +1138,26 @@ class StudentWorkController < ApplicationController end end + # 作品更换关联项目 + def change_project + work = @homework.student_works.has_committed.where("user_id = #{User.current.id}").first + project = Project.find params[:projectName].to_i + if work && project + relate_user_ids = work.student_work_projects.map{|pro| pro.user_id} + member_ids = project.members.map{|mem| mem.user_id} + if (relate_user_ids & member_ids) == relate_user_ids + work.student_work_projects.update_all(:project_id => params[:projectName].to_i) + student_works = @homework.student_works.where("user_id in #{'(' + relate_user_ids.join(',') + ')'}") + student_works.update_all(:project_id => params[:projectName].to_i) + else + @remain_user_ids = relate_user_ids - (relate_user_ids & member_ids) + end + end + respond_to do |format| + format.js + end + end + #查找课程的学生 def search_course_students name = "" diff --git a/app/views/student_work/_change_project.html.erb b/app/views/student_work/_change_project.html.erb new file mode 100644 index 000000000..d433157a0 --- /dev/null +++ b/app/views/student_work/_change_project.html.erb @@ -0,0 +1,64 @@ +
          +
          +

          更换项目

          + +
          +
          +
          + <%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'change_project',:homework => @homework.id},:method => "post", :remote => true) do |f|%> + +
          + +
            +

            + 确定 + 取消 +
            + <% end %> +
            +
            + \ No newline at end of file diff --git a/app/views/student_work/_relate_project.html.erb b/app/views/student_work/_relate_project.html.erb index 24eac58ef..771301aee 100644 --- a/app/views/student_work/_relate_project.html.erb +++ b/app/views/student_work/_relate_project.html.erb @@ -1,16 +1,21 @@ -
            - 关联项目 - - <%=form_tag url_for(:controller=>'student_work',:action=>'student_work_project',:homework=>@homework.id,:user_activity_id=>@user_activity_id,:hw_status =>@hw_status),:id =>'student_work_relate_project',:class=>'resourcesSearchBox',:remote => true do %> - -
            - -
              -

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

              关联项目

              + +
              +
              +
              + <%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'student_work_project',:homework => @homework.id,:user_activity_id=>@user_activity_id,:hw_status =>@hw_status},:method => "post", :remote => true) do |f|%> + +
              + +
                +

                + 确定 + 取消 +
                + <% end %> +
                \ No newline at end of file diff --git a/app/views/student_work/_relate_projects.html.erb b/app/views/student_work/_relate_projects.html.erb index c6a372a47..8a1382386 100644 --- a/app/views/student_work/_relate_projects.html.erb +++ b/app/views/student_work/_relate_projects.html.erb @@ -3,18 +3,22 @@ <% allow_visit = project.status != 9 && (project.is_public || User.current.member_of?(project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course)) %>
                + <% projectUser = User.where("id=?",project.user_id).first %> + <% is_change = project.status == 9 && projectUser == User.current && @homework.student_works.has_committed.where("user_id = #{User.current.id}").count == 1 %>

                <% if allow_visit %> <%= link_to "#{project.name}", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%> <% elsif project.status != 9 %> <%=project.name %> <% else %> - <%=project.name %> + <%=project.name %> <% end %>

                <%= project.is_public? ? '公开' : '私有' %> - <% projectUser = User.where("id=?",project.user_id).first %> - <%=link_to "创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}".html_safe, user_path(projectUser) %> + <% if is_change %> + 更换项目 + <% end %> + <%=link_to "".html_safe, user_path(projectUser), :title => "#{projectUser.show_name}" %>
                @@ -30,4 +34,16 @@
                <% end %> -
                \ No newline at end of file +
                + \ No newline at end of file diff --git a/app/views/student_work/change_project.js.erb b/app/views/student_work/change_project.js.erb new file mode 100644 index 000000000..96e80db30 --- /dev/null +++ b/app/views/student_work/change_project.js.erb @@ -0,0 +1,17 @@ +<% if @remain_user_ids %> +<% str = "" %> +<% @remain_user_ids.each do |user_id| %> + <% user = User.find user_id %> + <% if str == "" %> + <% str += user.show_name.to_s + "(" + user.login.to_s + ")" %> + <% else %> + <% str += "、" + user.show_name.to_s + "(" + user.login.to_s + ")" %> + <% end %> +<% end %> +var htmlvalue = '

                提示

                '+ + '

                以下组员还不是项目成员,请先前往项目添加成员

                <%=str %>

                '+ + '确  定
                '; +pop_box_new(htmlvalue, 350, 140); +<% else %> + window.location.href = "<%=student_work_index_url(:homework => @homework.id, :tab => 3) %>"; +<% end %> \ No newline at end of file diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index a88a41d97..c14e28f4d 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -186,8 +186,10 @@ <% if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
                - <% project_ids = @homework.student_work_projects.blank? ? "(-1)" : "(" + @homework.student_work_projects.map{|pro| pro.project_id}.join(",") + ")" %> - <% projects = Project.where("id in #{project_ids}") %> + <% student_work_ids = @homework.student_works.has_committed.blank? ? "(-1)" : "(" + @homework.student_works.has_committed.map{|st| st.id}.join(",") + ")" %> + <% student_work_projects = @homework.student_work_projects.where("student_work_id in #{student_work_ids} or student_work_id is null") %> + <% project_ids = student_work_projects.blank? ? "(-1)" : "(" + student_work_projects.map{|pro| pro.project_id}.join(",") + ")" %> + <% projects = Project.where("id in #{project_ids}").order("updated_on desc") %> <%= render :partial => "student_work/relate_projects", :locals => {:projects => projects}%>
                <% end %> diff --git a/app/views/student_work/new_student_work_project.js.erb b/app/views/student_work/new_student_work_project.js.erb index 51df45f13..83ef3d89a 100644 --- a/app/views/student_work/new_student_work_project.js.erb +++ b/app/views/student_work/new_student_work_project.js.erb @@ -1,5 +1,2 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/relate_project') %>'); -showModal('ajax-modal', '320px'); -$('#ajax-modal').siblings().remove(); -$('#ajax-modal').parent().css("top","").css("left",""); -$('#ajax-modal').parent().addClass("groupPopUp"); \ No newline at end of file +var htmlvalue = "<%= escape_javascript(render :partial => 'student_work/relate_project') %>"; +pop_box_new(htmlvalue, 400, 285); \ No newline at end of file diff --git a/app/views/student_work/search_user_projects.js.erb b/app/views/student_work/search_user_projects.js.erb index 7751821a5..2fc8b0ee4 100644 --- a/app/views/student_work/search_user_projects.js.erb +++ b/app/views/student_work/search_user_projects.js.erb @@ -3,7 +3,7 @@ <% else %> $("#search_project_list").html(""); <% @project_ids.each do |project|%> - link = "
              • "; - $("#search_project_list").append(link ); + link = "
              • "; + $("#search_project_list").append(link); <% end %> <% end %> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 026e65846..b916b12d5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -335,6 +335,7 @@ RedmineApp::Application.routes.draw do collection do post 'add_score_reply' post 'student_work_project' + post 'change_project' get 'new_student_work_project' get 'search_user_projects' get 'search_course_students' diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index 4998fb966..71cd2a69e 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -316,6 +316,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .H60 {height:60px !important;} .H150{ height:150px;} .p10 {padding-left:10px; padding-right:10px;} +.mw150 {max-width: 150px !important;} .mw220 {max-width: 220px !important;} .mw280 {max-width:280px !important;} .mw360 {max-width: 360px !important;} @@ -324,6 +325,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .mh18 {max-height: 18px;} .max_h54 {max-height:54px; } .maxHeight100 {max-height:100px; overflow-x:hidden; overflow-y:auto;} +.maxHeight200 {max-height:200px; overflow-x:hidden; overflow-y:auto;} .W50{ width:50px;} .W120{ width:110px;} From 34b14b4e51a09b3de715bacaf0cd13e91c50b1b2 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 9 Dec 2016 16:52:01 +0800 Subject: [PATCH 40/41] =?UTF-8?q?=E5=BE=AE=E4=BF=A1bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 1 + public/assets/wechat/issue_detail.html | 2 +- public/javascripts/wechat/controllers/issue.js | 4 ++++ public/stylesheets/weui/weixin.css | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 41653faf9..25ce1f83e 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -286,6 +286,7 @@ class WechatsController < ActionController::Base logger.info tmpurl news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "欢迎使用Trustie创新实践服务平台! 在这里您可以随时了解您的课程和项目动态,随时点赞和回复。交作业、代码提交等更多功能,请前往 www.trustie.net + 我们将会与微信不断结合,为您提供更有价值的服务。 您还未绑定确实的用户,请先绑定,谢谢!" } } diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index c2fc649c1..549739161 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -142,7 +142,7 @@
                - +
                • {{person.name}}

                  ({{person.login}})

                • diff --git a/public/javascripts/wechat/controllers/issue.js b/public/javascripts/wechat/controllers/issue.js index 40a2f0589..917de2990 100644 --- a/public/javascripts/wechat/controllers/issue.js +++ b/public/javascripts/wechat/controllers/issue.js @@ -50,6 +50,10 @@ app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'c vm.issue.comment += person.name + ' '; }; + vm.cancelAt = function(){ + vm.showAtDialog = false; + } + common.init({ id: $routeParams.id, scope: $scope, diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index a485d94bb..9026e837b 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -283,4 +283,4 @@ a.underline {text-decoration:underline;} .weixin-users-all li:hover{ background:#f4f4f4;} /*弹出@选择对话框 guange*/ -.wechat-at {position: fixed; top: 0; left:0; width: 100%; height: 100%; background-color: #ffffff;} \ No newline at end of file +.wechat-at {position: absolute; z-index: 999; top: 0; left:0; width: 100%; height: 100%; background-color: #ffffff;} \ No newline at end of file From 6903639699607e61aea48e886bc7ee3978db35c1 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Dec 2016 19:28:20 +0800 Subject: [PATCH 41/41] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=BC=BA=E9=99=B7@?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=8C=89=E9=92=AE=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 --- public/assets/wechat/issue_detail.html | 2 +- public/stylesheets/weui/weixin.css | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 549739161..e5b61cc52 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -142,7 +142,7 @@
                  - +
                  • {{person.name}}

                    ({{person.login}})

                  • diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 9026e837b..d8c272b93 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -283,4 +283,7 @@ a.underline {text-decoration:underline;} .weixin-users-all li:hover{ background:#f4f4f4;} /*弹出@选择对话框 guange*/ -.wechat-at {position: absolute; z-index: 999; top: 0; left:0; width: 100%; height: 100%; background-color: #ffffff;} \ No newline at end of file +.wechat-at {position: absolute; z-index: 999; top: 0; left:0; width: 100%; height: 100%; background-color: #ffffff;} + +/*@页面的取消按钮*/ +.cancel-btn-new {position: absolute; font-size: 13px; height: 24px; line-height: 24px; vertical-align: middle; padding: 0 7px; color: #888; background-color: #fff; outline: none; border: none; top: 11px; right: 10px;}