Add stream edit page for setting delegates instead of page in
ietfworkflows, add streams_menu template tag for outputting the streams menu instead of the one in ietfworkflows, move base_wgmenu.html and base_leftmenu.html templates to base/ (together with base/streams_menu.html), get rid of "first" madness in base/left_menu.html which is now obsolete anyway because we have a Settings headline which is always first - Legacy-Id: 6255
This commit is contained in:
parent
5f6f966355
commit
2d902e28d1
31
ietf/doc/templatetags/streams_menu.py
Normal file
31
ietf/doc/templatetags/streams_menu.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
from django import template
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import reverse as urlreverse
|
||||
|
||||
from ietf.ietfauth.utils import has_role
|
||||
from ietf.group.models import Group
|
||||
from ietf.name.models import StreamName
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@register.inclusion_tag('base/streams_menu.html', takes_context=True)
|
||||
def streams_menu(context):
|
||||
user = context["request"].user
|
||||
|
||||
editable_streams = []
|
||||
|
||||
if user.is_authenticated():
|
||||
streams = StreamName.objects.exclude(slug="legacy")
|
||||
|
||||
if has_role(user, "Secretariat"):
|
||||
editable_stream = streams
|
||||
else:
|
||||
acronyms = Group.objects.filter(acronym__in=(s.slug for s in streams),
|
||||
role__name="chair",
|
||||
role__person__user=user).distinct().values_list("acronym", flat=True)
|
||||
|
||||
for s in streams:
|
||||
if s.slug in acronyms:
|
||||
editable_streams.append(s)
|
||||
|
||||
return { 'editable_streams': streams }
|
|
@ -61,7 +61,7 @@ class WgMenuNode(template.Node):
|
|||
|
||||
areas = [a for a in areas if a.active_groups]
|
||||
|
||||
res = loader.render_to_string('base_wgmenu.html', {'areas':areas})
|
||||
res = loader.render_to_string('base/wg_menu.html', {'areas':areas})
|
||||
cache.set('base_left_wgmenu', x, 30*60)
|
||||
return res
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
<tr valign="top">
|
||||
<td style="width:130px;padding-right:8px;" class="noprint">
|
||||
<div class="ietf-navbar">
|
||||
{% include "base_leftmenu.html" %}
|
||||
{% include "base/left_menu.html" %}
|
||||
</div>
|
||||
<div style="width: 100%; text-align: center; padding-top:4px;font-size:69%;">
|
||||
{% if version_num %}
|
||||
|
|
|
@ -32,15 +32,15 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
{% endcomment %}
|
||||
{% load wg_menu %}
|
||||
{% load ietf_filters ietf_streams community_tags %}
|
||||
{% load wg_menu %}
|
||||
{% load streams_menu %}
|
||||
{% load ietf_filters community_tags %}
|
||||
<ul>
|
||||
<li class="sect first">Settings</li>
|
||||
<li><a href="{% url account_index %}">{% if request.user.is_authenticated %}Manage Account{% else %}New Account{% endif %}</a></li>
|
||||
<li><a href="{%url ietf.cookies.views.settings %}" rel="nofollow">Options</a></li>
|
||||
{% if user|has_role:"Area Director" %}
|
||||
<li class="sect first">AD Dashboard</li>
|
||||
<li class="sect">AD Dashboard</li>
|
||||
<li><a href="{% url docs_for_ad name=user.get_profile.full_name_as_key %}">My Documents</a></li>
|
||||
<li><a href="{% url ietf.iesg.views.agenda_documents %}">Next Telechat</a></li>
|
||||
<li><a href="{% url ietf.iesg.views.discusses %}">Discusses</a></li>
|
||||
|
@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
<li><a href="{% url ietf.iesg.views.working_group_actions %}">Working Groups</a></li>
|
||||
{% endif %}
|
||||
{% if user|has_role:"Secretariat" %}
|
||||
<li class="sect first">Secretariat</li>
|
||||
<li class="sect">Secretariat</li>
|
||||
<li><a href="/admin/iesg/telechatdate/">Telechat Dates</a></li>
|
||||
<li><a href="/admin/iesg/telechatagendaitem/">Management Items</a></li>
|
||||
<li><a href="{% url ietf.iesg.views.milestones_needing_review %}">Milestones</a></li>
|
||||
|
@ -57,24 +57,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
<li><a href="{% url ietf.iesg.views.working_group_actions %}">Working Groups</a></li>
|
||||
<li><a href="{% url ietf.sync.views.discrepancies %}">Sync discrepancies</a>
|
||||
{% endif %}
|
||||
{% if user %}
|
||||
{% get_user_managed_streams user as stream_list %}
|
||||
{% if stream_list %}
|
||||
<li class="sect{% if not user|in_group:"Area_Director,Secretariat" %} first{% endif %}">Streams</li>
|
||||
{% for stream in stream_list %}
|
||||
<li{% if forloop.last %} style="margin-bottom: 2px;"{% endif %}><a href="{% url stream_delegates stream.name %}">{{ stream.name }} stream</a></li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% streams_menu %}
|
||||
{% if user|has_role:"IANA" %}
|
||||
<li class="sect first">IANA</li>
|
||||
<li class="sect">IANA</li>
|
||||
<li><a href="{% url ietf.sync.views.discrepancies %}">Sync discrepancies</a></li>
|
||||
{% endif %}
|
||||
{% if user|has_role:"RFC Editor" %}
|
||||
<li class="sect first">RFC Editor</li>
|
||||
<li class="sect">RFC Editor</li>
|
||||
<li><a href="{% url ietf.sync.views.discrepancies %}">Sync discrepancies</a></li>
|
||||
{% endif %}
|
||||
<li class="sect{% if not user|has_role:"Area Director,Secretariat" %} first{% endif %}">Working Groups</li>
|
||||
<li class="sect">Working Groups</li>
|
||||
|
||||
<li style="padding-bottom:0;"><div id="wgs" class="yuimenu"><div class="bd" style="border:0;">
|
||||
<ul class="first-of-type" style="padding:0;">
|
7
ietf/templates/base/streams_menu.html
Normal file
7
ietf/templates/base/streams_menu.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{% load ietf_filters %}
|
||||
{% if editable_streams %}
|
||||
<li class="sect">Streams</li>
|
||||
{% for stream in editable_streams %}
|
||||
<li{% if forloop.last %} style="margin-bottom: 2px;"{% endif %}><a href="{% url ietf.group.views.stream_edit stream.slug %}">{{ stream.name }} stream</a></li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
|
@ -15,10 +15,10 @@ form.edit td { padding-bottom: .5em; }
|
|||
<h1>Manage {{ group.name }} stream</h1>
|
||||
|
||||
<p>
|
||||
<b>Chair{{ chairs|pluralize }}:</b>
|
||||
<b>Chair{{ chairs|pluralize }}:
|
||||
{% for chair in chairs %}
|
||||
{{ chair.person.plain_name }} <{{ chair.address }}>{% if not forloop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}</b>
|
||||
</p>
|
||||
|
||||
<p>Delegates can be assigned with permission to do the tasks of the
|
||||
|
|
Loading…
Reference in a new issue