Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix bug 761923 - edit & translate links on fallback pages #259

Merged
merged 1 commit into from

2 participants

@groovecoder
Owner

No description provided.

@groovecoder
Owner

Waiting for docs team to review the link implementation so please don't merge yet. But still would like code review.

@lmorchard

r+, Works for me!

The "Translate" button I wanted to see is there. And, though I'm meh on the "Edit English" button, I'm not actively opposed as long as "Translate" is there too.

One oddity I saw in the styling was that if there's both scripting messages and the "Our volunteers haven't translated..." message, the top of the second box gets cut off. I think there might be a negative margin somewhere

@lmorchard

Hmm, the "oddity" I mentioned must have been cached CSS or something, because it's gone away. Nothing to see here

@groovecoder groovecoder merged commit 699fa04 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 22 additions and 21 deletions.
  1. +21 −16 apps/wiki/templates/wiki/document.html
  2. +1 −5 media/css/wiki.css
View
37 apps/wiki/templates/wiki/document.html
@@ -7,7 +7,12 @@
{# If there is a parent doc, use it for translating. #}
{% set translate_url = url('wiki.select_locale', document_path=document.parent.full_path) %}
{% else %}
- {% set translate_url = url('wiki.select_locale', document_path=document.full_path) %}
+ {% set translate_url = url('wiki.select_locale', document_path=document.full_path, locale=document.locale) %}
+{% endif %}
+{% if fallback_reason == 'no_translation' %}
+ {% set help_link = url('wiki.translate', document_path=document.full_path, locale=document.locale)|urlparams(tolocale=request.locale) %}
+{% elif fallback_reason == 'translation_not_approved' %}
+ {% set help_link = url('wiki.translate', document_path=document.parent.full_path, locale=document.parent.locale)|urlparams(tolocale=request.locale) %}
{% endif %}
{% block extrahead %}
@@ -77,7 +82,13 @@ <h1 class="page-title">{{ document.title }}</h1>
<li class="page-watch"><a href="{{ url('wiki.document_watch', document.full_path) }}">{{_('Watch')}}</a></li>
{% endif %}
{% if document.allows_revision_by(request.user) %}
- <li class="page-edit"><a href="{{ url('wiki.edit_document', document.full_path) }}">{{_('Edit')}}</a></li>
+ {% if fallback_reason %}
+ {% set edit_label = _('Edit English') %}
+ <li class="page-edit"><a href="{{ help_link }}">{{ _('Translate') }}</a></li>
+ {% else %}
+ {% set edit_label = _('Edit') %}
+ {% endif %}
+ <li class="page-edit"><a href="{{ url('wiki.edit_document', document.full_path, locale=document.locale) }}">{{ edit_label }}</a></li>
{% endif %}
</ul>
{% if kumascript_errors %}
@@ -119,6 +130,14 @@ <h1 class="page-title">{{ document.title }}</h1>
{% endif %}
{% endfor %}
{% endif %}
+ {% if fallback_reason %}
+ <div id="doc-pending-fallback" class="warning">
+ {% trans help_link=help_link, locale=settings.LOCALES[request.locale].native %}
+ Our volunteers haven't translated this article into {{ locale }} yet.
+ <a href="{{ help_link }}">Join us and help get the job done!</a>
+ {% endtrans %}
+ </div>
+ {% endif %}
<div id="wikiArticle" class="page-content boxed">
{% if toc_html %}
@@ -142,22 +161,8 @@ <h1 class="page-title">{{ document.title }}</h1>
{{ document_html|safe }}
{% endif %}
{% elif fallback_reason == 'no_translation' %}
- <div id="doc-pending-fallback" class="warning-box">
- {% trans help_link=url('wiki.document', 'localize-firefox-help'),
- locale=settings.LOCALES[request.locale].native %}
- Our volunteers haven't translated this article into {{ locale }} yet.
- <a href="{{ help_link }}">Join us and help get the job done!</a>
- {% endtrans %}
- </div>
{{ document_html|safe }}
{% elif fallback_reason == 'translation_not_approved' %}
- <div id="doc-pending-fallback" class="warning-box">
- {# L10n: This is shown for existing, never-approved translations #}
- {% trans %}
- Our volunteers are working on translating this article.
- Until it's ready, maybe the English version can be of some help.
- {% endtrans %}
- </div>
{{ document.parent.html|safe }}
{% else %}
{{ _("This article doesn't have approved content yet.") }}
View
6 media/css/wiki.css
@@ -245,10 +245,6 @@ article #toc ul li {
line-height: 1.5em;
}
-#doc-pending-fallback {
- margin: -1em 0 2em;
-}
-
/* Blocks in the content that need margins. */
#doc-content p,
#doc-content pre,
@@ -345,7 +341,7 @@ article #toc ul li {
padding: .5em 1em;
}
-#doc-content .warning {
+#doc-content .warning, #page-content .warning {
background: #FFF9DB url(../img/wiki/bkg.warning.png) repeat-y left top;
color: #666458;
padding: .5em 1em;
Something went wrong with that request. Please try again.