From c1a9bf5084a63c848589831cb813c2ccc6336d95 Mon Sep 17 00:00:00 2001 From: Juan Funez Date: Tue, 1 Apr 2014 11:09:52 -0300 Subject: [PATCH 1/7] Filtros por checkins aceitos e pendentes (modelmanagers). #696 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: #696. [modelmanagers.py] Adiciono os 2 filtros: accepted e pending [views.py] a lista de objetos passados ao template agora são 2: objects_pending e objects_accepted, com a propria paginação. [checkin_list.html] adiciono markup para a 2 listas de objetos, + ajustes no paginador. [journal_list.html] [style.css] ajustes no paginador. [pagination_tags.py] Copia do template tag de scielo common, que foi removida por recomendação de @gustavofonseca. Agora a nova modificação no template tag permite mudar o nome do parametro 'page' da url, necessario para poder ter 2 paginadores independentes na misma páginan. obs: a mudança no template_tag, também foi enviada em um PR no repo scielo-django-extensions Conflicts: scielomanager/scielomanager/static/css/style.css --- scielomanager/articletrack/modelmanagers.py | 6 + .../templates/articletrack/checkin_list.html | 96 +++++++- .../templatetags/pagination_tags.py | 223 ++++++++++++++++++ scielomanager/articletrack/views.py | 6 +- .../journalmanager/journal_list.html | 20 +- .../scielomanager/static/css/style.css | 5 + 6 files changed, 337 insertions(+), 19 deletions(-) create mode 100644 scielomanager/articletrack/templatetags/pagination_tags.py diff --git a/scielomanager/articletrack/modelmanagers.py b/scielomanager/articletrack/modelmanagers.py index e904c744..0ba1c2c6 100644 --- a/scielomanager/articletrack/modelmanagers.py +++ b/scielomanager/articletrack/modelmanagers.py @@ -17,6 +17,12 @@ def active(self, get_active_collection=user_request_context.get_current_user_act return self.filter( article__journals__collection=get_active_collection()).distinct() + def accepted(self): + return self.filter(accepted_by__isnull=False) + + def pending(self): + return self.filter(accepted_by__isnull=True) + class CheckinManager(UserObjectManager): diff --git a/scielomanager/articletrack/templates/articletrack/checkin_list.html b/scielomanager/articletrack/templates/articletrack/checkin_list.html index 9d2da194..a8cc014c 100644 --- a/scielomanager/articletrack/templates/articletrack/checkin_list.html +++ b/scielomanager/articletrack/templates/articletrack/checkin_list.html @@ -1,22 +1,43 @@ {% extends "base_list_lv0.html" %} {% load i18n %} -{% load scielo_common %} +{% load pagination_tags %} {% load trans_status %} {% block page_title %}{% trans "List of Article Check ins" %}{% endblock %} {% block content %} + + +
-
-

{% trans 'List of Check-ins by Article' %}:

+
+ +

{% trans 'Pending' %}:

-
- {% simple_pagination checkins %} +
+
+ {% simple_pagination checkins_pending "pending_page" %} +
-{% regroup checkins.object_list by article as article_list %} + @@ -30,8 +51,7 @@

{% trans 'List of Check-ins by Article' %}:

- {% for article in article_list %} - {% with article.list|first as checkin %} + {% for checkin in checkins_pending.object_list %} @@ -47,7 +67,6 @@

{% trans 'List of Check-ins by Article' %}:

{% trans "Details" %} - {% endwith %} {% empty %}
{{ checkin.package_name }} {{ checkin.article.article_title|truncatewords:5 }}
@@ -61,4 +80,63 @@

{% trans 'List of Check-ins by Article' %}:

+ +
+
+ +

{% trans 'Accepted' %}:

