Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 9 commits
  • 17 files changed
  • 0 commit comments
  • 3 contributors
View
13 apps/dashboards/templates/dashboards/revisions.html
@@ -58,10 +58,11 @@
<section id="revisions-compare">
<section id="action-bar">
<ul id="page-buttons">
- <li> <a id="revert" href="#">{{ _('Revert') }}</a> </li>
- <li> <a id="view" href="#">{{ _('View Page') }}</a> </li>
- <li class="page-edit"> <a id="edit" href="#">{{ _('Edit Page') }}</a> </li>
- <li class="page-history"> <a id="history" href="#">{{ _('History') }}</a> </li>
+ <li> <a id="revert" href="#"><i class="icon-undo"></i>{{ _('Revert') }}</a> </li>
+ <li> <a id="view" href="#"><i class="icon-circle-arrow-right"></i>{{ _('View Page') }}</a> </li>
+ <li class="page-edit"><a id="edit" href="#"><i class="icon-pencil"></i>{{ _('Edit Page') }}</a> </li>
+ <li class="page-history"><a id="history" href="#"><i class="icon-book"></i>{{ _('History') }}</a> </li>
+ <li id="ban-user"></li>
</ul>
</section>
@@ -169,7 +170,8 @@
$revertLink = $('a#revert'),
$viewLink = $('a#view'),
$editLink = $('a#edit'),
- $historyLink = $('a#history');
+ $historyLink = $('a#history'),
+ $banUserItem = $('#ban-user');
if(e.target.tagName == 'A') return;
@@ -194,6 +196,7 @@
$viewLink.attr('href', data.doc_url);
$editLink.attr('href', data.edit_url);
$historyLink.attr('href', data.history_url);
+ $banUserItem.html(data.ban_link);
}
});
}
View
6 apps/dashboards/views.py
@@ -21,6 +21,9 @@
from sumo.parser import get_object_fallback
from sumo.urlresolvers import reverse
from sumo.utils import smart_int
+
+from users.helpers import ban_link
+
from wiki.events import (ApproveRevisionInLocaleEvent,
ReviewableRevisionInLocaleEvent)
from wiki.models import Document, Revision
@@ -222,7 +225,8 @@ def revisions(request):
'title': rev.title,
'richTitle': richTitle,
'date': rev.created.strftime('%b %d, %y - %H:%M'),
- 'slug': rev.document.slug
+ 'slug': rev.document.slug,
+ 'ban_link': ban_link(rev.creator, request.user)
})
result = json.dumps(revision_json)
View
3 apps/demos/helpers.py
@@ -197,8 +197,7 @@ def devderby_tag_to_date_url(tag):
if not tag:
return ''
parts = tag.split(':')
- return reverse('demos.views.devderby_by_date',
- args=(parts[-2], parts[-1]))
+ return reverse('demos_devderby_by_date', args=(parts[-2], parts[-1]))
@register.function
View
4 apps/demos/urls.py
@@ -5,7 +5,7 @@
from .feeds import SearchSubmissionsFeed
from .views import AllView
-from .views import DevDerbyTagView
+from .views import DevDerbyTagView, DevDerbyByDate
from .views import HomeView
from .views import SearchView
from .views import TagView
@@ -17,7 +17,7 @@
url(r'^devderby/?$', 'devderby_landing', name='demos_devderby_landing'),
url(r'^devderby/(?P<year>\d\d\d\d)/(?P<month>[\w]+)/?$',
- 'devderby_by_date', name='demos_devderby_by_date'),
+ DevDerbyByDate.as_view(), name='demos_devderby_by_date'),
url(r'^devderby/tag/(?P<tag>[^/]+)/?$', DevDerbyTagView.as_view(),
name='demos_devderby_tag'),
url(r'^devderby/rules/?$', 'devderby_rules', name='demos_devderby_rules'),
View
17 apps/demos/views.py
@@ -165,6 +165,7 @@ class DevDerbyTagView(ListView):
allow_empty = True
context_object_name = 'submission_list'
paginate_by = DEMOS_PAGE_SIZE
+ template_name = 'demos/listing_tag.html'
def get(self, request, *args, **kwargs):
tag = kwargs['tag']
@@ -203,6 +204,15 @@ def get_context_data(self, **kwargs):
return base_context
+class DevDerbyByDate(DevDerbyTagView):
+ def get(self, request, *args, **kwargs):
+ year = kwargs['year']
+ month = kwargs['month']
+ self.kwargs['tag'] = 'challenge:%s:%s' % (year, month)
+ return super(DevDerbyByDate, self).get(request,
+ tag=self.kwargs['tag'])
+
+
class SearchView(ListView):
allow_empty = True
context_object_name = 'submission_list'
@@ -462,10 +472,3 @@ def devderby_landing(request):
def devderby_rules(request):
"""Dev Derby rules page"""
return render(request, 'demos/devderby_rules.html', {})
-
-
-def devderby_by_date(request, year, month):
- """Friendly URL path to devderby tag.
- see: https://bugzilla.mozilla.org/show_bug.cgi?id=666460#c15
- """
- return devderby_tag(request, 'challenge:%s:%s' % (year, month))
View
5 apps/devmo/templates/devmo/profile.html
@@ -88,12 +88,13 @@ <h1 class="page-title"><span class="nickname">{{ profile.user.username }}</span>
</div>
<!-- Only shown for the user and admins -->
+ <p class="edit">
{% if profile.allows_editing_by(request.user) %}
- <p class="edit">
<a href="{{ url('authkeys.list') }}" class="button">{{_("Manage API Keys")}}</a>
<a id="edit-profile" href="{{ url('devmo.views.profile_edit', username=profile.user.username) }}" class="button">{{_("Edit Profile")}}</a>
- </p>
{% endif %}
+ {{ ban_link(profile.user, request.user) }}
+ </p>
</section>
{% if demos_page.object_list | length > 0 %}
View
11 apps/users/helpers.py
@@ -4,6 +4,8 @@
from jinja2 import escape, Markup
from jingo import register
+from tower import ugettext as _
+
from sumo.urlresolvers import reverse
@@ -35,6 +37,15 @@ def display_name(user):
return user.username
return profile.fullname if profile.fullname else user.username
+@register.function
+def ban_link(ban_user, banner_user):
+ """Returns a link to ban a user"""
+
+ link = ''
+ if ban_user.id != banner_user.id and banner_user.has_perm('users.add_userban'):
+ url = '%s?user=%s&by=%s' % (reverse('admin:users_userban_add'), ban_user.id, banner_user.id)
+ link = '<a href="%s" class="button ban-link">%s</a>' % (url, _('Ban User'))
+ return Markup(link)
@register.filter
def public_email(email):
View
9 apps/wiki/templates/wiki/ckeditor_config.js
@@ -97,7 +97,7 @@ CKEDITOR.mdn = CKEDITOR.mdn || {
CKEDITOR.timestamp = '{{ BUILD_ID_JS }}';
CKEDITOR.editorConfig = function(config) {
- config.extraPlugins = 'autogrow,definitionlist,mdn-buttons,mdn-link,mdn-syntaxhighlighter,mdn-keystrokes,mdn-attachments,mdn-image,mdn-enterkey,mdn-wrapstyle,mdn-table,tablesort,mdn-sampler,mdn-sample-finder,mdn-maximize,mdn-redirect';
+ config.extraPlugins = 'autogrow,definitionlist,mdn-buttons,mdn-link,mdn-syntaxhighlighter,mdn-keystrokes,mdn-attachments,mdn-image,mdn-enterkey,mdn-wrapstyle,mdn-table,tablesort,mdn-sampler,mdn-sample-finder,mdn-maximize,mdn-redirect,youtube';
config.removePlugins = 'link,image,tab,enterkey,table,maximize';
config.entities = false;
@@ -107,14 +107,9 @@ CKEDITOR.editorConfig = function(config) {
['Maximize'],
'/',
['h1Button', 'h2Button', 'h3Button', 'h4Button', 'h5Button', 'h6Button', 'Styles'],
- ['preButton', 'mdn-syntaxhighlighter', 'mdn-sampler', 'mdn-sample-finder', 'mdn-redirect'],
+ ['preButton', 'mdn-syntaxhighlighter', 'mdn-sampler', 'mdn-sample-finder', 'mdn-redirect', 'youtube'],
['Link', 'Unlink', 'Anchor', '-', 'Bold', 'Italic', 'Underline', 'codeButton', 'Strike', 'Superscript', 'RemoveFormat', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight']
];
-
- {% if waffle.flag('youtube_wysiwyg') %}
- config.extraPlugins += ',youtube';
- config.toolbar_MDN[5].push('youtube');
- {% endif %}
config.skin = 'kuma';
config.startupFocus = true;
View
14 apps/wiki/templates/wiki/document.html
@@ -131,18 +131,18 @@ <h1 class="page-title">{{ document.title }}</h1>
{% endif %}
</div>
<ul id="page-buttons">
- <li class="page-history"><a href="{{ url('wiki.document_revisions', document.full_path) }}">{{_('History')}}</a></li>
+ <li class="page-history"><a href="{{ url('wiki.document_revisions', document.full_path) }}"><i class="icon-book"></i>{{_('History')}}</a></li>
{% if request.user.is_authenticated() and waffle.flag('page_watch') %}
{{ document_watch(document, request.user) }}
{% endif %}
{% if document.allows_revision_by(request.user) %}
{% if fallback_reason %}
{% set edit_label = _('Edit English') %}
- <li class="page-edit"><a href="{{ help_link }}">{{ _('Translate') }}</a></li>
+ <li class="page-edit"><a href="{{ help_link }}"><i class="icon-pencil"></i>{{ _('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>
+ <li class="page-edit"><a href="{{ url('wiki.edit_document', document.full_path, locale=document.locale) }}"><i class="icon-pencil"></i>{{ edit_label }}</a></li>
{% endif %}
</ul>
@@ -232,16 +232,16 @@ <h1 class="page-title">{{ document.title }}</h1>
<ul class="page-anchors">
<li class="anchor-tags">
{% if tags|length %}
- <i class="icon-tags"></i> <a href="#page-tags">{{ _('Tags') }}</a>
+ <i class="icon-tags"></i><a href="#page-tags">{{ _('Tags') }}</a>
{% else %}
- <i class="icon-tags off"></i> <span title="{{ _('This document has no tags') }}">{{ _('Tags') }}</span>
+ <i class="icon-tags off"></i><span title="{{ _('This document has no tags') }}">{{ _('Tags') }}</span>
{% endif %}
</li>
<li class="anchor-files">
{% if attachments|length %}
- <i class="icon-paper-clip"></i> <a href="#page-file">Files</a>
+ <i class="icon-paper-clip"></i><a href="#page-file">Files</a>
{% else %}
- <i class="icon-paper-clip off"></i> <span title="{{ _('This document has no attachments') }}">{{ _('Files') }}</span>
+ <i class="icon-paper-clip off"></i><span title="{{ _('This document has no attachments') }}">{{ _('Files') }}</span>
{% endif %}
</li>
</ul>
View
3 apps/wiki/templates/wiki/includes/attachment_list.html
@@ -5,7 +5,7 @@
{% if show_attach_button and attachment_form %}
<p class="add">
- <a href="javascript:;" id="page-attachments-button">Attach Files</a>
+ <a href="javascript:;" id="page-attachments-button"><i class="icon-paper-clip"></i> Attach Files</a>
</p>
{% endif %}
@@ -53,7 +53,6 @@
<tr>
<td colspan="4">
<input type="submit" name="submit" value="Upload" />
- {# <input type="button" name="attachMore" id="page-attachments-more" value="Attach More Files" /> #}
<img src="/media/img/wiki/upload-spinner.gif" id="page-attachments-spinner" alt="Uploading" />
</td>
</tr>
View
4 apps/wiki/templates/wiki/includes/document_macros.html
@@ -4,12 +4,12 @@
{% if document.is_watched_by(user) %}
<form action="{{ url('wiki.document_unwatch', document.slug) }}" method="post">
{{ csrf() }}
- <input type="submit" class="link-btn" value="{{ _('Stop article emails') }}" />
+ <button type="submit" class="link-btn" /><i class='icon-eye-closed'></i>{{ _('Stop article emails') }}</button>
</form>
{% else %}
<form action="{{ url('wiki.document_watch', document.full_path) }}" method="post">
{{ csrf() }}
- <input type="submit" class="link-btn" value="{{ _('Email me article changes') }}" />
+ <button type="submit" class="link-btn" /><i class='icon-eye-open'></i>{{ _('Email me article changes') }}</button>
</form>
{% endif %}
</li>
View
5 apps/wiki/templates/wiki/revision.html
@@ -38,10 +38,7 @@ <h1 class="title">{{ document.title }}</h1>
<li>
<mark>{{ _('Creator:') }}</mark>
<span>{{ revision.creator }}</span>
-
- {% if user.has_perm('users.add_userban') and revision.creator != request.user %}
- (<a href="{{ url('admin:users_userban_add') }}?user={{revision.creator.id}}&by={{request.user.id}}">Ban user</a>)
- {% endif %}
+ {{ ban_link(revision.creator, request.user) }}
</li>
<li class="revision-is-reviewed">
<mark>{{ _('Is reviewed?') }}</mark>
View
6 media/css/redesign-transition.css
@@ -12,17 +12,19 @@
LONGTERM Styles
/*************************************************/
+/* Wiki page styles */
-/* Wiki page styles */
+/* Font-Awesome */
+i[class^='icon-'] { margin-right: 4px; }
/************************************************
COMPAT Styles - DELETE AFTER LAUNCH
/*************************************************/
-/* Wiki page styles */
+/* Wiki page styles */
#article-nav .anchor-tags i.off, #article-nav .anchor-files i.off { color: #333; }
#article-nav .anchor-tags i, #article-nav .anchor-files i { color: #369; }
#article-nav .anchor-tags a, #article-nav .anchor-tags span,
View
23 media/css/wiki-screen.css
@@ -270,17 +270,20 @@ a.edit-section:hover, a.edit-section:active, a.edit-section:focus { color: #333;
.previewing .article-content { margin-top: 1em; border-color: #c7dae9; }
#page-buttons { width: 50%; text-align: right; margin: 0; position: absolute; right: 4px; top: 20px; }
-#page-buttons li, #page-buttons form { display: inline; margin: 0 0 2px 10px; padding: 0; background: none; }
+#page-buttons li { margin: 0 0 2px 10px; }
+#page-buttons li, #page-buttons form { display: inline; padding: 0; background: none; }
#page-buttons a, #page-buttons button, #page-buttons input { display: inline-block; padding: 6px 8px 3px; color: #333; font: 200 15px/1 "Bebas Neue", "League Gothic", Haettenschweiler, sans-serif; text-transform: uppercase; letter-spacing: .5px; border: 0; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; -moz-box-shadow: 1px 1px 0 rgba(0,0,0,.25); -webkit-box-shadow: 1px 1px 0 rgba(0,0,0,.25); box-shadow: 1px 1px 0 rgba(0,0,0,.25); background-color: #ddd; }
#page-buttons a:hover, #page-buttons a:focus, #page-buttons a:active { text-decoration: none; }
-#page-buttons a, #page-buttons input { padding: 7px 8px 4px; }
-#page-buttons .page-edit a { padding-left: 32px; background: #a5d9f3 url("../img/wiki/button-edit.png") 0 50% repeat-x; }
+#page-buttons a, #page-buttons input, #page-buttons button { padding: 7px 8px 4px; }
+#page-buttons .page-edit a { background: #a5d9f3; }
#page-buttons .page-edit a:hover, #page-buttons .page-edit a:focus, #page-buttons .page-edit a:active { background-color: #ade4ff; text-decoration: none; }
#page-buttons .page-edit a.disabled { cursor: pointer; opacity: .75; background-color: #c8e6ed; }
-#page-buttons .page-watch input { padding-left: 35px; background: #f2d29e url("../img/wiki/button-watch.png") 0 50% repeat-x; }
-#page-buttons .page-watch input::-moz-focus-inner { border: 0; padding: 0; margin-top:-2px; margin-bottom: -2px; }
-#page-buttons .page-watch input:hover, #page-buttons .page-watch a:focus, #page-buttons .page-watch a:active { background-color: #f8daa9; text-decoration: none; }
-#page-buttons .page-watch input.disabled { cursor: pointer; opacity: .75; background-color: #f0e4c7; }
+#page-buttons .page-watch button { background: #f2d29e; }
+#page-buttons .page-watch button::-moz-focus-inner { border: 0; padding: 0; }
+#page-buttons .page-watch button:hover, #page-buttons .page-watch a:focus, #page-buttons .page-watch a:active { background-color: #f8daa9; text-decoration: none; }
+#page-buttons .page-watch button.disabled { cursor: pointer; opacity: .75; background-color: #f0e4c7; }
+
+#action-bar .ban-link { background-image: none; }
.btn-save {
background: #d7eca1;
@@ -360,10 +363,6 @@ a.edit-section:hover, a.edit-section:active, a.edit-section:focus { color: #333;
#article-nav .page-anchors li { display: inline; padding: 0; margin-right: 12px; background: none; }
#article-nav .page-anchors a, #article-nav .page-anchors span { padding-left: 16px; }
#article-nav .page-anchors span { cursor: default; }
-#article-nav .anchor-tags a { background: transparent url("../img/wiki/icons/tag-tiny.png") 0 50% no-repeat; }
-#article-nav .anchor-tags span { background: transparent url("../img/wiki/icons/tag-tiny-disabled.png") 0 50% no-repeat; }
-#article-nav .anchor-files a { background: transparent url("../img/wiki/icons/attach-tiny.png") 0 50% no-repeat; }
-#article-nav .anchor-files span { background: transparent url("../img/wiki/icons/attach-tiny-disabled.png") 0 50% no-repeat; }
/* @IRC @channels *********/
.suggestchannels { font-size: .857em; padding: 6px 6px 6px 8px; background-color: #f6f6f6; border: 1px solid #f3f3f3; margin-bottom: 5px; }
@@ -375,7 +374,7 @@ a.edit-section:hover, a.edit-section:active, a.edit-section:focus { color: #333;
.page-meta section { position: relative; overflow: hidden; background: #f5f5f1; padding: 15px 20px; margin: 0 0 20px; }
.page-meta h2 { margin: 0 20px 0 0; color: #666; font: 200 20px/1.1 "Bebas Neue", "League Gothic", Haettenschweiler, "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: .5px; }
.page-meta p.add { width: 190px; position: absolute; right: 20px; top: 12px; text-align: right; margin: 0; }
-.page-meta p.add a, #deki-page-tags-toggleview { display: inline-block; padding: 8px 10px 6px 32px; background: #a5d9f3 url("../img/wiki/button-attach.png") 0 50% repeat-x; color: #333; font: 200 15px/1 "Bebas Neue", "League Gothic", Haettenschweiler, "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: .5px; border: 0; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; -moz-box-shadow: 1px 1px 0 rgba(0,0,0,.25); -webkit-box-shadow: 1px 1px 0 rgba(0,0,0,.25); box-shadow: 1px 1px 0 rgba(0,0,0,.25); }
+.page-meta p.add a { padding: 7px 8px 4px; display: inline-block; background: #a5d9f3; color: #333; font: 200 15px/1 "Bebas Neue", "League Gothic", Haettenschweiler, "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: .5px; border: 0; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; -moz-box-shadow: 1px 1px 0 rgba(0,0,0,.25); -webkit-box-shadow: 1px 1px 0 rgba(0,0,0,.25); box-shadow: 1px 1px 0 rgba(0,0,0,.25); }
.page-meta p.add a:hover, .page-meta p.add a:focus, .page-meta p.add a:active { background-color: #ade4ff; text-decoration: none; }
.page-meta p.none { display: inline; }
.page-meta p.add a.disabled { opacity: .75; }
View
BIN media/img/wiki/button-attach.png
Deleted file not rendered
View
BIN media/img/wiki/button-edit.png
Deleted file not rendered
View
BIN media/img/wiki/button-watch.png
Deleted file not rendered

No commit comments for this range

Something went wrong with that request. Please try again.