calendar and small layout fix
This commit is contained in:
@@ -7,5 +7,6 @@ urlpatterns = [
|
|||||||
path('func/slug_calc', views.slug_calc),
|
path('func/slug_calc', views.slug_calc),
|
||||||
path('t/<str:tag>', views.tags, name='posts.tags'),
|
path('t/<str:tag>', views.tags, name='posts.tags'),
|
||||||
path('', views.index, name='posts.index'),
|
path('', views.index, name='posts.index'),
|
||||||
|
path('fet_calendar.ics', views.calendar, name='posts.calendar'),
|
||||||
path('<str:id>', views.show, name='posts.show'),
|
path('<str:id>', views.show, name='posts.show'),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ def index(request):
|
|||||||
|
|
||||||
return render(request, 'posts/index.html', {"posts": posts, "tags_list": t})
|
return render(request, 'posts/index.html', {"posts": posts, "tags_list": t})
|
||||||
|
|
||||||
|
def calendar(request):
|
||||||
|
events=deque(Post.objects.get_visible_articles().order_by('-public_date'))
|
||||||
|
return render(request, 'posts/fet_calendar.ics', {"events": events})
|
||||||
|
|
||||||
def tags(request, tag=""):
|
def tags(request, tag=""):
|
||||||
posts = deque(Post.objects.get_visible_articles().filter(tags__name=tag))
|
posts = deque(Post.objects.get_visible_articles().filter(tags__name=tag))
|
||||||
|
|||||||
34
fet2020/templates/posts/fet_calendar.ics
Normal file
34
fet2020/templates/posts/fet_calendar.ics
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
BEGIN:VCALENDAR
|
||||||
|
VERSION:2.0
|
||||||
|
PRODID:http://www.fet.at/
|
||||||
|
METHOD:PUBLISH
|
||||||
|
X-WR-TIMEZONE:Europe/Vienna
|
||||||
|
BEGIN:VTIMEZONE
|
||||||
|
TZID:Europe/Vienna
|
||||||
|
BEGIN:DAYLIGHT
|
||||||
|
TZOFFSETFROM:+0100
|
||||||
|
DTSTART:19810329T020000
|
||||||
|
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
|
||||||
|
TZNAME:MESZ
|
||||||
|
END:DAYLIGHT
|
||||||
|
BEGIN:STANDARD
|
||||||
|
TZOFFSETFROM:+0200
|
||||||
|
DTSTART:19961027T030000
|
||||||
|
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
|
||||||
|
TZNAME:MEZ
|
||||||
|
END:STANDARD
|
||||||
|
END:VTIMEZONE
|
||||||
|
{% for event in events %}
|
||||||
|
BEGIN:VEVENT
|
||||||
|
UID:4610745
|
||||||
|
ORGANIZER;CN="Fachschaft Elektrotechnik, Example Inc.":MAILTO:service@fet.at
|
||||||
|
LOCATION:Vienna
|
||||||
|
SUMMARY:{{ event.title }}
|
||||||
|
DESCRIPTION: {{event.url}} https://alpha.2020.fet.at/{{event.url}} <a href="https://alpha.2020.fet.at/{{event.url}}">{{even.title}}</a>
|
||||||
|
CLASS:PUBLIC
|
||||||
|
DTSTART;TZID=Europe/Vienna:20200306T120000
|
||||||
|
DTEND;TZID=Europe/Vienna:20200306T140000
|
||||||
|
DTSTAMP;TZID=Europe/Vienna:20200306T120000
|
||||||
|
END:VEVENT
|
||||||
|
{% endfor %}
|
||||||
|
END:VCALENDAR
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<a href="{% url 'posts.show' post.slug %}">
|
<a href="{% url 'posts.show' post.slug %}">
|
||||||
<div class="news-hero padding-bottom-1" style="background-image:url('{{ post.imageurl }}')">
|
<div class="news-hero padding-bottom-1" style="background-image:url('{{ post.imageurl }}')">
|
||||||
<div class="news-hero-text">
|
<div class="news-hero-text">
|
||||||
<h1>{{ post.title }}</h1>
|
<h1>{{ post.title | safe }}</h1>
|
||||||
<h2>{{ post.subtitle|default_if_none:" " }}</h2>
|
<h2>{{ post.subtitle|default_if_none:" " }}</h2>
|
||||||
{{ post }}
|
{{ post }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,12 +20,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="article-title">
|
<div class="article-title">
|
||||||
<h1>{{ post.title|tags_to_url }}</h1>
|
<h1>{{ post.title|tags_to_url }}</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="article-details">
|
<div class="article-details">
|
||||||
|
<div>
|
||||||
{{ post.subtitle|default_if_none:" "|tags_to_url }}
|
{{ post.subtitle|default_if_none:" "|tags_to_url }}
|
||||||
|
</div>
|
||||||
{% if post.author %}
|
{% if post.author %}
|
||||||
<div class="article-author"><a href="{% url 'member' post.author %}">
|
<div class="article-author"><a href="{% url 'member' post.author %}">
|
||||||
<img src="{{ author_image }}" alt="" /> {{ post.author }}
|
<img src="{{ author_image }}" alt="" /> {{ post.author }}
|
||||||
|
|||||||
Reference in New Issue
Block a user