Skip to content

Commit

Permalink
Added base to html pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
GGWPXXXX committed Sep 29, 2023
1 parent 77535ad commit b6db651
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 48 deletions.
16 changes: 16 additions & 0 deletions polls/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{% load static %}
<link rel="stylesheet" href="{% static 'style.css' %}" />
{% load static %}
<script src={% static '/js/script.js' %}>
</script>
</head>
<body>
{% block content %}{% endblock content %}
</body>

</html>
21 changes: 4 additions & 17 deletions polls/templates/detail.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Detail</title>
{% load static %}
<link rel="stylesheet" href="{% static 'style.css' %}" />
{% load static %}
<script src={% static '/js/script.js' %}>
</script>
</head>
<body>
{% extends "base.html" %}
{% block content %}
<title>Detail</title>
<script>
var is_login = {% if user.is_authenticated %}true{% else %}false{% endif %};
</script>
Expand All @@ -37,7 +27,4 @@
<input type="submit" value="Vote" id="voteBTN" />

</form>


</body>
</html>
{% endblock %}
24 changes: 5 additions & 19 deletions polls/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>KU Polls</title>
{% load static %}
<link rel="stylesheet" href="{% static 'style.css' %}">
{% load static %}
<script src={% static '/js/script.js' %}>
</script>

</head>
<body>
{% extends "base.html" %}
{% block content %}
<title>Polls</title>
<div id="header">
<ul>
{% if user.is_authenticated %}
Expand All @@ -20,7 +9,7 @@
<li><a href="{% url 'logout'%}">Logout</a></li>
{% else %}
<li><a href="{% url 'polls:index' %}">Home</a></li>
<li><a href="{% url 'signup'%}">SignUp</a></a></li>
<li><a href="{% url 'signup'%}">SignUp</a></li>
<li><a href="{% url 'login' %}">Login</a></li>
<li><a href="{% url 'admin:login' %}">Admin</a></li>
{% endif %}
Expand Down Expand Up @@ -124,7 +113,4 @@ <h1>Result</h1>
<div id="footer">
<p>© 2023 KU Polls By <a href="https://github.com/GGWPXXXX" target="_blank">GG_WPX, 2023</a></p>
</div>


</body>
</html>
{% endblock %}
15 changes: 3 additions & 12 deletions polls/templates/results.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Result</title>
{% load static %}
<link rel="stylesheet" href="{% static 'style.css' %}" />
</head>
<body>
{% extends "base.html" %}
{% block content %}
<table border="1" id="result_table">
<tr>
<th>
Expand Down Expand Up @@ -38,5 +30,4 @@ <h1>Vote Count</h1>
<form action="{% url 'polls:index' %}" method="get">
<input type="submit" id="home_result" value="Back to home" />
</form>
</body>
</html>
{% endblock %}

0 comments on commit b6db651

Please sign in to comment.