Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #256 from ryanpitts/development
Browse files Browse the repository at this point in the history
add SRCCON flag to base template
  • Loading branch information
ryanpitts committed May 29, 2014
2 parents a11cdf8 + 11d62fe commit 47517d2
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 56 deletions.
21 changes: 17 additions & 4 deletions source/base/static/base/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.container {
width: auto;
max-width: 800px;
position: relative;
}

.content {
Expand Down Expand Up @@ -160,6 +161,15 @@ aside .byline .link-list {
background-color: #d8d8d8;
}

#promo-flag {
border: none;
float: right;
width: 200px;
}
#promo-flag img {
width: 190px;
}

.fixed {
position: fixed;
top: 50px;
Expand Down Expand Up @@ -561,7 +571,7 @@ a.disabled {

h1.maintopic {
text-align: right;
width: 550px;
width: 500px;
margin-right: 0;
margin-top: -20px;
margin-bottom: 2em;
Expand Down Expand Up @@ -848,7 +858,7 @@ aside.search-results-single-col {
display: inline-block;
vertical-align: top;
width: 30%;
margin-right: 3%;
margin-right: 2%;
zoom: 1;
*display: inline;
}
Expand Down Expand Up @@ -914,7 +924,7 @@ h1 span.category {
}

img#main-logo {
width: 550px;
width: 500px;
}

pre.prettyprint {
Expand Down Expand Up @@ -1494,7 +1504,10 @@ a.permalink:hover i {
}


@media screen and (max-width: 730px) {
@media screen and (max-width: 768px) {
#promo-flag {
display: none;
}
}

@media screen and (max-width: 690px) {
Expand Down
Binary file added source/base/static/base/img/srccon_flag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions source/base/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
</header>
<div class="content">
<div class="container page-block">
<a id="promo-flag" href="http://srccon.org"><img src="{{ static('base/img/srccon_flag.png') }}" alt="SRCCON!"></a>
<a href="{{ url('homepage') }}"><img id="main-logo" src="{{ static('base/img/source_retina.png') }}" alt="Source"></a>
{% block base_tagline %}{% endblock %}
</div>
Expand Down
63 changes: 63 additions & 0 deletions source/jobs/management/commands/job_post_reminders.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
'''
Testing the Amazon email hookup.
'''
import logging
from datetime import datetime
from time import sleep

from django.conf import settings
from django.core.management.base import BaseCommand
from django.template.loader import render_to_string

from source.jobs.models import Job
from source.people.models import Organization
from source.utils.email import send_multipart_email

logging.basicConfig(filename='email_job_reminders.log', filemode='w', level=logging.INFO)


class Command(BaseCommand):
help = 'Testing email via Amazon SMTP.'
def handle(self, *args, **options):
logging.info('Started job: %s' % datetime.now())

organizations_with_jobs_ids = set(Job.live_objects.values_list('organization', flat=True))
organizations_with_jobs = Organization.objects.filter(id__in=organizations_with_jobs_ids)

for organization in organizations_with_jobs:
jobs = Job.live_objects.filter(organization=organization)



# add context for rendering personalized emails
subject = '[Source] Monthly update from Source Jobs'
email_context = {
'site_url': settings.BASE_SITE_URL,
'organization': organization,
'jobs': jobs,
}

# render text and html versions of email body
text_content = render_to_string(
'jobs/emails/job_post_reminder.txt',
email_context,
)
html_content = render_to_string(
'jobs/emails/job_post_reminder.html',
email_context
)

send_multipart_email(
subject = subject,
from_email = settings.DEFAULT_FROM_EMAIL,
to = organization.email,
text_content = text_content,
html_content = html_content
)

# avoid rate limit
sleep(1)


logging.info('Finished job: %s' % datetime.now())

52 changes: 0 additions & 52 deletions source/jobs/management/commands/test_email_send.py

This file was deleted.

0 comments on commit 47517d2

Please sign in to comment.