+
+
+
+ {% simple_pagination checkins_accepted "accepted_page" %} +
+
+
+ + + + + + + + + + + + + + + + + {% for checkin in checkins_accepted.object_list %} + + + + + + + + + + + + {% empty %} + + + + {% endfor %} + +
{% trans "Package" %}{% trans "Article" %}:{% trans "Journal" %}:{% trans "Issue label" %}:{% trans "Most recent upload" %}:{% trans "Error Level" %}:{% trans "Accepted by" %}:{% trans "Accepted at" %}: 
{{ checkin.package_name }}{{ checkin.article.article_title|truncatewords:5 }}{{ checkin.article.journal_title }}{{ checkin.article.issue_label }}{{ checkin.created_at|date:"d/m/Y - H:i" }} + + {{ checkin.get_error_level }} + + {{ checkin.accepted_by.get_full_name }}{{ checkin.accepted_at|date:"d/m/Y - H:i" }} + {% trans "Details" %} +
+
+ + {% trans 'There are no items.' %} +
+
+ {% endblock %} diff --git a/scielomanager/articletrack/templatetags/pagination_tags.py b/scielomanager/articletrack/templatetags/pagination_tags.py new file mode 100644 index 00000000..f7ecbe18 --- /dev/null +++ b/scielomanager/articletrack/templatetags/pagination_tags.py @@ -0,0 +1,223 @@ +# coding: utf-8 +from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import ugettext as __ +from django.conf import settings +from django import template + + +register = template.Library() + +GLOSSARY_URL = settings.DOCUMENTATION_BASE_URL +'/glossary.html#' + + +def easy_tag(func): + """ + Deals with the repetitive parts of parsing template tags + """ + def inner(parser, token): + try: + return func(*token.split_contents()) + except TypeError: + raise template.TemplateSyntaxError('Bad arguments for tag "%s"' % token.split_contents()[0]) + inner.__name__ = func.__name__ + inner.__doc__ = inner.__doc__ + return inner + +def full_path(context, page_param_name='page', **params): + + url_path = '' + url_get = context['request'].GET.copy() + + if 'PATH_INFO' in context['request'].META: + url_path = context['request'].META['PATH_INFO'] + + for key, value in params.items(): + if key == 'page' and page_param_name and page_param_name.lower() != 'page': + key = page_param_name.lower() + url_get[key] = value + + if len(url_get): + url_path += '&' if '?' in url_get else '?' + url_path += "%s" % "&".join(("%s=%s" % (key, value) for key, value in url_get.items() if value)) + + return url_path.encode('utf8') + + +class NamedPagination(template.Node): + + def __init__(self, letters, selected): + self.letters = template.Variable(letters) + self.selected = template.Variable(selected) + + def render(self, context): + letters = self.letters.resolve(context) + selected = self.selected.resolve(context) + + html_snippet = '''''' + + return html_snippet + +@register.tag() +@easy_tag +def named_pagination(_tag_name, *params): + return NamedPagination(*params) + +class Pagination(template.Node): + + def __init__(self, object_record, page_param_name='page'): + self.object_record = template.Variable(object_record) + self.page_param_name = template.Variable(page_param_name) if page_param_name.lower() != 'page' else None + + def render(self, context): + object_record = self.object_record.resolve(context) + page_param_name = self.page_param_name.resolve(context) if self.page_param_name else None + + if not object_record.paginator: + # the paginator is empty + return '' + + if object_record.paginator.count > settings.PAGINATION__ITEMS_PER_PAGE: + class_li_previous = 'disabled' if not object_record.has_previous() else '' + class_li_next = 'disabled' if not object_record.has_next() else '' + html_pages = [] + + for page in object_record.paginator.page_range: + class_li_page = 'active' if object_record.number == page else '' + html_pages.append(u'
  • {2}
  • '.format(class_li_page, full_path(context, page_param_name=page_param_name, page=page), page)) + + html_snippet = u''' + + '''.format( + class_li_previous, + full_path(context, page_param_name=page_param_name, page=object_record.previous_page_number()), + _('Previous'), + ''.join(html_pages), + class_li_next, + full_path(context, page_param_name=page_param_name, page=object_record.next_page_number()), + _('Next') + ) + return html_snippet + else: + return '' + +@register.tag() +@easy_tag +def pagination(_tag_name, params, page_param_name='page'): + return Pagination(params, page_param_name) + +class SimplePagination(template.Node): + + def __init__(self, object_record, page_param_name='page'): + self.object_record = template.Variable(object_record) + self.page_param_name = template.Variable(page_param_name) if page_param_name.lower() != 'page' else None + + def render(self, context): + + object_record = self.object_record.resolve(context) + page_param_name = self.page_param_name.resolve(context) if self.page_param_name else None + + if not object_record.paginator: + # the paginator is empty + return '' + + if object_record.paginator.count > settings.PAGINATION__ITEMS_PER_PAGE: + class_li_previous = 'disabled' if not object_record.has_previous() else '' + class_li_next = 'disabled' if not object_record.has_next() else '' + + html_snippet = u''' +
      + +
    • + + {0}-{1} {2} {3} + +
    • + +
    + '''.format(object_record.start_index(), + object_record.end_index(), _('of'), + object_record.paginator.count, + class_li_previous, + full_path(context, page_param_name=page_param_name, page=object_record.previous_page_number()), + class_li_next, + full_path(context, page_param_name=page_param_name, page=object_record.next_page_number())) + + return html_snippet + + else: + return '' + +@register.tag() +@easy_tag +def simple_pagination(_tag_name, params, page_param_name='page'): + return SimplePagination(params, page_param_name) + +class FieldHelpText(template.Node): + + def __init__(self, field_name, help_text, glossary_refname): + self.field_name = template.Variable(field_name) + self.help_text = template.Variable(help_text) + self.glossary_refname = glossary_refname + + def render(self, context): + field_name = self.field_name.resolve(context) + help_text = self.help_text.resolve(context) + glossary_refname = self.glossary_refname + + for value in ['field_name', 'help_text', 'glossary_refname']: + if len(locals().get(value)) < 1: + return '' + + html_snippet = u''' + +   + + '''.format(_('Help on:'), + field_name, + help_text, + GLOSSARY_URL, + glossary_refname).strip() + + return html_snippet + +@register.tag() +@easy_tag +def field_help(_tag_name, *params): + """ + Renders the help for a given field. + + Usage: {% field_help field_label help_text %} + """ + return FieldHelpText(*params) + + + diff --git a/scielomanager/articletrack/views.py b/scielomanager/articletrack/views.py index c3eb34b2..b1689d71 100644 --- a/scielomanager/articletrack/views.py +++ b/scielomanager/articletrack/views.py @@ -36,12 +36,14 @@ def checkin_index(request): checkins = models.Checkin.userobjects.active() - objects = get_paginated(checkins, request.GET.get('page', 1)) + objects_pending = get_paginated(checkins.pending(), request.GET.get('pending_page', 1)) + objects_accepted = get_paginated(checkins.accepted(), request.GET.get('accepted_page', 1)) return render_to_response( 'articletrack/checkin_list.html', { - 'checkins': objects, + 'checkins_pending': objects_pending, + 'checkins_accepted': objects_accepted, }, context_instance=RequestContext(request) ) diff --git a/scielomanager/journalmanager/templates/journalmanager/journal_list.html b/scielomanager/journalmanager/templates/journalmanager/journal_list.html index d3ff250b..cfd00959 100644 --- a/scielomanager/journalmanager/templates/journalmanager/journal_list.html +++ b/scielomanager/journalmanager/templates/journalmanager/journal_list.html @@ -1,7 +1,7 @@ {% extends "base_list_lv0.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} +{% load pagination_tags %} {% load query_string %} {% load inctag_toolbars %} @@ -9,15 +9,19 @@ {% block content %}
    -
    - {% if request.GET.letter %} - {% named_pagination letters request.GET.letter %} - {% else %} - {% named_pagination letters 'All' %} - {% endif %} +
    +
    + {% if request.GET.letter %} + {% named_pagination letters request.GET.letter %} + {% else %} + {% named_pagination letters 'All' %} + {% endif %} +
    -
    +
    +
    {% simple_pagination objects_journal %} +
    diff --git a/scielomanager/scielomanager/static/css/style.css b/scielomanager/scielomanager/static/css/style.css index 2cabdb4a..a5b8a9b8 100644 --- a/scielomanager/scielomanager/static/css/style.css +++ b/scielomanager/scielomanager/static/css/style.css @@ -377,6 +377,7 @@ table._listings h4 { .current_attempt { border: 2px solid #CCCCCC; } + .controls > ul { list-style: none outside none; } @@ -385,3 +386,7 @@ table._listings h4 { display: inline-block; padding: 5px; } + +.current_attempt { border: 2px solid #CCCCCC;} + +.pager > li { margin: 0 5px; } From 29f681be8a1b7b4b9ab06968ccbaaed87572571d Mon Sep 17 00:00:00 2001 From: Juan Funez Date: Tue, 1 Apr 2014 11:15:32 -0300 Subject: [PATCH 2/7] Filtros por checkins aceitos e pendentes (modelmanagers). #696 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: #696. [*.html] removido a template_tag de scielo_common (externo) pelo pagination_tags (local), tem alguns templates que não era necesario a inclusão do template_tag. --- .../templates/articletrack/history.html | 2 +- .../templates/articletrack/notice_detail.html | 2 +- .../templates/articletrack/ticket_list.html | 2 +- .../export/templates/export/markup_files.html | 3 +-- .../journalmanager/add_collection.html | 1 - .../templates/journalmanager/add_issue.html | 2 +- .../templates/journalmanager/add_journal.html | 2 +- .../templates/journalmanager/add_section.html | 1 - .../templates/journalmanager/add_sponsor.html | 2 +- .../templates/journalmanager/add_user.html | 3 +-- .../journalmanager/edit_journal_status.html | 1 - .../templates/journalmanager/issue_list.html | 2 +- .../journalmanager/journal_dash.html | 1 - .../journalmanager/journal_editors_list.html | 1 - .../journalmanager/pressrelease_list.html | 2 +- .../journalmanager/section_list.html | 10 ++++++---- .../journalmanager/sponsor_list.html | 20 +++++++++++-------- .../journalmanager/trash_listing.html | 2 +- .../templates/journalmanager/user_list.html | 2 +- .../registration/password_reset_complete.html | 1 - .../registration/password_reset_confirm.html | 4 +--- .../registration/password_reset_done.html | 1 - .../registration/password_reset_form.html | 1 - 23 files changed, 31 insertions(+), 37 deletions(-) diff --git a/scielomanager/articletrack/templates/articletrack/history.html b/scielomanager/articletrack/templates/articletrack/history.html index 1569f474..4b0dc8df 100644 --- a/scielomanager/articletrack/templates/articletrack/history.html +++ b/scielomanager/articletrack/templates/articletrack/history.html @@ -1,6 +1,6 @@ {% extends "base_list_lv0.html" %} {% load i18n %} -{% load scielo_common %} +{% load pagination_tags %} {% block page_title %}{% trans "List of specific attempt" %}{% endblock %} diff --git a/scielomanager/articletrack/templates/articletrack/notice_detail.html b/scielomanager/articletrack/templates/articletrack/notice_detail.html index a1018524..45f19f30 100644 --- a/scielomanager/articletrack/templates/articletrack/notice_detail.html +++ b/scielomanager/articletrack/templates/articletrack/notice_detail.html @@ -2,7 +2,7 @@ {% load i18n %} {% load static %} {% load trans_status %} -{% load scielo_common %} +{% load pagination_tags %} {% load user_avatar %} {% block page_title %}{% trans "Details of checkin" %}: {{ checkin.pk }}{% endblock %} diff --git a/scielomanager/articletrack/templates/articletrack/ticket_list.html b/scielomanager/articletrack/templates/articletrack/ticket_list.html index 29538487..2b068449 100644 --- a/scielomanager/articletrack/templates/articletrack/ticket_list.html +++ b/scielomanager/articletrack/templates/articletrack/ticket_list.html @@ -1,6 +1,6 @@ {% extends "base_list_lv0.html" %} {% load i18n %} -{% load scielo_common %} +{% load pagination_tags %} {% block page_title %}{% trans "List of Tickets" %}{% endblock %} diff --git a/scielomanager/export/templates/export/markup_files.html b/scielomanager/export/templates/export/markup_files.html index 18db0050..0908d847 100644 --- a/scielomanager/export/templates/export/markup_files.html +++ b/scielomanager/export/templates/export/markup_files.html @@ -1,8 +1,7 @@ {% extends "base_lv1.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} - +{% load pagination_tags %} {% block page_title %}{% trans "Downloads" %} - {% trans "Markup files" %}{% endblock %} {% block breadcrumb %} diff --git a/scielomanager/journalmanager/templates/journalmanager/add_collection.html b/scielomanager/journalmanager/templates/journalmanager/add_collection.html index 727d3360..30639546 100644 --- a/scielomanager/journalmanager/templates/journalmanager/add_collection.html +++ b/scielomanager/journalmanager/templates/journalmanager/add_collection.html @@ -1,7 +1,6 @@ {% extends "base_form_lv0.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} {% block page_title %}{% trans "Collection" %}{% endblock %} diff --git a/scielomanager/journalmanager/templates/journalmanager/add_issue.html b/scielomanager/journalmanager/templates/journalmanager/add_issue.html index 4ad4be79..44adec84 100644 --- a/scielomanager/journalmanager/templates/journalmanager/add_issue.html +++ b/scielomanager/journalmanager/templates/journalmanager/add_issue.html @@ -1,7 +1,7 @@ {% extends "base_form_lv0.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} +{% load pagination_tags %} {% load formstamps %} {% load inctag_toolbars %} diff --git a/scielomanager/journalmanager/templates/journalmanager/add_journal.html b/scielomanager/journalmanager/templates/journalmanager/add_journal.html index 4f22ced7..e412bfd9 100644 --- a/scielomanager/journalmanager/templates/journalmanager/add_journal.html +++ b/scielomanager/journalmanager/templates/journalmanager/add_journal.html @@ -1,7 +1,7 @@ {% extends "base_form_lv0.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} +{% load pagination_tags %} {% load widget_tweaks %} {% load inctag_toolbars %} diff --git a/scielomanager/journalmanager/templates/journalmanager/add_section.html b/scielomanager/journalmanager/templates/journalmanager/add_section.html index 42fe0a10..d5c62753 100644 --- a/scielomanager/journalmanager/templates/journalmanager/add_section.html +++ b/scielomanager/journalmanager/templates/journalmanager/add_section.html @@ -1,7 +1,6 @@ {% extends "base_form_lv0.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} {% load widget_tweaks %} {% load inctag_toolbars %} diff --git a/scielomanager/journalmanager/templates/journalmanager/add_sponsor.html b/scielomanager/journalmanager/templates/journalmanager/add_sponsor.html index 80f3db7f..d2df9b0e 100644 --- a/scielomanager/journalmanager/templates/journalmanager/add_sponsor.html +++ b/scielomanager/journalmanager/templates/journalmanager/add_sponsor.html @@ -1,7 +1,7 @@ {% extends "base_form_lv0.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} +{% load pagination_tags %} {% block page_title %}{% trans "Sponsor" %}{% endblock %} diff --git a/scielomanager/journalmanager/templates/journalmanager/add_user.html b/scielomanager/journalmanager/templates/journalmanager/add_user.html index 36904f9f..d6ea09a7 100644 --- a/scielomanager/journalmanager/templates/journalmanager/add_user.html +++ b/scielomanager/journalmanager/templates/journalmanager/add_user.html @@ -1,8 +1,7 @@ {% extends "base_form_lv0.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} - +{% load pagination_tags %} {% block messages %} {% if add_form.errors %}
    diff --git a/scielomanager/journalmanager/templates/journalmanager/edit_journal_status.html b/scielomanager/journalmanager/templates/journalmanager/edit_journal_status.html index 71e2e554..fa593b00 100644 --- a/scielomanager/journalmanager/templates/journalmanager/edit_journal_status.html +++ b/scielomanager/journalmanager/templates/journalmanager/edit_journal_status.html @@ -1,7 +1,6 @@ {% extends "base_form_lv0.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} {% load inctag_toolbars %} {% block page_title %}{% trans "Publication Status" %} - {{journal.title}}{% endblock %} diff --git a/scielomanager/journalmanager/templates/journalmanager/issue_list.html b/scielomanager/journalmanager/templates/journalmanager/issue_list.html index 828223df..dddd08af 100644 --- a/scielomanager/journalmanager/templates/journalmanager/issue_list.html +++ b/scielomanager/journalmanager/templates/journalmanager/issue_list.html @@ -2,7 +2,7 @@ {% load i18n %} {% load static %} {% load waffle_tags %} -{% load scielo_common %} +{% load pagination_tags %} {% load inctag_toolbars %} {% block page_title %}{% trans "Issues" %} - {{journal.title}}{% endblock %} diff --git a/scielomanager/journalmanager/templates/journalmanager/journal_dash.html b/scielomanager/journalmanager/templates/journalmanager/journal_dash.html index c5c56b86..20138f0b 100644 --- a/scielomanager/journalmanager/templates/journalmanager/journal_dash.html +++ b/scielomanager/journalmanager/templates/journalmanager/journal_dash.html @@ -1,7 +1,6 @@ {% extends "base_list_lv0.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} {% load query_string %} {% load inctag_toolbars %} diff --git a/scielomanager/journalmanager/templates/journalmanager/journal_editors_list.html b/scielomanager/journalmanager/templates/journalmanager/journal_editors_list.html index ace29330..4b67e00b 100644 --- a/scielomanager/journalmanager/templates/journalmanager/journal_editors_list.html +++ b/scielomanager/journalmanager/templates/journalmanager/journal_editors_list.html @@ -1,7 +1,6 @@ {% extends "base_list_lv0.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} {% load inctag_toolbars %} {% block page_title %}{% trans "Users" %}{% endblock %} diff --git a/scielomanager/journalmanager/templates/journalmanager/pressrelease_list.html b/scielomanager/journalmanager/templates/journalmanager/pressrelease_list.html index 528445a3..996a9454 100644 --- a/scielomanager/journalmanager/templates/journalmanager/pressrelease_list.html +++ b/scielomanager/journalmanager/templates/journalmanager/pressrelease_list.html @@ -1,6 +1,6 @@ {% extends "base_lv1.html" %} {% load i18n %} -{% load scielo_common %} +{% load pagination_tags %} {% load query_string %} {% load inctag_toolbars %} diff --git a/scielomanager/journalmanager/templates/journalmanager/section_list.html b/scielomanager/journalmanager/templates/journalmanager/section_list.html index 096e7390..5dbf3d71 100644 --- a/scielomanager/journalmanager/templates/journalmanager/section_list.html +++ b/scielomanager/journalmanager/templates/journalmanager/section_list.html @@ -1,6 +1,6 @@ {% extends "base_lv1.html" %} {% load i18n %} -{% load scielo_common %} +{% load pagination_tags %} {% load inctag_toolbars %} {% block page_title %}{% trans "Sections" %} - {{journal.title}}{% endblock %} @@ -8,11 +8,13 @@ {% block content %} {% journaldash_toolbar 'section' journal user %}
    -
    + -
    - {% simple_pagination objects_section %} +
    +
    + {% simple_pagination objects_section %} +
    diff --git a/scielomanager/journalmanager/templates/journalmanager/sponsor_list.html b/scielomanager/journalmanager/templates/journalmanager/sponsor_list.html index 6047c84f..f4654bfa 100644 --- a/scielomanager/journalmanager/templates/journalmanager/sponsor_list.html +++ b/scielomanager/journalmanager/templates/journalmanager/sponsor_list.html @@ -1,22 +1,26 @@ {% extends "base_list_lv0.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} +{% load pagination_tags %} {% load query_string %} {% block page_title %}{% trans "Sponsors" %}{% endblock %} {% block content %}
    -
    - {% if request.GET.letter %} - {% named_pagination letters request.GET.letter %} - {% else %} - {% named_pagination letters 'All' %} - {% endif %} +
    +
    + {% if request.GET.letter %} + {% named_pagination letters request.GET.letter %} + {% else %} + {% named_pagination letters 'All' %} + {% endif %} +
    -
    +
    +
    {% simple_pagination objects_sponsor %} +
    diff --git a/scielomanager/journalmanager/templates/journalmanager/trash_listing.html b/scielomanager/journalmanager/templates/journalmanager/trash_listing.html index 2db2b5d9..315dd8e6 100644 --- a/scielomanager/journalmanager/templates/journalmanager/trash_listing.html +++ b/scielomanager/journalmanager/templates/journalmanager/trash_listing.html @@ -1,7 +1,7 @@ {% extends "base_list_lv0.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} +{% load pagination_tags %} {% load query_string %} {% block page_title %}{% trans "Trash" %}{% endblock %} diff --git a/scielomanager/journalmanager/templates/journalmanager/user_list.html b/scielomanager/journalmanager/templates/journalmanager/user_list.html index ca06d2c3..0f033a3a 100644 --- a/scielomanager/journalmanager/templates/journalmanager/user_list.html +++ b/scielomanager/journalmanager/templates/journalmanager/user_list.html @@ -1,7 +1,7 @@ {% extends "base_list_lv0.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} +{% load pagination_tags %} {% load inctag_toolbars %} {% load user_avatar %} diff --git a/scielomanager/scielomanager/templates/registration/password_reset_complete.html b/scielomanager/scielomanager/templates/registration/password_reset_complete.html index fa4c2a2e..38aa1639 100644 --- a/scielomanager/scielomanager/templates/registration/password_reset_complete.html +++ b/scielomanager/scielomanager/templates/registration/password_reset_complete.html @@ -1,7 +1,6 @@ {% extends "registration/base.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} {% block content %} {{block.super}} diff --git a/scielomanager/scielomanager/templates/registration/password_reset_confirm.html b/scielomanager/scielomanager/templates/registration/password_reset_confirm.html index 9e5f3804..8f1cbddf 100644 --- a/scielomanager/scielomanager/templates/registration/password_reset_confirm.html +++ b/scielomanager/scielomanager/templates/registration/password_reset_confirm.html @@ -1,8 +1,6 @@ {% extends "registration/base.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} - {% block content %} {{block.super}} @@ -27,7 +25,7 @@ -
    {% endif %} {% endblock %} diff --git a/scielomanager/scielomanager/templates/registration/password_reset_done.html b/scielomanager/scielomanager/templates/registration/password_reset_done.html index d771d564..3ca47ce5 100644 --- a/scielomanager/scielomanager/templates/registration/password_reset_done.html +++ b/scielomanager/scielomanager/templates/registration/password_reset_done.html @@ -1,7 +1,6 @@ {% extends "registration/base.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} {% block content %} {{block.super}} diff --git a/scielomanager/scielomanager/templates/registration/password_reset_form.html b/scielomanager/scielomanager/templates/registration/password_reset_form.html index f8e2ac6d..2f7fdbe6 100644 --- a/scielomanager/scielomanager/templates/registration/password_reset_form.html +++ b/scielomanager/scielomanager/templates/registration/password_reset_form.html @@ -1,7 +1,6 @@ {% extends "registration/base.html" %} {% load i18n %} {% load static %} -{% load scielo_common %} {% block content %} {% if perms.journalmanager.change_issue %}
    -
    {% trans 'Total of ahead of print documents at:' %}
    {% csrf_token %} -
    - {{ current_year }} {{ aheadform.current_ahead_documents }} +
    + {% trans 'Total of ahead of print documents at:' %} +    {{ current_year }} {{ aheadform.current_ahead_documents }} +    {{ previous_year }} {{ aheadform.previous_ahead_documents }} +
    -
    - {{ previous_year }} {{ aheadform.previous_ahead_documents }} -
    -
    {% endif %}
    - - - - - - - - - {% for year, vols in issue_grid.items %} - {% for vol, nums in vols.items %} - - - - + + {% endfor %} + {% empty %} + + -
    {% trans 'Year' %}{% trans 'Volume' %}{% trans 'Numbers' %} - {% if perms.journalmanager.can_reorder_issues %} - - +
    {{ year }}{{ vol|default:'-' }} -
    -
      +
    + +
    +
    + + + + + {% flag 'articletrack' %} + + {% endflag %} + + + + + + + {% for num in nums %} - {% if not num.number and not num.suppl_number and not num.suppl_volume %} -
  • - {% trans 'volume issue' %} -
  • - {% else %} -
  • - {{ num.identification }} - {% flag 'articletrack' %} - {% trans "article" %} - {% endflag %} -
  • - {% endif %} + + + + + + + + + {% empty %} + + + {% endfor %} - - - {% endfor %} - - {% empty %} - - - + +
    {% trans "Number" %}:{% trans "Articles" %}:{% trans "Total documents" %}:{% trans "Publication months" %}:{% trans "Updated" %}:{% trans "Actions" %}:
    + + {% if num.number %} + {{ num.number }} + {% else %} + {% trans 'volume issue' %} + {% endif %} + + {{ num.articles.all|length }} {% trans "articles" %} + + {% flag 'articletrack' %} + {% trans "view articles" %} + {% endflag %} + + + {{ num.total_documents }} + + {{ num.get_publication_start_month_display }}/{{ num.get_publication_end_month_display }}{{ num.updated|date:"d/m/Y - H:i" }} + + {% trans "Edit" %} + +
    {% trans 'There are no items.' %}
    {% trans 'There are no items.' %}
    +
    +
    + {% empty %} +
    {% trans 'There are no items.' %}
    {% trans 'There are no items.' %}
    + {% endfor %} +
    +
    {% endblock %} -{% block extrafooter %} -{{ block.super }} - -{% endblock %} diff --git a/scielomanager/scielomanager/static/css/style.css b/scielomanager/scielomanager/static/css/style.css index 2cabdb4a..f3724874 100644 --- a/scielomanager/scielomanager/static/css/style.css +++ b/scielomanager/scielomanager/static/css/style.css @@ -385,3 +385,27 @@ table._listings h4 { display: inline-block; padding: 5px; } + +#accordion-issues .accordion-heading { + background-color: #F5F5F5; + border: 1px solid #DDDDDD; + margin-top: 1px; +} + +#accordion-issues .accordion-heading a { + text-decoration: none; + color:#333; + font-weight: bold; +} + +#accordion-issues .accordion-body.collapse.in { + border-bottom: 1px solid #DDDDDD; + margin-bottom: 10px; +} + +#accordion-issues .accordion-group { + border-left: 1px solid #E5E5E5; + border-right: 1px solid #E5E5E5; + border-radius: 4px; + margin-bottom: 2px; +} \ No newline at end of file From 7fec59caa02952f7adf62c3568a547a47e212964 Mon Sep 17 00:00:00 2001 From: Juan Funez Date: Thu, 3 Apr 2014 10:16:01 -0300 Subject: [PATCH 4/7] =?UTF-8?q?Reforma=20na=20grade=20de=20fasc=C3=ADculos?= =?UTF-8?q?=20#723?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix: ocultamento certo quando não tem ativado ao waffle ``articles`` --- .../templates/journalmanager/issue_list.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scielomanager/journalmanager/templates/journalmanager/issue_list.html b/scielomanager/journalmanager/templates/journalmanager/issue_list.html index f27254fe..2951e490 100644 --- a/scielomanager/journalmanager/templates/journalmanager/issue_list.html +++ b/scielomanager/journalmanager/templates/journalmanager/issue_list.html @@ -82,11 +82,11 @@ {{ num.articles.all|length }} {% trans "articles" %} - - {% flag 'articletrack' %} + {% flag 'articletrack' %} + {% trans "view articles" %} - {% endflag %} - + + {% endflag %} {{ num.total_documents }} From 5c88315ea87642948213b4789918da3d1de95095 Mon Sep 17 00:00:00 2001 From: Juan Funez Date: Thu, 3 Apr 2014 11:46:29 -0300 Subject: [PATCH 5/7] =?UTF-8?q?Reforma=20na=20grade=20de=20fasc=C3=ADculos?= =?UTF-8?q?=20#723?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: - campo numero do Issue Special, debe estar oculto - os form lista os campos ocultos, ou visibles separadamente - lista de issues, agora simplificado utilizando a propery identification quando é possivel. - mudança no test, que quebrou no ``assertTemplateUsed``, que agora é testado em ``test_templates_used`` --- scielomanager/journalmanager/forms.py | 5 +---- .../includes/issue_form_generic_field_list.html | 5 ++++- .../templates/journalmanager/issue_list.html | 6 +++--- scielomanager/journalmanager/tests/tests_forms.py | 14 ++++++++++++-- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/scielomanager/journalmanager/forms.py b/scielomanager/journalmanager/forms.py index 38b520dd..a53b1ecc 100644 --- a/scielomanager/journalmanager/forms.py +++ b/scielomanager/journalmanager/forms.py @@ -402,10 +402,7 @@ def clean(self): class SpecialIssueForm(RegularIssueForm): - number = forms.CharField(required=True, initial=SPECIAL_ISSUE_FORM_FIELD_NUMBER, widget=forms.TextInput(attrs={'readonly':'readonly'})) - - class Meta(RegularIssueForm.Meta): - exclude = ('number',) + number = forms.CharField(required=False, initial=SPECIAL_ISSUE_FORM_FIELD_NUMBER, widget=forms.HiddenInput(attrs={'readonly':'readonly'})) def __init__(self, *args, **kwargs): # RegularIssueForm expects 'params' is present in kwargs diff --git a/scielomanager/journalmanager/templates/journalmanager/includes/issue_form_generic_field_list.html b/scielomanager/journalmanager/templates/journalmanager/includes/issue_form_generic_field_list.html index 029cb672..02589de1 100644 --- a/scielomanager/journalmanager/templates/journalmanager/includes/issue_form_generic_field_list.html +++ b/scielomanager/journalmanager/templates/journalmanager/includes/issue_form_generic_field_list.html @@ -1,7 +1,10 @@ {% load scielo_common %} {% load i18n %}
    - {% for field in form %} + {% for field in form.hidden_fields %} + {{ field }} + {% endfor %} + {% for field in form.visible_fields %} {% if field.name != "cover" %}
    -
    - {% simple_pagination notices %} +
    +
    +
    +   +
    +
    +
    + {% simple_pagination notices %} +
    From ead3eef3bdb1e01548111de883ceaffdfdec043d Mon Sep 17 00:00:00 2001 From: Juan Funez Date: Thu, 3 Apr 2014 15:15:03 -0300 Subject: [PATCH 7/7] Filtros por checkins aceitos e pendentes (modelmanagers). #696 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removida a paginação --- .../templates/articletrack/notice_detail.html | 13 +------------ scielomanager/articletrack/views.py | 5 +---- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/scielomanager/articletrack/templates/articletrack/notice_detail.html b/scielomanager/articletrack/templates/articletrack/notice_detail.html index 71b91c51..754cb6bb 100644 --- a/scielomanager/articletrack/templates/articletrack/notice_detail.html +++ b/scielomanager/articletrack/templates/articletrack/notice_detail.html @@ -2,7 +2,6 @@ {% load i18n %} {% load static %} {% load trans_status %} -{% load pagination_tags %} {% load user_avatar %} {% block page_title %}{% trans "Details of checkin" %}: {{ checkin.pk }}{% endblock %} @@ -70,16 +69,6 @@

    {% trans "Check-in Information" %}:

    -
    -
    -   -
    -
    -
    - {% simple_pagination notices %} -
    -
    -
    @@ -116,7 +105,7 @@

    {% trans 'Notices' %}:

    - {% for notice in notices.object_list %} + {% for notice in notices %} {{ notice.stage }} diff --git a/scielomanager/articletrack/views.py b/scielomanager/articletrack/views.py index b1689d71..758a08d6 100644 --- a/scielomanager/articletrack/views.py +++ b/scielomanager/articletrack/views.py @@ -74,9 +74,6 @@ def notice_detail(request, checkin_id): checkin = get_object_or_404(models.Checkin.userobjects.active(), pk=checkin_id) notices = checkin.notices.all() - - objects = get_paginated(notices, request.GET.get('page', 1)) - tickets = checkin.article.tickets.all() opened_tickets = tickets.filter(finished_at__isnull=True) closed_tickets = tickets.filter(finished_at__isnull=False) @@ -84,7 +81,7 @@ def notice_detail(request, checkin_id): zip_filename = "%s_%s"% (datetime.date.today().isoformat(), slugify(checkin.article.article_title)) context = { - 'notices': objects, + 'notices': notices, 'checkin': checkin, 'opened_tickets': opened_tickets, 'closed_tickets': closed_tickets,