Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhilkoc <hilkoc@users.noreply.github.com>2016-08-29 21:21:53 +0300
committerBenjamin Neff <benjamin@coding4coffee.ch>2016-10-26 03:48:11 +0300
commitb7791e6c9db0d202bceeb3d1c649874f9a66a5a3 (patch)
treecf2e6a75f775e570cb336361d4d842222a7e63b1 /app/views/publisher
parent74fff52e512e4342d6f7529927ae66eddb520792 (diff)
Add user setting for default post visibility
fixes #4319 closes #7118
Diffstat (limited to 'app/views/publisher')
-rw-r--r--app/views/publisher/_aspect_dropdown.html.haml38
-rw-r--r--app/views/publisher/_publisher.html.haml6
2 files changed, 3 insertions, 41 deletions
diff --git a/app/views/publisher/_aspect_dropdown.html.haml b/app/views/publisher/_aspect_dropdown.html.haml
deleted file mode 100644
index e97e50426..000000000
--- a/app/views/publisher/_aspect_dropdown.html.haml
+++ /dev/null
@@ -1,38 +0,0 @@
-.btn-group.aspect_dropdown
- %button.btn.btn-default.dropdown-toggle{ ! current_user.getting_started? ? {'data-toggle' => 'dropdown'} : {'data-toggle' => 'dropdown', title: popover_with_close_html("2. #{t('shared.public_explain.control_your_audience')}"), 'data-content'=> t('shared.public_explain.visibility_dropdown')} }
- - if publisher_public
- %i#visibility-icon.entypo-globe.small
- %span.text
- = t('public')
- - else
- %i#visibility-icon.entypo-lock.small
- %span.text
- - if all_aspects_selected?(selected_aspects)
- = t('all_aspects')
- - elsif selected_aspects.size == 1
- = selected_aspects.first.name
- - else
- = t('shared.aspect_dropdown.toggle', count: selected_aspects.size)
- %span.caret
- %ul.dropdown-menu.pull-right{ unSelectable: 'on' }
-
- %li.public.radio{"data-aspect_id" => "public", class: ("selected" if publisher_public)}
- %a
- %span.status_indicator
- %i.glyphicon.glyphicon-ok
- %span.text
- = t('public')
- %li.all_aspects.radio{"data-aspect_id" => "all_aspects", class: ("selected" if (!publisher_public && all_aspects_selected?(selected_aspects)))}
- %a
- %span.status_indicator
- %i.glyphicon.glyphicon-ok
- %span.text
- = t('all_aspects')
- %li.divider
- - for aspect in all_aspects
- %li.aspect_selector{ 'data-aspect_id' => aspect.id, class: !all_aspects_selected?(selected_aspects) && selected_aspects.include?(aspect) ? "selected" : "" }
- %a
- %span.status_indicator
- %i.glyphicon.glyphicon-ok
- %span.text
- = aspect.name
diff --git a/app/views/publisher/_publisher.html.haml b/app/views/publisher/_publisher.html.haml
index 5e1ca38f1..d71b1e27f 100644
--- a/app/views/publisher/_publisher.html.haml
+++ b/app/views/publisher/_publisher.html.haml
@@ -40,9 +40,9 @@
!= t("shared.publisher.formatWithMarkdown", markdown_link: link_to(t("help.markdown"),
"https://diasporafoundation.org/formatting", target: :blank))
- - if publisher_public
+ - if public_selected?(selected_aspects)
= hidden_field_tag "aspect_ids[]", "public"
- - elsif all_aspects_selected?(selected_aspects)
+ - elsif all_aspects_selected?(all_aspects, selected_aspects)
= hidden_field_tag "aspect_ids[]", "all_aspects"
- else
- for aspect_id in aspect_ids
@@ -54,7 +54,7 @@
.options_and_submit.col-sm-12
.public_toggle.clearfix
.btn-toolbar.pull-right
- = render partial: "publisher/aspect_dropdown", locals: {selected_aspects: selected_aspects}
+ = render partial: "aspects/aspect_dropdown", locals: {selected_aspects: selected_aspects}
%button.btn.btn-group.btn-primary#submit= t("shared.publisher.share")
.btn-toolbar.pull-right#publisher-service-icons