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

Commit b585bc3

Browse files
committed
modified nearby events section
1 parent 1d5178a commit b585bc3

File tree

5 files changed

+69
-97
lines changed

5 files changed

+69
-97
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/_near_event_grid.scss

Lines changed: 0 additions & 89 deletions
This file was deleted.

static/scss/style.scss

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

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

3838
// styles in base.scss
3939
@import "base";
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
{% load static %}
2-
<div class="col-md-3 col-sm-6 col-xs-12 grid">
2+
<div class="col-md-3 col-sm-6 grid">
33
<a href="{% url 'web.view_event' event.id event.slug %}">
44
<figure>
55
{% if event.picture %}
66
<img src="{{ event.picture.url }}" alt="{{ event.title }} Image">
77
{% else %}
88
<img src="{% static 'img/event_default_picture.png' %}" alt="{{ event.title }} Image">
99
{% endif %}
10-
<div class="caption-description"><p>{{ event.description|truncatewords:15 }}</p></div>
11-
<div class="caption-hider"></div>
12-
<figcaption>
10+
11+
<div class="caption-description">
1312
<h4>{{ event.title }}</h4>
14-
<span>{{ event.start_date|date:"F j, Y" }}</span>
15-
</figcaption>
13+
<span>{{ event.start_date|date:"F j, Y" }}</span><p>{{ event.description|truncatewords:12 }}</p></div>
1614
</figure>
1715
</a>
1816
</div>

web/views/events.py

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

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

0 commit comments

Comments
 (0)