Skip to content

Commit

Permalink
Merge pull request #1419 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 authored Sep 14, 2017
2 parents 7a7fe7d + 51ac87c commit a0e4b95
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
9 changes: 9 additions & 0 deletions scielomanager/journalmanager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,15 @@ class Meta:
# --------------------
# Callbacks de signals
# --------------------
@receiver(post_save, sender=Membership)
def journal_update_date(sender, instance, created, **kwargs):
""" Update journal.update_date when journal status is changed.
"""

instance.journal.updated = datetime.datetime.now()
instance.journal.save()


@receiver(post_save, sender=User)
def create_profile(sender, instance, created, **kwargs):
""" Create a matching profile whenever a user object is created.
Expand Down
16 changes: 11 additions & 5 deletions scielomanager/scielomanager/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@
# Third-party URLS
DOCUMENTATION_BASE_URL = r'http://docs.scielo.org/projects/scielo-manager/en/latest'

AVAILABLE_IN_TEMPLATES = {
'docs_url': DOCUMENTATION_BASE_URL,
}

# URL prefix for admin static files -- CSS, JavaScript and images.
# Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/", "/static/admin/".
Expand Down Expand Up @@ -353,9 +349,11 @@
# Checkin expiration time span (in days)
CHECKIN_EXPIRATION_TIME_SPAN = 7 # days

# Liga e desliga de funcionalidades da app ``validator``
VALIDATOR_ENABLE_HTML_PREVIEWER = True

# ## END App customization settings
#################################################################

# Local deployment settings: there *must* be an unversioned
# 'scielomanager.conf' file in /etc/scieloapps/.
# See sample file at settings_local-SAMPLE.include.
Expand All @@ -378,3 +376,11 @@
# StyleChecker deve ser notficado do Deprecation Warning.
# A versão deve respeitar o formato do atributo @specific-use: 'sps-1.1' ou 'sps-1.2'.
PACKTOOLS_DEPRECATION_WARNING_VERSION = 'sps-1.1'

# Todas as chaves do dicionário abaixo serão disponibilizadas nos contextos de
# todos os templates do projeto.
AVAILABLE_IN_TEMPLATES = {
'docs_url': DOCUMENTATION_BASE_URL,
'enable_html_previewer': VALIDATOR_ENABLE_HTML_PREVIEWER,
}

2 changes: 2 additions & 0 deletions scielomanager/scielomanager/templates/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ <h4>{% trans "Tools" %}</h4>
<li>
<a href="{% url validator.packtools.stylechecker %}">{% trans "Style Checker" %}</a>
</li>
{% if enable_html_previewer %}
<li>
<a href="{% url validator.packtools.preview_html %}">{% trans "HTML Previewer" %}</a>
</li>
{% endif %}
</ul>
</div>
<div class="span2">
Expand Down
10 changes: 8 additions & 2 deletions scielomanager/validator/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# -*- encoding: utf-8 -*-
from django.conf.urls.defaults import *
from django.conf import settings

from . import views

urlpatterns = patterns(
'',
url(r'^stylechecker/$', views.packtools_home, name="validator.packtools.stylechecker"),
url(r'^preview/html/$', views.packtools_preview_html, name="validator.packtools.preview_html"),
)
)

if settings.VALIDATOR_ENABLE_HTML_PREVIEWER:
urlpatterns += (
url(r'^preview/html/$', views.packtools_preview_html, name="validator.packtools.preview_html"),
)

0 comments on commit a0e4b95

Please sign in to comment.