Retrospring/app/views/application/_questionbox.haml

54 lines
2.1 KiB
Plaintext

.card
.card-header
- if user.profile.motivation_header.blank?
= t(".title")
- else
= user.profile.motivation_header
.card-body
- if user.banned?
.text-center
%strong= t(".status.banned")
- elsif user_signed_in? && current_user.blocking?(user)
.text-center
%strong= t(".status.blocking")
- elsif user_signed_in? && user.blocking?(current_user)
.text-center
%strong= t(".status.blocked")
- else
- if user_signed_in? || user.privacy_allow_anonymous_questions?
#question-box
%textarea.form-control{ name: "qb-question", placeholder: t(".placeholder") }
.row{ style: "padding-top: 5px; padding-left: 5px; padding-right: 5px;" }
.col-6
- if user_signed_in?
- if user.privacy_allow_anonymous_questions?
%label
%input{ name: "qb-anonymous", type: :checkbox }
= t(".anonymous")
%br/
- else
%input{ name: "qb-anonymous", type: :hidden, value: false }/
.col-6
%p.pull-right
%input{ name: "qb-to", type: "hidden", value: user.id }/
%button.btn.btn-primary{ name: "qb-ask",
type: :button,
data: { loading_text: t(".load"), promote: user_signed_in? ? "false" : "true" } }
Ask
- unless user_signed_in?
- if user.privacy_allow_anonymous_questions?
.d-none#question-box-promote
.row
.col-12.text-center
%strong= t(".promote.message")
.row
.col-sm-5.offset-sm-1
%button.btn.btn-block.btn-primary#create-account= t(".promote.create")
.col-sm-5
%button.btn.btn-block.btn-default#new-question= t(".promote.another")
.row
.col-xs-12.col-sm-10.offset-sm-1.text-center
%small= t(".promote.join", app_title: APP_CONFIG["site_name"])
- else
%p= raw t(".required", signup: link_to(t("views.sessions.new"), new_user_registration_path))