From 1a1e08f2cd3a9e6a9417360f8f2ee1353cbb6a0a Mon Sep 17 00:00:00 2001 From: yanzeng li Date: Sun, 11 Sep 2016 18:18:07 +0800 Subject: [PATCH 01/14] liyanzeng-modify-registration-email-invalid-message --- config/locales/devise.zh-CN.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/locales/devise.zh-CN.yml b/config/locales/devise.zh-CN.yml index 7e7aa4d..eb0b938 100644 --- a/config/locales/devise.zh-CN.yml +++ b/config/locales/devise.zh-CN.yml @@ -13,6 +13,7 @@ zh-CN: email: blank: "邮箱不能为空" taken: "该邮箱已注册过" + invalid: "请输入有效的电子邮件地址" current_password: invalid: "原始密码错误" blank: "请输入原始密码" From cd87f90378c24a06d06ae943c06af4f93d2458a5 Mon Sep 17 00:00:00 2001 From: nfreeness Date: Mon, 12 Sep 2016 08:50:45 +0800 Subject: [PATCH 02/14] fix landingpage img RoutingError & change devise error msg color --- app/assets/stylesheets/devise.scss.erb | 12 ++++++++++++ app/assets/stylesheets/newwelcome.scss.erb | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/devise.scss.erb b/app/assets/stylesheets/devise.scss.erb index 0f1dfe0..bbd1f2e 100644 --- a/app/assets/stylesheets/devise.scss.erb +++ b/app/assets/stylesheets/devise.scss.erb @@ -20,6 +20,18 @@ a:visited {color: #fff} ; a:hover {text-decoration:underline; color: #fff} ; a:active {text-decoration:underline; color: #fff} ; + .has-error .help-block, + .has-error .control-label, + .has-error .radio, + .has-error .checkbox, + .has-error .radio-inline, + .has-error .checkbox-inline, + .has-error.radio label, + .has-error.checkbox label, + .has-error.radio-inline label, + .has-error.checkbox-inline label{ + color: #fff; + } .btn-devise, .btn-devise:focus, .btn-devise.focus , diff --git a/app/assets/stylesheets/newwelcome.scss.erb b/app/assets/stylesheets/newwelcome.scss.erb index 78bc660..6e0c3a4 100644 --- a/app/assets/stylesheets/newwelcome.scss.erb +++ b/app/assets/stylesheets/newwelcome.scss.erb @@ -204,7 +204,7 @@ top: 41px; z-index: 49; position: absolute; - background-image: url('<%= asset_path("quotes2.jpg") %>'); + // background-image: url('<%= asset_path("quotes2.jpg") %>'); } .lp-pom-box-77 { display: block; From 5376cf50015ce80762fe46aa654edef89fa0d03f Mon Sep 17 00:00:00 2001 From: nfreeness Date: Mon, 12 Sep 2016 09:04:04 +0800 Subject: [PATCH 03/14] modified project index min width --- app/assets/stylesheets/projects.scss.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/projects.scss.erb b/app/assets/stylesheets/projects.scss.erb index bceb511..40f81c0 100644 --- a/app/assets/stylesheets/projects.scss.erb +++ b/app/assets/stylesheets/projects.scss.erb @@ -244,7 +244,7 @@ // config project index .index-out{ - min-width:900px; + min-width: 1200px; margin: auto; text-align:center; } From 8738f04094fc456580636486d4d8d2c2ad82421d Mon Sep 17 00:00:00 2001 From: nfreeness Date: Mon, 12 Sep 2016 14:42:07 +0800 Subject: [PATCH 04/14] custom http error pages --- app/assets/javascripts/errors.coffee | 3 + app/assets/stylesheets/errors.scss | 25 +++++++ app/controllers/errors_controller.rb | 9 +++ app/helpers/errors_helper.rb | 2 + .../errors/internal_server_error.html.erb | 12 ++++ app/views/errors/not_found.html.erb | 11 +++ config/application.rb | 1 + config/routes.rb | 5 ++ public/404.html | 67 ------------------- public/500.html | 66 ------------------ 10 files changed, 68 insertions(+), 133 deletions(-) create mode 100644 app/assets/javascripts/errors.coffee create mode 100644 app/assets/stylesheets/errors.scss create mode 100644 app/controllers/errors_controller.rb create mode 100644 app/helpers/errors_helper.rb create mode 100644 app/views/errors/internal_server_error.html.erb create mode 100644 app/views/errors/not_found.html.erb delete mode 100644 public/404.html delete mode 100644 public/500.html diff --git a/app/assets/javascripts/errors.coffee b/app/assets/javascripts/errors.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/errors.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/errors.scss b/app/assets/stylesheets/errors.scss new file mode 100644 index 0000000..4d61ffa --- /dev/null +++ b/app/assets/stylesheets/errors.scss @@ -0,0 +1,25 @@ +// Place all the styles related to the errors controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ + +.error-block{ + background-color: #fff; + margin: 20px; + padding-top: 100px; + width: 500px; + height: 300px; + i{ + font-size:1.2em; + padding-right: 5px; + color: #3499E0; + } + h1{ + font-size: 1.5em; + } + h2{ + font-size: 1.2em; + } + p{ + margin-top: 20px; + } +} diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb new file mode 100644 index 0000000..2e647bb --- /dev/null +++ b/app/controllers/errors_controller.rb @@ -0,0 +1,9 @@ +class ErrorsController < ApplicationController + def not_found + render(:status => 404) + end + + def internal_server_error + render(:status => 500) + end +end diff --git a/app/helpers/errors_helper.rb b/app/helpers/errors_helper.rb new file mode 100644 index 0000000..8e3b415 --- /dev/null +++ b/app/helpers/errors_helper.rb @@ -0,0 +1,2 @@ +module ErrorsHelper +end diff --git a/app/views/errors/internal_server_error.html.erb b/app/views/errors/internal_server_error.html.erb new file mode 100644 index 0000000..b9310f3 --- /dev/null +++ b/app/views/errors/internal_server_error.html.erb @@ -0,0 +1,12 @@ +
+
+ +

呀,被你发现了~

+
+

错误500: 服务器内部错误

+

+ 反馈问题| + <%= link_to '返回上页', :back %> +

+
+
diff --git a/app/views/errors/not_found.html.erb b/app/views/errors/not_found.html.erb new file mode 100644 index 0000000..c74ebdb --- /dev/null +++ b/app/views/errors/not_found.html.erb @@ -0,0 +1,11 @@ +
+
+

呀,被你发现了~

+
+

错误404: 页面不存在

+

+ 反馈问题| + <%= link_to '返回上页', :back %> +

+
+
diff --git a/config/application.rb b/config/application.rb index 1bc7a32..a5149f9 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,6 +17,7 @@ class Application < Rails::Application config.active_record.default_timezone = :local config.generators.test_framework = nil config.i18n.default_locale = :"zh-CN" + config.exceptions_app = self.routes # config.serve_static_assets = true diff --git a/config/routes.rb b/config/routes.rb index 63a775f..ac5fae4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,9 @@ Rails.application.routes.draw do + get 'errors/not_found' + + get 'errors/internal_server_error' + match "/404", :to => "errors#not_found", :via => :all + match "/500", :to => "errors#internal_server_error", :via => :all devise_for :users, controllers: { registrations: "devise/users/registrations"} # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html diff --git a/public/404.html b/public/404.html deleted file mode 100644 index b612547..0000000 --- a/public/404.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The page you were looking for doesn't exist (404) - - - - - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/public/500.html b/public/500.html deleted file mode 100644 index 061abc5..0000000 --- a/public/500.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - We're sorry, but something went wrong (500) - - - - - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

-
- - From 3e583a15cafc2ff6e067ffa3e9a4720c0b6c9b13 Mon Sep 17 00:00:00 2001 From: nfreeness Date: Mon, 12 Sep 2016 15:13:53 +0800 Subject: [PATCH 05/14] fix search bar style --- app/assets/stylesheets/projects.scss.erb | 247 +++++++++++++++++++++++ app/views/projects/_search_bar.html.erb | 17 +- 2 files changed, 257 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/projects.scss.erb b/app/assets/stylesheets/projects.scss.erb index 40f81c0..2983140 100644 --- a/app/assets/stylesheets/projects.scss.erb +++ b/app/assets/stylesheets/projects.scss.erb @@ -495,3 +495,250 @@ width:400px; min-height: 630px; } + +// config new search bar +.header-categories__search { + float: right; + padding-top: 7px; + width: 170px +} + + +.search-field { + display: -webkit-flex; + display: -ms-flexbox; + display: flex +} + +.search-field.-size-xl { + font-size: 16px; + height: 60px +} + +.search-field.-size-l { + font-size: 16px; + height: 50px +} + +.search-field.-size-m { + font-size: 14px; + height: 40px +} + +.search-field,.search-field.-size-s { + font-size: 16px; + height: 30px +} + +@media (min-width: 1025px) { + .search-field,.search-field.-size-s { + font-size: 13px + } +} + +.search-field__input { + -webkit-flex: 1 auto; + -ms-flex: 1 auto; + flex: 1 auto; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + min-width: 0 +} + +input.search-field__input-field { + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + box-sizing: border-box; + padding: 5px 8px 6px; + border: 1px solid #bababa; + border-radius: 7px 0 0 7px; + border-right: 0; + color: gray; + -webkit-appearance: none; + outline: none; + min-width: 0 +} + +@media (min-width: 1025px) { + .-size-xl input.search-field__input-field { + padding: 5px 20px + } +} + +@media (min-width: 1025px) { + .-size-l input.search-field__input-field { + padding: 5px 15px + } +} + +.-border-none input.search-field__input-field { + border: none +} + +.-border-light input.search-field__input-field { + border-color: #dedede +} + +@media (min-width: 1025px) { + input.search-field__input-field.is-autosuggest-visible { + border-bottom-left-radius: 0 + } +} + +button.search-field__button { + -webkit-flex: 0 0 30px; + -ms-flex: 0 0 30px; + flex: 0 0 30px; + padding: 3px 0 2px; + background-color: #fff; + color: #999; + border-radius: 0 7px 7px 0; + border: 1px solid #bababa; + border-left: none; + font-size: 14px; + -webkit-transition: background-color 0.2s; + transition: background-color 0.2s +} + +button.search-field__button:hover { + background-color: #f5f5f5 +} + +button.search-field__button:hover:before { + color: #333 +} + +button.search-field__button:focus { + background-color: #fff +} + +button.search-field__button:active { + background-color: #ededed +} + +.-theme-3docean button.search-field__button:hover { + color: #ab0f34 +} + +.-theme-audiojungle button.search-field__button:hover { + color: #9ac130 +} + +.-theme-codecanyon button.search-field__button:hover { + color: #e78733 +} + +.-theme-graphicriver button.search-field__button:hover { + color: #308eb1 +} + +.-theme-photodune button.search-field__button:hover { + color: #0f8c98 +} + +.-theme-themeforest button.search-field__button:hover { + color: #1abc9c +} + +.-theme-videohive button.search-field__button:hover { + color: #e7a802 +} + +.-size-l button.search-field__button { + -webkit-flex-basis: 45px; + -ms-flex-preferred-size: 45px; + flex-basis: 45px; + font-size: 20px +} + +@media (min-width: 569px) { + .-size-l button.search-field__button { + -webkit-flex-basis: 70px; + -ms-flex-preferred-size: 70px; + flex-basis: 70px; + font-size: 24px + } +} + +.-size-xl button.search-field__button { + -webkit-flex-basis: 45px; + -ms-flex-preferred-size: 45px; + flex-basis: 45px; + font-size: 20px +} + +@media (min-width: 569px) { + .-size-xl button.search-field__button { + -webkit-flex-basis: 80px; + -ms-flex-preferred-size: 80px; + flex-basis: 80px; + font-size: 26px + } +} + +.-border-none button.search-field__button { + border: none +} + +.-border-light button.search-field__button { + border-color: #dedede +} + +.no-flexbox .search-field { + display: block; + width: 100% +} + +.no-flexbox .search-field:after { + content: ""; + display: table; + clear: both +} + +.no-flexbox .search-field.-size-l .search-field__button { + width: 18%; + max-width: 70px; + font-size: 24px +} + +.no-flexbox .search-field.-size-xl .search-field__button { + width: 18%; + max-width: 80px; + font-size: 26px +} + +.no-flexbox .search-field__input { + display: block; + float: left; + width: 85%; + height: 100% +} + +@media (max-width: 568px) { + .no-flexbox .search-field__input { + width: 82% + } +} + +.no-flexbox input[type='search']::-ms-clear { + height: 0; + width: 0 +} + +.no-flexbox .search-field__input-field { + width: 100%; + height: 100% +} + +.no-flexbox .search-field__button { + display: block; + float: left; + height: 100%; + width: 15% +} + +// new searchbar end diff --git a/app/views/projects/_search_bar.html.erb b/app/views/projects/_search_bar.html.erb index 114ce68..5426438 100644 --- a/app/views/projects/_search_bar.html.erb +++ b/app/views/projects/_search_bar.html.erb @@ -1,10 +1,13 @@ - From 0773d4bc8f45d8a97a428dafe916d0cf4aff67d5 Mon Sep 17 00:00:00 2001 From: nfreeness Date: Mon, 12 Sep 2016 15:33:10 +0800 Subject: [PATCH 06/14] fix navbar link style --- app/assets/stylesheets/main.scss | 19 +++++++++++++++++++ app/views/common/_navbar.html.erb | 12 ++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss index 1117586..3f657a1 100644 --- a/app/assets/stylesheets/main.scss +++ b/app/assets/stylesheets/main.scss @@ -91,6 +91,25 @@ hr{ border-bottom: 1px solid #CCCCCC; } +.navbar-link{ + font-size: 1em; + font-weight: bold; + margin-top: 20px; + margin-left: 30px; + a:link {color: #666}; + a:visited {color: #666} ; + a:hover {color: #43cb83} ; + a:active {color: #43cb83}; + a{ + margin-left: 12px; + } +} + +.logo span{ + font-size: 22px; + font-weight: bold; + // color: #43cb83 +} // config navbar end diff --git a/app/views/common/_navbar.html.erb b/app/views/common/_navbar.html.erb index 936966c..34890d0 100644 --- a/app/views/common/_navbar.html.erb +++ b/app/views/common/_navbar.html.erb @@ -2,18 +2,18 @@