change question display and add report placeholder
This commit is contained in:
parent
e4118c0013
commit
c8ba89dd1e
|
@ -19,6 +19,16 @@ body {
|
|||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.question-page {
|
||||
padding-top: 100px;
|
||||
}
|
||||
|
||||
@media(max-width: $screen-xs-max) {
|
||||
.question-page {
|
||||
padding-top: 130px;
|
||||
}
|
||||
}
|
||||
|
||||
.centre {
|
||||
text-align: center;
|
||||
}
|
||||
|
@ -135,4 +145,4 @@ body {
|
|||
|
||||
.panel-default {
|
||||
border-color: transparent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,9 +34,27 @@
|
|||
|
||||
.answerbox--question-text {
|
||||
line-height: 1.3em;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.answerbox--answer-date {
|
||||
font-size: 12px;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
}
|
||||
|
||||
.panel-question {
|
||||
position: fixed;
|
||||
border-top: 1px solid #fff;
|
||||
width: 100%;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.answerbox--question-media, .question-media, .question-body {
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
.question-actions {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 20px;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
$main-color: #5e35b1;
|
||||
$black: #000;
|
|
@ -1,19 +1,35 @@
|
|||
.container.j2-page
|
||||
.panel.panel-default.panel-question
|
||||
.panel-body
|
||||
.media.question-media
|
||||
- unless @question.author_is_anonymous
|
||||
%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
|
||||
%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: @question.id }}
|
||||
%i.fa.fa-trash-o
|
||||
Delete
|
||||
- unless @question.user == current_user
|
||||
%li
|
||||
%a{href: '#', data: { action: 'ab-question-report', q_id: @question.id }}
|
||||
%i.fa.fa-exclamation-triangle
|
||||
Report
|
||||
%p.answerbox--question-text= @question.content
|
||||
.container.question-page
|
||||
/ TODO: make this pretty (it's currently C-c'd straight from shared/_answerbox)
|
||||
.panel.panel-default
|
||||
.panel-body
|
||||
.media
|
||||
- unless @question.author_is_anonymous
|
||||
%a.pull-left{href: show_user_profile_path(@question.user.screen_name)}
|
||||
%img.img-rounded.answerbox--img{src: gravatar_url(@question.user)}
|
||||
.media-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
|
||||
%p.answerbox--question-text= @question.content
|
||||
|
||||
#answers
|
||||
- @answers.each do |a|
|
||||
|
@ -38,4 +54,4 @@
|
|||
%label
|
||||
%input{type: 'checkbox', name: 'share', checked: :checked, data: { q_id: @question.id, service: service.provider }}
|
||||
Post to
|
||||
= service.provider.capitalize
|
||||
= service.provider.capitalize
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
.panel.panel-default.answerbox{data: { id: a.id }}
|
||||
- if @question.nil?
|
||||
.panel-heading
|
||||
.media
|
||||
.media.question-media
|
||||
- unless a.question.author_is_anonymous
|
||||
%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
|
||||
.media-body.question-body
|
||||
%h6.text-muted.media-heading.answerbox--question-user
|
||||
= user_screen_name a.question.user, a.question.author_is_anonymous
|
||||
asked
|
||||
|
@ -22,6 +22,22 @@
|
|||
·
|
||||
%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
|
||||
|
@ -67,4 +83,4 @@
|
|||
= render 'shared/answerbox_buttons', a: a
|
||||
.panel-footer{id: "ab-comments-section-#{a.id}", style: @display_all.nil? ? 'display: none' : nil }
|
||||
%div{id: "ab-smiles-#{a.id}"}= render 'shared/smiles', a: a
|
||||
%div{id: "ab-comments-#{a.id}"}= render 'shared/comments', a: a
|
||||
%div{id: "ab-comments-#{a.id}"}= render 'shared/comments', a: a
|
||||
|
|
14
db/schema.rb
14
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: 20150421120557) do
|
||||
ActiveRecord::Schema.define(version: 20150422024104) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -19,11 +19,12 @@ ActiveRecord::Schema.define(version: 20150421120557) do
|
|||
create_table "answers", force: :cascade do |t|
|
||||
t.text "content"
|
||||
t.integer "question_id"
|
||||
t.integer "comment_count", default: 0, null: false
|
||||
t.integer "comment_count", default: 0, null: false
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "smile_count", default: 0, null: false
|
||||
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
|
||||
|
@ -109,7 +110,8 @@ ActiveRecord::Schema.define(version: 20150421120557) do
|
|||
t.integer "user_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "answer_count", default: 0, null: false
|
||||
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
|
||||
|
@ -132,6 +134,7 @@ ActiveRecord::Schema.define(version: 20150421120557) do
|
|||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.boolean "deleted", default: false
|
||||
t.string "reason"
|
||||
end
|
||||
|
||||
create_table "services", force: :cascade do |t|
|
||||
|
@ -207,6 +210,9 @@ ActiveRecord::Schema.define(version: 20150421120557) 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
|
||||
|
||||
|
|
Loading…
Reference in New Issue