forked from chicagopython/chipy.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
98 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 19 additions & 12 deletions
31
chipy_org/apps/sponsors/templates/sponsors/sponsor_detail.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
{% extends "site_base.html" %} | ||
|
||
{% load i18n staticfiles %} | ||
{% load i18n staticfiles thumbnail %} | ||
|
||
{% block head_title %}{% trans "Past Meetings" %}{% endblock %} | ||
|
||
{% block body %} | ||
<h2>Sponsored by:</h2> | ||
<h2>ChiPy Sponsor</h2> | ||
|
||
<h3> | ||
{{ sponsor.name }} | ||
</h3> | ||
<div class="row"> | ||
<h3 class="span12">{{ sponsor.name }}</h3> | ||
</row> | ||
<div class="row"> | ||
{% if sponsor.logo %} | ||
<img src="{{ sponsor.logo.url }}" alt="{{ sponsor.name }}"> | ||
{% endif %} | ||
<p> | ||
{{ sponsor.description }} | ||
</p> | ||
{% if sponsor.url %} | ||
<p><a href="{{ sponsor.url }}">Visit Site</a></p> | ||
{% thumbnail sponsor.logo "400x300" crop="center" as im %} | ||
<div class="span4 sponsor-image"><a href="{{ sponsor.url }}"> | ||
<img src="{{ im.url }}" alt="{{ sponsor.name }}"></a></div> | ||
{% endthumbnail %} | ||
{% endif %} | ||
|
||
<div class="span8">{{ sponsor.description }} | ||
{% if sponsor.url %} | ||
<div><a href="{{ sponsor.url }}">Visit Site</a></div> | ||
{% endif %} | ||
</div> | ||
|
||
</div> | ||
|
||
<hr> | ||
{% endblock body %} |
29 changes: 29 additions & 0 deletions
29
chipy_org/apps/sponsors/templates/sponsors/sponsor_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{% extends "site_base.html" %} | ||
|
||
{% load i18n staticfiles thumbnail %} | ||
|
||
{% block head_title %}{% trans "Sponsor List" %}{% endblock %} | ||
|
||
{% block body %} | ||
<h2>ChiPy Sponsors</h2> | ||
|
||
{% for sponsor in sponsors %} | ||
<div class="row"> | ||
|
||
{% if sponsor.logo %} | ||
{% thumbnail sponsor.logo "100x75" crop="center" as im %} | ||
<div class="span2 sponsor-image"> | ||
<a href="{% url 'sponsor_detail' sponsor.slug %}"><img src="{{ im.url }}" alt="{{ sponsor.name }}"></a> | ||
</div> | ||
{% endthumbnail %} | ||
{% else %} | ||
<div class="span2 sponsor-image"> </div> | ||
{% endif %} | ||
<h4 class="span3">{{ sponsor.name }}</h4> | ||
<div class="span6"><a href="{% url 'sponsor_detail' sponsor.slug %}">More Info</a></div> | ||
|
||
</div> | ||
<hr> | ||
{% endfor %} | ||
|
||
{% endblock body %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
from django.conf.urls import * | ||
from .views import SponsorDetailView | ||
from .views import SponsorDetailView, SponsorListView | ||
|
||
|
||
urlpatterns = patterns("", | ||
url(r'^detail/(?P<slug>[\w]+)/$', | ||
SponsorDetailView.as_view(), name='sponsor_detail'), | ||
url(r'^list/$', | ||
SponsorListView.as_view(), name='sponsor_list'), | ||
|
||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
from django.shortcuts import render | ||
from .models import Sponsor | ||
from django.views.generic import DetailView | ||
from django.views.generic import DetailView, ListView | ||
|
||
|
||
class SponsorDetailView(DetailView): | ||
model = Sponsor | ||
context_object_name = "sponsor" | ||
template_name = "sponsors/sponsor_detail.html" | ||
|
||
|
||
class SponsorListView(ListView): | ||
model = Sponsor | ||
context_object_name = "sponsors" | ||
template_name = "sponsors/sponsor_list.html" | ||
|
||
def get_queryset(self): | ||
return super(SponsorListView, self).get_queryset().order_by('name') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{% load i18n %} | ||
<div><a href="{% url 'sponsor_list' %}">Sponsors</div> | ||
<div class="legal"> | ||
{% trans "© 2014 Chicago Python User Group" %}: {% trans "Source code available at " %}<a href="https://github.com/chicagopython/chipy.org">Github</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters