Commit 921cc850 authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Merge branch 'tc/remove-old-template' into 'master'

Remove old template

Closes #713

See merge request thalia/concrexit!1009
parents cef6dedf 6117f554
......@@ -25,14 +25,6 @@ partners.apps module
:undoc-members:
:show-inheritance:
partners.context\_processors module
-----------------------------------
.. automodule:: partners.context_processors
:members:
:undoc-members:
:show-inheritance:
partners.emails module
----------------------
......
.announcement {
background: #E62272;
color: #FFFFFF;
font-weight: bold;
text-align:center;
padding: 10px;
position: relative;
.close {
color: #FFFFFF;
}
p {
display: inline;
margin-left: 5px;
}
a {
color: white;
text-decoration: underline;
}
a:hover {
color: #F0F0EE;
text-decoration: underline;
cursor: pointer;
}
}
from random import sample
from partners.models import Partner
def showcased_partners(request):
"""
Generate a sequence of showcased partners (banners)
For each user we generate a sequence of banners. This sequence
is then stored for that user, because doing it randomly creates
a feel of an artificial 'bias' towards certain partners. Doing
it this way ensures that everyone gets an exactly fair number of
views.
"""
all_partners = Partner.objects.filter(is_active=True).order_by('id')
ids = [partner.id for partner in all_partners]
# check if partners have changed; if so, update sequence in session
if ('partner_sequence' not in request.session or
'partner_ids' not in request.session or
request.session['partner_ids'] != ids):
# Store a list of partner ids to allow checking for changes in partners
request.session['partner_ids'] = ids
request.session['partner_sequence'] = sample(ids, len(ids))
sequence = request.session['partner_sequence']
chosen, rest = sequence[:4], sequence[4:]
request.session['partner_sequence'] = rest + chosen
return {
'showcased_partners': [p for p in all_partners if p.id in chosen],
}
<div id="partner-{{ position }}" class="partner-header">
<a href="{% url "partners:partner" partner.slug %}">
<img src="{{ partner.logo.url }}" alt="Logo {{ partner.name }}"/>
</a>
</div>
from random import sample
from django import template
from partners.models import Partner
register = template.Library()
@register.inclusion_tag('partners/banners.html', takes_context=True)
def render_partner_banners(context):
request = context['request']
all_partners = Partner.objects.filter(is_active=True).order_by('id')
ids = [partner.id for partner in all_partners]
# check if partners have changed; if so, update sequence in session
if ('partner_sequence' not in request.session or
'partner_ids' not in request.session or
request.session['partner_ids'] != ids):
# Store a list of partner ids to allow checking for changes in partners
request.session['partner_ids'] = ids
request.session['partner_sequence'] = sample(ids, len(ids))
sequence = request.session['partner_sequence']
chosen, rest = sequence[:4], sequence[4:]
request.session['partner_sequence'] = rest + chosen
return {
'partners': context['showcased_partners']
'partners': [p for p in all_partners if p.id in chosen]
}
......@@ -100,7 +100,6 @@ TEMPLATES = [
'django.template.context_processors.media',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'partners.context_processors.showcased_partners',
'announcements.context_processors.announcements',
],
'loaders': [
......
......@@ -120,7 +120,6 @@ TEMPLATES = [
'django.template.context_processors.media',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'partners.context_processors.showcased_partners',
'announcements.context_processors.announcements',
'thaliawebsite.context_processors.source_commit',
'thaliawebsite.context_processors.thumbnail_sizes',
......
This diff is collapsed.
@font-face {
font-family: 'Open Sans';
src: url('../fonts/OpenSans-Italic.eot');
src: url('../fonts/OpenSans-Italic.eot?#iefix') format('embedded-opentype'),
url('../fonts/OpenSans-Italic.woff2') format('woff2'),
url('../fonts/OpenSans-Italic.woff') format('woff'),
url('../fonts/OpenSans-Italic.ttf') format('truetype'),
url('../fonts/OpenSans-Italic.svg#OpenSans-Italic') format('svg');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'Open Sans';
src: url('../fonts/OpenSans-BoldItalic.eot');
src: url('../fonts/OpenSans-BoldItalic.eot?#iefix') format('embedded-opentype'),
url('../fonts/OpenSans-BoldItalic.woff2') format('woff2'),
url('../fonts/OpenSans-BoldItalic.woff') format('woff'),
url('../fonts/OpenSans-BoldItalic.ttf') format('truetype'),
url('../fonts/OpenSans-BoldItalic.svg#OpenSans-BoldItalic') format('svg');
font-weight: bold;
font-style: italic;
}
@font-face {
font-family: 'Open Sans';
src: url('../fonts/OpenSans-Bold.eot');
src: url('../fonts/OpenSans-Bold.eot?#iefix') format('embedded-opentype'),
url('../fonts/OpenSans-Bold.woff2') format('woff2'),
url('../fonts/OpenSans-Bold.woff') format('woff'),
url('../fonts/OpenSans-Bold.ttf') format('truetype'),
url('../fonts/OpenSans-Bold.svg#OpenSans-Bold') format('svg');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'Open Sans';
src: url('../fonts/OpenSans.eot');
src: url('../fonts/OpenSans.eot?#iefix') format('embedded-opentype'),
url('../fonts/OpenSans.woff2') format('woff2'),
url('../fonts/OpenSans.woff') format('woff'),
url('../fonts/OpenSans.ttf') format('truetype'),
url('../fonts/OpenSans.svg#OpenSans') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Oswald';
src: url('../fonts/Oswald-Regular.eot');
src: url('../fonts/Oswald-Regular.eot?#iefix') format('embedded-opentype'),
url('../fonts/Oswald-Regular.woff2') format('woff2'),
url('../fonts/Oswald-Regular.woff') format('woff'),
url('../fonts/Oswald-Regular.ttf') format('truetype'),
url('../fonts/Oswald-Regular.svg#Oswald-Regular') format('svg');
font-weight: normal;
font-style: normal;
}
/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
.fancybox-wrap,
.fancybox-skin,
.fancybox-outer,
.fancybox-inner,
.fancybox-image,
.fancybox-wrap iframe,
.fancybox-wrap object,
.fancybox-nav,
.fancybox-nav span,
.fancybox-tmp
{
padding: 0;
margin: 0;
border: 0;
outline: none;
vertical-align: top;
}
.fancybox-wrap {
position: absolute;
top: 0;
left: 0;
z-index: 8020;
}
.fancybox-skin {
position: relative;
background: #f9f9f9;
color: #444;
text-shadow: none;
-webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
.fancybox-opened {
z-index: 8030;
}
.fancybox-outer, .fancybox-inner {
position: relative;
}
.fancybox-inner {
overflow: hidden;
}
.fancybox-type-iframe .fancybox-inner {
-webkit-overflow-scrolling: touch;
}
.fancybox-error {
color: #444;
font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
margin: 0;
padding: 15px;
white-space: nowrap;
}
.fancybox-image, .fancybox-iframe {
display: block;
width: 100%;
height: 100%;
}
.fancybox-image {
max-width: 100%;
max-height: 100%;
}
#fancybox-loading {
position: fixed;
top: 50%;
left: 50%;
margin-top: -22px;
margin-left: -22px;
background-position: 0 -108px;
opacity: 0.8;
cursor: pointer;
z-index: 8060;
background-color: #000;
}
#fancybox-loading div {
width: 44px;
height: 44px;
background: url('../images/fancybox/fancybox_loading.gif') center center no-repeat;
}
.fancybox-close {
background:url('../images/misc/icon_close.png') 0 0 no-repeat;
background-size: 32px 64px;
position: absolute;
top: 20px;
right: 20px;
width: 32px;
height: 32px;
cursor: pointer;
z-index: 8040;
}
.fancybox-download {
background:url('../images/misc/icon_download.png') 0 0 no-repeat;
background-size: 32px 64px;
position: absolute;
top: 20px;
right: 72px;
width: 32px;
height: 32px;
cursor: pointer;
z-index: 8040;
}
.fancybox-close:hover, .fancybox-download:hover {
background-position: 0 -32px;
}
.fancybox-nav {
position: absolute;
top: 0;
width: 40%;
height: 100%;
cursor: pointer;
text-decoration: none;
background: transparent url('../images/fancybox/blank.gif'); /* helps IE */
-webkit-tap-highlight-color: rgba(0,0,0,0);
z-index: 8040;
}
.fancybox-prev {
left: 0;
}
.fancybox-next {
right: 0;
}
.fancybox-nav span {
background: url('../images/misc/slider_large_next_prev.png') 0 0 no-repeat;
background-size: 64px 64px;
position: absolute;
top: 50%;
width: 32px;
height: 32px;
margin-top: -18px;
cursor: pointer;
z-index: 8040;
visibility: hidden;
}
.fancybox-prev span {
left: 20px;
background-position: 0 0;
}
.fancybox-prev span:hover {
background-position: -32px 0;
}
.fancybox-next span {
right: 20px;
background-position: 0 -32px;
}
.fancybox-next span:hover {
background-position: -32px -32px;
}
.fancybox-nav:hover span {
visibility: visible;
}
.fancybox-tmp {
position: absolute;
top: -99999px;
left: -99999px;
visibility: hidden;
max-width: 99999px;
max-height: 99999px;
overflow: visible !important;
}
/* Overlay helper */
.fancybox-lock {
overflow: hidden !important;
width: auto;
}
.fancybox-lock body {
overflow: hidden !important;
}
.fancybox-lock-test {
overflow-y: hidden !important;
}
.fancybox-overlay {
position: absolute;
top: 0;
left: 0;
overflow: hidden;
display: none;
z-index: 8010;
background: rgba(255,255,255,0.7);
}
.fancybox-overlay-fixed {
position: fixed;
bottom: 0;
right: 0;
}
.fancybox-lock .fancybox-overlay {
overflow: auto;
overflow-y: scroll;
}
/* Title helper */
.fancybox-title {
visibility: hidden;
font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
position: relative;
text-shadow: none;
z-index: 8050;
}
.fancybox-opened .fancybox-title {
visibility: visible;
}
.fancybox-title-float-wrap {
position: absolute;
bottom: 0;
right: 50%;
margin-bottom: -35px;
z-index: 8050;
text-align: center;
}
.fancybox-title-float-wrap .child {
display: inline-block;
margin-right: -100%;
padding: 2px 20px;
background: transparent; /* Fallback for web browsers that doesn't support RGBa */
background: rgba(0, 0, 0, 0.8);
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
text-shadow: 0 1px 2px #222;
color: #FFF;
font-weight: bold;
line-height: 24px;
white-space: nowrap;
}
.fancybox-title-outside-wrap {
position: relative;
margin-top: 10px;
color: #fff;
}
.fancybox-title-inside-wrap {
padding-top: 10px;
}
.fancybox-title-over-wrap {
position: absolute;
bottom: 0;
left: 0;
color: #fff;
padding: 10px;
background: #000;
background: rgba(0, 0, 0, .8);
}
\ No newline at end of file
$preset-name: "ThImbus Defaults";
$preset-icon: concrete-icon(#E62272, #FFFFFF, #D8206B);
$background-color: #FFFFFF;
$primary-color: #E62272;
$inverted-color: #000000;
$lavalamp-color: rgba(230, 35, 113, 0.68);
$faded-color: #EEEDE7;
$dark-primary-color: #D8206B;
$body-color: #313131;
@import "presets/defaults.scss";
@import "fonts.scss";
/* -------------------------------------------------------------------------------- /
[1] SETUP - general settings, common classes
/ -------------------------------------------------------------------------------- */
body {
background: $background-color;
color: $body-color;
}
.thimbus-page {
a {
color: $primary-color;
}
::-moz-selection {
background: $primary-color;
}
::selection {
background: $primary-color;
}
/* -------------------------------------------------------------------------------- /
[2] LAYOUT
/ -------------------------------------------------------------------------------- */
#main {
background: $background-color;
}
/* -------------------------------------------------------------------------------- /
[3] HEADER
/ -------------------------------------------------------------------------------- */
#header {
background: $background-color;
#top-menu-container {
.btn {
background: $inverted-color;
color: $background-color;
&:hover {
background-color: $primary-color !important;
}
&:active, &:focus {
background-color: $inverted-color !important;
}
}
.dropdown-menu {
background-color: $inverted-color;
a {
color: $background-color;
&:hover {
background-image: none;
background-color: $primary-color !important;
}
&:focus {
background-image: none;
background-color: $dark-primary-color !important;
}
}
}
}
}
#header-info {
background: $primary-color;
}
#logo {
padding: 55px 0 !important;
}
/* -------------------------------------------------------------------------------- /
[4] NAVIGATION
/ -------------------------------------------------------------------------------- */
#primary-navigation {
background: $background-color;
.nav {
& > li {
&:before {
background: $background-color;
}
&:hover > a {
color: $primary-color;
}
&.nav-path-selected > a {
color: $primary-color;
}
}
li {
a {
background-color: $background-color;
color: $inverted-color;
font-family: 'Oswald';
font-weight: normal;
font-weight: normal;
font-size: 18px;
}
& > ul {
background: $background-color;
}
}