From e2f06167dca00d74ef6745ccf5dc551725dba570 Mon Sep 17 00:00:00 2001 From: pixeldesu <git@pixelde.su> Date: Sun, 26 Apr 2015 02:46:37 +0200 Subject: [PATCH] fix styling and schema --- app/assets/stylesheets/scss/answerbox.scss | 6 ---- app/views/question/show.html.haml | 14 +++++----- app/views/shared/_answerbox.html.haml | 32 +++++++++++----------- db/schema.rb | 5 ---- 4 files changed, 23 insertions(+), 34 deletions(-) diff --git a/app/assets/stylesheets/scss/answerbox.scss b/app/assets/stylesheets/scss/answerbox.scss index c2d909e2..1481c7cb 100644 --- a/app/assets/stylesheets/scss/answerbox.scss +++ b/app/assets/stylesheets/scss/answerbox.scss @@ -52,9 +52,3 @@ .answerbox--question-media, .question-media, .question-body { overflow: visible !important; } - -.question-actions { - position: absolute; - top: 10px; - right: 20px; -} diff --git a/app/views/question/show.html.haml b/app/views/question/show.html.haml index 2785f759..cf8564a1 100644 --- a/app/views/question/show.html.haml +++ b/app/views/question/show.html.haml @@ -5,15 +5,9 @@ %a.pull-left{href: show_user_profile_path(@question.user.screen_name)} %img.img-rounded.answerbox--img{src: gravatar_url(@question.user)} .media-body.question-body - %h6.text-muted.media-heading.answerbox--question-user - = user_screen_name @question.user, @question.author_is_anonymous - asked - %span{title: @question.created_at, data: { toggle: :tooltip, placement: :bottom }} - = time_ago_in_words(@question.created_at) - ago - if user_signed_in? .pull-right - .btn-group.question-actions + .btn-group %button.btn.btn-link.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }} %span.caret %ul.dropdown-menu.dropdown-menu-right{role: :menu} @@ -27,6 +21,12 @@ %a{href: '#', data: { action: 'ab-question-report', q_id: @question.id }} %i.fa.fa-exclamation-triangle Report + %h6.text-muted.media-heading.answerbox--question-user + = user_screen_name @question.user, @question.author_is_anonymous + asked + %span{title: @question.created_at, data: { toggle: :tooltip, placement: :bottom }} + = time_ago_in_words(@question.created_at) + ago %p.answerbox--question-text= @question.content .container.question-page / TODO: make this pretty (it's currently C-c'd straight from shared/_answerbox) diff --git a/app/views/shared/_answerbox.html.haml b/app/views/shared/_answerbox.html.haml index 65d9e040..bb391f2f 100644 --- a/app/views/shared/_answerbox.html.haml +++ b/app/views/shared/_answerbox.html.haml @@ -6,6 +6,22 @@ %a.pull-left{href: show_user_profile_path(a.question.user.screen_name)} %img.img-rounded.answerbox--img{src: gravatar_url(a.question.user)} .media-body.question-body + - if user_signed_in? + .pull-right + .btn-group + %button.btn.btn-link.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }} + %span.caret + %ul.dropdown-menu.dropdown-menu-right{role: :menu} + - if current_user.mod? + %li.text-danger + %a{href: '#', data: { action: 'ab-question-destroy', q_id: a.question.id }} + %i.fa.fa-trash-o + Delete + - unless a.question.user == current_user + %li + %a{href: '#', data: { action: 'ab-question-report', q_id: a.question.id }} + %i.fa.fa-exclamation-triangle + Report %h6.text-muted.media-heading.answerbox--question-user = user_screen_name a.question.user, a.question.author_is_anonymous asked @@ -22,22 +38,6 @@ ยท %a{href: show_user_question_path(a.question.user.screen_name, a.question.id)} #{a.question.answer_count} answers - - if user_signed_in? - .pull-right - .btn-group.question-actions - %button.btn.btn-link.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }} - %span.caret - %ul.dropdown-menu.dropdown-menu-right{role: :menu} - - if current_user.mod? - %li.text-danger - %a{href: '#', data: { action: 'ab-question-destroy', q_id: a.question.id }} - %i.fa.fa-trash-o - Delete - - unless a.question.user == current_user - %li - %a{href: '#', data: { action: 'ab-question-report', q_id: a.question.id }} - %i.fa.fa-exclamation-triangle - Report .answerbox--question-text = a.question.content .panel-body diff --git a/db/schema.rb b/db/schema.rb index 2f3bb0bc..847182ea 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -24,7 +24,6 @@ ActiveRecord::Schema.define(version: 20150422024104) do t.datetime "created_at" t.datetime "updated_at" t.integer "smile_count", default: 0, null: false - t.boolean "nsfw", default: false end add_index "answers", ["user_id", "created_at"], name: "index_answers_on_user_id_and_created_at", using: :btree @@ -111,7 +110,6 @@ ActiveRecord::Schema.define(version: 20150422024104) do t.datetime "created_at" t.datetime "updated_at" t.integer "answer_count", default: 0, null: false - t.boolean "nsfw", default: false end add_index "questions", ["user_id", "created_at"], name: "index_questions_on_user_id_and_created_at", using: :btree @@ -210,9 +208,6 @@ ActiveRecord::Schema.define(version: 20150422024104) do t.boolean "privacy_show_in_search", default: true t.boolean "banned", default: false t.boolean "blogger", default: false - t.boolean "nsfw", default: false - t.boolean "show_nsfw", default: false - t.boolean "privacy_allow_nsfw_questions", default: true t.boolean "contributor", default: false end