Skip to content

Commit f5ab559

Browse files
authored
Merge pull request #16 from Animesh-Ghosh/templates-updoot
Update templates
2 parents 9065f70 + f8a07dd commit f5ab559

14 files changed

Lines changed: 334 additions & 448 deletions

File tree

api/templates/api.html

Lines changed: 81 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,89 @@
11
{% extends 'base.html'%}
22
{% block content %}
33
<center>
4-
<section class="hero is-medium is-primary is-bold">
5-
<div class="hero-body">
6-
<div class="container">
7-
<h1 class="title">
8-
Are you a creator ? <br>
9-
Try tutorialdb REST API 👇
10-
</h1>
4+
<section class="hero is-medium is-primary is-bold">
5+
<div class="hero-body">
6+
<div class="container">
7+
<h1 class="title">
8+
Are you a creator ? <br>
9+
Try tutorialdb REST API 👇
10+
</h1>
11+
</div>
1112
</div>
12-
</div>
13-
</section>
13+
</section>
1414
</center>
15-
1615
<section class="hero is-medium" style="background-color: orange">
17-
<div class="hero-body">
18-
<div>
19-
<details>
20-
<summary class="title">See Docs</summary>
21-
<div class="table-container">
22-
<table class="table is-hoverable">
23-
<th>Request</th>
24-
<th>Endpoint</th>
25-
<th>Description</th>
26-
<tr>
27-
<td><code>GET</code></td>
28-
<td><code>/api/tutorials</code></td>
29-
<td><p>Returns all the tutorials.</p></td>
30-
</tr>
31-
<tr>
32-
<td><code>POST</code></td>
33-
<td><code>/api/tutorials</code></td>
34-
<td>
35-
<p>Submit a tutorial.</p>
36-
<code>
37-
{
38-
"link":"https://abc.xyz",
39-
"category":"video"
40-
}
41-
</code>
42-
</td>
43-
</tr>
44-
<tr>
45-
<td><code>GET</code></td>
46-
<td><code>/api/tutorials/{tags}/</code></td>
47-
<td>
48-
<p>Returns tutorials filtered by tags.<br>
49-
Multiple Tags should be separated with commas,<br>
50-
for e.g <code>/api/tutorials/python,api</code>
51-
</p>
52-
</td>
53-
</tr>
54-
<tr>
55-
<td><code>GET</code></td>
56-
<td><code>/api/tutorials/{tags}/{category}/</code></td>
57-
<td>
58-
<p>Returns tutorials filtered by tags and category.<br>
59-
Only one category can be specified at a time for e.g <br>
60-
<code>/api/tutorials/python,api/video</code> or <br>
61-
<code>/api/tutorials/react/article</code>
62-
</p>
63-
Available Categories :
64-
<ul>
65-
<li>article</li>
66-
<li>video</li>
67-
<li>docs</li>
68-
<li>course</li>
69-
<li>book</li>
70-
<li>cheatsheet</li>
71-
</ul>
72-
</td>
73-
</tr>
74-
<tr>
75-
<td><code>GET</code></td>
76-
<td><code>/api/tags/</code></td>
77-
<td><p>Returns all the tags.</p></td>
78-
</tr>
79-
<tr>
80-
<td><code>GET</code></td>
81-
<td><code>/api/latest/</code></td>
82-
<td><p>Return latest 10 tutorials from tutorialdb.</p></td>
83-
</tr>
84-
</table>
85-
</div>
86-
</details>
87-
</div>
88-
</div>
16+
<div class="hero-body">
17+
<div>
18+
<details>
19+
<summary class="title">See Docs</summary>
20+
<div class="table-container">
21+
<table class="table is-hoverable">
22+
<th>Request</th>
23+
<th>Endpoint</th>
24+
<th>Description</th>
25+
<tr>
26+
<td><code>GET</code></td>
27+
<td><code>/api/tutorials</code></td>
28+
<td><p>Returns all the tutorials.</p></td>
29+
</tr>
30+
<tr>
31+
<td><code>POST</code></td>
32+
<td><code>/api/tutorials</code></td>
33+
<td>
34+
<p>Submit a tutorial.</p>
35+
<code>
36+
{
37+
"link":"https://abc.xyz",
38+
"category":"video"
39+
}
40+
</code>
41+
</td>
42+
</tr>
43+
<tr>
44+
<td><code>GET</code></td>
45+
<td><code>/api/tutorials/{tags}/</code></td>
46+
<td>
47+
<p>Returns tutorials filtered by tags.<br>
48+
Multiple Tags should be separated with commas,<br>
49+
for e.g <code>/api/tutorials/python,api</code>
50+
</p>
51+
</td>
52+
</tr>
53+
<tr>
54+
<td><code>GET</code></td>
55+
<td><code>/api/tutorials/{tags}/{category}/</code></td>
56+
<td>
57+
<p>Returns tutorials filtered by tags and category.<br>
58+
Only one category can be specified at a time for e.g <br>
59+
<code>/api/tutorials/python,api/video</code> or <br>
60+
<code>/api/tutorials/react/article</code>
61+
</p>
62+
Available Categories :
63+
<ul>
64+
<li>article</li>
65+
<li>video</li>
66+
<li>docs</li>
67+
<li>course</li>
68+
<li>book</li>
69+
<li>cheatsheet</li>
70+
</ul>
71+
</td>
72+
</tr>
73+
<tr>
74+
<td><code>GET</code></td>
75+
<td><code>/api/tags/</code></td>
76+
<td><p>Returns all the tags.</p></td>
77+
</tr>
78+
<tr>
79+
<td><code>GET</code></td>
80+
<td><code>/api/latest/</code></td>
81+
<td><p>Return latest 10 tutorials from tutorialdb.</p></td>
82+
</tr>
83+
</table>
84+
</div>
85+
</details>
86+
</div>
87+
</div>
8988
</section>
9089
{% endblock %}

