Skip to content

Commit 208f4f3

Browse files
authored
Merge pull request #7 from eapearson/master
Fine tune sharing messages for narrative strips
2 parents e756b1f + 14e8a17 commit 208f4f3

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

src/plugin/resources/PublicNarrativesWidget/templates/slider.html

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,30 @@
147147
{% elif narrative.workspace.user_permission == 'r' %}
148148
<span class="fa fa-minus dimmed" style="opacity: 0.4;" data-toggle="tooltip" data-placement="auto" title="Sharing information not available for this read-only Narrative" data-container="body"></span>
149149
{% else %}
150+
{# Note: narrative sharing permissions are not reported for the current user -- we must grok that from other
151+
properties. E.g. in this case we know the current user permission is 'w', which is only possible when then
152+
narrative has been shared thus. #}
150153
{% if narrative.permissions|length == 0 %}
151-
<span data-toggle="tooltip" data-placement="auto" title="This narrative has not been shared with you, but not anyone else." data-container="body">
154+
<span data-toggle="tooltip" data-placement="auto" title="This narrative has been shared with you, but not anyone else." data-container="body">
152155
1 <span class="fa fa-share-alt"></span>
153156
</span>
154157
{% elif narrative.permissions|length == 1 %}
155-
<span data-toggle="tooltip" data-placement="auto" title="This narrative has been shared with you and one other user." data-container="body">
156-
{{ narrative.permissions | length + 1}}
158+
<span data-toggle="tooltip" data-placement="auto" title="This narrative has been shared with 2 users, including you." data-container="body">
159+
{{ narrative.permissions | length + 1}}
157160
<span class="fa fa-share-alt"></span>
158161
</span>
159162
{% else %}
160-
<span data-toggle="tooltip" data-placement="auto" title="This narrative has been shared with you and {{narrative.permissions|length}} other users." data-container="body">
161-
{{ narrative.permissions | length + 1}}
162-
<span class="fa fa-share-alt"></span>
163-
</span>
163+
{% if env.loggedInUser == narrative.workspace.owner %}
164+
<span data-toggle="tooltip" data-placement="auto" title="This narrative is owned by you and shared with {{narrative.permissions|length}} other users." data-container="body">
165+
{{ narrative.permissions | length }}
166+
<span class="fa fa-share-alt"></span>
167+
</span>
168+
{% else %}
169+
<span data-toggle="tooltip" data-placement="auto" title="This narrative has been shared with {{narrative.permissions|length + 1}} users, including you." data-container="body">
170+
{{ narrative.permissions | length + 1}}
171+
<span class="fa fa-share-alt"></span>
172+
</span>
173+
{% endif %}
164174
{% endif %}
165175
{% endif %}
166176
{% if narrative.workspace.globalread == 'r' or narrative.workspace.globalread == 'w' %}

src/plugin/resources/SharedNarrativesWidget/templates/slider.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,19 +141,19 @@
141141
<div class="-footer">
142142
<div style="display:inline-block; width: 100%;text-align: center;">
143143
{% if narrative.workspace.user_permission == 'r' %}
144-
<span class="fa fa-minus dimmed" style="opacity: 0.4;" data-toggle="tooltip" data-placement="auto" title="Sharing information not available for this read-only Narrative" data-container="body"></span>
144+
<span class="fa fa-minus dimmed" style="opacity: 0.4;" data-toggle="tooltip" data-placement="auto" title="Sharing information not available for this Narrative, because it is shared with you as read-only." data-container="body"></span>
145145
{% else %}
146146
{% if narrative.permissions|length == 0 %}
147147
<span data-toggle="tooltip" data-placement="auto" title="This narrative has been shared with you, but not anyone else." data-container="body">
148148
1 <span class="fa fa-share-alt"></span>
149149
</span>
150150
{% elif narrative.permissions|length == 1 %}
151-
<span data-toggle="tooltip" data-placement="auto" title="This narrative has been shared with you and one other user." data-container="body">
151+
<span data-toggle="tooltip" data-placement="auto" title="This narrative has been shared with 2 users, including you." data-container="body">
152152
{{ narrative.permissions | length + 1}}
153153
<span class="fa fa-share-alt"></span>
154154
</span>
155155
{% else %}
156-
<span data-toggle="tooltip" data-placement="auto" title="This narrative has been shared with you and {{narrative.permissions|length}} other users." data-container="body">
156+
<span data-toggle="tooltip" data-placement="auto" title="This narrative has been shared with {{narrative.permissions|length + 1}} users, including you." data-container="body">
157157
{{ narrative.permissions | length + 1}}
158158
<span class="fa fa-share-alt"></span>
159159
</span>

0 commit comments

Comments
 (0)