Skip to content
This repository was archived by the owner on Sep 19, 2018. It is now read-only.

Commit bfda002

Browse files
committed
Merge pull request #347 from ViaCoco/master
nearby events section - did some work on layout and style
2 parents 5effc38 + b585bc3 commit bfda002

File tree

4 files changed

+75
-11
lines changed

4 files changed

+75
-11
lines changed

static/scss/_near-event-grid.scss

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.grid {
2+
padding: 5px;
3+
overflow: hidden;
4+
5+
a {
6+
color: $primary-color;
7+
8+
figure {
9+
position: relative;
10+
overflow: hidden;
11+
background: $white;
12+
height: 250px;
13+
width: 100%;
14+
margin: 0 auto;
15+
border: 1px solid $primary-color;
16+
17+
img {
18+
display: block;
19+
position: relative;
20+
width: 100%;
21+
z-index: 9;
22+
-webkit-filter: grayscale(0.5);
23+
-moz-filter: grayscale(0.5);
24+
filter: grayscale(0.5);
25+
opacity: 0.7;
26+
}
27+
28+
.caption-description {
29+
position: absolute;
30+
padding: 10px;
31+
top: 40%;
32+
z-index: 10;
33+
width: 100%;
34+
height: 60%;
35+
background: $whitesmoke;
36+
border-top: 1px solid $primary-color;
37+
38+
h4 {
39+
margin: 5px;
40+
padding-top: 5px;
41+
color: $primary-color;
42+
text-transform: uppercase;
43+
backface-visibility: hidden;
44+
}
45+
46+
span {
47+
margin: 0 5px;
48+
display: inline-block;
49+
backface-visibility: hidden;
50+
font-size: 12px;
51+
}
52+
53+
p {
54+
width: 90%;
55+
margin: 5px auto;
56+
display: block;
57+
overflow: hidden;
58+
color: $aluminum;
59+
}
60+
}
61+
}
62+
}
63+
}

static/scss/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ of the styles inside media queries.
3333

3434
// Components
3535
//@import "thumbnails";
36+
@import "near-event-grid";
3637

3738
// styles in base.scss
3839
@import "base";
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{% load static %}
2-
<div class="col-sm-3 col-xs-6">
3-
<a href="{% url 'web.view_event' event.id event.slug %}" class="thumbnail clearfix">
4-
<h4>{{ event.title }}</h4>
5-
<div class="caption">
6-
<span class="countdown pull-left caption">
7-
{{ event.start_date|date:"F j, Y" }}
8-
</span>
9-
</div>
2+
<div class="col-md-3 col-sm-6 grid">
3+
<a href="{% url 'web.view_event' event.id event.slug %}">
4+
<figure>
105
{% if event.picture %}
116
<img src="{{ event.picture.url }}" alt="{{ event.title }} Image">
12-
{% else %}
7+
{% else %}
138
<img src="{% static 'img/event_default_picture.png' %}" alt="{{ event.title }} Image">
14-
{% endif %}
9+
{% endif %}
10+
11+
<div class="caption-description">
12+
<h4>{{ event.title }}</h4>
13+
<span>{{ event.start_date|date:"F j, Y" }}</span><p>{{ event.description|truncatewords:12 }}</p></div>
14+
</figure>
1515
</a>
1616
</div>

web/views/events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def view_event_by_country(request, country_code):
191191
def view_event(request, event_id, slug):
192192
event = get_event_by_id(event_id)
193193
next_event = get_next_or_previous(event, country_code=event.country)
194-
nearby = get_nearby_events(event, limit=10)
194+
nearby = get_nearby_events(event, limit=4)
195195

196196
return render_to_response(
197197
'pages/view_event.html', {

0 commit comments

Comments
 (0)