diff --git a/app/javascript/styles/application.scss b/app/javascript/styles/application.scss index b98740da..a90394a5 100644 --- a/app/javascript/styles/application.scss +++ b/app/javascript/styles/application.scss @@ -79,6 +79,7 @@ "components/entry", "components/flags", "components/icons", +"components/inbox-actions", "components/inbox-entry", "components/jumbotron", "components/locales", diff --git a/app/javascript/styles/components/_inbox-actions.scss b/app/javascript/styles/components/_inbox-actions.scss new file mode 100644 index 00000000..3a6c3dc8 --- /dev/null +++ b/app/javascript/styles/components/_inbox-actions.scss @@ -0,0 +1,5 @@ +.inbox-actions { + .form-group { + margin-bottom: 0; + } +} diff --git a/app/views/inbox/_actions.haml b/app/views/inbox/_actions.haml new file mode 100644 index 00000000..304461e8 --- /dev/null +++ b/app/views/inbox/_actions.haml @@ -0,0 +1,23 @@ +.card.inbox-actions + .card-body + .d-md-flex + = bootstrap_form_tag url: inbox_path, method: :get, html: { class: "d-block" } do |f| + = f.text_field :author, value: params[:author], placeholder: t(".author.placeholder"), prepend: "@", hide_label: true, + append: f.button(t(".author.button"), name: nil, class: "btn btn-light", id: "ib-author") + .d-flex.ml-auto.mt-2.mt-md-0 + %button.btn.btn-info.mr-auto{ type: :button, id: "ib-generate-question" } + = t(".questions.button") + .button-group.ml-1 + %button.btn.btn-default{ data: { toggle: :dropdown }, aria: { expanded: false } } + %i.fa.fa-fw.fa-share-alt + %span.sr-only= t(".share.heading") + .dropdown-menu.dropdown-menu-right{ role: :menu } + %a.dropdown-item{ href: "https://twitter.com/intent/tweet?text=Ask%20me%20anything%21&url=#{user_url(current_user)}", target: "_blank" } + %i.fa.fa-fw.fa-twitter + = t(".share.button", service: "Twitter") + %a.dropdown-item{ href: "https://www.tumblr.com/share/link?url=#{user_url(current_user)}&name=Ask%20me%20anything%21", target: "_blank" } + %i.fa.fa-fw.fa-tumblr + = t(".share.button", service: "Tumblr") + %button.btn.btn-danger.ml-1{ type: :button, id: delete_id, disabled: (disabled ? :disabled : nil), data: { ib_count: inbox_count } } + %i.fa.fa-fw.fa-trash-o + %span.sr-only= t(".actions.delete") diff --git a/app/views/layouts/inbox.haml b/app/views/layouts/inbox.haml index 8b82f9d6..0aff256e 100644 --- a/app/views/layouts/inbox.haml +++ b/app/views/layouts/inbox.haml @@ -1,8 +1,7 @@ .container-lg.container--main .row - .col-md-3.col-xs-12.col-sm-4.order-2.order-sm-1 - = render 'inbox/sidebar', delete_id: @delete_id, disabled: @disabled, inbox_count: @inbox_count - .col-md-9.col-xs-12.col-sm-8.order-1.order-sm-2 + .col-sm-10.col-md-10.col-lg-9.mx-auto + = render 'inbox/actions', delete_id: @delete_id, disabled: @disabled, inbox_count: @inbox_count = render 'layouts/messages' = yield