Skip to content

Commit

Permalink
feat: initialize navbar and footer design
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew4Coding committed Oct 11, 2024
1 parent a5a18a7 commit ab26939
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 17 deletions.
6 changes: 3 additions & 3 deletions modules/authentication/templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
>
<img src={% static "assets/icon.png" %} alt="icon" class="w-20 object-contain">
<h1
class="font-bold text-xl sm:text-2xl text-center"
class="font-semibold text-xl text-center"
>Welcome to EventYog!</h1>
<form method="POST" action="" class="flex flex-col gap-5 bg-white">
{% csrf_token %}
<input type="hidden" name="remember" value="true">
<div class="rounded-md shadow-sm -space-y-px flex flex-col gap-5">
<div>
<label for="username" class="sr-only">Username</label>
<input id="username" name="username" type="text" required class="bg-[#F2F2F2] py-3 px-10 text-black placeholder:text-[#C9C9C9] focus:outline-none font-semibold placeholder:font-normal rounded-3xl justify-center" placeholder="Username">
<input id="username" name="username" type="text" required class="bg-[#F2F2F2] py-3 px-10 text-black placeholder:text-[#C9C9C9] focus:outline-none font-normal rounded-3xl justify-center" placeholder="Username">
</div>
<div>
<label for="password" class="sr-only">Password</label>
<input id="password" name="password" type="password" required class="bg-[#F2F2F2] py-3 px-10 text-black placeholder:text-[#C9C9C9] focus:outline-none font-semibold placeholder:font-normal rounded-3xl justify-center" placeholder="Password">
<input id="password" name="password" type="password" required class="bg-[#F2F2F2] py-3 px-10 text-black placeholder:text-[#C9C9C9] focus:outline-none font-normal rounded-3xl justify-center" placeholder="Password">
</div>
</div>
<button
Expand Down
4 changes: 2 additions & 2 deletions modules/authentication/templates/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
>
<img src={% static "assets/icon.png" %} alt="icon" class="w-20 object-contain">
<h1
class="font-bold text-xl sm:text-2xl text-center"
class="font-semibold text-xl text-center"
>Register to EventYog!</h1>
<form method="POST" action="" class="flex flex-col gap-5 bg-white">
{% csrf_token %}
<input type="hidden" name="remember" value="true">
<div class="rounded-md shadow-sm -space-y-px flex flex-col gap-5">
{% for field in form %}
<div class="{% if not forloop.first %}mt-4{% endif %}">
<label for="{{ field.id_for_label }}" class="mb-2 font-semibold text-black">
<label for="{{ field.id_for_label }}" class="mb-2 font-semibold text-black text-sm">
{{ field.label }}
</label>
<div class="relative">
Expand Down
4 changes: 1 addition & 3 deletions modules/authentication/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ def login_user(request):
return response
else:
messages.error(request, "Invalid username or password")


else:
form = AuthenticationForm(request)

context = {'form': form}
context = {'form': form, 'show_navbar': False, 'show_footer': False}
return render(request, 'login.html', context)

def logout_user(request):
Expand Down
2 changes: 1 addition & 1 deletion modules/main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# Create your views here.
@login_required(login_url='auth:login')
def main(request):
return render(request, 'base.html')
return render(request, 'base.html', {'show_navbar': True, 'show_footer': True})
Binary file added static/assets/eventyog-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 11 additions & 4 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@
<title>Eventyog</title>
</head>
<body class="font-Poppins">
<main class="flex flex-col">
{% include "ds/navbar.html" %}
{% block content %}{% endblock content%}
{% include "ds/footer.html" %}
<main class="flex flex-col min-h-screen">
{% if show_navbar %}
{% include "ds/navbar.html" %}
{% endif %}
<div class="container h-full min-h-screen">
{% block content %}{% endblock content%}
</div>

{% if show_footer %}
{% include "ds/footer.html" %}
{% endif %}
</main>
</body>
</main>
17 changes: 15 additions & 2 deletions templates/ds/footer.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
<footer>
<h1>Ini Footer</h1>
{% load static %}
<footer class="px-10 py-10 bg-[#003FE2] text-white flex flex-col gap-5">
<div
class="flex gap-6 items-center justify-center"
>
<img
src="{% static 'assets/eventyog-white.png' %}"
alt="icon"
class="w-16 object-contain"
/>
<h1 class="font-semibold text-xl">EventYog</h1>
</div>
<div class="w-full flex justify-center">
<h3 class="text-xs">&copy; 2024 EventYog!</h3>
</div>
</footer>
18 changes: 16 additions & 2 deletions templates/ds/navbar.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
<nav>
<h1>Ini Navbar</h1>
{% load static %}
<nav class="px-10 flex items-center py-5 justify-between border-b-[1px] border-black/10">
<img src={% static "assets/icon.png" %} alt="icon" class="w-16 object-contain">
<div
class="flex items-center gap-5"
>
<p class="text-sm">Hello, {{user.username}}!</p>
<div class="w-10 h-10 bg-black rounded-full overflow-hidden">
</div>
<a href="{% url 'auth:logout'%}">
<button
class="bg-[#003FE2] text-white text-sm font-semibold rounded-2xl h-full hover:scale-105 duration-300 ml-auto px-5 py-2">
Logout
</button>
</a>
</div>
</nav>

0 comments on commit ab26939

Please sign in to comment.