From 927d6632c1f855d894758711d9b22c94687f48ea Mon Sep 17 00:00:00 2001 From: pixeldesu Date: Wed, 16 Sep 2015 23:59:47 +0200 Subject: [PATCH] make the notification center smaller and shorten content --- .../stylesheets/scss/notifications.scss | 6 +++- app/views/layouts/_notifications.html.haml | 18 ++++++---- .../notifications/_notification.html.haml | 18 ++++++---- app/views/user/theme.css.scss.erb | 4 +++ db/schema.rb | 36 ++++++++++++++++++- 5 files changed, 68 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/scss/notifications.scss b/app/assets/stylesheets/scss/notifications.scss index 530521f0..e46253ef 100644 --- a/app/assets/stylesheets/scss/notifications.scss +++ b/app/assets/stylesheets/scss/notifications.scss @@ -61,7 +61,7 @@ } .notification-center { - min-width: 500px; + min-width: 400px; margin-top: 0px !important; } @@ -74,6 +74,10 @@ .notification--heading { margin-bottom: 4px; + + a { + border-bottom: 1px dotted $link-color; + } } .notification--list-heading { diff --git a/app/views/layouts/_notifications.html.haml b/app/views/layouts/_notifications.html.haml index 2a38c47f..34f27641 100644 --- a/app/views/layouts/_notifications.html.haml +++ b/app/views/layouts/_notifications.html.haml @@ -39,12 +39,14 @@ .media.question-media .media-body %h6.notification--list-heading question - .notification--list-content= markdown notification.target.question.content + .notification--list-content + = markdown notification.target.question.content[0..60] + "#{notification.target.question.content.length > 60 ? '[...]' : ''}" .list-group-item .media.question-media .media-body %h6.notification--list-heading answer - .notification--list-content= markdown notification.target.content + .notification--list-content + = markdown notification.target.content[0..60] + "#{notification.target.content.length > 60 ? '[...]' : ''}" - when "Relationship" .pull-left %img.img-rounded.notification--dropdown-img{src: notification.target.source.profile_picture.url(:small)} @@ -69,7 +71,8 @@ .media.question-media .media-body %h6.notification--list-heading answer - .notification--list-content= markdown notification.target.answer.content + .notification--list-content + = markdown notification.target.answer.content[0..60] + "#{notification.target.answer.content.length > 60 ? '[...]' : ''}" - when "CommentSmile" .pull-left %i.fa.fa-2x.fa-fw.fa-smile-o @@ -86,7 +89,8 @@ .media.question-media .media-body %h6.notification--list-heading comment - .notification--list-content= markdown notification.target.comment.content + .notification--list-content + = markdown notification.target.comment.content[0..60] + "#{notification.target.comment.content.length > 60 ? '[...]' : ''}" - when "Comment" .pull-left %i.fa.fa-2x.fa-fw.fa-comments @@ -108,12 +112,14 @@ .media.question-media .media-body %h6.notification--list-heading answer - .notification--list-content= markdown notification.target.answer.content + .notification--list-content + = markdown notification.target.answer.content[0..60] + "#{notification.target.answer.content.length > 60 ? '[...]' : ''}" .list-group-item .media.question-media .media-body %h6.notification--list-heading comment - .notification--list-content= markdown notification.target.content + .notification--list-content + = markdown notification.target.content[0..60] + "#{notification.target.content.length > 60 ? '[...]' : ''}" %li.text-center %a{href: notifications_path} %i.fa.fa-fw.fa-chevron-right diff --git a/app/views/notifications/_notification.html.haml b/app/views/notifications/_notification.html.haml index 3c04d338..594ec85c 100644 --- a/app/views/notifications/_notification.html.haml +++ b/app/views/notifications/_notification.html.haml @@ -17,12 +17,14 @@ .media.question-media .media-body %h6.notification--list-heading question - .notification--list-content= markdown notification.target.question.content + .notification--list-content + = markdown notification.target.question.content .list-group-item .media.question-media .media-body %h6.notification--list-heading answer - .notification--list-content= markdown notification.target.content + .notification--list-content + = markdown notification.target.content[0..255] + "#{notification.target.content.length > 255 ? '[...]' : ''}" - when "Relationship" .pull-left %img.img-rounded.notification--dropdown-img{src: notification.target.source.profile_picture.url(:small)} @@ -47,7 +49,8 @@ .media.question-media .media-body %h6.notification--list-heading answer - .notification--list-content= markdown notification.target.answer.content + .notification--list-content + = markdown notification.target.answer.content[0..255] + "#{notification.target.answer.content.length > 255 ? '[...]' : ''}" - when "CommentSmile" .pull-left %i.fa.fa-2x.fa-fw.fa-smile-o @@ -64,7 +67,8 @@ .media.question-media .media-body %h6.notification--list-heading comment - .notification--list-content= markdown notification.target.comment.content + .notification--list-content + = markdown notification.target.comment.content - when "Comment" .pull-left %i.fa.fa-2x.fa-fw.fa-comments @@ -86,9 +90,11 @@ .media.question-media .media-body %h6.notification--list-heading answer - .notification--list-content= markdown notification.target.answer.content + .notification--list-content + = markdown notification.target.answer.content[0..255] + "#{notification.target.answer.content.length > 255 ? '[...]' : ''}" .list-group-item .media.question-media .media-body %h6.notification--list-heading comment - .notification--list-content= markdown notification.target.content + .notification--list-content + = markdown notification.target.content diff --git a/app/views/user/theme.css.scss.erb b/app/views/user/theme.css.scss.erb index 70ae6143..b08d8cee 100644 --- a/app/views/user/theme.css.scss.erb +++ b/app/views/user/theme.css.scss.erb @@ -138,6 +138,10 @@ body#version1 { } } + .notification--heading a { + border-color: $primary_text; + } + > li.divider { background-color: $primary_border; } diff --git a/db/schema.rb b/db/schema.rb index 13998567..4ec72116 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150721154255) do +ActiveRecord::Schema.define(version: 20150826224857) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -177,6 +177,39 @@ ActiveRecord::Schema.define(version: 20150721154255) do t.boolean "is_active", default: true end + create_table "themes", force: :cascade do |t| + t.integer "user_id", null: false + t.integer "primary_color", default: 6174129 + t.integer "primary_text", default: 16777215 + t.integer "danger_color", default: 16711737 + t.integer "danger_text", default: 16777215 + t.integer "success_color", default: 4175384 + t.integer "success_text", default: 16777215 + t.integer "warning_color", default: 16741656 + t.integer "warning_text", default: 16777215 + t.integer "info_color", default: 10048699 + t.integer "info_text", default: 16777215 + t.integer "default_color", default: 2236962 + t.integer "default_text", default: 15658734 + t.integer "panel_color", default: 16382457 + t.integer "panel_text", default: 1381653 + t.integer "link_color", default: 6174129 + t.integer "background_color", default: 16777215 + t.integer "background_text", default: 2236962 + t.integer "background_muted", default: 12303291 + t.string "css_file_name" + t.string "css_content_type" + t.integer "css_file_size" + t.datetime "css_updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "input_color", default: 16777215, null: false + t.integer "input_text", default: 0, null: false + t.integer "outline_color", default: 6174129, null: false + end + + add_index "themes", ["user_id", "created_at"], name: "index_themes_on_user_id_and_created_at", using: :btree + create_table "users", force: :cascade do |t| t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false @@ -239,6 +272,7 @@ ActiveRecord::Schema.define(version: 20150721154255) do t.datetime "confirmed_at" t.datetime "confirmation_sent_at" t.string "unconfirmed_email" + t.boolean "show_foreign_themes", default: true, null: false end add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree