This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 680
Watch tree 842340 #3602
Merged
Merged
Watch tree 842340 #3602
Changes from 14 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
cca5fde
bug 842340 - new tidings event for trees
groovecoder 3fb6ee0
bug 842340 - fire a single EventUnion on edits
groovecoder 70eac0d
bug 842340 - review cleanup
groovecoder c8f90d1
bug 842340 - watch_menu_items macro for buttons.html
groovecoder 052042e
bug 842340: tree subscription copy in edited.ltxt
groovecoder 0280387
bug 842340: watch tree tests: events, models, views
groovecoder 9d2d89b
bug 842340 - view tests for document watches
groovecoder c58e966
bug 842340 - GA tracking for page watch (menu)
groovecoder f3cee25
bug 842340 - flake8 test code; context for macro
groovecoder 3e4ac84
fix bug 1218448 - no need to JSON.parse data
groovecoder 176be50
bug 842340 - proper <ul> nesting of watch_menu
groovecoder b7935ca
bug 842340 - <bdi> for {language} text
groovecoder b3d29f2
bug 842340 - Document.parent_trees_watched_by(user)
groovecoder cfa69a3
bug 842340 - clean edited.ltxt footer
groovecoder fabc188
bug 842340 - clean whitespace in emails
groovecoder a418f65
bug 842340 - include parent tree unsubscribe links
groovecoder c6f7345
bug 842340 - rename document tree test helper
groovecoder 01a06c1
Merge branch 'master' into watch-tree-842340
groovecoder 50ad728
bug 842340 - escape doc title in tree item
groovecoder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{% from "wiki/includes/document_macros.html" import watch_menu_items with context%} | ||
{% macro get_document_buttons(document, edit_link) %} | ||
|
||
{% if document.parent %} | ||
|
@@ -11,8 +12,11 @@ | |
{% set edit_link = document.get_edit_url() %} | ||
{% endif %} | ||
|
||
{% set watch_menu_items_html = watch_menu_items(document, user) %} | ||
|
||
<ul class="page-buttons" data-sticky="false">{% if not document.is_template %}<li><button id="languages-menu" class="transparent" aria-haspopup="true" aria-owns="languages-menu-submenu" aria-expanded="false"><span>{{ _('Languages') }}</span><i aria-hidden="true" class="icon-globe"></i></button> | ||
<ul class="page-buttons" data-sticky="false"> | ||
{% if not document.is_template %} | ||
<li><button id="languages-menu" class="transparent" aria-haspopup="true" aria-owns="languages-menu-submenu" aria-expanded="false"><span>{{ _('Languages') }}</span><i aria-hidden="true" class="icon-globe"></i></button> | ||
|
||
<div class="submenu js-submenu" id="languages-menu-submenu"> | ||
<div class="submenu-column"> | ||
|
@@ -30,34 +34,33 @@ | |
{% endif %} | ||
</ul> | ||
</div> | ||
</div></li>{% endif %}<li class="page-buttons-edit"><a href="{{ edit_link }}" class="button" data-optimizely-hook="button-edit-doc" id="edit-button">{{ _('Edit') }}<i aria-hidden="true" class="icon-pencil"></i></a></li><li><button id="advanced-menu" class="only-icon" aria-haspopup="true" aria-owns="advanced-menu-submenu" aria-expanded="false"><span>{{ _('Advanced') }}</span><i aria-hidden="true" class="icon-cog"></i></button> | ||
</div> | ||
</li>{% endif %} | ||
|
||
<li class="page-buttons-edit"><a href="{{ edit_link }}" class="button" data-optimizely-hook="button-edit-doc" id="edit-button">{{ _('Edit') }}<i aria-hidden="true" class="icon-pencil"></i></a></li> | ||
|
||
{% if user.is_authenticated() and document and waffle.flag('watch_menu')%} | ||
<li><button id="watch-menu" class="only-icon" aria-haspopup="true" aria-owns="watch-menu-submenu" aria-expanded="false"><span>{{ _('Watch') }}</span><i aria-hidden="true" class="icon-eye"></i></button> | ||
<div class="submenu js-submenu" id="watch-menu-submenu"> | ||
<div class="submenu-column"> | ||
<div class="title">{{ _('Watch') }}</div> | ||
{{ watch_menu_items_html }} | ||
</div> | ||
</div> | ||
</li> | ||
{% endif %} | ||
|
||
<li><button id="advanced-menu" class="only-icon" aria-haspopup="true" aria-owns="advanced-menu-submenu" aria-expanded="false"><span>{{ _('Advanced') }}</span><i aria-hidden="true" class="icon-cog"></i></button> | ||
<div class="submenu js-submenu" id="advanced-menu-submenu"> | ||
<!-- this page --> | ||
<div class="submenu-column"> | ||
<div class="title">{{ _('Advanced') }}</div> | ||
{% if user.is_authenticated() and document and not waffle.flag('watch_menu')%} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. space before |
||
{{ watch_menu_items_html }} | ||
{% endif %} | ||
<ul> | ||
<li><a href="{{ url('wiki.document_revisions', document.slug) }}" rel="nofollow, noindex">{{_('History')}}</a></li> | ||
{% if user.is_authenticated() and document %} | ||
<li class="page-watch"> | ||
{% set subscribe_status = _('Updating subscription status') %} | ||
<form action="{{ url('wiki.subscribe', document.slug, locale=document.locale) }}" method="post"> | ||
{{ csrf() }} | ||
<a href="#" data-subscribe-status="{{ subscribe_status }}" data-subscribe-text="{{ _('Subscribe to this article') }}" data-unsubscribe-text="{{ _('Unsubscribe from this article') }}" data-subscribe-message="{{ _('You are now subscribed to this article.') }}" data-unsubscribe-message="{{ _('You have been unsubscribed from this article.') }}"> | ||
{% if document.is_watched_by(user) %}{{ _('Unsubscribe from this article') }}{% else %}{{ _('Subscribe to this article') }}{% endif %} | ||
</a> | ||
</form> | ||
|
||
{% if document.parent %} | ||
{% set parent_language = document.parent.language %} | ||
<form action="{{ url('wiki.subscribe', document.parent.slug, locale=document.parent.locale) }}" method="post"> | ||
{{ csrf() }} | ||
<a href="#" data-subscribe-status="{{ subscribe_status }}" data-subscribe-text="{{ _('Subscribe to {language} version')|f(language=parent_language) }}" data-unsubscribe-text="{{ _('Unsubscribe from {language} version')|f(language=parent_language) }}" data-subscribe-message="{{ _('You are now subscribed to the {language} version of this article.')|f(language=parent_language) }}" data-unsubscribe-message="{{ _('You have been unsubscribed from the {language} version of this article.')|f(language=parent_language) }}"> | ||
{% if document.parent.is_watched_by(user) %}{{ _('Unsubscribe from {language} version')|f(language=parent_language) }}{% else %}{{ _('Subscribe to {language} version')|f(language=parent_language) }}{% endif %} | ||
</a> | ||
</form> | ||
{% endif %} | ||
|
||
</li>{% endif %} | ||
{% if user.is_authenticated() and not document.is_template %} | ||
<li><a href="{{ url('wiki.create') }}?parent={{ document.id }}" rel="nofollow, noindex">{{ _('New sub-article') }}</a></li> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is an email, do you want to use jinja2 whitespace eating tags? Or do you want those strings indented?