diff --git a/src/FOSSDB/settings.py b/src/FOSSDB/settings.py index 1fd65fd..bada5dd 100644 --- a/src/FOSSDB/settings.py +++ b/src/FOSSDB/settings.py @@ -35,19 +35,19 @@ DEBUG = config["DEBUG"] # Application definition INSTALLED_APPS = [ - "fossdb", - "account", - "main", - "search_views", - "tailwind", - "tokyonight_night", - "fontawesomefree", "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", + "account", + "main", + "fossdb", + "search_views", + "tailwind", + "tokyonight_night", + "fontawesomefree", ] TAILWIND_APP_NAME = "tokyonight_night" diff --git a/src/apps/account/templates/login.html b/src/apps/account/templates/login.html index 44b76df..fa2d774 100644 --- a/src/apps/account/templates/login.html +++ b/src/apps/account/templates/login.html @@ -2,7 +2,7 @@ {% load static %} {% block title %}{{ title }}{% endblock %} {% block meta %} - + {% endblock meta %} {% block content %}
Login

Don't have an account? Create one Here! + href="{% url "signup" %}">Here!

{% endblock %} diff --git a/src/apps/account/templates/profile.html b/src/apps/account/templates/profile.html index f825d88..19bfc3f 100644 --- a/src/apps/account/templates/profile.html +++ b/src/apps/account/templates/profile.html @@ -5,10 +5,10 @@ {% block content %}
- + - +
diff --git a/src/apps/account/templates/setting.html b/src/apps/account/templates/setting.html index accbc54..a0b9b6b 100644 --- a/src/apps/account/templates/setting.html +++ b/src/apps/account/templates/setting.html @@ -5,7 +5,7 @@ {% block content %}
diff --git a/src/apps/account/templates/signup.html b/src/apps/account/templates/signup.html index 2767fc9..9bf9db2 100644 --- a/src/apps/account/templates/signup.html +++ b/src/apps/account/templates/signup.html @@ -2,7 +2,7 @@ {% load static %} {% block title %}{{ title }}{% endblock %} {% block meta %} - + {% endblock meta %} {% block content %}
{% if form.username.errors %}

{{ form.username.errors }}

{% endif %} {% if form.email.errors %}

{{ form.email.errors }}

{% endif %} {% if form.password1.errors %}

{{ form.password1.errors }}

{% endif %} {% if form.password2.errors %}

{{ form.password2.errors }}

{% endif %}

- Have an account? Login Here! + Have an account? Login Here!

{% endblock %} diff --git a/src/apps/account/views.py b/src/apps/account/views.py index 7ba82a1..e1d98e2 100644 --- a/src/apps/account/views.py +++ b/src/apps/account/views.py @@ -3,6 +3,7 @@ from django.contrib.auth import authenticate, login, logout, update_session_auth from django.contrib.auth.forms import PasswordChangeForm from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import redirect, render +from django.urls import reverse_lazy from django.views.generic import ListView, TemplateView, View from fossdb.models import Project @@ -12,7 +13,7 @@ from .forms import LoginForm, SignUpForm, UserChangeForm class ProfileUpdateView(LoginRequiredMixin, TemplateView): template_name = "setting.html" - login_url = "/login/" + login_url = reverse_lazy("login") redirect_field_name = "redirect_to" def get(self, request): @@ -67,7 +68,7 @@ class ProfileProjectListView(LoginRequiredMixin, ListView): model = Project template_name = "profile.html" context_object_name = "projects" - login_url = "/login/" + login_url = reverse_lazy("login") redirect_field_name = "redirect_to" def get_queryset(self): diff --git a/src/apps/fossdb/templates/detailed_view.html b/src/apps/fossdb/templates/detailed_view.html index 69e34a0..51e78ed 100644 --- a/src/apps/fossdb/templates/detailed_view.html +++ b/src/apps/fossdb/templates/detailed_view.html @@ -1,15 +1,15 @@ {% extends "base.html" %} -{% load static %} +{% load static custom_filters %} {% block title %}{{ project.owner }}/{{ project.name }}{% endblock %} {% block meta %} - + {% endblock meta %} {% block content %}

{{ project.name }}

- By {{ project.owner }} + By {{ project.owner }}

@@ -77,7 +77,7 @@
{% for tag in project.tag.all|dictsort:"name" %} - + {{ tag }} @@ -88,7 +88,7 @@ {% if user == project.owner %} diff --git a/src/apps/fossdb/templates/explore.html b/src/apps/fossdb/templates/explore.html index 233c55e..fd2ef50 100644 --- a/src/apps/fossdb/templates/explore.html +++ b/src/apps/fossdb/templates/explore.html @@ -4,13 +4,13 @@ {% block meta %}{% endblock %} {% block content %}
-

Projects

+

Projects

{% for project in projects %}
-

{{ project.name }}

+

{{ project.name }}

{{ project.description|slice:500 }}

diff --git a/src/apps/fossdb/templatetags/custom_filters.py b/src/apps/fossdb/templatetags/custom_filters.py new file mode 100644 index 0000000..bdb5afa --- /dev/null +++ b/src/apps/fossdb/templatetags/custom_filters.py @@ -0,0 +1,8 @@ +from django import template + +register = template.Library() + + +@register.filter +def remove_spaces(value): + return value.replace(" ", "+") diff --git a/src/apps/main/apps.py b/src/apps/main/apps.py index 167f044..34f1451 100644 --- a/src/apps/main/apps.py +++ b/src/apps/main/apps.py @@ -2,5 +2,5 @@ from django.apps import AppConfig class MainConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'main' + default_auto_field = "django.db.models.BigAutoField" + name = "main" diff --git a/src/apps/main/templates/dashboard.html b/src/apps/main/templates/dashboard.html index c4b9433..375c5fe 100644 --- a/src/apps/main/templates/dashboard.html +++ b/src/apps/main/templates/dashboard.html @@ -2,4 +2,8 @@ {% load static %} {% block title %}{{ title }}{% endblock %} {% block meta %}{% endblock %} -{% block content %}{% endblock %} +{% block content %} +
+

Dashboard

+
+{% endblock %} diff --git a/src/apps/main/templates/help.html b/src/apps/main/templates/help.html index c4b9433..ac3d367 100644 --- a/src/apps/main/templates/help.html +++ b/src/apps/main/templates/help.html @@ -2,4 +2,8 @@ {% load static %} {% block title %}{{ title }}{% endblock %} {% block meta %}{% endblock %} -{% block content %}{% endblock %} +{% block content %} +
+

Help

+
+{% endblock %} diff --git a/src/apps/main/templates/homepage.html b/src/apps/main/templates/homepage.html index c4b9433..6be4500 100644 --- a/src/apps/main/templates/homepage.html +++ b/src/apps/main/templates/homepage.html @@ -2,4 +2,8 @@ {% load static %} {% block title %}{{ title }}{% endblock %} {% block meta %}{% endblock %} -{% block content %}{% endblock %} +{% block content %} +
+

Welcome to FOSSDB!

+
+{% endblock %} diff --git a/src/apps/main/templates/news.html b/src/apps/main/templates/news.html index c4b9433..4fbe9b6 100644 --- a/src/apps/main/templates/news.html +++ b/src/apps/main/templates/news.html @@ -2,4 +2,8 @@ {% load static %} {% block title %}{{ title }}{% endblock %} {% block meta %}{% endblock %} -{% block content %}{% endblock %} +{% block content %} +
+

News

