diff --git a/app/views/aspects/_aspect_dropdown.mobile.haml b/app/views/aspects/_aspect_dropdown.mobile.haml new file mode 100644 index 000000000..807f295f2 --- /dev/null +++ b/app/views/aspects/_aspect_dropdown.mobile.haml @@ -0,0 +1,36 @@ +-# Note: all_aspects is a global in the ApplicationController +:ruby + dropdown_css = {"data-toggle" => "dropdown"} + if current_user.getting_started? + dropdown_css[:title] = popover_with_close_html("2. #{t('shared.public_explain.control_your_audience')}") + dropdown_css["data-content"] = t("shared.public_explain.visibility_dropdown") + end + +.btn-group.aspect_dropdown + %button.btn.btn-default.dropdown-toggle{dropdown_css} + %i.entypo-lock.small#visibility-icon + %span.text + = t("all_aspects") + %span.caret + %ul.dropdown-menu.pull-right{unSelectable: "on"} + + %li.public.radio{"data-aspect_id" => "public"} + %a + %span.status_indicator + %i.glyphicon.glyphicon-ok + %span.text + = t("public") + %li.all_aspects.radio{"data-aspect_id" => "all_aspects"} + %a + %span.status_indicator + %i.glyphicon.glyphicon-ok + %span.text + = t("all_aspects") + %li.divider + - all_aspects.each do |aspect| + %li.aspect_selector{"data-aspect_id" => aspect.id} + %a + %span.status_indicator + %i.glyphicon.glyphicon-ok + %span.text + = aspect.name diff --git a/app/views/publisher/_publisher.mobile.haml b/app/views/publisher/_publisher.mobile.haml index e031c1027..6a320da2e 100644 --- a/app/views/publisher/_publisher.mobile.haml +++ b/app/views/publisher/_publisher.mobile.haml @@ -8,6 +8,7 @@ = status.hidden_field :provider_display_name, value: 'mobile' = status.text_area :text, placeholder: t('shared.publisher.whats_on_your_mind'), rows: 4, autofocus: "autofocus", class: "form-control" + = hidden_field_tag "aspect_ids[]", "all_aspects" .form-group %span#publisher-service-icons - if current_user.services @@ -16,16 +17,18 @@ title: service.provider.titleize, class: "service_icon dim", id: "#{service.provider}", maxchar: "#{service.class::MAX_CHARACTERS}" - %select{id: "aspect_ids_", class: "form-control", name: "aspect_ids[]"} - %option{value: 'public'} - = t('public') + -# %select{id: "aspect_ids_", class: "form-control", name: "aspect_ids[]"} + -# %option{value: 'public'} + -# = t('public') - %option{value: 'all_aspects', selected: true} - = t('all_aspects') + -# %option{value: 'all_aspects', selected: true} + -# = t('all_aspects') - - current_user.aspects.each do |aspect| - %option{value: aspect.id} - = "· #{aspect.name}" + -# - current_user.aspects.each do |aspect| + -# %option{value: aspect.id} + -# = "· #{aspect.name}" + .btn-toolbar.pull-right + = render partial: "aspects/aspect_dropdown" .clear #publisher-textarea-wrapper