Created main app

This commit is contained in:
Kristofers Solo 2023-06-28 16:19:54 +00:00
parent 6ea8e2c3c3
commit a77bf0eb5b
13 changed files with 67 additions and 6 deletions

View File

@ -35,6 +35,7 @@ DEBUG = config["DEBUG"]
# Application definition
INSTALLED_APPS = [
"main",
"account",
"fossdb",
"django_filters",

View File

@ -21,6 +21,7 @@ urlpatterns = [
path("admin/", admin.site.urls),
path("", include("account.urls")),
path("", include("fossdb.urls")),
path("", include("main.urls")),
path("", include("django.contrib.auth.urls")),
]
if settings.DEBUG:

View File

3
src/apps/main/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
src/apps/main/apps.py Normal file
View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class MainConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'main'

View File

3
src/apps/main/models.py Normal file
View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
src/apps/main/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

11
src/apps/main/urls.py Normal file
View File

@ -0,0 +1,11 @@
from django.urls import path
from . import views
urlpatterns = [
path("", views.homepage, name="homepage"),
path("contribute/", views.contribute, name="contribute"),
path("news/", views.news, name="news"),
path("dashboard/", views.dashboard, name="dashboard"),
path("help/", views.help, name="help"),
]

21
src/apps/main/views.py Normal file
View File

@ -0,0 +1,21 @@
from django.shortcuts import render
def homepage(request):
return render(request, "main/homepage.html", {"title": "FOSSDB"})
def contribute(request):
return render(request, "main/contribute.html", {"title": "FOSSDB | Contribute"})
def news(request):
return render(request, "main/news.html", {"title": "FOSSDB | News"})
def dashboard(request):
return render(request, "main/dashboard.html", {"title": "FOSSDB | Dashboard"})
def help(request):
return render(request, "main/help.html", {"title": "FOSSDB | Help"})

View File

@ -21,7 +21,8 @@
width="40"
src="{% static 'img/icons/logo.svg' %}"
alt="logo" />
<a class="hover:text-skyblue transform duration-300 ease-in-out" href="">foss<span class="text-skyblue">db</span></a>
<a class="hover:text-skyblue transform duration-300 ease-in-out"
href="{% url 'homepage' %}">foss<span class="text-skyblue">db</span></a>
</div>
<!-- search -->
<div class="relative items-center flex">
@ -31,11 +32,16 @@
</div>
<!-- navbar -->
<nav class="uppercase flex gap-x-6 items-center">
<a href="" class="hover:text-skyblue transform duration-200 ease-in-out">explore</a>
<a href="" class="hover:text-skyblue transform duration-200 ease-in-out">contribute</a>
<a href="" class="hover:text-skyblue transform duration-200 ease-in-out">news</a>
<a href="" class="hover:text-skyblue transform duration-200 ease-in-out">dashboard</a>
<a href="" class="hover:text-skyblue transform duration-200 ease-in-out">help</a>
<a href="{% url 'explore' %}"
class="hover:text-skyblue transform duration-200 ease-in-out">explore</a>
<a href="{% url 'contribute' %}"
class="hover:text-skyblue transform duration-200 ease-in-out">contribute</a>
<a href="{% url 'news' %}"
class="hover:text-skyblue transform duration-200 ease-in-out">news</a>
<a href="{% url 'dashboard' %}"
class="hover:text-skyblue transform duration-200 ease-in-out">dashboard</a>
<a href="{% url 'help' %}"
class="hover:text-skyblue transform duration-200 ease-in-out">help</a>
</nav>
</div>
<div class="">
@ -45,6 +51,7 @@
</div>
</header>
<main class="flex-grow">
{% block content %}{% endblock %}
</main>
<footer class="h-32 flex items-center text-slategray bg-gray-200 mb-1 mt-4 font-condensed">
<div class="p-8">

View File

@ -0,0 +1,5 @@
{% extends "layout.html" %}
{% load static %}
{% block title %}{{ title }}{% endblock %}
{% block meta %}{% endblock %}
{% block content %}{% endblock %}