diff --git a/app/assets/images/users/user-256.jpg b/app/assets/images/users/user-256.jpg new file mode 100644 index 0000000..66137fd Binary files /dev/null and b/app/assets/images/users/user-256.jpg differ diff --git a/app/assets/images/users/userbg.jpg b/app/assets/images/users/userbg.jpg new file mode 100644 index 0000000..6158aef Binary files /dev/null and b/app/assets/images/users/userbg.jpg differ diff --git a/app/assets/javascripts/editormd.js b/app/assets/javascripts/editormd.js index 7589ced..651e07a 100644 --- a/app/assets/javascripts/editormd.js +++ b/app/assets/javascripts/editormd.js @@ -4370,11 +4370,11 @@ }); var userCanSelect = function (obj) { - obj.removeClass(classPrefix + "user-unselect").off("selectstart"); + obj.removeClass(classPrefix + "users-unselect").off("selectstart"); }; var userUnselect = function (obj) { - obj.addClass(classPrefix + "user-unselect").on("selectstart", function(event) { // selectstart for IE + obj.addClass(classPrefix + "users-unselect").on("selectstart", function(event) { // selectstart for IE return false; }); }; diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 3134afa..eb832cb 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -21,6 +21,7 @@ // "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables" @import "public"; +@import "common"; @import "bootstrap.min"; @import "font-awesome"; diff --git a/app/assets/stylesheets/common.css b/app/assets/stylesheets/common.css new file mode 100644 index 0000000..372c6e3 --- /dev/null +++ b/app/assets/stylesheets/common.css @@ -0,0 +1,53 @@ +@charset "utf-8"; + +/*用户首页*/ +.content-page { + margin-left: 240px; + overflow: hidden; + position: relative; +} +.content-page > .content { + margin-top: 50px; + padding: 20px; + position: relative; +} + +.profile-banner { + width: 100%; + height: 300px; + background-position: center center; + background-size: cover; + position: relative; + background-color: #252932; + border-bottom: 4px solid #fff; + box-shadow: 2px 0px 4px rgba(0,0,0,0.1); +} + +.avatar-container { + height: 300px; + text-align: center; +} +.profile-avatar { + width: 200px; + position: relative; + margin: 0px auto; + margin-top: 196px; + border: 4px solid #f3f3f3; +} + +.profile-actions { + position: absolute; + bottom: 20px; +} +.user-profile-2 { + margin-top: 50px; +} +.user-profile-sidebar { + margin: 0 0 20px 0; +} +.user-profile-sidebar .user-identity { + margin: 20px 0 0 0; +} +.user-profile-sidebar img { + width: 90px; +} diff --git a/app/assets/stylesheets/main.css b/app/assets/stylesheets/main.css index d7bf56e..2b199b3 100644 --- a/app/assets/stylesheets/main.css +++ b/app/assets/stylesheets/main.css @@ -2019,14 +2019,7 @@ textarea#message{ } .badge { - background-color: #c52d2f; - border-radius: 5px; - color: #fff; - padding: 8px; - position: relative; - left: 60px; - top: -18px; - font-weight: normal; + vertical-align: bottom; } .blog_archieve { diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 6be8963..e717a7b 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,4 +1,5 @@ class SessionsController < ApplicationController + def new end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a864121..c43b115 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -51,7 +51,7 @@ class UsersController < ApplicationController private def user_params - params.require(:user).permit(:name, :email, :password, + params.require(:users).permit(:name, :email, :password, :password_confirmation) end @@ -64,7 +64,7 @@ class UsersController < ApplicationController end end - # Confirms the correct user. + # Confirms the correct users. def correct_user @user = User.find(params[:id]) redirect_to(root_url) unless current_user?(@user) diff --git a/app/models/job.rb b/app/models/job.rb index 2d43220..7f1d2e3 100644 --- a/app/models/job.rb +++ b/app/models/job.rb @@ -1,3 +1,3 @@ class Job < ActiveRecord::Base - belongs_to :user + belongs_to :users end diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 1aee085..67acc33 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -1,30 +1,4 @@