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

64 lines
2.8 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: { controller: "character-count", "character-count-max-value": 512 }}
%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
2023-01-04 02:00:45 -08:00
%span.text-muted.me-1{ data: { "character-count-target": "counter" } } 512
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))