Fakultas Ilmu Komputer UI

Commit abb38713 authored by Mikhael's avatar Mikhael
Browse files

[#13] Bugfix: Homepage UI Fix

parent 8db4e2fe
<nav class="navbar navbar-expand-lg navbar-light static-top shadow katalog-navbar"> <!-- Sidebar Toggle (Topbar) -->
<div class="sidebar-brand-text navbar-brand">Digipus</div>
<nav class="navbar navbar-expand-lg navbar-light sticky-top shadow katalog-navbar"> <!-- Sidebar Toggle (Topbar) -->
<a class="sidebar-brand-text navbar-brand" href="/">Digipus</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="/">Home<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="/forum">Forum</a>
</li>
......@@ -21,16 +18,24 @@
</li>
{% if not request.user.is_authenticated %}
<li class="nav-item">
<a class="nav-link" href="/registrasi/umum">Registrasi Umum</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/registrasi">Registrasi Kontributor</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/login">Login</a>
<div class="dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Registrasi</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/registrasi/umum">Umum</a>
<a class="dropdown-item" href="/registrasi">Kontributor</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="/login_admin">Login Admin</a>
<div class="dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Login</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/login">Kontributor</a>
<a class="dropdown-item" href="/login_admin">Admin</a>
</div>
</div>
</li>
{% else %}
{% if request.user.is_contributor %}
......
......@@ -99,16 +99,20 @@
</h2>
</div>
<div id="collapseOne" class="collapse" aria-labelledby="headingOne"
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne"
data-parent="#accordionExample">
<div class="card-body">
<ul>
{% for itemKategori in kategori_list %}
<li>
<a href="?kategori={{itemKategori.pk}}">{{itemKategori.name}}</a>
</li>
{% endfor %}
</ul>
{% if kategori_list.count != 0 %}
<ul>
{% for itemKategori in kategori_list %}
<li>
<a href="?kategori={{itemKategori.pk}}">{{itemKategori.name}}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p class="text-center">Belum ada kategori</p>
{% endif %}
</div>
</div>
</div>
......
......@@ -3463,45 +3463,55 @@ class LandingPageNavbarTest(TestCase):
def test_navbar_admin(self):
self.client.login(**self.admin_credential)
response = self.client.get('/')
self.assertContains(response, '<a class="nav-link" href="/">Home<span class="sr-only">(current)</span></a>')
self.assertContains(response, '<a class="sidebar-brand-text navbar-brand" href="/">Digipus</a>')
self.assertContains(response, '<a class="nav-link" href="/forum">Forum</a>')
self.assertContains(response, '<a class="nav-link" href="/news/all">Berita</a>')
self.assertContains(response, '<a class="nav-link" href="/administration">Administrasi</a>')
self.assertContains(response, '<a class="nav-link" href="/profil">Profil</a>')
self.assertContains(response, '<a class="nav-link" href="/logout">Logout</a>')
self.assertNotContains(response, '<a class="nav-link" href="/logout">LogoutX</a>')
self.assertContains(response, '<a class="nav-link" href="/administration">Administrasi</a>')
self.assertNotContains(response, '<a class="nav-link" href="/dashboard">Dasbor</a>')
def test_navbar_contributor(self):
self.client.login(**self.contributor_credential)
response = self.client.get('/')
self.assertContains(response, '<a class="nav-link" href="/">Home<span class="sr-only">(current)</span></a>')
self.assertContains(response, '<a class="sidebar-brand-text navbar-brand" href="/">Digipus</a>')
self.assertContains(response, '<a class="nav-link" href="/forum">Forum</a>')
self.assertContains(response, '<a class="nav-link" href="/news/all">Berita</a>')
self.assertContains(response, '<a class="nav-link" href="/dashboard">Dasbor</a>')
self.assertContains(response, '<a class="nav-link" href="/profil">Profil</a>')
self.assertContains(response, '<a class="nav-link" href="/logout">Logout</a>')
self.assertNotContains(response, '<a class="nav-link" href="/logout">LogoutX</a>')
self.assertContains(response, '<a class="nav-link" href="/dashboard">Dasbor</a>')
self.assertNotContains(response, '<a class="nav-link" href="/administration">Administrasi</a>')
def test_navbar_public(self):
self.client.login(**self.public_credential)
response = self.client.get('/')
self.assertContains(response, '<a class="nav-link" href="/">Home<span class="sr-only">(current)</span></a>')
self.assertContains(response, '<a class="sidebar-brand-text navbar-brand" href="/">Digipus</a>')
self.assertContains(response, '<a class="nav-link" href="/forum">Forum</a>')
self.assertContains(response, '<a class="nav-link" href="/news/all">Berita</a>')
self.assertContains(response, '<a class="nav-link" href="/profil">Profil</a>')
self.assertContains(response, '<a class="nav-link" href="/logout">Logout</a>')
self.assertNotContains(response, '<a class="nav-link" href="/logout">LogoutX</a>')
self.assertNotContains(response, '<a class="nav-link" href="/dashboard">Dasbor</a>')
self.assertNotContains(response, '<a class="nav-link" href="/administration">Administrasi</a>')
def test_navbar_anonymous(self):
response = self.client.get('/')
self.assertContains(response, '<a class="nav-link" href="/">Home<span class="sr-only">(current)</span></a>')
self.assertContains(response, '<a class="sidebar-brand-text navbar-brand" href="/">Digipus</a>')
self.assertContains(response, '<a class="nav-link" href="/forum">Forum</a>')
self.assertContains(response, '<a class="nav-link" href="/news/all">Berita</a>')
self.assertContains(response, '<a class="nav-link" href="/registrasi/umum">Registrasi Umum</a>')
self.assertContains(response, '<a class="nav-link" href="/registrasi">Registrasi Kontributor</a>')
self.assertContains(response, '<a class="nav-link" href="/login">Login</a>')
self.assertContains(response, '<a class="nav-link" href="/login_admin">Login Admin</a>')
self.assertNotContains(response, '<a class="nav-link" href="/logout">LogoutX</a>')
self.assertContains(
response,
'<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">'
)
self.assertContains(response, 'Registrasi</a>')
self.assertContains(response, '<a class="dropdown-item" href="/registrasi/umum">Umum</a>')
self.assertContains(response, '<a class="dropdown-item" href="/registrasi">Kontributor</a>')
self.assertContains(response, 'Login</a>')
self.assertContains(response, '<a class="dropdown-item" href="/login">Kontributor</a>')
self.assertContains(response, '<a class="dropdown-item" href="/login_admin">Admin</a>')
self.assertNotContains(response, '<a class="nav-link" href="/profil">Profil</a>')
self.assertNotContains(response, '<a class="nav-link" href="/logout">Logout</a>')
self.assertNotContains(response, '<a class="nav-link" href="/dashboard">Dasbor</a>')
self.assertNotContains(response, '<a class="nav-link" href="/administration">Administrasi</a>')
class MateriRecommendationTest(TestCase):
......
......@@ -72,6 +72,10 @@
<a href="/registrasi" class="txt1">
Ingin jadi kontributor? klik di sini
</a>
<br>
<a href="/" class="txt1">
Kembali ke halaman beranda
</a>
</div>
</div>
......
......@@ -81,6 +81,10 @@
<a href="/registrasi/admin/" class="txt1">
Belum mendaftar? klik di sini
</a>
<br>
<a href="/" class="txt1">
Kembali ke halaman beranda
</a>
</div>
</div>
......
{% load static %}
<br>
<a href="/" class="txt1">
Kembali ke halaman beranda
</a>{% load static %}
<!DOCTYPE html>
<html lang="en">
......@@ -103,6 +107,10 @@
<a href="/login/" class="txt1">
Kembali ke halaman login
</a>
<br>
<a href="/" class="txt1">
Kembali ke halaman beranda
</a>
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment