Skip to content

Commit

Permalink
Bug 729657 - wiki translate page
Browse files Browse the repository at this point in the history
  • Loading branch information
craigcook committed Apr 16, 2012
1 parent b74abcc commit 52b0d4e
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 119 deletions.
8 changes: 8 additions & 0 deletions apps/wiki/templates/wiki/ckeditor_config.js
Expand Up @@ -45,5 +45,13 @@ CKEDITOR.editorConfig = function(config) {
config.startupFocus = true; config.startupFocus = true;
config.toolbar = 'MDN'; config.toolbar = 'MDN';


config.autoGrow_minHeight = 600;
config.contentsCss = '/media/css/wiki-edcontent.css';
config.toolbarCanCollapse = false;
config.resize_enabled = false;
config.dialog_backgroundCoverColor = 'black';
config.dialog_backgroundCoverOpacity = 0.3;
config.docType = '<!DOCTYPE html>';

{{ editor_config|safe }} {{ editor_config|safe }}
}; };
158 changes: 84 additions & 74 deletions apps/wiki/templates/wiki/translate.html
Expand Up @@ -15,36 +15,41 @@
<section id="content"> <section id="content">
<div class="wrap"> <div class="wrap">
<div id="content-main" class="full"> <div id="content-main" class="full">
<article id="localize-document">
<h1>{{ _('Translating {title}')|f(title=parent.title) }}</h1> <div id="localize-document" class="editing">
<div class="change-locale"> <header id="article-head">
<p> <div class="title">
<h1>{{ _('Translating <em>{title}</em>')|fe(title=parent.title) }}</h1>
</div>

<div class="change-locale">
{{ _('Translating article to {locale}' )|f(locale=language) }}. {{ _('Translating article to {locale}' )|f(locale=language) }}.
<a id="change-locale-link" class="change" href="#change-locale">{{ _('Change') }}</a> <a id="change-locale-link" class="toggle" href="#change-locale">{{ _('Change') }}</a>
</p> <ul id="change-locale" class="sub-menu" data-target="#change-locale-link" data-modal="true" data-close-on-out-click="true">
{% if not based_on.reviewed or not based_on.is_approved %} {% for lcl in settings.LANGUAGE_CHOICES %}
<div class="warning-box"> {% if lcl[0] not in [settings.WIKI_DEFAULT_LANGUAGE, locale] %}
{{ _('You are translating an unreviewed or rejected English document.') }} <li><a href="{{ url('wiki.translate', locale=lcl[0], document_path=document.parent.full_path) }}" title="{{ lcl[1] }}">{{ lcl[0] }}</a></li>
</div> {% endif %}
{% endif %} {% endfor %}
<section id="change-locale" class="kbox" title="{{ _('Choose a locale:') }}" data-target="#change-locale-link" data-modal="true" data-close-on-out-click="true">
<ul>
{% for lcl in settings.LANGUAGE_CHOICES %}
{% if lcl[0] not in [settings.WIKI_DEFAULT_LANGUAGE, locale] %}
<li><a href="{{ url('wiki.translate', locale=lcl[0], document_path=document.parent.full_path) }}" title="{{ lcl[1] }}">{{ lcl[0] }}</a></li>
{% endif %}
{% endfor %}
</ul> </ul>
</section> </div>
</div>
{% include 'wiki/includes/page_buttons.html' %}

{% if not based_on.reviewed or not based_on.is_approved %}
<p class="trans-note">{{ _('You are translating an unreviewed or rejected English document.') }}</p>
{% endif %}
</header>

{% if not document %} {% if not document %}
{# If this is the first translation to this locale, we use 1 big form. #} {# If this is the first translation to this locale, we use 1 big form. #}
<form action="" method="post" data-json-url="{{ url('wiki.json') }}"> <form action="" method="post" data-json-url="{{ url('wiki.json') }}">
{{ csrf() }} {{ csrf() }}
<input type="hidden" name="form" value="both" /> <input type="hidden" name="form" value="both" />
{% endif %} {% endif %}

{% if document_form %} {% if document_form %}
<details class="h2"{% if disclose_description %} open="open"{% endif %}> <details id="trans-description"{% if disclose_description %} open="open"{% endif %}>
<summary>{{ _('Translate Description') }}</summary> <summary>{{ _('Translate Description') }}</summary>
{{ errorlist(document_form) }} {{ errorlist(document_form) }}
{% if document %} {% if document %}
Expand All @@ -53,39 +58,36 @@ <h1>{{ _('Translating {title}')|f(title=parent.title) }}</h1>
{{ csrf() }} {{ csrf() }}
<input type="hidden" name="form" value="doc" /> <input type="hidden" name="form" value="doc" />
{% endif %} {% endif %}
<ul class="description"> <ul class="description">
<li> <li>
<div class="approved"> <dl class="approved">
<h3>{{ _('Title:') }}</h3> <dt>{{ _('Title:') }}</dt>
<div class="val">{{ parent.title }}</div> <dd>{{ parent.title }}</dd>
</div> </dl>
<div class="localized"> <dl class="localized">
<h3><label for="{{ document_form.title.auto_id }}" title="{{ document_form.title.help_text }}">{{ _('Title in {locale}:')|f(locale=language) }}</label></h3> <dt><label for="{{ document_form.title.auto_id }}" title="{{ document_form.title.help_text }}">{{ _('Title in {locale}:')|f(locale=language) }}</label></dt>
{{ document_form.title|safe }} <dd>{{ document_form.title|safe }}</dd>
</div> </dl>
</li> </li>
<li> <li>
<div class="approved"> <dl class="approved">
<h3>{{ _('Slug:') }}</h3> <dt>{{ _('Slug:') }}</dt>
<div class="val">{{ parent.slug }}</div> <dd>{{ parent.slug }}</dd>
</div> </dl>
<div class="localized"> <dl class="localized">
<h3><label for="{{ document_form.slug.auto_id }}" title="{{ document_form.slug.help_text }}">{{ _('Slug in {locale}:')|f(locale=language) }}</label></h3> <dt><label for="{{ document_form.slug.auto_id }}" title="{{ document_form.slug.help_text }}">{{ _('Slug in {locale}:')|f(locale=language) }}</label></dt>
{{ document_form.slug|safe }} <dd>{{ document_form.slug|safe }}</dd>
</div> </dl>
</li> </li>
</ul> </ul>
{% if document %} {% if document %}
<div class="submit">
<input type="submit" value="{{ _('Save') }}">
</div>
</form> </form>
{% endif %} {% endif %}
</details> </details>
{% endif %} {% endif %}


{% if revision_form %} {% if revision_form %}
<details class="h2" open="open"> <details id="trans-content" open="open">
<summary>{{ _('Translate Content') }}</summary> <summary>{{ _('Translate Content') }}</summary>
{{ errorlist(revision_form) }} {{ errorlist(revision_form) }}
{% if document %} {% if document %}
Expand All @@ -94,27 +96,28 @@ <h3><label for="{{ document_form.slug.auto_id }}" title="{{ document_form.slug.h
{{ csrf() }} {{ csrf() }}
<input type="hidden" name="form" value="rev" /> <input type="hidden" name="form" value="rev" />
{% endif %} {% endif %}

{# TODO: restore keywords and summary when we restore search app {# TODO: restore keywords and summary when we restore search app
<ul class="description"> <ul class="description">
<li> <li>
<div class="approved"> <dl class="approved">
<h3>{{ _('Keywords:') }}</h3> <dt>{{ _('Keywords:') }}</dt>
<div class="val">{{ based_on.keywords }}</div> <dd>{{ based_on.keywords }}</dd>
</div> </dl>
<div class="localized"> <dl class="localized">
<h3><label for="{{ revision_form.keywords.auto_id }}" title="{{ revision_form.keywords.help_text }}">{{ _('Keywords in {locale}:')|f(locale=language) }}</label></h3> <dt><label for="{{ revision_form.keywords.auto_id }}" title="{{ revision_form.keywords.help_text }}">{{ _('Keywords in {locale}:')|f(locale=language) }}</label></dt>
{{ revision_form.keywords|safe }} <dd>{{ revision_form.keywords|safe }}</dd>
</div> </dl>
</li> </li>
<li> <li>
<div class="approved"> <dl class="approved">
<h3>{{ _('Search result summary:') }}</h3> <dt>{{ _('Search result summary:') }}</dt>
<div class="val">{{ based_on.summary }}</div> <dd>{{ based_on.summary }}</dd>
</div> </dl>
<div class="localized"> <dl class="localized">
<h3><label for="{{ revision_form.summary.auto_id }}" title="{{ revision_form.summary.help_text }}">{{ _('Search result summary in {locale}:')|f(locale=language) }}</label></h3> <dt><label for="{{ revision_form.summary.auto_id }}" title="{{ revision_form.summary.help_text }}">{{ _('Search result summary in {locale}:')|f(locale=language) }}</label></dt>
{{ revision_form.summary|safe }} <dd>{{ revision_form.summary|safe }}</dd>
</div> </dl>
</li> </li>
</ul> </ul>
#} #}
Expand All @@ -125,21 +128,28 @@ <h3><label for="{{ revision_form.summary.auto_id }}" title="{{ revision_form.sum
{% include 'wiki/includes/revision_diff.html' %} {% include 'wiki/includes/revision_diff.html' %}
{# TODO: 'change revisions' link and modal selector #} {# TODO: 'change revisions' link and modal selector #}
{% else %} {% else %}
<p>{{ _('Note: There are no approved translations for this article.') }} <p class="no-trans">{{ _('Note: There are no approved translations for this article.') }}</p>
{% endif %} {% endif %}

<div id="content-fields"> <div id="content-fields">
<ul> <article class="approved">
<div class="approved"> <header>
<h3>{{ _('Approved {default_locale} version:')|f(default_locale=settings.LANGUAGES[settings.WIKI_DEFAULT_LANGUAGE.lower()]) }}</h3> <h3>{{ _('Approved {default_locale} version:')|f(default_locale=settings.LANGUAGES[settings.WIKI_DEFAULT_LANGUAGE.lower()]) }}</h3>
<textarea readonly="readonly">{{ based_on.content }}</textarea> </header>
</div> <div class="boxed">
<div class="localized"> {{ based_on.content|safe }}
<h3>{{ _('{locale} translation:')|f(locale=language) }}</h3> </div>
</article>

<article class="localized">
<header>
<h3>{{ _('{locale} translation:')|f(locale=language) }}</h3>
</header>
{{ content_editor(revision_form.content) }} {{ content_editor(revision_form.content) }}
</div> </article>
</div> </div>
{{ revision_form.hidden_fields()|join|safe }} {{ revision_form.hidden_fields()|join|safe }}
{% include 'wiki/includes/submit_revision_for_review.html' %}
{% if document %} {% if document %}
</form> </form>
{% endif %} {% endif %}
Expand All @@ -149,7 +159,7 @@ <h3>{{ _('{locale} translation:')|f(locale=language) }}</h3>
</form> </form>
{% endif %} {% endif %}
<div id="preview"></div> <div id="preview"></div>
</article> </div>
</div> </div>
</div> </div>
</section> </section>
Expand Down
22 changes: 6 additions & 16 deletions media/ckeditor/skins/kuma/editor.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 6 additions & 11 deletions media/css/mdn-screen.css
Expand Up @@ -38,8 +38,7 @@ Font sizes -
src: url('../fonts/League_Gothic-webfont.eot'); /* IE9 */ src: url('../fonts/League_Gothic-webfont.eot'); /* IE9 */
src: url('../fonts/League_Gothic-webfont.eot?') format('eot'), /* IE6-8 */ src: url('../fonts/League_Gothic-webfont.eot?') format('eot'), /* IE6-8 */
url('../fonts/League_Gothic-webfont.woff') format('woff'), /* Modern browsers */ url('../fonts/League_Gothic-webfont.woff') format('woff'), /* Modern browsers */
url('../fonts/League_Gothic-webfont.ttf') format('truetype'), /* Older Webkits */ url('../fonts/League_Gothic-webfont.ttf') format('truetype'); /* Older Webkits */
url('../fonts/League_Gothic-webfont.svg#webfont') format('svg'); /* Opera */
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
Expand All @@ -49,8 +48,7 @@ Font sizes -
src: url('../fonts/BebasNeue-webfont.eot'); /* IE9 */ src: url('../fonts/BebasNeue-webfont.eot'); /* IE9 */
src: url('../fonts/BebasNeue-webfont.eot?') format('eot'), /* IE6-8 */ src: url('../fonts/BebasNeue-webfont.eot?') format('eot'), /* IE6-8 */
url('../fonts/BebasNeue-webfont.woff') format('woff'), /* Modern browsers */ url('../fonts/BebasNeue-webfont.woff') format('woff'), /* Modern browsers */
url('../fonts/BebasNeue-webfont.ttf') format('truetype'), /* Older Webkits */ url('../fonts/BebasNeue-webfont.ttf') format('truetype'); /* Older Webkits */
url('../fonts/BebasNeue-webfont.svg#webfont') format('svg'); /* Opera */
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
Expand All @@ -60,8 +58,7 @@ Font sizes -
src: url('../fonts/CartoGothicStd-Bold-webfont.eot'); /* IE9 */ src: url('../fonts/CartoGothicStd-Bold-webfont.eot'); /* IE9 */
src: url('../fonts/CartoGothicStd-Bold-webfont.eot?') format('eot'), /* IE6-8 */ src: url('../fonts/CartoGothicStd-Bold-webfont.eot?') format('eot'), /* IE6-8 */
url('../fonts/CartoGothicStd-Bold-webfont.woff') format('woff'), /* Modern browsers */ url('../fonts/CartoGothicStd-Bold-webfont.woff') format('woff'), /* Modern browsers */
url('../fonts/CartoGothicStd-Bold-webfont.ttf') format('truetype'), /* Older Webkits */ url('../fonts/CartoGothicStd-Bold-webfont.ttf') format('truetype'); /* Older Webkits */
url('../fonts/CartoGothicStd-Bold-webfont.svg#webfont') format('svg'); /* Opera */
font-weight: bold; font-weight: bold;
font-style: normal; font-style: normal;
} }
Expand All @@ -71,8 +68,7 @@ Font sizes -
src: url('../fonts/ABTSmilk.eot'); /* IE9 */ src: url('../fonts/ABTSmilk.eot'); /* IE9 */
src: url('../fonts/ABTSmilk.eot?') format('eot'), /* IE6-8 */ src: url('../fonts/ABTSmilk.eot?') format('eot'), /* IE6-8 */
url('../fonts/ABTSmilk.woff') format('woff'), /* Modern browsers */ url('../fonts/ABTSmilk.woff') format('woff'), /* Modern browsers */
url('../fonts/ABTSmilk.ttf') format('truetype'), /* Older Webkits */ url('../fonts/ABTSmilk.ttf') format('truetype'); /* Older Webkits */
url('../fonts/ABTSmilk.svg#webfont') format('svg'); /* Opera */
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
Expand All @@ -82,14 +78,13 @@ Font sizes -
src: url('../fonts/MuseoSans_500-webfont.eot'); /* IE9 */ src: url('../fonts/MuseoSans_500-webfont.eot'); /* IE9 */
src: url('../fonts/MuseoSans_500-webfont.eot?') format('eot'), /* IE6-8 */ src: url('../fonts/MuseoSans_500-webfont.eot?') format('eot'), /* IE6-8 */
url('../fonts/MuseoSans_500-webfont.woff') format('woff'), /* Modern browsers */ url('../fonts/MuseoSans_500-webfont.woff') format('woff'), /* Modern browsers */
url('../fonts/MuseoSans_500-webfont.ttf') format('truetype'), /* Older Webkits */ url('../fonts/MuseoSans_500-webfont.ttf') format('truetype'); /* Older Webkits */
url('../fonts/MuseoSans_500-webfont.svg#webfont') format('svg'); /* Opera */
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }


