Skip to content

Commit 4389f6d

Browse files
committed
added missing export calendar feature to profile page
1 parent 20b5026 commit 4389f6d

File tree

3 files changed

+60
-38
lines changed

3 files changed

+60
-38
lines changed

app/templates/index.html

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,42 @@
33
{% block content %}
44

55
<div class="mx-auto">
6-
<main class="d-flex justify-content-center">
7-
<div>
8-
<h2 class="fs-1 fw-bold">
9-
PyLendar
10-
<br>
11-
</h2>
12-
<p>
13-
Open Source Calendar built with Python
14-
</p>
15-
<div class="d-flex position-relative">
16-
<div class="container mx-auto gap-3">
6+
<main class="d-flex justify-content-center">
7+
<div>
8+
<h2 class="fs-1 fw-bold">
9+
PyLendar
10+
<br>
11+
</h2>
12+
<p>
13+
Open Source Calendar built with Python
14+
</p>
15+
<div class="d-flex position-relative">
16+
<div class="container mx-auto gap-3">
1717

18-
{% if quote %}
19-
{% if not quote.author%}
20-
<p><i>"{{ quote.text }}"</i></p>
21-
{% else %}
22-
<p><i>"{{ quote.text }}"</i> <span style="font-size: small;">&nbsp; \ {{quote.author}}</span>
23-
</p>
24-
{% endif %}
25-
{% endif %}
26-
</div>
27-
</div>
28-
<div class="d-flex justify-content-center">
29-
<div class="d-flex justify-content-center">
30-
<a href="{{ url_for('calendar') }}"
31-
class="btn btn-lg btn-primary shadow-lg bg-body p-3 mb-5 bg-gradient2 landing-page-button"
32-
type="button">
33-
<span>Get Started</span>
34-
</a>
35-
</div>
36-
</div>
18+
{% if quote %}
19+
{% if not quote.author%}
20+
<p><i>"{{ quote.text }}"</i></p>
21+
{% else %}
22+
<p><i>"{{ quote.text }}"</i> <span style="font-size: small;">&nbsp; \ {{quote.author}}</span>
23+
</p>
24+
{% endif %}
25+
{% endif %}
3726
</div>
38-
</main>
39-
<div>
40-
<img class="d-block w-100" src="{{ url_for('static', path='/images/calendar.jpg') }}" alt="calendar image">
27+
</div>
28+
<div class="d-flex justify-content-center">
29+
<div class="d-flex justify-content-center">
30+
<a href="{{ url_for('calendar') }}"
31+
class="btn btn-lg btn-primary shadow-lg bg-body p-3 mb-5 bg-gradient2 landing-page-button"
32+
type="button">
33+
<span>Get Started</span>
34+
</a>
35+
</div>
36+
</div>
4137
</div>
38+
</main>
39+
<div>
40+
<img class="d-block w-100" src="{{ url_for('static', path='/images/calendar.jpg') }}" alt="calendar image">
41+
</div>
4242
</div>
4343

44-
{% endblock %}
44+
{% endblock %}

app/templates/partials/user_profile/sidebar_left/features_card.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,21 @@
66
</p>
77

88
<ul class="list-group">
9+
910
{% if not user.telegram_id %}
1011
<li class="list-group-item list-group-item-action no-border">
1112
<a class="text-decoration-none text-success" href="https://t.me/pylander_bot" target="_blank">
1213
<strong>Try PyLander bot</strong>
1314
</a>
1415
</li>
1516
{% endif %}
16-
<li class="list-group-item list-group-item-action no-border">
17-
<a class="text-decoration-none text-secondary" href="#">Export my calendar</a>
18-
</li>
17+
18+
1919
<li class="list-group-item list-group-item-action no-border">
2020
<a class="text-decoration-none text-secondary" href="{{ url_for('import_holidays') }}">Add
2121
holidays to calendar</a>
2222
</li>
23+
2324
<li class="list-group-item list-group-item-action no-border">
2425
{% if google_error %}
2526
<a class="text-decoration-none text-secondary" href="{{ url_for('google_sync') }}">Sync with
@@ -28,6 +29,12 @@
2829
<a class="text-decoration-none text-secondary" href="{{ url_for('google_sync') }}">Sync with
2930
Google</a> {% endif %}
3031
</li>
32+
33+
<!-- Export Calendar -->
34+
<li class="list-group-item list-group-item-action no-border">
35+
{% include 'partials/user_profile/sidebar_left/features_card/export_calendar.html' %}
36+
</li>
37+
3138
</ul>
3239
</div>
33-
</div>
40+
</div>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<a class="text-decoration-none text-secondary" data-toggle="collapse" href="#export-calendar" role="button"
2+
aria-expanded="false"
3+
aria-controls="export-calendar">
4+
Export my calendar
5+
</a>
6+
7+
<div class="collapse" id="export-calendar">
8+
<form method="GET" action="{{ url_for('export') }}">
9+
<label for="start_date">{{ gettext("From") }}</label><br>
10+
<input class="filter" type="date" id="start_date" name="start_date"><br>
11+
<label for="end_date">{{ gettext("To") }}</label><br>
12+
<input class="filter" type="date" id="end_date" name="end_date"><br>
13+
<input class="filter" type="submit" value="{{ gettext('Export') }}">
14+
</form>
15+
</div>

0 commit comments

Comments
 (0)