Retrospring/app/views/application/_questionbox.html.haml

64 lines
2.9 KiB
Plaintext
Raw Normal View History

2020-04-19 14:31:24 -07:00
.card
2020-04-19 14:09:41 -07:00
.card-header
- if user.profile.motivation_header.blank?
2022-06-13 12:55:37 -07:00
= t(".title")
- else
= user.profile.motivation_header
2020-04-19 14:09:41 -07:00
.card-body
2020-05-10 05:06:22 -07:00
- if user.banned?
2020-04-26 08:30:06 -07:00
.text-center
2022-06-13 12:55:37 -07:00
%strong= t(".status.banned")
2022-06-13 13:48:40 -07:00
- 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")
- elsif user.inbox_locked?
.text-center
%strong= t(".status.locked")
- elsif !user_signed_in? && user.privacy_require_user?
.text-center
%strong= t(".status.require_user_html", sign_in: link_to(t("voc.login"), new_user_session_path), sign_up: link_to(t("voc.register"), new_user_registration_path))
- else
2020-05-10 05:06:22 -07:00
- if user_signed_in? || user.privacy_allow_anonymous_questions?
#question-box{ data: user.profile.allow_long_questions ? {} : { controller: "character-count", "character-count-max-value": user.profile.question_length_limit }}
%textarea.form-control{ name: "qb-question", placeholder: t(".placeholder"), data: { "character-count-target": "input" } }
.row{ style: "padding-top: 5px;" }
2020-04-26 08:30:06 -07:00
.col-6
- if user_signed_in?
2020-05-10 05:06:22 -07:00
- if user.privacy_allow_anonymous_questions?
%label
%input{ name: "qb-anonymous", type: :checkbox }
= t(".anonymous")
%br/
- else
2022-06-13 12:55:37 -07:00
%input{ name: "qb-anonymous", type: :hidden, value: false }/
2020-04-26 08:30:06 -07:00
.col-6
%p.pull-right
%span.text-muted.me-1{ class: user.profile.allow_long_questions ? "d-none" : "", data: { "character-count-target": "counter" } }= Question::SHORT_QUESTION_MAX_LENGTH
2022-06-13 12:55:37 -07:00
%input{ name: "qb-to", type: "hidden", value: user.id }/
%button.btn.btn-primary{ name: "qb-ask",
2020-05-10 05:06:22 -07:00
type: :button,
data: { loading_text: t(".load"), promote: user_signed_in? ? "false" : "true", "character-count-target": "action" } }
2020-05-10 05:06:22 -07:00
Ask
- unless user_signed_in?
2020-05-10 05:06:22 -07:00
- if user.privacy_allow_anonymous_questions?
2022-01-03 13:37:01 -08:00
.d-none#question-box-promote
.row
2020-04-26 08:30:06 -07:00
.col-12.text-center
2022-06-13 12:55:37 -07:00
%strong= t(".promote.message")
.row
2020-04-26 08:30:06 -07:00
.col-sm-5.offset-sm-1
2023-01-04 05:43:28 -08:00
.d-grid
%button.btn.btn-primary#create-account= t(".promote.create")
.col-sm-5
2023-01-04 05:43:28 -08:00
.d-grid
%button.btn.btn-default#new-question= t(".promote.another")
.row
2020-04-26 08:30:06 -07:00
.col-xs-12.col-sm-10.offset-sm-1.text-center
2022-06-13 12:55:37 -07:00
%small= t(".promote.join", app_title: APP_CONFIG["site_name"])
- else
.text-center
%strong= t(".status.non_anonymous_html", sign_in: link_to(t("voc.login"), new_user_session_path), sign_up: link_to(t("voc.register"), new_user_registration_path))