Permalink
Browse files

Merge branch 'feature/non-image-logo' into develop

  • Loading branch information...
peterbe committed Aug 16, 2012
2 parents a8e6e1b + e7514de commit ad9c99d43465e6c953af6859a6a10c54f7c0ad00
View
@@ -21,7 +21,8 @@ pto/settings/local*
TODO
cover/
sample_data.py
-build/
-collected/
-static/
+/build/
+puppet/manifests/build/
+/collected/
+/static/
.vagrant
@@ -1,6 +1,6 @@
#date_discriminator {
/*width: 900px;*/
- margin: 0 0 0 180px;
+ margin: 20px 0 0 180px;
}
#date_discriminator_panel {
float: left;
@@ -32,7 +32,7 @@ <h2>People you're following (or not)</h2>
<h3>Add more people to follow:</h3>
<input name="search" id="id_search" size="50" placeholder="Start typing name or email of a person you want to follow">
<p class="tip-note"><strong>Note!</strong> If you can't find the person you're looking for,
-maybe that person hasn't used the PTO app before and can therefore not be found.</p>
+maybe that person hasn't used the Vacation tool before, and can therefore not be found.</p>
</form>
<div id="observed">
@@ -65,7 +65,7 @@
</div>
<div id="pto_taken" class="extra-info">
-<h2>How much PTO have I taken?</h2>
+<h2>How much vacation have I taken?</h2>
<p>You have taken
<strong>{{ taken }}</strong>
@@ -115,7 +115,7 @@ <h2>How much PTO have I taken?</h2>
WHILST WE DECIDE TO KEEP IT AT ALL
<div id="rightnow" class="extra-info">
-<h2>Who's on PTO right now?</h2>
+<h2>Who's on Vacation right now?</h2>
<dl>
{% for user in right_now_users %}
@@ -18,7 +18,7 @@
<form action="." method="post">{{ csrf() }}
<div id="date_discriminator_panel">
- <p>Days of PTO:</p>
+ <p>Days of Vacation:</p>
<h5 id="date_discriminator_hours">{{ total_days }}</h5>
</div>
<div id="date_discriminator">
@@ -39,7 +39,7 @@
<table id="filters" border="0">
<tr>
<td>
- PTO between:
+ Vacation between:
</td>
<td>
{{ form.date_from|safe }}
@@ -5,7 +5,7 @@
-->
#}
-{{ user.first_name }} {{ user.last_name }} has submitted {{ entry.total_days }} days of PTO starting {{ start_date }}{% if not entry.details %}.{% else %} with the details:
+{{ user.first_name }} {{ user.last_name }} has submitted {{ entry.total_days }} days of vacation starting {{ start_date }}{% if not entry.details %}.{% else %} with the details:
{{ line_indent(entry.details) }}{% endif %}
--
@@ -257,7 +257,7 @@ def test_notify_basics(self):
ok_(entry.details in email.body)
ok_(entry.start.strftime(settings.DEFAULT_DATE_FORMAT)
in email.body)
- ok_('submitted 1.5 days of PTO' in email.body)
+ ok_('submitted 1.5 days of vacation' in email.body)
eq_(email.cc, [peter.email])
ok_('--\n%s' % settings.EMAIL_SIGNATURE in email.body)
View
@@ -398,7 +398,7 @@ def is_blacklisted(user):
@login_required
def notify(request):
data = {}
- data['page_title'] = "Notify about new PTO"
+ data['page_title'] = "Notify about new vacation"
if request.method == 'POST':
form = forms.AddForm(request.user, data=request.POST)
if form.is_valid():
@@ -493,7 +493,7 @@ def hours(request, pk):
assert success
#messages.info(request,
- # '%s hours of PTO logged.' % total_hours
+ # '%s hours of vacation logged.' % total_hours
#)
recently_created = make_entry_title(entry, request.user)
cache_key = 'recently_created_%s' % request.user.pk
@@ -971,7 +971,7 @@ def calendar_vcal(request, key):
RequestSite(request).domain)
home_url = base_url + '/'
cal = vobject.iCalendar()
- cal.add('x-wr-calname').value = 'Mozilla PTO'
+ cal.add('x-wr-calname').value = 'Mozilla Vacation'
try:
user = UserKey.objects.get(key=key).user
@@ -1021,7 +1021,7 @@ def make_list_url(entry):
return _list_base_url + '?' + urlencode(data, True)
for entry in entries:
event = cal.add('vevent')
- event.add('summary').value = '%s PTO' % make_entry_title(entry, user,
+ event.add('summary').value = '%s Vacation' % make_entry_title(entry, user,
include_details=False)
event.add('dtstart').value = entry.start
event.add('dtend').value = entry.end
@@ -15,7 +15,7 @@
<link rel="apple-touch-icon-precomposed" href="{{ static('mobile/img/apple-touch-icon.png') }}">
<link rel="shortcut icon" href="{{ static('mobile/img/apple-touch-icon.png') }}">
- <title>{% block page_title %}Mozilla PTO{% endblock %}</title>
+ <title>{% block page_title %}Mozilla Vacation{% endblock %}</title>
{% compress css %}
<link rel="stylesheet" href="{{ static("css/libs/jquery.mobile-1.1.0.min.css") }}">
@@ -1 +0,0 @@
-delete me
@@ -19,9 +19,9 @@ <h1>{{ page_title }}</h1>
<ul data-role="listview">
- <li><a href="#notify">Notify of new PTO</a></li>
- <li><a href="#taken">How much PTO have I taken?</a></li>
- <li><a href="#rightnow">Who is on PTO right now?</a></li>
+ <li><a href="#notify">Notify of new Vacation</a></li>
+ <li><a href="#taken">How much vacation have I taken?</a></li>
+ <li><a href="#rightnow">Who is on vacation right now?</a></li>
<li><a href="#settings">Settings</a></li>
<li><a href="#logout">Log out</a></li>
</ul>
@@ -8,7 +8,7 @@
<div data-role="page" id="left" data-add-back-btn="true"><!-- left page -->
<div data-role="header">
- <h1>PTO left</h1>
+ <h1>Vacation left</h1>
{% include "mobile/homeicon.html" %}
</div>
@@ -8,16 +8,16 @@
<div data-role="page" id="rightnow" data-add-back-btn="true"><!-- right now page -->
<div data-role="header">
- <h1>PTO right now</h1>
+ <h1>Vacation right now</h1>
{% include "mobile/homeicon.html" %}
</div>
<div data-role="content">
- <h3>People on PTO right now:</h3>
+ <h3>People on vacation right now:</h3>
<p class="loading">figuring that out...</p>
<dl class="now"></dl>
- <h3>Upcoming PTO:</h3>
+ <h3>Upcoming Vacation:</h3>
<p class="loading">figuring that out...</p>
<dl class="upcoming"></dl>
</div>
@@ -8,7 +8,7 @@
<div data-role="page" id="taken" data-add-back-btn="true"><!-- left page -->
<div data-role="header">
- <h1>PTO taken</h1>
+ <h1>Vacation taken</h1>
{% include "mobile/homeicon.html" %}
</div>
View
@@ -2,8 +2,10 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
+import time
import datetime
from django import http
+from django.db.models import Q
from django.contrib.auth.decorators import login_required
from django.db import transaction
from django.views.decorators.http import require_POST
@@ -22,7 +24,7 @@
def home(request):
data = {}
- data['page_title'] = 'Mozilla PTO'
+ data['page_title'] = 'Mozilla Vacation'
# not fully developed so disabled for now
data['use_manifest'] = False#True#not settings.DEBUG
@@ -40,33 +42,31 @@ def appcache(request):
def right_now(request):
if not request.user.is_authenticated(): # XXX improve this
return {'error': 'Not logged in'}
- from pto.apps.dates.views import get_right_nows, get_upcomings
from pto.apps.dates.helpers import format_date
- right_nows, right_now_users = get_right_nows()
- upcomings, upcoming_users = get_upcomings(14)
+ from pto.apps.dates.views import get_observed_users, make_entry_title
now = []
- for user in right_now_users:
- descriptions = []
- for days_left, entry in right_nows[user]:
- description = 'ends in '
- if days_left == 1:
- description += '1 day '
- else:
- description += '%d days ' % days_left
- description += 'on %s' % format_date(None, entry.end, shorter=True)
- descriptions.append(description)
- name = user.get_full_name()
- if not name:
- name = user.username
- now.append({'name': name,
- 'email': user.email,
- 'descriptions': descriptions})
-
upcoming = []
- for user in upcoming_users:
- descriptions = []
- for days, entry in upcomings[user]:
+ user_ids = [request.user.pk]
+ for user_ in get_observed_users(request.user, max_depth=2):
+ user_ids.append(user_.pk)
+
+ start = today = datetime.datetime.utcnow()
+ end = start + datetime.timedelta(days=90)
+ for entry in (Entry.objects
+ .filter(user__in=user_ids,
+ total_hours__gte=0,
+ total_hours__isnull=False)
+ .select_related('user')
+ .exclude(Q(end__lt=start) | Q(start__gt=end))):
+ row = {}
+ name = entry.user.get_full_name()
+ if not name:
+ name = entry.user.username
+ row['name'] = name
+ row['email'] = entry.user.email
+ if entry.start > today.date():
+ days = (entry.start - today.date()).days
description = 'starts in '
if days == 1:
description += '1 day '
@@ -77,15 +77,18 @@ def right_now(request):
else:
description += '%d days ' % days
description += 'on %s' % format_date(None, entry.end, shorter=True)
- descriptions.append(description)
- name = user.get_full_name()
- if not name:
- name = user.username
- upcoming.append({
- 'name': name,
- 'email': user.email,
- 'descriptions': descriptions
- })
+ row['descriptions'] = [description]
+ upcoming.append(row)
+ else:
+ days_left = (entry.end - today.date()).days
+ description = 'ends in '
+ if days_left == 1:
+ description += '1 day '
+ else:
+ description += '%d days ' % days_left
+ description += 'on %s' % format_date(None, entry.end, shorter=True)
+ row['descriptions'] = [description]
+ now.append(row)
return {'now': now, 'upcoming': upcoming}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -16,17 +16,17 @@ html {
color:#ffffff;
}
h1 {
- font-size:180%;
- font-weight:bold;
margin-bottom:20px;
a {
- left:10%;
- height:47px;
- width:0;
- padding-left:275px;
- background:url(/static/css/images/pto.png) no-repeat;
- overflow:hidden;
- display:block;
+ font-size:250%;
+ font-weight:bold;
+ color: white;
+ text-shadow: 1px 1px 1px rgba(20, 20, 20, 1);
+ background:url(/static/css/images/pto-dino.png) no-repeat;
+ padding-left: 70px;
+ }
+ a:hover {
+ text-decoration: none;
}
}
h2 {
@@ -55,8 +55,11 @@ em {
width:90%;
margin:0 auto;
position:relative;
- a {
- color:#0489b7;
+ /* do this nesting to avoid styling the header */
+ section {
+ a {
+ color:#0489b7;
+ }
}
}
section {
@@ -50,7 +50,7 @@
<body>
<div id="page">
<header>
- <h1><a href="/">PTO Notification</a></h1>
+ <h1><a href="/">Vacation Notification</a></h1>
</header>
<section id="content">
@@ -9,22 +9,21 @@
<meta charset="utf-8">
<link rel="shortcut icon" href="{{ static("img/favicon.ico") }}">
<link rel="shortcut icon" type="image/x-icon" href="{{ static("img/favicon.ico") }}">
- <title>{% block page_title %}Mozilla PTO{% endblock %}</title>
+ <title>{% block page_title %}Mozilla Vacation{% endblock %}</title>
- {#<link rel="stylesheet" href="{{ static("css/style.css") }}">#}
{% compress css %}
<link type="text/less" rel="stylesheet" href="{{ static("css/style.less") }}">
<link rel="stylesheet" href="{{ static("css/libs/jquery_ui/redmond/jquery-ui-1.8.20.datepicker.autocomplete.dialog.css") }}">
{% endcompress %}
-
+
{% block extra_site_css %}
{% endblock %}
</head>
<body>
<div id="page">
<header>
- <h1><a href="/">PTO Notification</a></h1>
+ <h1><a href="/">Mozilla Vacation</a></h1>
{% if request.user.is_authenticated() %}
<nav>
<ul id="menu">
View
@@ -38,10 +38,10 @@
MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES)
MIDDLEWARE_CLASSES.remove('funfactory.middleware.LocaleURLMiddleware')
-MIDDLEWARE_CLASSES.append('mobility.middleware.DetectMobileMiddleware')
-MIDDLEWARE_CLASSES.append('mobility.middleware.XMobileMiddleware')
MIDDLEWARE_CLASSES = tuple(MIDDLEWARE_CLASSES)
MIDDLEWARE_CLASSES += (
+ 'mobility.middleware.DetectMobileMiddleware',
+ 'mobility.middleware.XMobileMiddleware',
'commonware.middleware.ScrubRequestOnException',
)
@@ -111,9 +111,9 @@
DEFAULT_DATE_FORMAT = '%A, %B %d, %Y'
WORK_DAY = 8 # hours
-EMAIL_SUBJECT = 'PTO notification from %(first_name)s %(last_name)s'
-EMAIL_SUBJECT_EDIT = 'PTO update from %(first_name)s %(last_name)s'
-EMAIL_SIGNATURE = "The Mozilla PTO"
+EMAIL_SUBJECT = 'Vacation notification from %(first_name)s %(last_name)s'
+EMAIL_SUBJECT_EDIT = 'Vacation update from %(first_name)s %(last_name)s'
+EMAIL_SIGNATURE = "Mozilla Vacation"
FALLBACK_TO_ADDRESS = 'jvandeven@mozilla.com'
# People you're not allowed to notify additionally

0 comments on commit ad9c99d

Please sign in to comment.