+
+{% endblock %} diff --git a/src/apps/tokyonight_night/static_src/tailwind.config.js b/src/apps/tokyonight_night/static_src/tailwind.config.js index 1f8e88b..455ff35 100644 --- a/src/apps/tokyonight_night/static_src/tailwind.config.js +++ b/src/apps/tokyonight_night/static_src/tailwind.config.js @@ -123,14 +123,6 @@ module.exports = { ], roboto: ["Roboto", "Helvetica", "Arial", "sans-serif"], }, - fontSize: { - base: "1rem", - xl: "1.25rem", - "2xl": "1.5rem", - "3xl": "2rem", - "4xl": "4rem", - xs: "0.75rem", - }, extend: {}, }, plugins: [ diff --git a/src/apps/tokyonight_night/templates/base.html b/src/apps/tokyonight_night/templates/base.html index a3f0a1f..d46127f 100644 --- a/src/apps/tokyonight_night/templates/base.html +++ b/src/apps/tokyonight_night/templates/base.html @@ -2,7 +2,7 @@ - + @@ -16,8 +16,7 @@ {% tailwind_css %} - + {% block meta %}{% endblock %} {% block title %}{% endblock %} @@ -27,16 +26,13 @@ <header class="flex justify-between items-center px-6 py-2 font-abel text-xl"> <div class="flex justify-between"> <!-- logo --> - <div class="flex items-center text-4xl font-rationale"> - <img class="" - width="40" - src="{% static 'img/icons/logo.svg' %}" - alt="logo" /> + <div class="flex items-center text-5xl font-rationale font-bold"> + <img class="" width="40" src="{% static "img/icons/logo.svg" %}" alt="logo" /> <a class="hover:text-skyblue-300 transform duration-300 ease-linear" - href="{% url 'homepage' %}">foss<span class="text-skyblue-300">db</span></a> + href="{% url "homepage" %}">foss<span class="text-skyblue-300">db</span></a> </div> <!-- search --> - <form action="{% url 'search' %}" + <form action="{% url "search" %}" method="get" class="relative items-center flex"> <input type="text" @@ -46,15 +42,15 @@ </form> <!-- navbar --> <nav class="uppercase flex gap-x-6 items-center"> - <a href="{% url 'explore' %}" + <a href="{% url "explore" %}" class="hover:text-skyblue-300 transform duration-200 ease-linear">explore</a> - <a href="{% url 'contribute' %}" + <a href="{% url "contribute" %}" class="hover:text-skyblue-300 transform duration-200 ease-linear">contribute</a> - <a href="{% url 'news' %}" + <a href="{% url "news" %}" class="hover:text-skyblue-300 transform duration-200 ease-linear">news</a> - <a href="{% url 'dashboard' %}" + <a href="{% url "dashboard" %}" class="hover:text-skyblue-300 transform duration-200 ease-linear">dashboard</a> - <a href="{% url 'help' %}" + <a href="{% url "help" %}" class="hover:text-skyblue-300 transform duration-200 ease-linear">help</a> </nav> </div> @@ -63,12 +59,12 @@ {% if user.is_authenticated %} <div class="flex items-center justify-between"> <p class="mx-4">{{ user.username }}</p> - <a href="{% url 'profile' user.username %}"> + <a href="{% url "profile" user.username %}"> <img src="{{ user.profile.picture.url }}" class="w-[2rem]" alt="pic" /> </a> </div> {% else %} - <a href="{% url 'login' %}" + <a href="{% url "login" %}" class="hover:text-skyblue-300 transition duration-300 ease-linear"><i class="fa-solid fa-user fa-lg ml-4 "></i></a> {% endif %} </div> @@ -76,8 +72,8 @@ <main class="flex flex-col flex-grow"> {% block content %}{% endblock %} </main> - <footer class="w-full h-32 flex items-center text-slategray-200 bg-gray-500 mt-32 font-condensed border-gradient-horizontal"> - <div class="p-8"> + <footer class="w-full h-auto flex text-slategray-200 bg-gray-500 mt-32 font-condensed border-gradient-horizontal mb-2"> + <div class="p-8 w-full flex justify-between"> <div class="space-y-4 text-left"> <p> FOSSDB is a passion project of <a class="underline" @@ -86,8 +82,22 @@ </p> <!-- TODO: finish these sentences --> <p>This site has no affiliation with GitHub or any other hosting platform.</p> + <p> + P. S. All users with "_bot" are generated by the site owner. If you are the original owner, please contact the administrator. + </p> + </div> + <div class=""> + <div class="flex items-center justify-center gap-4"> + <p>Have some feedback? Come chat with us!</p> + <a href=""> + <img class="w-10" src="{% static "img/icons/discord.svg" %}" alt="discord" /> + </a> + <a href=""> + <img class="w-10" src="{% static "img/icons/irc.svg" %}" alt="matrix" /> + </a> + <div class="flex justify-center gap-4"></div> + </div> </div> - <div></div> </div> </footer> </body> diff --git a/src/static/img/icons/discord.svg b/src/static/img/icons/discord.svg new file mode 100644 index 0000000..4613aa9 --- /dev/null +++ b/src/static/img/icons/discord.svg @@ -0,0 +1 @@ +<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 245 240"><style>.st0{fill:#FFFFFF;}</style><path class="st0" d="M104.4 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1.1-6.1-4.5-11.1-10.2-11.1zM140.9 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1s-4.5-11.1-10.2-11.1z"/><path class="st0" d="M189.5 20h-134C44.2 20 35 29.2 35 40.6v135.2c0 11.4 9.2 20.6 20.5 20.6h113.4l-5.3-18.5 12.8 11.9 12.1 11.2 21.5 19V40.6c0-11.4-9.2-20.6-20.5-20.6zm-38.6 130.6s-3.6-4.3-6.6-8.1c13.1-3.7 18.1-11.9 18.1-11.9-4.1 2.7-8 4.6-11.5 5.9-5 2.1-9.8 3.5-14.5 4.3-9.6 1.8-18.4 1.3-25.9-.1-5.7-1.1-10.6-2.7-14.7-4.3-2.3-.9-4.8-2-7.3-3.4-.3-.2-.6-.3-.9-.5-.2-.1-.3-.2-.4-.3-1.8-1-2.8-1.7-2.8-1.7s4.8 8 17.5 11.8c-3 3.8-6.7 8.3-6.7 8.3-22.1-.7-30.5-15.2-30.5-15.2 0-32.2 14.4-58.3 14.4-58.3 14.4-10.8 28.1-10.5 28.1-10.5l1 1.2c-18 5.2-26.3 13.1-26.3 13.1s2.2-1.2 5.9-2.9c10.7-4.7 19.2-6 22.7-6.3.6-.1 1.1-.2 1.7-.2 6.1-.8 13-1 20.2-.2 9.5 1.1 19.7 3.9 30.1 9.6 0 0-7.9-7.5-24.9-12.7l1.4-1.6s13.7-.3 28.1 10.5c0 0 14.4 26.1 14.4 58.3 0 0-8.5 14.5-30.6 15.2z"/></svg> \ No newline at end of file diff --git a/src/static/img/icons/irc.svg b/src/static/img/icons/irc.svg new file mode 100644 index 0000000..c6ee7e7 --- /dev/null +++ b/src/static/img/icons/irc.svg @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + id="Layer_1" + viewBox="0 0 245 240" + version="1.1" + sodipodi:docname="discord_white.svg" + inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20, custom)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <defs + id="defs11"> + <rect + x="65" + y="45" + width="125" + height="125" + id="rect9079" /> + </defs> + <sodipodi:namedview + id="namedview9" + pagecolor="#505050" + bordercolor="#eeeeee" + borderopacity="1" + inkscape:pageshadow="0" + inkscape:pageopacity="0" + inkscape:pagecheckerboard="0" + showgrid="true" + inkscape:zoom="3.7417734" + inkscape:cx="122.26823" + inkscape:cy="118.79394" + inkscape:window-width="1920" + inkscape:window-height="1022" + inkscape:window-x="1920" + inkscape:window-y="32" + inkscape:window-maximized="1" + inkscape:current-layer="Layer_1"> + <inkscape:grid + type="xygrid" + id="grid1075" /> + </sodipodi:namedview> + <style + id="style2">.st0{fill:#FFFFFF;}</style> + <path + id="path1364" + style="fill:#ffffff;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 55.5 20 C 44.2 20 35 29.199609 35 40.599609 L 35 175.80078 C 35 187.20078 44.2 196.40039 55.5 196.40039 L 168.90039 196.40039 L 163.59961 177.90039 L 176.40039 189.80078 L 188.5 201 L 210 220 L 210 40.599609 C 210 29.199609 200.8 20 189.5 20 L 55.5 20 z M 110.75586 37.820312 L 125.94336 37.820312 L 116.19336 76.726562 L 143.56836 76.726562 L 153.41211 37.820312 L 168.41211 37.820312 L 158.75586 76.726562 L 188.00586 76.726562 L 188.00586 91.164062 L 155.09961 91.164062 L 147.41211 122.47656 L 177.22461 122.47656 L 177.22461 136.82031 L 143.75586 136.82031 L 134.00586 175.63281 L 119.00586 175.63281 L 128.66211 136.82031 L 101.19336 136.82031 L 91.537109 175.63281 L 76.443359 175.63281 L 86.193359 136.82031 L 56.662109 136.82031 L 56.662109 122.47656 L 89.662109 122.47656 L 97.537109 91.164062 L 67.349609 91.164062 L 67.349609 76.726562 L 101.19336 76.726562 L 110.75586 37.820312 z M 112.72461 91.164062 L 104.84961 122.47656 L 132.31836 122.47656 L 140.00586 91.164062 L 112.72461 91.164062 z " /> + <text + xml:space="preserve" + id="text9077" + style="font-style:normal;font-weight:normal;font-size:192px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect9079);fill:#000000;fill-opacity:1;stroke:none"><tspan + x="65" + y="339.875" + id="tspan51300"><tspan + style="font-size:96px;font-family:Inconsolata;-inkscape-font-specification:Inconsolata" + id="tspan51298">#</tspan></tspan></text> +</svg>