From 6cbafb66d9be3945aecb006673bf7f93defd4fa6 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 23 Jul 2015 10:20:32 +0800 Subject: [PATCH 01/68] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=BB=9F=E8=AE=A1=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/stats.html.erb | 4 +++- public/stylesheets/project.css | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/views/repositories/stats.html.erb b/app/views/repositories/stats.html.erb index 7e558119f..fe3bf20ac 100644 --- a/app/views/repositories/stats.html.erb +++ b/app/views/repositories/stats.html.erb @@ -1,7 +1,9 @@

<%= l(:label_statistics) %>

-

+

修订 是版本库的提交次数, 显示为橘红色。

+
变更 是对版本库中文件的修改次数, 显示为蓝色。
+

<%= tag("embed", :width => 670, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %>

diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index f005b2df6..fa1bec754 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -551,7 +551,24 @@ p.percent { font-size: 12px; } .repositorytitle select{ width: 110px; height: 21px; } - +.riviseRed { + width:15px; + height:15px; + margin-right: 3px; + background-color:#FF0000; + filter:alpha(opacity=50); /* ie 有效*/ + -moz-opacity:0.5; /* Firefox 有效*/ + opacity: 0.5; /* 通用,其他浏览器 有效*/ +} +.changeBlue { + width:15px; + height:15px; + margin-right: 3px; + background-color:#0000FF; + filter:alpha(opacity=50); /* ie 有效*/ + -moz-opacity:0.5; /* Firefox 有效*/ + opacity: 0.5; /* 通用,其他浏览器 有效*/ +} /*导出*/ From 8f0262618305b96a58cded2f1ec4d11c75004244 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 23 Jul 2015 10:36:51 +0800 Subject: [PATCH 02/68] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=91=E5=8C=96?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E8=BF=9B=E5=BA=A6=E6=9D=A1=EF=BC=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=88=90=E7=AD=89=E5=BE=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/yun_dep.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/projects/yun_dep.html.erb b/app/views/projects/yun_dep.html.erb index 20abf038f..7a774f4e4 100644 --- a/app/views/projects/yun_dep.html.erb +++ b/app/views/projects/yun_dep.html.erb @@ -5,27 +5,27 @@

-

云化部署中...

-
-
0%
+

云化部署中....

+
+
+ +<%= form_tag(upload_school_path(@school.id),method: "post", multipart: true) do %> + <%#= text_field_tag 'school'%> +
+ + <%= image_tag(@school.logo_link, id: "avatar_image", :class=>"school_avatar")%> + 上传图片 + <%= file_field_tag 'logo',:style => "display:none;", :id => "file", :onchange => "showPreview(this)"%> +
+
+ <%= submit_tag('上传') %> + <%= submit_tag('取消') %> +
+
<% end %> + diff --git a/config/routes.rb b/config/routes.rb index d353c60ff..280053f60 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -39,6 +39,17 @@ RedmineApp::Application.routes.draw do end + resources :school do + collection do + + end + + member do + get 'upload_logo' + post 'upload' + end + end + resources :homework_attach do collection do get 'get_homework_member_list' @@ -809,9 +820,6 @@ RedmineApp::Application.routes.draw do post 'school/search_school/', :to => 'school#search_school' get 'school/search_school/', :to => 'school#search_school' - post 'school/upload', :to => 'school#upload' - get 'school/upload_logo', :to => 'school#upload_logo' - ######added by nie match 'tags/show_projects_tags' ########### added by liuping diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index d4d309181..3e01d68ff 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2796,4 +2796,15 @@ div.repos_explain{ .upload_img img{max-width: 100%;} #activity .upload_img img{max-width: 580px;} -img,embed{max-width: 100%;} \ No newline at end of file +img,embed{max-width: 100%;} + +img.school_avatar { + background: rgb(245, 245, 245); + padding: 4px; + border: 1px solid #e5dfc7; + float: left; + display: block; + width: 100px; + height: 100px; + max-width: none; +} \ No newline at end of file From 45d5972a93d98b576c57a8a78ed82a283949ccad Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 28 Jul 2015 10:27:45 +0800 Subject: [PATCH 60/68] =?UTF-8?q?=E5=9C=A8=E5=8F=91=E5=B8=83=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=AD=E9=97=B4=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=8F=92=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 16 +- app/views/poll/_new_MC.html.erb | 1 + app/views/poll/_poll_form.html.erb | 186 ++++++++++++++++++++- app/views/poll/_show_MC.html.erb | 18 +- app/views/poll/_show_MCQ.html.erb | 14 +- app/views/poll/_show_mulit.html.erb | 14 +- app/views/poll/_show_single.html.erb | 14 +- app/views/poll/create_poll_question.js.erb | 6 +- public/stylesheets/polls.css | 5 +- 9 files changed, 261 insertions(+), 13 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 758747e02..8f81bc2c6 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -137,11 +137,19 @@ class PollController < ApplicationController @poll_questions.poll_answers.new question_option end end - if @poll_questions.save - respond_to do |format| - format.js + # 如果是插入的话,那么从插入的这个id以后的question_num都将要+1 + if params[:quest_id] + @is_insert = true + @poll.poll_questions.where("question_number > #{params[:quest_num].to_i}").update_all(" question_number = question_number + 1") + @poll_question_num = params[:quest_num].to_i + @poll_questions.question_number = params[:quest_num].to_i + 1 + end + if @poll_questions.save + respond_to do |format| + format.js + end end - end + end #修改题目 diff --git a/app/views/poll/_new_MC.html.erb b/app/views/poll/_new_MC.html.erb index 8c47baa01..e5f2a6b82 100644 --- a/app/views/poll/_new_MC.html.erb +++ b/app/views/poll/_new_MC.html.erb @@ -1,5 +1,6 @@ <%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%> + <% insert_begin = insert_begin %>
diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index 74ca9fb32..0a15143fb 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -6,23 +6,203 @@ function edit_head(){ $("#polls_description").val($("#polls_description_div").html()); } - function add_MC(){ +function chooseQuestionType(quest_type,quest_id){ + $("#div_"+quest_type+"_"+quest_id).css("position", "absolute"); + + $("#div_"+quest_type+"_"+quest_id).css("top", $("#add_"+quest_type+"_"+quest_id).offset().top+30); + + $("#div_"+quest_type+"_"+quest_id).css("left", $("#add_"+quest_type+"_"+quest_id).offset().left-10); + if( $("#div_"+quest_type+"_"+quest_id).css('display') == 'block') { + $("#div_"+quest_type+"_"+quest_id).css('display', 'none'); + } + else{ + $("#div_"+quest_type+"_"+quest_id).css('display', 'block'); + } +} + +function add_MC(){ $("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC') %>"); $("#poll_questions_title").focus(); - } - function add_MCQ(){ +} + + function insert_MC(quest_type,quest_num,quest_id){ + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( + '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+ + '
'+ + '
'+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'+ + '
'+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '<% end%>' + ); + $("#poll_questions_title").focus(); +} + +function add_MCQ(){ $("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MCQ') %>"); $("#poll_questions_title").focus(); +} + +function insert_MCQ(quest_type,quest_num,quest_id){ + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( + '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+ + '
'+ + '
'+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'+ + '
'+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
  • '+ + ''+ + ''+ + ''+ + ''+ + '
  • '+ + '
    '+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '<% end%>' + ); + $("#poll_questions_title").focus(); } + function add_single(){ $("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_single') %>"); $("#poll_questions_title").focus(); } + + function insert_SINGLE(quest_type,quest_num,quest_id){ + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( + '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+ + '
'+ + '
'+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'+ + ''+ + '
'+ + '
'+ + '<% end%>' + ); + $("#poll_questions_title").focus(); + } function add_mulit(){ $("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_mulit') %>"); $("#poll_questions_title").focus(); } + function insert_MULIT(quest_type,quest_num,quest_id){ + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( + '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+ + '
'+ + '
'+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '<% end%>' + ); + $("#poll_questions_title").focus(); + } + //添加标题时确定按钮 function add_poll_question(doc) { diff --git a/app/views/poll/_show_MC.html.erb b/app/views/poll/_show_MC.html.erb index ff8e52f25..9c47894dc 100644 --- a/app/views/poll/_show_MC.html.erb +++ b/app/views/poll/_show_MC.html.erb @@ -1,3 +1,6 @@ +
@@ -9,9 +12,11 @@ * <%end%>
+ <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
@@ -29,4 +34,15 @@
-
\ No newline at end of file +
+ +
+
+ \ No newline at end of file diff --git a/app/views/poll/_show_MCQ.html.erb b/app/views/poll/_show_MCQ.html.erb index 63b9d1c1f..fb2c03080 100644 --- a/app/views/poll/_show_MCQ.html.erb +++ b/app/views/poll/_show_MCQ.html.erb @@ -12,6 +12,7 @@ <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
@@ -29,4 +30,15 @@
-
\ No newline at end of file +
+ +
+
+ \ No newline at end of file diff --git a/app/views/poll/_show_mulit.html.erb b/app/views/poll/_show_mulit.html.erb index 2d52fffb5..ad01d0a3e 100644 --- a/app/views/poll/_show_mulit.html.erb +++ b/app/views/poll/_show_mulit.html.erb @@ -13,9 +13,21 @@ <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
-
\ No newline at end of file +
+ +
+
+ \ No newline at end of file diff --git a/app/views/poll/_show_single.html.erb b/app/views/poll/_show_single.html.erb index 8caa7b1a5..f5846b6b7 100644 --- a/app/views/poll/_show_single.html.erb +++ b/app/views/poll/_show_single.html.erb @@ -12,8 +12,20 @@ <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
-
\ No newline at end of file + + +
+
+ \ No newline at end of file diff --git a/app/views/poll/create_poll_question.js.erb b/app/views/poll/create_poll_question.js.erb index ac44ebb4c..8a597514e 100644 --- a/app/views/poll/create_poll_question.js.erb +++ b/app/views/poll/create_poll_question.js.erb @@ -1,4 +1,8 @@ +<% if @is_insert %> + $("#poll_content").html('<%= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll})%>'); +<% else %> $("#new_poll_question").html(""); + $("#poll_content").append("
" + "
" + "<% if @poll_questions.question_type == 1%>" + @@ -23,4 +27,4 @@ $("#poll_content").append("
" + "<% end%>" + "
" + "
"); - +<% end %> diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index 353ec3937..83fa5089b 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -28,7 +28,7 @@ a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;} #polls div{word-break: break-all;word-wrap: break-word;} .ur_prefix_content{ color:#656565; text-indent:30px; margin-top:10px; } .ur_card{border-top:1px solid #dcdcdc;margin-top:20px; color:#3a3a3a;} -.ur_title{ padding:20px 0px ; float:left; width:604px; } +.ur_title{ padding:20px 0px ; float:left; width:564px; } .ur_required{ font-weight: bold; color:red;} .ur_inputs{ color:#666;} .ur_table{border-top:1px solid #dcdcdc; background:#fff;} @@ -101,10 +101,13 @@ a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;} .ur_editor02{width:648px; border:1px solid #cbcbcb; padding:10px; margin-bottom:10px;} a.ur_button_submit{ display:block; width:106px; height:31px; margin:0 auto; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:4px; margin-bottom:10px; } a:hover.ur_button_submit{ background:#0fa9bb; text-decoration:none;} + a.ur_icon_de{ background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px;} a:hover.ur_icon_de{ background:url(images/icons.png) -20px -338px no-repeat;} .ur_icon_edit{ background:url(images/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px; margin-right:10px;} a:hover.ur_icon_edit{ background:url(images/icons.png) -21px -272px no-repeat;} +.ur_icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px; margin-right:10px;} +a:hover.ur_icon_add{background:url(images/icons.png) -20px -310px no-repeat;} /***弹框***/ .popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} From 6b45702f8c403a7f5b37393ae26b9cb8cbf664d0 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 28 Jul 2015 11:20:21 +0800 Subject: [PATCH 61/68] =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=A9=BA=E7=99=BD?= =?UTF-8?q?=E5=A4=84=E5=8F=AF=E4=BB=A5=E8=AE=A9=E5=BC=B9=E5=87=BA=E6=A1=86?= =?UTF-8?q?=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll_form.html.erb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index 0a15143fb..b081f4d18 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -2,11 +2,24 @@