Summary: Clean up some of the FACELIFT comments
- Legacy-Id: 8959
This commit is contained in:
parent
6da1939c7c
commit
b5458c29d3
|
@ -134,8 +134,7 @@ def ballotposition(doc, user):
|
|||
|
||||
|
||||
@register.filter
|
||||
# FACELIFT: added flavor argument for styling
|
||||
def state_age_colored(doc, flavor=""):
|
||||
def state_age_colored(doc):
|
||||
if doc.type_id == 'draft':
|
||||
if not doc.get_state_slug() in ["active", "rfc"]:
|
||||
# Don't show anything for expired/withdrawn/replaced drafts
|
||||
|
@ -178,26 +177,17 @@ def state_age_colored(doc, flavor=""):
|
|||
goal1 = 14
|
||||
goal2 = 28
|
||||
if days > goal2:
|
||||
if flavor == "facelift":
|
||||
class_name = "label label-danger"
|
||||
else:
|
||||
class_name = "ietf-small ietf-highlight-r"
|
||||
class_name = "label label-danger"
|
||||
elif days > goal1:
|
||||
if flavor == "facelift":
|
||||
class_name = "label label-warning"
|
||||
else:
|
||||
class_name = "ietf-small ietf-highlight-y"
|
||||
class_name = "label label-warning"
|
||||
else:
|
||||
class_name = "ietf-small"
|
||||
if days > goal1:
|
||||
title = ' title="Goal is <%d days"' % (goal1,)
|
||||
else:
|
||||
title = ''
|
||||
# It's too bad that this function returns HTML; this makes it hard to
|
||||
# style. For the facelift, I therefore needed to add a new "flavor"
|
||||
# parameter, which is ugly.
|
||||
return mark_safe('<span class="%s"%s>%sfor %d day%s%s</span>' % (
|
||||
class_name, title, '(' if flavor != "facelift" else "", days,
|
||||
's' if days != 1 else '', '(' if flavor != "facelift" else "" ))
|
||||
return mark_safe('<span class="%s"%s>for %d day%s</span>' % (
|
||||
class_name, title, days,
|
||||
's' if days != 1 else ''))
|
||||
else:
|
||||
return ""
|
||||
|
|
|
@ -557,8 +557,6 @@ class WordWrapNode(template.Node):
|
|||
def render(self, context):
|
||||
return wrap(str(self.nodelist.render(context)), int(self.len))
|
||||
|
||||
# FACELIFT: The following filters are only used by the facelift UI:
|
||||
|
||||
@register.filter
|
||||
def pos_to_label(text):
|
||||
"""Return a valid Bootstrap3 label type for a ballot position."""
|
||||
|
|
|
@ -57,8 +57,6 @@ from ietf.iesg.agenda import agenda_data, agenda_sections, fill_in_agenda_docs,
|
|||
from ietf.iesg.models import TelechatDate
|
||||
from ietf.ietfauth.utils import has_role, role_required, user_is_person
|
||||
from ietf.person.models import Person
|
||||
|
||||
# FACELIFT:
|
||||
from ietf.doc.views_search import fill_in_search_attributes
|
||||
|
||||
def review_decisions(request, year=None):
|
||||
|
@ -363,7 +361,7 @@ def agenda_documents(request):
|
|||
telechats = []
|
||||
for date in dates:
|
||||
sections = agenda_sections()
|
||||
# FACELIFT: augment the docs with the search attributes, since we're using
|
||||
# augment the docs with the search attributes, since we're using
|
||||
# the search_result_row view to display them (which expects them)
|
||||
fill_in_search_attributes(docs_by_date[date])
|
||||
fill_in_agenda_docs(date, sections, docs_by_date[date])
|
||||
|
|
|
@ -201,6 +201,9 @@ INSTALLED_APPS = (
|
|||
'django.contrib.messages',
|
||||
'south',
|
||||
'tastypie',
|
||||
'widget_tweaks',
|
||||
'typogrify',
|
||||
'bootstrap3',
|
||||
'ietf.person',
|
||||
'ietf.name',
|
||||
'ietf.group',
|
||||
|
@ -233,10 +236,6 @@ INSTALLED_APPS = (
|
|||
'ietf.secr.sreq',
|
||||
'ietf.nomcom',
|
||||
'ietf.dbtemplate',
|
||||
# FACELIFT: apps for facelift UI
|
||||
'widget_tweaks',
|
||||
'typogrify',
|
||||
'bootstrap3',
|
||||
)
|
||||
|
||||
# Settings for django-bootstrap3
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
{{ doc.friendly_state|safe }}
|
||||
{% endif %}
|
||||
|
||||
<wbr>{{ doc|state_age_colored:"facelift" }}
|
||||
<wbr>{{ doc|state_age_colored }}
|
||||
|
||||
{% if doc.telechat_date %}
|
||||
<br>IESG telechat: {{ doc.telechat_date }}
|
||||
|
|
|
@ -56,8 +56,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% comment %} FACELIFT: We use the same template as the search results now. {% endcomment %}
|
||||
{% for doc in section.docs %}
|
||||
{% for doc in section.docs %}
|
||||
{% include "doc/search/search_result_row.html" %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
@ -3,6 +3,5 @@
|
|||
{% block subtitle %} - Home {% endblock %}
|
||||
|
||||
{% block nomcom_content %}
|
||||
{# XXX FACELIFT: The content below comes from somewhere not in the svn repo? #}
|
||||
{{ template|safe }}
|
||||
{{ template|safe }}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue