Skip to content

Commit

Permalink
Merge pull request #918 from scieloorg/beta
Browse files Browse the repository at this point in the history
Incorporação de códigos estáveis
  • Loading branch information
gustavofonseca committed Aug 6, 2014
2 parents db817ec + 2520362 commit 5800e7a
Show file tree
Hide file tree
Showing 30 changed files with 2,885 additions and 413 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jsonfield
django-tastypie==0.9.14
django-waffle==0.9.1
git+git://github.com/scieloorg/django-htmlmin.git
git+git://github.com/scieloorg/django-cache-machine.git#egg=django-cache-machine
-e git+git://github.com/scieloorg/django-cache-machine.git#egg=django-cache-machine
git+git://github.com/scieloorg/packtools.git#egg=packtools
Celery
django-celery
Expand Down
2 changes: 2 additions & 0 deletions scielomanager/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,13 +1236,15 @@ def test_api_v1_data_checkin(self):
u'accepted_at',
u'article',
u'attempt_ref',
u'checked_out',
u'created_at',
u'expiration_at',
u'id',
u'package_name',
u'rejected_at',
u'rejected_cause',
u'reviewed_at',
u'scielo_reviewed_at',
u'resource_uri',
u'status',
u'uploaded_at'
Expand Down
2 changes: 1 addition & 1 deletion scielomanager/articletrack/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def display_member(self, obj):


class CheckinAdmin(admin.ModelAdmin):
list_display = ('package_name', 'attempt_ref', 'uploaded_at', 'created_at')
list_display = ('package_name', 'attempt_ref', 'uploaded_at', 'created_at', 'status',)
search_fields = ('package_name',)
readonly_fields = ('created_at',)

Expand Down
2 changes: 1 addition & 1 deletion scielomanager/articletrack/balaio.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def is_up(self):
"""
try:
return self.call('status')
except xmlrpclib.Error:
except Exception: # any exception, such as "CONNECTION REFUESED" means API is down
return False

def get_server(self, uri):
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

251 changes: 176 additions & 75 deletions scielomanager/articletrack/models.py

Large diffs are not rendered by default.

81 changes: 50 additions & 31 deletions scielomanager/articletrack/templates/articletrack/checkin_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,61 @@
<div class="navbar-inner">
<ul class="nav">
<li>
<a class="brand" href="#">{% trans 'List of Check-ins' %}</a>
<a class="brand force-no-margin" href="#">{% trans 'List of Check-ins' %}:</a>
</li>
<li class="divider-vertical"></li>
</ul>
<ul class="nav pull-right">
<li class="divider-vertical"></li>
<li><a href="#pending" role="menuitem"><i class="icon-time"></i> {% trans "Pending" %}</a></li>
<li class="divider-vertical"></li>
<li><a href="#rejected" role="menuitem"><i class="icon-eye-close"></i> {% trans "Rejected" %}</a></li>
<li class="divider-vertical"></li>
<li><a href="#review" role="menuitem"><i class="icon-eye-open"></i> {% trans "Review" %}</a></li>
<li class="divider-vertical"></li>
<li><a href="#accepted" role="menuitem"><i class="icon-ok-circle"></i> {% trans "Accepted" %}</a></li>
</ul>
</div>
</div>

{# PENDING LIST #}
{% with status="pending" icon_class="icon-time" list_title="Pending" checkins_collection=checkins_pending pagination_prefix="pending_page" filter_form=pending_filter_form %}
{% include "articletrack/includes/checkin_list_and_filterform.html" %}
{% endwith %}

{# REJECTED LIST #}
{% with status="rejected" icon_class="icon-eye-close" list_title="Rejected" checkins_collection=checkins_rejected pagination_prefix="rejected_page" filter_form=rejected_filter_form %}
{% include "articletrack/includes/checkin_list_and_filterform.html" %}
{% endwith %}

{# REVIEW LIST #}
{% with status="review" icon_class="icon-eye-open" list_title="Review" checkins_collection=checkins_review pagination_prefix="review_page" filter_form=review_filter_form %}
{% include "articletrack/includes/checkin_list_and_filterform.html" %}
{% endwith %}

{# ACCEPTED LIST #}
{% with status="accepted" icon_class="icon-ok-circle" list_title="Accepted" checkins_collection=checkins_accepted pagination_prefix="accepted_page" filter_form=accepted_filter_form %}
{% include "articletrack/includes/checkin_list_and_filterform.html" %}
{% endwith %}
<ul class="nav nav-tabs">
<li {% if prefered_tab == 'pending' %}class="active" {% endif %}>
<a href="#PENDING" data-toggle="tab">
<strong><i class="icon-time"></i> {% trans "Pending" %}</strong>
</a>
</li>
<li {% if prefered_tab == 'rejected' %}class="active" {% endif %}>
<a href="#REJECTED" data-toggle="tab">
<strong><i class="icon-eye-close"></i> {% trans "Rejected" %}</strong>
</a>
</li>
<li {% if prefered_tab == 'review' %}class="active" {% endif %}>
<a href="#REVIEW" data-toggle="tab">
<strong><i class="icon-eye-open"></i> {% trans "Review" %}</strong>
</a>
</li>
<li {% if prefered_tab == 'accepted' %}class="active" {% endif %}>
<a href="#ACCEPTED" data-toggle="tab">
<strong><i class="icon-ok-circle"></i> {% trans "Accepted" %}</strong>
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="PENDING">
{# PENDING LIST #}
{% with status="pending" icon_class="icon-time" list_title="Pending" checkins_collection=checkins_pending pagination_prefix="pending_page" filter_form=pending_filter_form %}
{% include "articletrack/includes/checkin_list_and_filterform.html" %}
{% endwith %}
</div>
<div class="tab-pane" id="REJECTED">
{# REJECTED LIST #}
{% with status="rejected" icon_class="icon-eye-close" list_title="Rejected" checkins_collection=checkins_rejected pagination_prefix="rejected_page" filter_form=rejected_filter_form %}
{% include "articletrack/includes/checkin_list_and_filterform.html" %}
{% endwith %}
</div>
<div class="tab-pane" id="REVIEW">
{# REVIEW LIST #}
{% with status="review" icon_class="icon-eye-open" list_title="Review" checkins_collection=checkins_review pagination_prefix="review_page" filter_form=review_filter_form %}
{% include "articletrack/includes/checkin_list_and_filterform.html" %}
{% endwith %}
</div>
<div class="tab-pane" id="ACCEPTED">
{# ACCEPTED LIST #}
{% with status="accepted" icon_class="icon-ok-circle" list_title="Accepted" checkins_collection=checkins_accepted pagination_prefix="accepted_page" filter_form=accepted_filter_form %}
{% include "articletrack/includes/checkin_list_and_filterform.html" %}
{% endwith %}
</div>
</div>

{% endblock %}
{% block extrafooter %}
Expand Down Expand Up @@ -77,4 +96,4 @@
});
</script>

{% endblock extrafooter %}
{% endblock extrafooter %}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ <h4>{% trans "Check-in Information" %}:</h4>
{% endif %}
{{ checkin.get_status_display }}
</dd>
{% if checkin.status == 'accepted' and checkin.checked_out %}
<dd>
<dt>{% trans "Checked out" %}</dt>
<dd><i class='icon-ok-circle'></i></dd>
</dd>
{% endif %}
<dt>{% trans "Package name" %}:</dt>
<dd>{{ checkin.package_name }}</dd>
<dt>{% trans "Updated at" %}:</dt>
Expand All @@ -63,6 +69,15 @@ <h4>{% trans "Check-in Information" %}:</h4>
<dd>{{ checkin.reviewed_at|date:"d/m/Y - H:i" }}</dd>
{% endif %}

{%if checkin.scielo_reviewed_by %}
<dt style="text-align: left;"><em>SciELO review:</em></dt>
<dd>&nbsp;</dd>
<dt>{% trans "Reviewed by" %}:</dt>
<dd>{{ checkin.scielo_reviewed_by.get_full_name|default:checkin.scielo_reviewed_by }}</dd>
<dt>{% trans "Reviewed at" %}:</dt>
<dd>{{ checkin.scielo_reviewed_at|date:"d/m/Y - H:i" }}</dd>
{% endif %}

{% endif %}

{% if checkin.is_accepted %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@
{% load pagination_tags %}
{% load trans_status %}

{% with filter_form as form %}
{% include "articletrack/includes/filter_form.html" %}
{% endwith %}

<div class="row-fluid show-grid">
<div class="span8">
<a name="{{ status }}"></a>
<h3><i class="{{ icon_class|default:''}}"></i> {% trans list_title %}:</h3>
</div>
<div class="span4">
<div class="span12">
<div class="pull-right">
{% simple_pagination checkins_collection pagination_prefix %}
</div>
</div>
</div>

{% with filter_form as form %}
{% include "articletrack/includes/filter_form.html" %}
{% endwith %}

<table id="{{ status }}_results" class="table table-striped table-condensed">
<thead>
<tr>
Expand Down Expand Up @@ -87,4 +83,4 @@ <h3><i class="{{ icon_class|default:''}}"></i> {% trans list_title %}:</h3>
</tbody>
</table>

<hr>
<hr>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="alert alert-error alert-block">
<h4><i class="icon-warning-sign"></i> {% trans "REJECTED" %}:</h4>
<p>
{% trans "This checkin is rejected by" %}
{% trans "This checkin was rejected by" %}
{% with checkin.rejected_by as user %}
{% include "articletrack/includes/gravatar_tooltip.html" %}
{% endwith %}
Expand Down Expand Up @@ -44,7 +44,7 @@ <h4><i class="icon-ok-circle"></i> {% trans "THIS CHECKIN WILL EXPIRE TODAY" %}:
{% trans "at" %} {{ checkin.expiration_at|date:"d/m/Y - H:i" }}
</p>
<p>
{% trans "Before that date, the checkin will be unreachable." %}
{% trans "After that date, the checkin will be unreachable." %}
</p>
</div>
</div>
Expand Down
128 changes: 79 additions & 49 deletions scielomanager/articletrack/templates/articletrack/notice_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,58 +20,88 @@
<a href="{% url checkin_index %}"><i class="icon-chevron-left"></i> {% trans "List of Checkins" %}</a>
</li>
<li class="divider-vertical"></li>
{% if not checkin.is_accepted %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<strong>{% trans "Actions" %}:</strong>
<b class="caret"></b>
</a>
{% if not checkin.is_accepted or checkin.can_be_send_to_checkout %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<strong>{% trans "Actions" %}:</strong>
<b class="caret"></b>
</a>

<ul class="dropdown-menu">
{% if checkin.can_be_rejected %}
<li>
<a href="#reject_modal" data-toggle="modal">
<i class='icon-eye-close'></i> <span class="label label-important">{% trans "Reject" %}</span>
</a>
</li>
{% endif %}
<ul class="dropdown-menu">

{# REJECT #}
{% if checkin.can_be_rejected and user.get_profile.can_reject_checkins %}
<li>
<a href="#reject_modal" data-toggle="modal">
<i class='icon-eye-close'></i> <span class="label label-important">{% trans "Reject" %}</span>
</a>
</li>
{% endif %}

{# SEND TO PENDING #}
{% if checkin.can_be_send_to_pending and user.get_profile.can_send_checkins_to_pending %}
<li>
<a href="{% url checkin_send_to_pending checkin.pk %}">
<i class='icon-time'></i> {% trans "Send to" %}: <strong>{% trans "Pending" %}</strong>
</a>
</li>
{% endif %}

{% if checkin.can_be_send_to_pending %}
<li>
<a href="{% url checkin_send_to_pending checkin.pk %}">
<i class='icon-time'></i> {% trans "Send to" %}: <strong>{% trans "Pending" %}</strong>
</a>
</li>
{% endif %}

{% if checkin.can_be_send_to_review %}
{# SEND TO REVIEW #}
<li>
<a href="{% url checkin_send_to_review checkin.pk %}">
<i class='icon-eye-open'></i> {% trans "Send to" %}: <strong>{% trans "Review" %}</strong>
</a>
</li>
{% endif %}
{% if checkin.can_be_send_to_review and user.get_profile.can_send_checkins_to_review %}
<li>
<a href="{% url checkin_send_to_review checkin.pk %}">
<i class='icon-eye-open'></i> {% trans "Send to" %}: <strong>{% trans "Review" %}</strong>
</a>
</li>
{% endif %}

{% if checkin.can_be_reviewed and not checkin.is_reviewed %}
{# DO REVIEW #}
<li>
<a href="{% url checkin_review checkin.pk %}">
<i class='icon-ok-circle'></i> <span class="label label-success">{% trans "Review &amp; Accept!" %}</span>
</a>
</li>
{% elif checkin.can_be_accepted %}
{# DO REVIEW #}
<li>
<a href="{% url checkin_accept checkin.pk %}">
<i class='icon-ok-circle'></i> <span class="label label-success">{% trans "Accept!" %}</span>
</a>
</li>
{% endif %}
</ul>
</li>
<li class="divider-vertical"></li>
{% endif %}
{% if checkin.can_be_reviewed %}

{# LEVEL 1 #}
{% if user.get_profile.can_review_l1_checkins and not checkin.is_level1_reviewed %}
<li>
<a href="{% url checkin_review checkin.pk 1 %}">
<i class='icon-ok-circle'></i> <span class="label label-success">{% trans "Review" %}</span>
</a>
</li>
{% endif %}

{# LEVEL 2 #}
{% if user.get_profile.can_review_l2_checkins and not checkin.is_level2_reviewed %}
<li>
<a href="{% url checkin_review checkin.pk 2 %}">
<i class='icon-ok-circle'></i> <span class="label label-success">{% trans "SciELO Review" %}</span>
</a>
</li>
{% endif %}
{% endif %}

{% if checkin.can_be_accepted and user.get_profile.can_accept_checkins %}
{# DO ACCEPT #}
<li>
<a href="{% url checkin_accept checkin.pk %}">
<i class='icon-ok-circle'></i> <span class="label label-success">{% trans "Accept" %}</span>
</a>
</li>
{% elif checkin.can_be_send_to_checkout and user.get_profile.can_send_checkins_to_checkout %}
{# DO CHECKOUT #}
<li>
<a href="{% url checkin_send_to_checkout checkin.pk %}">
<i class='icon-ok-circle'></i> <span class="label label-success">{% trans "Checkout!" %}</span>
</a>
</li>
{% endif %}

{# THERE ARE NO ACTIONS AVAILABLE #}
{% if not have_actions_to_do %}
<li class="disabled force-no-margin"><a href="#">{% trans "There are no actions available" %}</a></li>
{% endif %}
</ul>
</li>
<li class="divider-vertical"></li>
{% endif %}
<li>
<a href="{% url checkin_history checkin.pk %}" role="menuitem">
<i class="icon-time"></i> {% trans "History" %}
Expand Down Expand Up @@ -119,7 +149,7 @@ <h3>{% trans 'Notices' %}:</h3>
{% trans "System logs" %}
</a>
</li>
<li>
<li class="longer-tab">
<a href="#annotations" data-toggle="tab">
{% trans "Style Checking" %}
{% if not xml_data.can_be_analyzed.0 %}
Expand Down Expand Up @@ -215,7 +245,7 @@ <h3>{% trans "Related tickets" %}:</h3>
{% trans "Closed" %} <span class="badge">{{ closed_tickets|length }}</span>
</a>
</li>
{% if perms.ticket.can_add %}
{% if perms.articletrack.add_ticket %}
<li class='pull-right'>
<a class='tab_add_ticket btn btn-mini btn-success' href="{% url ticket_add checkin.pk %}">
{% trans "Create a ticket" %}
Expand Down
Loading

0 comments on commit 5800e7a

Please sign in to comment.