/* @Reset *********/ /* @Reset *********/
header, hgroup, nav, section, article, aside, footer, figure { display: block; } header, hgroup, nav, section, article, aside, footer, figure, details, summary { display: block; }
html, body, form, fieldset, legend, figure, html, body, form, fieldset, legend, figure,
h1, h2, h3, h4, h5, h6, dt, dd { margin: 0; padding: 0; } h1, h2, h3, h4, h5, h6, dt, dd { margin: 0; padding: 0; }
blockquote:before, blockquote:after, q:before, q:after { content: ""; } blockquote:before, blockquote:after, q:before, q:after { content: ""; }
Expand Down
21 changes: 14 additions & 7 deletions media/css/wiki-edcontent.css
Expand Up @@ -8,12 +8,19 @@ a { text-decoration: none; color: #369 !important; cursor: default; }


.plain { background-color: #dbdbdb; border: 1px dotted #bbb; } .plain { background-color: #dbdbdb; border: 1px dotted #bbb; }


h1, .header_1 { font-size: 1.857em; } h1, .header_1 { font-size: 1.857em; margin: 0 0 .8em; }
h2, .header_2 { font-size: 1.571em; } h2, .header_2 { font-size: 1.428em; margin: 0 0 .8em; }
h3, .header_3 { font-size: 1.396em; } h3, .header_3 { font-size: 1.142em; margin: 0 0 .8em; }
h4, .header_4 { font-size: 1.142em; } h4, .header_4,
h5, .header_5 { font-size: 1em; } h5, .header_5,
h6, .header_6 { font-size: 1em; } h6, .header_6 { font-size: 1em; margin: 0 0 .8em; }

/*** @Headings *********/
h1, h2, h3, h4, h5, h6 { margin: 0 0 .8em; }
h1, .page-title { font-size: 1.857em; }
h2 { font-size: 1.428em; }
h3 { font-size: 1.142em; }
h4, h5, h6 { font-size: 1em; }


.urlexpansion { display: none; } .urlexpansion { display: none; }
a.imagelink, a[rel~="internal"] { background: none; padding-right: 0; } a.imagelink, a[rel~="internal"] { background: none; padding-right: 0; }
Expand Down Expand Up @@ -59,7 +66,7 @@ a.labs:hover, a.labs:focus, a.labs:active { color: #bcbcbc; }
p.footnote { font-size: 90%; font-style: italic; color: #716d65; } p.footnote { font-size: 90%; font-style: italic; color: #716d65; }
div.callout-box { float: right; margin: 0 0 .5em 15px; border: 1px solid #eee; padding: 10px; width: 200px; background: #fafafa; text-align: center; } div.callout-box { float: right; margin: 0 0 .5em 15px; border: 1px solid #eee; padding: 10px; width: 200px; background: #fafafa; text-align: center; }
div.note { margin-bottom: 1.286em; border: solid #dddaaa; border-width: 1px 0; padding: .75em 15px; background: #faf9e2; color: #5d5636; } div.note { margin-bottom: 1.286em; border: solid #dddaaa; border-width: 1px 0; padding: .75em 15px; background: #faf9e2; color: #5d5636; }
div.tip { margin-bottom: 1.286em; border: 1px solid #e1f5f0; border-width: 1px 0; padding: .75em 15px; color: #6d675f; } div.tip { margin-bottom: 1.286em; border: 1px solid #e1f5f0; border-width: 1px 0; padding: .75em 15px; background: transparent url("img/tip-bg.png") repeat-x; color: #6d675f; }
div.note p, div.tip p { margin-bottom: .75em; } div.note p, div.tip p { margin-bottom: .75em; }


/*** @Legacy classes - Leftovers from the old wiki. These can be phased out. *********/ /*** @Legacy classes - Leftovers from the old wiki. These can be phased out. *********/
Expand Down

0 comments on commit 52b0d4e

Please sign in to comment.