Added actual Message of the Day text (and functionality).

This commit is contained in:
Gregory Koberger 2011-01-21 11:47:04 -08:00
Родитель 5024ede67a
Коммит d27dc7f007
6 изменённых файлов: 77 добавлений и 12 удалений

Просмотреть файл

@ -50,7 +50,7 @@
{% endblock %}
{% block js %}
{{ js('zamboni/devhub') }}
{{ js('zamboni/editors') }}
{% endblock %}
{% block outer_content %}{% include "messages.html" %}{% endblock %}

Просмотреть файл

@ -1,18 +1,19 @@
{% extends "editors/base.html" %}
{% block content %}
<div id="editor-stats">
<div id="editors_main">
{# TODO(gkoberger): Fill in the MOTD below #}
<div class="featured daily-message">
<div class="featured-inner">
<h2>{{ _('Announcement') }}</h2>
<p>This is where the Message of the Day will eventually go!</p>
<p>{{ motd }}</p>
<a class="close" href="#" title="{{ _('Dismiss this announcement') }}">x</a>
</div>
</div>
<div class="featured" id="editors_stats">
<div class="featured" id="editors-stats">
<div class="featured-inner">
<div class="listing-header">
<div class="editor-stats-title"><span>{{ _('Total Reviews') }}</span></div>

Просмотреть файл

@ -12,7 +12,7 @@ from editors.helpers import ViewEditorQueueTable
from amo.utils import paginate
from amo.urlresolvers import reverse
from files.models import Approval
from zadmin.models import get_config
def editor_required(func):
"""Requires the user to be logged in as an editor or admin."""
@ -29,7 +29,8 @@ def editor_required(func):
@editor_required
def home(request):
data = {'reviews_total': Approval.total_reviews(),
'reviews_monthly': Approval.monthly_reviews()}
'reviews_monthly': Approval.monthly_reviews(),
'motd': get_config('editors_review_motd')}
return jingo.render(request, 'editors/home.html', data)

Просмотреть файл

@ -129,23 +129,23 @@ ul.tabnav a:hover {
background-color: #ffffff;
border-color: #2E5186;
padding-bottom: 9px;
=======
}
#editor-stats .listing .results-inner {
#editors_main .listing .results-inner {
padding: 0 0.5em;
}
#editor-stats .listing time {
#editors_main .listing time {
color: #aaa;
font-style: italic;
}
#editor-stats .listing .row {
#editors_main .listing .row {
padding: 0.5em;
border-top: 1px dotted #ADD0DC;
}
#editor-stats .listing .row:first-child {
#editors_main .listing .row:first-child {
border-top-width: 0px;
}
@ -196,14 +196,45 @@ ul.tabnav a:hover {
font-style: italic;
}
#editors_stats .listing-header {
#editors-stats .listing-header {
line-height: 1.8em;
}
.daily-message {
position: relative;
}
.daily-message div {
padding: 15px;
}
.daily-message .close {
background-color: #DDDDDD;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
color: #FFFFFF;
font-weight: bold;
height: 15px;
line-height: 12px;
position: absolute;
right: 5px;
text-align: center;
top: 5px;
width: 15px;
text-decoration: none;
display: none;
}
.daily-message .close:hover {
background-color: #CCC;
text-decoration: none;
}
.daily-message p {
margin: 0;
}
.daily-message h2 {
font-size: 1em;
font-weight: bold;

Просмотреть файл

@ -0,0 +1,29 @@
$(function() {
// Main page
if($('#editors_main').length) {
initEditorsMain();
}
});
function initEditorsMain() {
var $motd = $('#editors_main .daily-message');
try {
if('localStorage' in window && window['localStorage'] !== null) {
if(window.localStorage['motd_closed'] == $('p', $motd).text()) {
$motd.hide();
}
$motd.find('.close').click(close_motd);
$motd.find('.close').show();
}
} catch(e){}
function close_motd(e) {
e.stopPropagation();
try {
if('localStorage' in window && window['localStorage'] !== null) {
window.localStorage['motd_closed'] = $('#editors_main .daily-message p').text();
}
$motd.slideUp();
} catch(e){}
}
}

Просмотреть файл

@ -434,6 +434,9 @@ MINIFY_BUNDLES = {
'js/zamboni/truncation.js',
'js/zamboni/devhub.js',
),
'zamboni/editors': (
'js/zamboni/editors.js',
),
}
}