From 576f7991053ca4aff99f2eb2177d359bd447fdf3 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 9 Jan 2015 19:09:19 +0800 Subject: [PATCH 01/20] Signed-off-by: alan <547533434@qq.com> --- app/models/course.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index 196e7168d..26cba8a75 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -35,8 +35,8 @@ class Course < ActiveRecord::Base acts_as_nested_set :order => 'name', :dependent => :destroy acts_as_attachable :view_permission => :view_course_files, :delete_permission => :manage_files - - validates_presence_of :password, :term,:name + + validates_presence_of :password, :term,:name, validates_format_of :class_period, :with =>/^[1-9]\d*$/ validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/ validates_length_of :description, :maximum => 10000 From 479a1249ae01fdf79aaa497d0353f4ca373973f6 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 16 Jan 2015 17:23:35 +0800 Subject: [PATCH 02/20] Signed-off-by: alan <547533434@qq.com> --- app/models/course.rb | 2 +- app/views/layouts/base_newcontest.html.erb | 3 +- .../stylesheets/window_js/mac_os_x_dialog.css | 320 ++++++++--------- .../stylesheets/window_js/nuncio.css | 328 +++++++++--------- .../stylesheets/window_js/spread.css | 216 ++++++------ 5 files changed, 435 insertions(+), 434 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index 2ce2db141..d30e46e48 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -36,7 +36,7 @@ class Course < ActiveRecord::Base acts_as_attachable :view_permission => :view_course_files, :delete_permission => :manage_files - validates_presence_of :password, :term,:name, + validates_presence_of :password, :term,:name validates_format_of :class_period, :with =>/^[1-9]\d*$/ validates_format_of :name,:with =>/^[^ ]+[a-zA-Z0-9_\u4e00-\u9fa5\s\S]+$/ validates_length_of :description, :maximum => 10000 diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb index 6c3721fcf..343cf32eb 100644 --- a/app/views/layouts/base_newcontest.html.erb +++ b/app/views/layouts/base_newcontest.html.erb @@ -79,7 +79,8 @@ <%=link_to l(:field_homepage), home_path %> > - <%=l(:label_courses_management_platform)%> + <%=l(:label_contests_management_platform)%> + > <%= link_to h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %> diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css b/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css index 4c89f602d..e663e3c5e 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css @@ -1,160 +1,160 @@ -.overlay_mac_os_x_dialog { - background-color: #FF7224; - filter:alpha(opacity=60); - -moz-opacity: 0.6; - opacity: 0.6; -} - -.mac_os_x_dialog_nw { - background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; - width:16px; - height:16px; -} - -.mac_os_x_dialog_n { - background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; - height:18px; -} - -.mac_os_x_dialog_ne { - background: transparent url(mac_os_x_dialog/R.png) repeat-y top left; - width:16px; - height:16px; -} - -.mac_os_x_dialog_w { - background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; - width:16px; -} - -.mac_os_x_dialog_e { - background: transparent url(mac_os_x_dialog/R.png) repeat-y top right; - width:16px; -} - -.mac_os_x_dialog_sw { - background: transparent url(mac_os_x_dialog/BL.png) no-repeat 0 0; - width:31px; - height:40px; -} - -.mac_os_x_dialog_s { - background: transparent url(mac_os_x_dialog/B.png) repeat-x 0 0; - height:40px; -} - -.mac_os_x_dialog_se, .mac_os_x_dialog_sizer { - background: transparent url(mac_os_x_dialog/BR.png) no-repeat 0 0; - width:31px; - height:40px; -} - -.mac_os_x_dialog_sizer { - cursor:se-resize; -} - -.mac_os_x_dialog_close { - width: 19px; - height: 19px; - background: transparent url(mac_os_x_dialog/close.gif) no-repeat 0 0; - position:absolute; - top:12px; - left:25px; - cursor:pointer; - z-index:1000; -} - -.mac_os_x_dialog_minimize { - width: 19px; - height: 19px; - background: transparent url(mac_os_x_dialog/minimize.gif) no-repeat 0 0; - position:absolute; - top:12px; - left:45px; - cursor:pointer; - z-index:1000; -} - -.mac_os_x_dialog_maximize { - width: 19px; - height: 19px; - background: transparent url(mac_os_x_dialog/maximize.gif) no-repeat 0 0; - position:absolute; - top:12px; - left:65px; - cursor:pointer; - z-index:1000; -} - -.mac_os_x_dialog_title { - float:left; - height:14px; - font-family: Tahoma, Arial, sans-serif; - font-size:12px; - text-align:center; - margin-top:6px; - width:100%; - color:#000; -} - -.mac_os_x_dialog_content { - overflow:auto; - color: #222; - font-family: Tahoma, Arial, sans-serif; - font-size: 10px; - background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; -} - -.mac_os_x_dialog_buttons { - text-align: center; -} -/* FOR IE */ -* html .mac_os_x_dialog_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); -} - - -* html .mac_os_x_dialog_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BL.png", sizingMethod="crop"); -} - -* html .mac_os_x_dialog_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/B.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_se { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); -} - -* html .mac_os_x_dialog_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); -} - +.overlay_mac_os_x_dialog { + background-color: #FF7224; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +.mac_os_x_dialog_nw { + background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; + width:16px; + height:16px; +} + +.mac_os_x_dialog_n { + background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; + height:18px; +} + +.mac_os_x_dialog_ne { + background: transparent url(mac_os_x_dialog/R.png) repeat-y top left; + width:16px; + height:16px; +} + +.mac_os_x_dialog_w { + background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; + width:16px; +} + +.mac_os_x_dialog_e { + background: transparent url(mac_os_x_dialog/R.png) repeat-y top right; + width:16px; +} + +.mac_os_x_dialog_sw { + background: transparent url(mac_os_x_dialog/BL.png) no-repeat 0 0; + width:31px; + height:40px; +} + +.mac_os_x_dialog_s { + background: transparent url(mac_os_x_dialog/B.png) repeat-x 0 0; + height:40px; +} + +.mac_os_x_dialog_se, .mac_os_x_dialog_sizer { + background: transparent url(mac_os_x_dialog/BR.png) no-repeat 0 0; + width:31px; + height:40px; +} + +.mac_os_x_dialog_sizer { + cursor:se-resize; +} + +.mac_os_x_dialog_close { + width: 19px; + height: 19px; + background: transparent url(mac_os_x_dialog/close.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:25px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_dialog_minimize { + width: 19px; + height: 19px; + background: transparent url(mac_os_x_dialog/minimize.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:45px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_dialog_maximize { + width: 19px; + height: 19px; + background: transparent url(mac_os_x_dialog/maximize.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:65px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_dialog_title { + float:left; + height:14px; + font-family: Tahoma, Arial, sans-serif; + font-size:12px; + text-align:center; + margin-top:6px; + width:100%; + color:#000; +} + +.mac_os_x_dialog_content { + overflow:auto; + color: #222; + font-family: Tahoma, Arial, sans-serif; + font-size: 10px; + background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; +} + +.mac_os_x_dialog_buttons { + text-align: center; +} +/* FOR IE */ +* html .mac_os_x_dialog_nw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); +} + + +* html .mac_os_x_dialog_ne { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_w { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_e { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_sw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BL.png", sizingMethod="crop"); +} + +* html .mac_os_x_dialog_s { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/B.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_se { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); +} + +* html .mac_os_x_dialog_sizer { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); +} + diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/nuncio.css b/public/plugin_assets/redmine_code_review/stylesheets/window_js/nuncio.css index e2700e5b7..2c439bd00 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/nuncio.css +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/nuncio.css @@ -1,164 +1,164 @@ -.overlay_nuncio img { border: none; } - -.overlay_nuncio { - background-color: #666666; -} - -.nuncio_nw { - width: 12px; - height: 28px; - background: url(nuncio/top_left.png) no-repeat; -} - -.nuncio_n { - background: url(nuncio/top_mid.png) repeat-x; - height: 28px; -} - -.nuncio_ne { - width: 21px; - height: 28px; - background: url(nuncio/top_right.png) no-repeat; -} - -.nuncio_e { - width: 21px; - background: url(nuncio/center_right.png) repeat-y top right; -} - -.nuncio_w { - width: 12px; - background: url(nuncio/center_left.png) repeat-y top left; -} - -.nuncio_sw { - width: 12px; - height: 18px; - background: url(nuncio/bottom_left.png) no-repeat; -} - -.nuncio_s { - background: url(nuncio/bottom_mid.png) repeat-x 0 0; - height: 18px; -} - -.nuncio_se, .nuncio_sizer { - width: 21px; - height: 18px; - background: url(nuncio/bottom_right.png) no-repeat; -} - -.nuncio_close { - width: 14px; - height: 14px; - background: url(nuncio/close.png) no-repeat; - position:absolute; - top:10px; - right:22px; - cursor:pointer; - z-index:2000; -} - -.nuncio_minimize { - width: 14px; - height: 15px; - background: url(nuncio/minimize.png) no-repeat; - position:absolute; - top:10px; - right:40px; - cursor:pointer; - z-index:2000; -} - -.nuncio_title { - float:left; - font-size:11px; - font-weight: bold; - font-style: italic; - color: #fff; - width: 100% -} - -.nuncio_content { - background: url(nuncio/overlay.png) repeat; - overflow:auto; - color: #ddd; - font-family: Tahoma, Arial, "sans-serif"; - font-size: 10px; -} - -.nuncio_sizer { - cursor:se-resize; -} - - -.top_draggable, .bottom_draggable { - cursor:move -} -/* FOR IE */ -* html .nuncio_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_left.png", sizingMethod="crop"); -} - -* html .nuncio_n { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_mid.png", sizingMethod="scale"); -} - -* html .nuncio_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_right.png", sizingMethod="crop"); -} - -* html .nuncio_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_left.png", sizingMethod="scale"); -} - -* html .nuncio_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_right.png", sizingMethod="scale"); -} - -* html .nuncio_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_left.png", sizingMethod="crop"); -} - -* html .nuncio_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_mid.png", sizingMethod="scale"); -} - -* html .nuncio_se { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop"); -} - -* html .nuncio_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop"); -} - -* html .nuncio_close { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/close.png", sizingMethod="crop"); -} - -* html .nuncio_minimize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/minimize.png", sizingMethod="crop"); -} - +.overlay_nuncio img { border: none; } + +.overlay_nuncio { + background-color: #666666; +} + +.nuncio_nw { + width: 12px; + height: 28px; + background: url(nuncio/top_left.png) no-repeat; +} + +.nuncio_n { + background: url(nuncio/top_mid.png) repeat-x; + height: 28px; +} + +.nuncio_ne { + width: 21px; + height: 28px; + background: url(nuncio/top_right.png) no-repeat; +} + +.nuncio_e { + width: 21px; + background: url(nuncio/center_right.png) repeat-y top right; +} + +.nuncio_w { + width: 12px; + background: url(nuncio/center_left.png) repeat-y top left; +} + +.nuncio_sw { + width: 12px; + height: 18px; + background: url(nuncio/bottom_left.png) no-repeat; +} + +.nuncio_s { + background: url(nuncio/bottom_mid.png) repeat-x 0 0; + height: 18px; +} + +.nuncio_se, .nuncio_sizer { + width: 21px; + height: 18px; + background: url(nuncio/bottom_right.png) no-repeat; +} + +.nuncio_close { + width: 14px; + height: 14px; + background: url(nuncio/close.png) no-repeat; + position:absolute; + top:10px; + right:22px; + cursor:pointer; + z-index:2000; +} + +.nuncio_minimize { + width: 14px; + height: 15px; + background: url(nuncio/minimize.png) no-repeat; + position:absolute; + top:10px; + right:40px; + cursor:pointer; + z-index:2000; +} + +.nuncio_title { + float:left; + font-size:11px; + font-weight: bold; + font-style: italic; + color: #fff; + width: 100% +} + +.nuncio_content { + background: url(nuncio/overlay.png) repeat; + overflow:auto; + color: #ddd; + font-family: Tahoma, Arial, "sans-serif"; + font-size: 10px; +} + +.nuncio_sizer { + cursor:se-resize; +} + + +.top_draggable, .bottom_draggable { + cursor:move +} +/* FOR IE */ +* html .nuncio_nw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_left.png", sizingMethod="crop"); +} + +* html .nuncio_n { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_mid.png", sizingMethod="scale"); +} + +* html .nuncio_ne { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_right.png", sizingMethod="crop"); +} + +* html .nuncio_w { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_left.png", sizingMethod="scale"); +} + +* html .nuncio_e { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_right.png", sizingMethod="scale"); +} + +* html .nuncio_sw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_left.png", sizingMethod="crop"); +} + +* html .nuncio_s { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_mid.png", sizingMethod="scale"); +} + +* html .nuncio_se { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop"); +} + +* html .nuncio_sizer { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop"); +} + +* html .nuncio_close { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/close.png", sizingMethod="crop"); +} + +* html .nuncio_minimize { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/minimize.png", sizingMethod="crop"); +} + diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/spread.css b/public/plugin_assets/redmine_code_review/stylesheets/window_js/spread.css index d7d722e8a..9bda2a68d 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/spread.css +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/spread.css @@ -1,108 +1,108 @@ -.overlay_spread { - background-color: #85BBEF; - filter:alpha(opacity=60); - -moz-opacity: 0.6; - opacity: 0.6; -} - -.spread_nw { - background: transparent url(spread/left-top.gif) no-repeat 0 0; - width:10px; - height:25px; -} - -.spread_n { - background: transparent url(spread/top-middle.gif) repeat-x 0 0; - height:25px; -} - -.spread_ne { - background: transparent url(spread/right-top.gif) no-repeat 0 0; - width:10px; - height:25px; -} - -.spread_w { - background: transparent url(spread/frame-left.gif) repeat-y top left; - width:7px; -} - -.spread_e { - background: transparent url(spread/frame-right.gif) repeat-y top right; - width:7px; -} - -.spread_sw { - background: transparent url(spread/bottom-left-c.gif) no-repeat 0 0; - width:7px; - height:7px; -} - -.spread_s { - background: transparent url(spread/bottom-middle.gif) repeat-x 0 0; - height:7px; -} - -.spread_se, .spread_sizer { - background: transparent url(spread/bottom-right-c.gif) no-repeat 0 0; - width:7px; - height:7px; -} - -.spread_sizer { - cursor:se-resize; -} - -.spread_close { - width: 23px; - height: 23px; - background: transparent url(spread/button-close-focus.gif) no-repeat 0 0; - position:absolute; - top:0px; - right:11px; - cursor:pointer; - z-index:1000; -} - -.spread_minimize { - width: 23px; - height: 23px; - background: transparent url(spread/button-min-focus.gif) no-repeat 0 0; - position:absolute; - top:0px; - right:55px; - cursor:pointer; - z-index:1000; -} - -.spread_maximize { - width: 23px; - height: 23px; - background: transparent url(spread/button-max-focus.gif) no-repeat 0 0; - position:absolute; - top:0px; - right:33px; - cursor:pointer; - z-index:1000; -} - -.spread_title { - float:left; - height:14px; - font-family: Tahoma, Arial, sans-serif; - font-size:14px; - font-weight:bold; - text-align:left; - margin-top:2px; - width:100%; - color:#E47211; -} - -.spread_content { - overflow:auto; - color: #222; - font-family: Tahoma, Arial, sans-serif; - font-size: 10px; - background:#A9EA00; -} - +.overlay_spread { + background-color: #85BBEF; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +.spread_nw { + background: transparent url(spread/left-top.gif) no-repeat 0 0; + width:10px; + height:25px; +} + +.spread_n { + background: transparent url(spread/top-middle.gif) repeat-x 0 0; + height:25px; +} + +.spread_ne { + background: transparent url(spread/right-top.gif) no-repeat 0 0; + width:10px; + height:25px; +} + +.spread_w { + background: transparent url(spread/frame-left.gif) repeat-y top left; + width:7px; +} + +.spread_e { + background: transparent url(spread/frame-right.gif) repeat-y top right; + width:7px; +} + +.spread_sw { + background: transparent url(spread/bottom-left-c.gif) no-repeat 0 0; + width:7px; + height:7px; +} + +.spread_s { + background: transparent url(spread/bottom-middle.gif) repeat-x 0 0; + height:7px; +} + +.spread_se, .spread_sizer { + background: transparent url(spread/bottom-right-c.gif) no-repeat 0 0; + width:7px; + height:7px; +} + +.spread_sizer { + cursor:se-resize; +} + +.spread_close { + width: 23px; + height: 23px; + background: transparent url(spread/button-close-focus.gif) no-repeat 0 0; + position:absolute; + top:0px; + right:11px; + cursor:pointer; + z-index:1000; +} + +.spread_minimize { + width: 23px; + height: 23px; + background: transparent url(spread/button-min-focus.gif) no-repeat 0 0; + position:absolute; + top:0px; + right:55px; + cursor:pointer; + z-index:1000; +} + +.spread_maximize { + width: 23px; + height: 23px; + background: transparent url(spread/button-max-focus.gif) no-repeat 0 0; + position:absolute; + top:0px; + right:33px; + cursor:pointer; + z-index:1000; +} + +.spread_title { + float:left; + height:14px; + font-family: Tahoma, Arial, sans-serif; + font-size:14px; + font-weight:bold; + text-align:left; + margin-top:2px; + width:100%; + color:#E47211; +} + +.spread_content { + overflow:auto; + color: #222; + font-family: Tahoma, Arial, sans-serif; + font-size: 10px; + background:#A9EA00; +} + From 3e2deaf0e3dce32b97033e15b8c56b1c8e5852a3 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 30 Jan 2015 17:22:36 +0800 Subject: [PATCH 03/20] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Kaminari=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../redpenny-master/stylesheets/application.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index 936610c6b..31746802e 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -2259,3 +2259,16 @@ ul.messages-for-user-reply li { .footer_text_link{ margin: 0px 5px; } + +/**kaminari 分頁當前頁樣式**/ +div.pagination a.current-page { + /*color: rgb(153, 153, 153); add by huang*/ + /*color:#e2f4ff;*/ + cursor: default; +} + +div.pagination a.current-page { + /*background-color: rgb(245, 245, 245); add by huang*/ + background-color:#e2f4ff; +} +/**kaminari 分頁樣式**/ From 55e049edbb8015d47f0ce42b1f8632930fafd91e Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 30 Jan 2015 17:23:04 +0800 Subject: [PATCH 04/20] =?UTF-8?q?=E5=8E=BB=E6=8E=89Kaminari=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/application.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 3b482f333..29d81fe88 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2923,7 +2923,7 @@ input[class~='m3p10'], .m3p10 { .search_results { color: red; } -/*lizanle 分页样式*/ +/*lizanle 分页样式 .pagination ul li a, .pagination ul li span{ background-color: #FFFFFF; border-color: #DDDDDD; @@ -2947,4 +2947,5 @@ input[class~='m3p10'], .m3p10 { margin-right: 3px; list-style: none outside none; -} \ No newline at end of file +} +*/ From c543a28cc82b0dbcb712ecbedb6d8a089b3ea9f3 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 30 Jan 2015 17:24:26 +0800 Subject: [PATCH 05/20] =?UTF-8?q?=E9=87=8D=E5=86=99url=5Fhelper=20link=5Ft?= =?UTF-8?q?o=5Funless=E6=96=B9=E6=B3=95=EF=BC=8C=E7=BB=99Kaminari=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E9=A1=B5=E6=B7=BB=E5=8A=A0=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/initializers/url_helper.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 config/initializers/url_helper.rb diff --git a/config/initializers/url_helper.rb b/config/initializers/url_helper.rb new file mode 100644 index 000000000..7c4b68be9 --- /dev/null +++ b/config/initializers/url_helper.rb @@ -0,0 +1,22 @@ +# Time 2015-01-30 17:02:41 +# Author lizanle +# Description 打开redmine\ruby\lib\ruby\gems\1.9.1\gems\actionpack-3.2.13\lib\action_view\helpers\UrlHelper,重写link_to_unless方法 +# 如果是当前页,则给当前页添加样式:class=>'current-page' +module ActionView + # = Action View URL Helpers + module Helpers #:nodoc: + # Provides a set of methods for making links and getting URLs that + # depend on the routing subsystem (see ActionDispatch::Routing). + # This allows you to use the same format for links in views + # and controllers. + module UrlHelper + def link_to_unless(condition, name, options = {}, html_options = {}, &block) + if condition + link_to(name, options, html_options.merge(:class => 'current-page')) + else + link_to(name, options, html_options) + end + end + end + end +end \ No newline at end of file From a47cb8eb65ea11a299524208d2edc155dea47f4c Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 30 Jan 2015 17:24:56 +0800 Subject: [PATCH 06/20] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=8E=9F=E6=9C=89?= =?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=E5=88=86=E9=A1=B5=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/search.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/projects/search.html.erb b/app/views/projects/search.html.erb index 0f6fa695e..a9d3184b7 100644 --- a/app/views/projects/search.html.erb +++ b/app/views/projects/search.html.erb @@ -65,11 +65,11 @@ <% end %> - + + +<%= paginate @project_pages %> + + <% if User.current.logged? %>

From ff80bea0c26509accfcbc01b5b7f7c54359a63e8 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 30 Jan 2015 17:25:27 +0800 Subject: [PATCH 07/20] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Kaminari=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=EF=BC=8C=E5=B9=B6=E7=BB=99=E5=87=BA?= =?UTF-8?q?=E4=BA=86=E6=AF=94=E8=BE=83=E8=AF=A6=E7=BB=86=E7=9A=84=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/initializers/kaminari_config.rb | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 config/initializers/kaminari_config.rb diff --git a/config/initializers/kaminari_config.rb b/config/initializers/kaminari_config.rb new file mode 100644 index 000000000..63e6b7f9b --- /dev/null +++ b/config/initializers/kaminari_config.rb @@ -0,0 +1,32 @@ +# Time 2015-01-30 17:04:12 +# Author lizanle +# Description kaminari配置文件 +# <%= paginate @users, :window => 2 %> +# 则展示页会像 5 6 7 8 9 ,当7是当前页的时候 + +# <%= paginate @users, :outer_window => 3 %> +# 分页展示会像 1 2 3 4 ...(snip)... 17 18 19 20 当总共有20个页面的时候 + +# <%= paginate @users, :left => 1, :right => 3 %> +# 分页展示会像 1 ...(snip)... 18 19 20 当总共有20个页面的时候 + +# <%= paginate @users, :param_name => :pagina %> +# 这样子会将每个链接传进去一个参数 :pagina + +# <%= paginate @users, :params => {:controller => 'foo', :action => 'bar'} %> +# 这样子将会修改每个链接的控制器和动作. :controller and :action + +# <%= paginate @users, :remote => true %> +# 这将会使每个链接使用ajax方式,极其简单,非常完美的工作。data-remote="true" + +#更多知识详见 https://github.com/honwlee/kaminari +Kaminari.configure do |config| + # config.default_per_page = 25 + # config.max_per_page = nil + # config.window = 4 + # config.outer_window = 3 + # config.left = 0 + # config.right = 0 + # config.page_method_name = :page + # config.param_name = :page +end From 999b3957633606e5ec09ff168c0daa12f3a2915b Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 30 Jan 2015 17:26:23 +0800 Subject: [PATCH 08/20] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Kaminari=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E6=A0=B7=E5=BC=8F=E6=96=87=E4=BB=B6=EF=BC=8C=20=5Fpag?= =?UTF-8?q?inator.html.erb=20=E8=BF=99=E6=98=AF=E6=80=BB=E7=9A=84=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E6=96=87=E4=BB=B6=EF=BC=8C=E5=8F=AF=E4=BB=A5=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E4=BF=AE=E6=94=B9=E5=AE=83=E6=9D=A5=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E6=95=B4=E4=BD=93=E7=BB=93=E6=9E=84?= =?UTF-8?q?=20=E6=AF=94=E5=A6=82=E6=88=91=E4=B8=8D=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E2=80=9C=E9=A6=96=E9=A1=B5=E2=80=9D=EF=BC=8C=E2=80=9D=E6=9C=AB?= =?UTF-8?q?=E9=A1=B5=E2=80=9C=E8=BF=99=E4=B8=A4=E4=B8=AA=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=EF=BC=8C=E9=82=A3=E4=B9=88=E6=88=91=E5=B0=B1=E5=9C=A8=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E6=96=87=E4=BB=B6=E9=87=8C=E9=9D=A2=E5=B0=86=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E4=BB=A3=E7=A0=81=E5=88=A0=E9=99=A4=20=5Fpag?= =?UTF-8?q?e.html.erb=20=E5=AF=B9=E5=BA=94=E9=A1=B5=E7=A0=81=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=20=5Ffirst=5Fpage.html.erb=20/=20=5Flast=5Fpage.html.?= =?UTF-8?q?erb=20=E5=AF=B9=E5=BA=94=E2=80=9C=E9=A6=96=E9=A1=B5=E2=80=9D?= =?UTF-8?q?=E5=92=8C=E2=80=9C=E6=9C=AB=E9=A1=B5=E2=80=9D=E7=9A=84=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=20=5Fprev=5Fpage.html.erb=20/=20=5Fnext=5Fpage.html.e?= =?UTF-8?q?rb=20=E5=AF=B9=E5=BA=94=E2=80=9C=E4=B8=8A=E4=B8=80=E9=A1=B5?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E4=B8=8B=E4=B8=80=E9=A1=B5=E2=80=9D?= =?UTF-8?q?=E7=9A=84=E9=93=BE=E6=8E=A5=20=5Fgap.html.erb=20=E7=A9=BA?= =?UTF-8?q?=E9=9A=99=E7=9A=84=E6=98=BE=E7=A4=BA=EF=BC=8C=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=98=AF=E4=B8=AD=E9=97=B4=E7=9A=84=E7=9C=81=E7=95=A5=E5=8F=B7?= =?UTF-8?q?(...)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/kaminari/_first_page.html.erb | 11 +++++++++++ app/views/kaminari/_gap.html.erb | 8 ++++++++ app/views/kaminari/_last_page.html.erb | 11 +++++++++++ app/views/kaminari/_next_page.html.erb | 11 +++++++++++ app/views/kaminari/_page.html.erb | 13 +++++++++++++ app/views/kaminari/_paginator.html.erb | 23 +++++++++++++++++++++++ app/views/kaminari/_prev_page.html.erb | 11 +++++++++++ 7 files changed, 88 insertions(+) create mode 100644 app/views/kaminari/_first_page.html.erb create mode 100644 app/views/kaminari/_gap.html.erb create mode 100644 app/views/kaminari/_last_page.html.erb create mode 100644 app/views/kaminari/_next_page.html.erb create mode 100644 app/views/kaminari/_page.html.erb create mode 100644 app/views/kaminari/_paginator.html.erb create mode 100644 app/views/kaminari/_prev_page.html.erb diff --git a/app/views/kaminari/_first_page.html.erb b/app/views/kaminari/_first_page.html.erb new file mode 100644 index 000000000..ec2c75026 --- /dev/null +++ b/app/views/kaminari/_first_page.html.erb @@ -0,0 +1,11 @@ +<%# Link to the "First" page + - available local variables + url: url to the first page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> + + <%= link_to_unless current_page.first?, l('views.pagination.first').html_safe, url, :remote => remote %> + diff --git a/app/views/kaminari/_gap.html.erb b/app/views/kaminari/_gap.html.erb new file mode 100644 index 000000000..258fd29b2 --- /dev/null +++ b/app/views/kaminari/_gap.html.erb @@ -0,0 +1,8 @@ +<%# Non-link tag that stands for skipped pages... + - available local variables + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> + diff --git a/app/views/kaminari/_last_page.html.erb b/app/views/kaminari/_last_page.html.erb new file mode 100644 index 000000000..410d05c55 --- /dev/null +++ b/app/views/kaminari/_last_page.html.erb @@ -0,0 +1,11 @@ +<%# Link to the "Last" page + - available local variables + url: url to the last page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> + + <%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, :remote => remote %> + diff --git a/app/views/kaminari/_next_page.html.erb b/app/views/kaminari/_next_page.html.erb new file mode 100644 index 000000000..d119475ff --- /dev/null +++ b/app/views/kaminari/_next_page.html.erb @@ -0,0 +1,11 @@ +<%# Link to the "Next" page + - available local variables + url: url to the next page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> + + <%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, :rel => 'next', :remote => remote %> + diff --git a/app/views/kaminari/_page.html.erb b/app/views/kaminari/_page.html.erb new file mode 100644 index 000000000..91aa63a46 --- /dev/null +++ b/app/views/kaminari/_page.html.erb @@ -0,0 +1,13 @@ +<%# Link showing page number + - available local variables + page: a page object for "this" page + url: url to this page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote + <%= link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} +-%> + + <%= link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %> + diff --git a/app/views/kaminari/_paginator.html.erb b/app/views/kaminari/_paginator.html.erb new file mode 100644 index 000000000..04f03c02c --- /dev/null +++ b/app/views/kaminari/_paginator.html.erb @@ -0,0 +1,23 @@ +<%# The container tag + - available local variables + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote + paginator: the paginator that renders the pagination tags inside +-%> +<%= paginator.render do -%> +

+<% end -%> diff --git a/app/views/kaminari/_prev_page.html.erb b/app/views/kaminari/_prev_page.html.erb new file mode 100644 index 000000000..ff7b1ab79 --- /dev/null +++ b/app/views/kaminari/_prev_page.html.erb @@ -0,0 +1,11 @@ +<%# Link to the "Previous" page + - available local variables + url: url to the previous page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> + + <%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, :rel => 'prev', :remote => remote %> + From be9ff9b4bbe273e72009d480d1b02561b10af081 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 30 Jan 2015 17:58:41 +0800 Subject: [PATCH 09/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=99=A8=E5=90=8D=20=E8=A7=A3=E5=86=B3=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=AD=E4=BC=81=E4=B8=9A=E9=87=8D=E5=90=8D=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/enterprises_controller.rb | 6 ------ app/controllers/originizations_controller.rb | 6 ++++++ app/controllers/welcome_controller.rb | 8 ++++---- ...{enterprises_helper.rb => originizations_helper.rb} | 0 .../{enterprises => originizations}/index.html.erb | 2 +- app/views/welcome/index.html.erb | 10 +++++----- config/routes.rb | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 app/controllers/enterprises_controller.rb create mode 100644 app/controllers/originizations_controller.rb rename app/helpers/{enterprises_helper.rb => originizations_helper.rb} (100%) rename app/views/{enterprises => originizations}/index.html.erb (83%) diff --git a/app/controllers/enterprises_controller.rb b/app/controllers/enterprises_controller.rb deleted file mode 100644 index c15b6dc8f..000000000 --- a/app/controllers/enterprises_controller.rb +++ /dev/null @@ -1,6 +0,0 @@ -class EnterprisesController < ApplicationController - layout 'project_base' - def index - @enterprises = Project.find_by_sql("select enterprise_name from projects") - end -end diff --git a/app/controllers/originizations_controller.rb b/app/controllers/originizations_controller.rb new file mode 100644 index 000000000..033f9d8ec --- /dev/null +++ b/app/controllers/originizations_controller.rb @@ -0,0 +1,6 @@ +class OriginizationsController < ApplicationController + layout 'project_base' + def index + @enterprises = Project.find_by_sql("select distinct(enterprise_name) from projects") + end +end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 6c28ec502..b1138f964 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -25,10 +25,10 @@ class WelcomeController < ApplicationController before_filter :entry_select, :only => [:index] def index - unless params[:enterprise].nil? - @enterprise = params[:enterprise] - @enterprise_projects = Project.find_by_sql(["select * from projects where enterprise_name =? ", @enterprise]) - @e_count = @enterprise_projects.count + unless params[:originization].nil? + @originization = params[:originization] + @originization_projects = Project.find_by_sql(["select * from projects where enterprise_name =? ", @originization]) + @e_count = @originization_projects.count if @e_count < 10 part_count = 10 -@e_count # @part_projects = find_all_hot_project part_count, order diff --git a/app/helpers/enterprises_helper.rb b/app/helpers/originizations_helper.rb similarity index 100% rename from app/helpers/enterprises_helper.rb rename to app/helpers/originizations_helper.rb diff --git a/app/views/enterprises/index.html.erb b/app/views/originizations/index.html.erb similarity index 83% rename from app/views/enterprises/index.html.erb rename to app/views/originizations/index.html.erb index 9db8d99ab..002ea84f8 100644 --- a/app/views/enterprises/index.html.erb +++ b/app/views/originizations/index.html.erb @@ -10,7 +10,7 @@ <% unless enterprise.enterprise_name.blank? %> <% end %> diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index f29f588b0..c53377134 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -77,7 +77,7 @@
    - <% if @enterprise.nil? %> + <% if @originization.nil? %> <% @projects.map do |project| %> <%= render :partial => 'hot_projects_list', :locals => {:project => project} %> <% end; reset_cycle %> @@ -87,9 +87,9 @@

    <%= l(:label_enterprise_tips) %>

    <% @projects.map do |project| %> <%= render :partial => 'hot_projects_list', :locals => {:project => project} %> - <% end; reset_cycle %> + <% end %> <% elsif @e_count < 10 %> - <% @enterprise_projects.map do |project| %> + <% @originization_projects.map do |project| %> <%= render :partial => 'hot_projects_list', :locals => {:project => project} %> <% end %>

    <%= l(:label_part_enterprise_tips) %>

    @@ -100,8 +100,8 @@ <% @part_projects.map do |project| %> <%= render :partial => 'hot_projects_list', :locals => {:project => project} %> <% end %> - <% end; reset_cycle %> - <% end; reset_cycle %> + <% end %> + <% end %>
diff --git a/config/routes.rb b/config/routes.rb index aad7adcb3..1b79a737d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -26,7 +26,7 @@ # Example: :via => :get ====> :via => :get RedmineApp::Application.routes.draw do - get "enterprises/index" + get "originizations/index" #match '/contests/:id/contestnotifications', :controller => 'contestnotifications', :action => 'index' @@ -390,7 +390,7 @@ RedmineApp::Application.routes.draw do match '/statistics', :to => 'projects#statistics', :as => 'statistics', :via => :get # match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get match '/homework', :to => 'projects#homework', :as => 'homework', :via => :get - match 'enterprise', :to => 'enterprises#index', :as => 'index', :via => :get + match 'originizations', :to => 'originizations#index', :as => 'index', :via => :get # match '/activity', :controller => 'activities', :action => 'index', :as => 'activity', :via => :get # match '/repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository', :via => :get From 3484fd34bb9489a8e4705cc0c51bc14df3ff2566 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Sat, 31 Jan 2015 10:47:09 +0800 Subject: [PATCH 10/20] merge dev_zanle branch Signed-off-by: alan <547533434@qq.com> --- app/views/kaminari/_first_page.html.erb | 22 +- app/views/kaminari/_gap.html.erb | 16 +- app/views/kaminari/_last_page.html.erb | 22 +- app/views/kaminari/_next_page.html.erb | 22 +- app/views/kaminari/_page.html.erb | 26 +-- app/views/kaminari/_paginator.html.erb | 46 ++-- app/views/kaminari/_prev_page.html.erb | 22 +- app/views/projects/search.html.erb | 266 ++++++++++++------------ config/initializers/kaminari_config.rb | 64 +++--- config/initializers/url_helper.rb | 42 ++-- 10 files changed, 274 insertions(+), 274 deletions(-) diff --git a/app/views/kaminari/_first_page.html.erb b/app/views/kaminari/_first_page.html.erb index ec2c75026..a732013b7 100644 --- a/app/views/kaminari/_first_page.html.erb +++ b/app/views/kaminari/_first_page.html.erb @@ -1,11 +1,11 @@ -<%# Link to the "First" page - - available local variables - url: url to the first page - current_page: a page object for the currently displayed page - total_pages: total number of pages - per_page: number of items to fetch per page - remote: data-remote --%> - - <%= link_to_unless current_page.first?, l('views.pagination.first').html_safe, url, :remote => remote %> - +<%# Link to the "First" page + - available local variables + url: url to the first page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> + + <%= link_to_unless current_page.first?, l('views.pagination.first').html_safe, url, :remote => remote %> + diff --git a/app/views/kaminari/_gap.html.erb b/app/views/kaminari/_gap.html.erb index 258fd29b2..a45dfdaa0 100644 --- a/app/views/kaminari/_gap.html.erb +++ b/app/views/kaminari/_gap.html.erb @@ -1,8 +1,8 @@ -<%# Non-link tag that stands for skipped pages... - - available local variables - current_page: a page object for the currently displayed page - total_pages: total number of pages - per_page: number of items to fetch per page - remote: data-remote --%> - +<%# Non-link tag that stands for skipped pages... + - available local variables + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> + diff --git a/app/views/kaminari/_last_page.html.erb b/app/views/kaminari/_last_page.html.erb index 410d05c55..d1a9089d1 100644 --- a/app/views/kaminari/_last_page.html.erb +++ b/app/views/kaminari/_last_page.html.erb @@ -1,11 +1,11 @@ -<%# Link to the "Last" page - - available local variables - url: url to the last page - current_page: a page object for the currently displayed page - total_pages: total number of pages - per_page: number of items to fetch per page - remote: data-remote --%> - - <%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, :remote => remote %> - +<%# Link to the "Last" page + - available local variables + url: url to the last page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> + + <%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, :remote => remote %> + diff --git a/app/views/kaminari/_next_page.html.erb b/app/views/kaminari/_next_page.html.erb index d119475ff..59c3d0a21 100644 --- a/app/views/kaminari/_next_page.html.erb +++ b/app/views/kaminari/_next_page.html.erb @@ -1,11 +1,11 @@ -<%# Link to the "Next" page - - available local variables - url: url to the next page - current_page: a page object for the currently displayed page - total_pages: total number of pages - per_page: number of items to fetch per page - remote: data-remote --%> - - <%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, :rel => 'next', :remote => remote %> - +<%# Link to the "Next" page + - available local variables + url: url to the next page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> + + <%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, :rel => 'next', :remote => remote %> + diff --git a/app/views/kaminari/_page.html.erb b/app/views/kaminari/_page.html.erb index 91aa63a46..0b5e68075 100644 --- a/app/views/kaminari/_page.html.erb +++ b/app/views/kaminari/_page.html.erb @@ -1,13 +1,13 @@ -<%# Link showing page number - - available local variables - page: a page object for "this" page - url: url to this page - current_page: a page object for the currently displayed page - total_pages: total number of pages - per_page: number of items to fetch per page - remote: data-remote - <%= link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} --%> - - <%= link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %> - +<%# Link showing page number + - available local variables + page: a page object for "this" page + url: url to this page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote + <%= link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} +-%> + + <%= link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %> + diff --git a/app/views/kaminari/_paginator.html.erb b/app/views/kaminari/_paginator.html.erb index 04f03c02c..5250cd1a0 100644 --- a/app/views/kaminari/_paginator.html.erb +++ b/app/views/kaminari/_paginator.html.erb @@ -1,23 +1,23 @@ -<%# The container tag - - available local variables - current_page: a page object for the currently displayed page - total_pages: total number of pages - per_page: number of items to fetch per page - remote: data-remote - paginator: the paginator that renders the pagination tags inside --%> -<%= paginator.render do -%> - -<% end -%> +<%# The container tag + - available local variables + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote + paginator: the paginator that renders the pagination tags inside +-%> +<%= paginator.render do -%> + +<% end -%> diff --git a/app/views/kaminari/_prev_page.html.erb b/app/views/kaminari/_prev_page.html.erb index ff7b1ab79..c44edd07a 100644 --- a/app/views/kaminari/_prev_page.html.erb +++ b/app/views/kaminari/_prev_page.html.erb @@ -1,11 +1,11 @@ -<%# Link to the "Previous" page - - available local variables - url: url to the previous page - current_page: a page object for the currently displayed page - total_pages: total number of pages - per_page: number of items to fetch per page - remote: data-remote --%> - - <%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, :rel => 'prev', :remote => remote %> - +<%# Link to the "Previous" page + - available local variables + url: url to the previous page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> + + <%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, :rel => 'prev', :remote => remote %> + diff --git a/app/views/projects/search.html.erb b/app/views/projects/search.html.erb index 19dddb61f..ccffce775 100644 --- a/app/views/projects/search.html.erb +++ b/app/views/projects/search.html.erb @@ -1,133 +1,133 @@ -<% @nav_dispaly_project_label = 1 - @nav_dispaly_forum_label = 1 %> -<% content_for :header_tags do %> -<%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %> -<% end %> -
- <%= form_tag(projects_search_path, :method => :get, :id => "project_search_form") do %> - <% if params[:project_type] == "1" %> - - - - - - <% end %> - <% end %> - - - - - - - -
<%= l(:label_course_practice) %><%= l(:label_user_location) %> : - <% if User.current.logged?%> - <% if User.current.user_extensions.identity == 0 %> - <%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> - -
<%= link_to request.host() + "/projects", :controller => 'projects', :action => 'course', :project_type => 1 %> <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course', :project_type => 1 %>
- <% else %> - - - - - - - - - - - -
- <%= l(:label_project_deposit) %> - - <%= l(:label_user_location) %> : - - <% if User.current.logged? %> - <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> - <% end %> - - - -
- - <%= link_to request.host()+"/projects", :controller => 'projects', :action => 'index', :project_type => 0 %> - - - <%=link_to l(:field_homepage), home_path %> > - <%=link_to l(:label_project_deposit), :controller => 'projects', :action => 'index', :project_type => 0 %> -
- <% end %> - <% end %> -
- -<% if @projects.size == 0 %> -<%= render :partial => 'layouts/no_content'%> -<% else %> -
- <%= render_project_hierarchy(@projects)%> -
-<% end %> - - - -<%= paginate @project_pages %> - - - -<% if User.current.logged? %> -

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

-<% end %> - -<% other_formats_links do |f| %> -<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> -<% end %> - -<% content_for :sidebar do %> -<%= form_tag({}, :method => :get) do %> -

<%= l(:label_project_plural) %>

- -

- <%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %> -

-<% end %> -<% end %> - -<% html_title(l(:label_project_plural)) -%> +<% @nav_dispaly_project_label = 1 + @nav_dispaly_forum_label = 1 %> +<% content_for :header_tags do %> +<%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %> +<% end %> +
+ <%= form_tag(projects_search_path, :method => :get, :id => "project_search_form") do %> + <% if params[:project_type] == "1" %> + + + + + + <% end %> + <% end %> + + + + + + + +
<%= l(:label_course_practice) %><%= l(:label_user_location) %> : + <% if User.current.logged?%> + <% if User.current.user_extensions.identity == 0 %> + <%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> + +
<%= link_to request.host() + "/projects", :controller => 'projects', :action => 'course', :project_type => 1 %> <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course', :project_type => 1 %>
+ <% else %> + + + + + + + + + + + +
+ <%= l(:label_project_deposit) %> + + <%= l(:label_user_location) %> : + + <% if User.current.logged? %> + <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> + <% end %> + + + +
+ + <%= link_to request.host()+"/projects", :controller => 'projects', :action => 'index', :project_type => 0 %> + + + <%=link_to l(:field_homepage), home_path %> > + <%=link_to l(:label_project_deposit), :controller => 'projects', :action => 'index', :project_type => 0 %> +
+ <% end %> + <% end %> +
+ +<% if @projects.size == 0 %> +<%= render :partial => 'layouts/no_content'%> +<% else %> +
+ <%= render_project_hierarchy(@projects)%> +
+<% end %> + + + +<%= paginate @project_pages %> + + + +<% if User.current.logged? %> +

+ <%= l(:label_my_projects) %> +

+<% end %> + +<% other_formats_links do |f| %> +<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> +<% end %> + +<% content_for :sidebar do %> +<%= form_tag({}, :method => :get) do %> +

<%= l(:label_project_plural) %>

+ +

+ <%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %> +

+<% end %> +<% end %> + +<% html_title(l(:label_project_plural)) -%> diff --git a/config/initializers/kaminari_config.rb b/config/initializers/kaminari_config.rb index 63e6b7f9b..2ae42e414 100644 --- a/config/initializers/kaminari_config.rb +++ b/config/initializers/kaminari_config.rb @@ -1,32 +1,32 @@ -# Time 2015-01-30 17:04:12 -# Author lizanle -# Description kaminari配置文件 -# <%= paginate @users, :window => 2 %> -# 则展示页会像 5 6 7 8 9 ,当7是当前页的时候 - -# <%= paginate @users, :outer_window => 3 %> -# 分页展示会像 1 2 3 4 ...(snip)... 17 18 19 20 当总共有20个页面的时候 - -# <%= paginate @users, :left => 1, :right => 3 %> -# 分页展示会像 1 ...(snip)... 18 19 20 当总共有20个页面的时候 - -# <%= paginate @users, :param_name => :pagina %> -# 这样子会将每个链接传进去一个参数 :pagina - -# <%= paginate @users, :params => {:controller => 'foo', :action => 'bar'} %> -# 这样子将会修改每个链接的控制器和动作. :controller and :action - -# <%= paginate @users, :remote => true %> -# 这将会使每个链接使用ajax方式,极其简单,非常完美的工作。data-remote="true" - -#更多知识详见 https://github.com/honwlee/kaminari -Kaminari.configure do |config| - # config.default_per_page = 25 - # config.max_per_page = nil - # config.window = 4 - # config.outer_window = 3 - # config.left = 0 - # config.right = 0 - # config.page_method_name = :page - # config.param_name = :page -end +# Time 2015-01-30 17:04:12 +# Author lizanle +# Description kaminari配置文件 +# <%= paginate @users, :window => 2 %> +# 则展示页会像 5 6 7 8 9 ,当7是当前页的时候 + +# <%= paginate @users, :outer_window => 3 %> +# 分页展示会像 1 2 3 4 ...(snip)... 17 18 19 20 当总共有20个页面的时候 + +# <%= paginate @users, :left => 1, :right => 3 %> +# 分页展示会像 1 ...(snip)... 18 19 20 当总共有20个页面的时候 + +# <%= paginate @users, :param_name => :pagina %> +# 这样子会将每个链接传进去一个参数 :pagina + +# <%= paginate @users, :params => {:controller => 'foo', :action => 'bar'} %> +# 这样子将会修改每个链接的控制器和动作. :controller and :action + +# <%= paginate @users, :remote => true %> +# 这将会使每个链接使用ajax方式,极其简单,非常完美的工作。data-remote="true" + +#更多知识详见 https://github.com/honwlee/kaminari +Kaminari.configure do |config| + # config.default_per_page = 25 + # config.max_per_page = nil + # config.window = 4 + # config.outer_window = 3 + # config.left = 0 + # config.right = 0 + # config.page_method_name = :page + # config.param_name = :page +end diff --git a/config/initializers/url_helper.rb b/config/initializers/url_helper.rb index 7c4b68be9..7f54df604 100644 --- a/config/initializers/url_helper.rb +++ b/config/initializers/url_helper.rb @@ -1,22 +1,22 @@ -# Time 2015-01-30 17:02:41 -# Author lizanle -# Description 打开redmine\ruby\lib\ruby\gems\1.9.1\gems\actionpack-3.2.13\lib\action_view\helpers\UrlHelper,重写link_to_unless方法 -# 如果是当前页,则给当前页添加样式:class=>'current-page' -module ActionView - # = Action View URL Helpers - module Helpers #:nodoc: - # Provides a set of methods for making links and getting URLs that - # depend on the routing subsystem (see ActionDispatch::Routing). - # This allows you to use the same format for links in views - # and controllers. - module UrlHelper - def link_to_unless(condition, name, options = {}, html_options = {}, &block) - if condition - link_to(name, options, html_options.merge(:class => 'current-page')) - else - link_to(name, options, html_options) - end - end - end - end +# Time 2015-01-30 17:02:41 +# Author lizanle +# Description 打开redmine\ruby\lib\ruby\gems\1.9.1\gems\actionpack-3.2.13\lib\action_view\helpers\UrlHelper,重写link_to_unless方法 +# 如果是当前页,则给当前页添加样式:class=>'current-page' +module ActionView + # = Action View URL Helpers + module Helpers #:nodoc: + # Provides a set of methods for making links and getting URLs that + # depend on the routing subsystem (see ActionDispatch::Routing). + # This allows you to use the same format for links in views + # and controllers. + module UrlHelper + def link_to_unless(condition, name, options = {}, html_options = {}, &block) + if condition + link_to(name, options, html_options.merge(:class => 'current-page')) + else + link_to(name, options, html_options) + end + end + end + end end \ No newline at end of file From 3e1d90630e50fd777e26922b0f212531c4917da1 Mon Sep 17 00:00:00 2001 From: whimlex Date: Sat, 31 Jan 2015 10:48:09 +0800 Subject: [PATCH 11/20] =?UTF-8?q?=E6=89=BE=E5=9B=9E=E5=AF=86=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E9=82=AE=E4=BB=B6=E6=BF=80=E6=B4=BB=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/account/email_valid.html.erb | 10 +- app/views/account/lost_password.html.erb | 2 +- app/views/welcome/index.html.erb | 4 +- config/locales/en.yml | 117 +++++++----- config/locales/zh.yml | 219 +++++++++++++++-------- 5 files changed, 216 insertions(+), 136 deletions(-) diff --git a/app/views/account/email_valid.html.erb b/app/views/account/email_valid.html.erb index e6bc2a2db..1aecc6904 100644 --- a/app/views/account/email_valid.html.erb +++ b/app/views/account/email_valid.html.erb @@ -1,7 +1,7 @@ - 注册帐号 + <%= l(:label_regiter_account)%>