api/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from . import views
33

44
urlpatterns = [
5-
path('', views.index),
5+
path('', views.index, name='api-home'),
66
path('tutorials/<str:tags>/', views.tutorial_Tags),
77
path('tutorials/<str:tags>/<str:category>/', views.tutorial_Tags_Category),
88
path('tutorials/', views.tutorials),

app/templates/about.html

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
{% extends 'base.html'%}
22
{% load staticfiles %}
3-
43
{% block content %}
5-
64
<section class="hero is-medium is-primary is-bold">
7-
<div class="hero-body">
8-
<h1 class="title">About</h1>
9-
<div class="container">
10-
<center>
11-
<img src="{% static 'app/computer2.svg' %}" height="170" width="170"><br><br>
12-
</center>
13-
<ul class="list title is-5">
14-
<li class="list-item">
15-
tutorialdb is a small scale search engine for programming/dev tutorials, it is meant to help anyone who is getting started to learn a new technology.
16-
</li>
17-
<li class="list-item">
18-
The sole purpose of tutorialdb is to help people get to resoures which might help them learn new things for e.g sometimes there are tutorials on personal blogs which do not get indexed in google easily.
19-
</li>
20-
<li class="list-item">
21-
All the content (tutorials) is owned by the respective authors/sites.<br>
22-
tutorialdb maintains its own database saving the links to tutorials and some meta info.
23-
</li>
24-
</ul>
25-
</div>
26-
</div>
5+
<div class="hero-body">
6+
<h1 class="title">About</h1>
7+
<div class="container">
8+
<center>
9+
<img src="{% static 'app/computer2.svg' %}" height="170" width="170"><br><br>
10+
</center>
11+
<ul class="list title is-5">
12+
<li class="list-item">
13+
tutorialdb is a small scale search engine for programming/dev tutorials, it is meant to help anyone who is getting started to learn a new technology.
14+
</li>
15+
<li class="list-item">
16+
The sole purpose of tutorialdb is to help people get to resoures which might help them learn new things for e.g sometimes there are tutorials on personal blogs which do not get indexed in google easily.
17+
</li>
18+
<li class="list-item">
19+
All the content (tutorials) is owned by the respective authors/sites.<br>
20+
tutorialdb maintains its own database saving the links to tutorials and some meta info.
21+
</li>
22+
</ul>
23+
</div>
24+
</div>
2725
</section>
2826
{% endblock %}

app/templates/base.html

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
<meta property="twitter:title" content="tutorialdb" />
2020
<meta property="og:image" content="{% static 'app/tutorialdb.png' %}"/>
2121
<meta name="twitter:image" content="{% static 'app/tutorialdb.png' %}">
22-
2322
<link rel="shortcut icon" type="image/png" href="{% static 'app/tutorialdb.png' %}"/>
2423
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css">
24+
<link rel="stylesheet" type="text/css" href="{% static 'app/css/customCSS.css' %}">
25+
<link rel="manifest" href="{% static 'app/manifest.json' %}"/>
2526
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
2627
<script defer src="{% static 'app/js/burger.js' %}"></script>
27-
<link rel="stylesheet" type="text/css" href="{% static 'app/css/customCSS.css' %}">
2828
</head>
2929
<body>
3030
<nav class="navbar is-active is-dark" role="navigation" aria-label="main navigation">
3131
<div class="navbar-brand">
32-
<a class="navbar-item" href="/">
32+
<a class="navbar-item" href="{% url 'app:home' %}">
3333
<img src="{% static 'app/tutorialdb.png' %}" width="112" height="28">
3434
</a>
3535
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample" name="customBurger">
@@ -40,35 +40,34 @@
4040
</div>
4141
<div id="navbarBasicExample" class="navbar-menu is-dark" >
4242
<div class="navbar-start is-dark">
43-
<a class="navbar-item" href="/">
43+
<a class="navbar-item" href="{% url 'app:home' %}">
4444
Home
4545
</a>
46-
<a class="navbar-item" href="/api">
46+
<a class="navbar-item" href="{% url 'api-home' %}">
4747
API
4848
</a>
49-
<a class="navbar-item" href="/latest">
49+
<a class="navbar-item" href="{% url 'app:latest' %}">
5050
Latest
5151
</a>
52-
<a class="navbar-item" href="/tags">
52+
<a class="navbar-item" href="{% url 'app:tags' %}">
5353
Tags
5454
</a>
55-
<a class="navbar-item" href="/about">
55+
<a class="navbar-item" href="{% url 'app:about' %}">
5656
About
5757
</a>
5858
</div>
5959
<div class="navbar-end">
6060
<div class="navbar-item">
6161
<div class="buttons">
62-
<a class="button is-primary" href="/contribute">
62+
<a class="button is-primary" href="{% url 'app:contribute' %}">
6363
<strong>Contribute</strong>
6464
</a>
6565
</div>
6666
</div>
6767
</div>
6868
</div>
6969
</nav>
70-
{% block content %}
71-
{% endblock content %}
70+
{% block content %}{% endblock content %}
7271
<footer class="footer">
7372
<div class="content has-text-centered">
7473
<p>

app/templates/contribute.html

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{% extends 'base.html' %}
22
{% load staticfiles %}
33
{% block content %}
4-
54
<section class="hero is-medium is-primary is-bold">
65
<div class="hero-body">
76
<div class="container">
@@ -14,7 +13,6 @@ <h1 class="title" align="center">
1413
</div>
1514
</div>
1615
</section>
17-
1816
<section class="hero is-medium is-dark is-bold">
1917
<div class="hero-body">
2018
<div class="container">
@@ -32,40 +30,36 @@ <h1 class="title" align="center">Or just,<br>
3230
<h2 class="title is-3"><i>{{ error }}</i></h2>
3331
{% endif %}
3432
<div class="container">
35-
<form action="/thankyou/" method="post">
36-
{% csrf_token %}
37-
<div class="field">
38-
<label class="label">Link</label>
39-
<div class="control">
40-
<input class="input is-rounded" type="url" name="tlink" placeholder="paste tutorial link here" autofocus>
41-
</div>
42-
</div>
43-
44-
<div class="field">
45-
<label class="label">Type</label>
46-
<div class="control">
47-
<div class="select is-rounded">
48-
<select name="tcategory">
49-
<option value ="video">Video</option>
50-
<option value ="article">Article</option>
51-
<option value ="course">Course</option>
52-
<option value ="docs">Docs</option>
53-
<option value ="book">Books</option>
54-
<option value ="cheatsheet">Cheatsheet</option>
55-
</select>
56-
</div>
57-
</div>
33+
<form action="{% url 'app:thankyou' %}" method="post">
34+
{% csrf_token %}
35+
<div class="field">
36+
<label class="label">Link</label>
37+
<div class="control">
38+
<input class="input is-rounded" type="url" name="tlink" placeholder="paste tutorial link here" autofocus>
5839
</div>
59-
60-
<div class="field is-grouped">
61-
<div class="control">
62-
<button class="button is-link is-rounded" type="submit">Submit</button>
40+
</div>
41+
<div class="field">
42+
<label class="label">Type</label>
43+
<div class="control">
44+
<div class="select is-rounded">
45+
<select name="tcategory">
46+
<option value ="video">Video</option>
47+
<option value ="article">Article</option>
48+
<option value ="course">Course</option>
49+
<option value ="docs">Docs</option>
50+
<option value ="book">Books</option>
51+
<option value ="cheatsheet">Cheatsheet</option>
52+
</select>
6353
</div>
6454
</div>
65-
</form>
55+
</div>
56+
<div class="field is-grouped">
57+
<div class="control">
58+
<button class="button is-link is-rounded" type="submit">Submit</button>
59+
</div>
60+
</div>
61+
</form>
6662
</div>
6763
</div>
6864
</section>
69-
70-
{% endblock content %}
71-
65+
{% endblock content %}

0 commit comments

Comments
 (0)