4 Commits

Author SHA1 Message Date
Aarni Halinen ee1345c90c Merge branch 'develop' into clean-old-templates 2022-01-14 00:00:54 +02:00
Aarni Halinen 28cd34e973 common footer template 2021-11-17 18:16:27 +02:00
Aarni Halinen bfa11ba4fc move footer out of webapp 2021-11-17 18:16:27 +02:00
Aarni Halinen 52f536d350 remove old templates 2021-11-17 18:16:27 +02:00
39 changed files with 80 additions and 508 deletions
+1
View File
@@ -3,6 +3,7 @@ SENTRY_DSN=
HOST=api.dev.sahkoinsinoorikilta.fi
DEBUG=True
SECRET_KEY=7p$85^4ibb^p4-=vs44b7!y0e-zemugze18@a#30&71=a8)dp(
TG_BOT_TOKEN=
DB_NAME=postgres
DB_USER=postgres
DB_PASSWD=postgres
+1
View File
@@ -3,6 +3,7 @@ DEPLOY_ENV=local
HOST=localhost
DEBUG=True
SECRET_KEY=7p$85^4ibb^p4-=vs44b7!y0e-zemugze18@a#30&71=a8)dp(
TG_BOT_TOKEN=
DB_NAME=postgres
DB_USER=postgres
DB_PASSWD=postgres
-1
View File
@@ -1,6 +1,5 @@
members/static/js/lib
infoscreen/static/js/lib
webapp/static/js/lib
static/js/lib
collected_static
venv
+1 -1
View File
@@ -29,7 +29,7 @@
{% block styles %}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="{% static "webapp/css/footer.css" %}">
<link rel="stylesheet" href="{% static "css/footer.css" %}">
{% endblock styles %}
{% block controllers %}
-7
View File
@@ -1,7 +0,0 @@
{% load i18n %}
{% load static %}
<div class="header-content">
<div class="logo">
<a href="/"><img src="{% static "webapp/img/logo_header.png" %}" alt="Aalto-yliopiston Sähköinsinöörikilta ry"></a>
</div>
</div>
+1 -1
View File
@@ -41,5 +41,5 @@
</div>
</div>
{% include "webapp:footer.html" %}
{% include "footer.html" %}
{% endblock body %}
+1 -2
View File
@@ -7,7 +7,6 @@
<link rel="stylesheet" href="{% static "kaehmy/css/base.css" %}">
<link rel="stylesheet" href="{% static "kaehmy/css/header.css" %}">
<link rel="stylesheet" href="{% static "kaehmy/css/nav.css" %}">
<link rel="stylesheet" href="{% static "kaehmy/css/footer.css" %}">
{% endblock styles %}
{% block body %}
@@ -28,7 +27,7 @@
</div>
<div class="footer">
{% block footer %}
{% include "kaehmy:footer.html" %}
{% include "footer.html" %}
{% endblock footer %}
</div>
-24
View File
@@ -1,24 +0,0 @@
{% load i18n %}
{% load static %}
{% load staticfiles %}
<footer style="text-align: center">
<div>
<form class="lang-form form" action="{% url 'set_language' %}" method="post">{% csrf_token %}
<span>
<input name="next" type="hidden" value="{{ redirect_to }}" />
<select onchange="this.form.submit()" class="lang-select form-control" name="language">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
{{ language.name_local }} ({{ language.code }})
</option>
{% endfor %}
</select>
</span>
</form>
<span>{% trans "Copyright Aalto-yliopiston Sähköinsinöörikilta ry" %} {% now 'Y' %}</span>
</div>
</footer>
+1 -1
View File
@@ -35,6 +35,6 @@
<body>
{% block content %}
{% endblock content %}
{% include "webapp:footer.html" %}
{% include "footer.html" %}
</body>
</html>
+2 -2
View File
@@ -22,7 +22,7 @@
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="{% static "members/css/simple-sidebar.css" %}">
<link rel="stylesheet" href="{% static "members/css/members.css" %}">
<link rel="stylesheet" href="{% static "webapp/css/footer.css" %}">
<link rel="stylesheet" href="{% static "css/footer.css" %}">
</head>
<body>
@@ -92,6 +92,6 @@
</div>
</div>
{% include "webapp:footer.html" %}
{% include "footer.html" %}
</body>
</html>
-34
View File
@@ -1,34 +0,0 @@
#footer-div {
height:10vh;
}
footer {
/* position: absolute; */
bottom: 0;
width: 100%;
height: 60px; /* Set the fixed height of the footer here */
/* line-height: 60px; /* Vertically center the text there */
margin-top: 2rem;
margin-bottom: 1rem;
}
footer .container .col .nav .nav-item {
display: inline-block;
margin-right: 3vh;
}
.lang-button {
height: 4vh;
width: 6vh;
margin-left: 1vh;
margin-right: 1vh;
}
.lang-select {
width: 10rem;
display: inline-block;
}
footer .lang-form {
margin: 1rem auto 0;
}
+1 -1
View File
@@ -22,7 +22,7 @@
{% endblock %}
{% block footer %}
{% include "ohlhafv:footer.html" %}
{% include "footer.html" %}
{% endblock footer %}
{% endblock body %}
-25
View File
@@ -1,25 +0,0 @@
{% load i18n %}
{% load static %}
{% load staticfiles %}
<link rel="stylesheet" href="{% static "ohlhafv/css/footer.css" %}">
<footer style="text-align: center">
<div>
<form class="lang-form form" action="{% url 'set_language' %}" method="post">{% csrf_token %}
<span>
<input name="next" type="hidden" value="{{ redirect_to }}" />
<select onchange="this.form.submit()" class="lang-select form-control" name="language">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
{{ language.name_local }} ({{ language.code }})
</option>
{% endfor %}
</select>
</span>
</form>
<span>{% trans "Copyright Aalto-yliopiston Sähköinsinöörikilta ry" %} {% now 'Y' %}</span>
</div>
</footer>
+3
View File
@@ -4,6 +4,9 @@
if test -f "$SECRET_KEY_FILE"; then
export SECRET_KEY=$(cat $SECRET_KEY_FILE)
fi
if test -f "$TG_BOT_TOKEN_FILE"; then
export TG_BOT_TOKEN=$(cat $TG_BOT_TOKEN_FILE)
fi
if test -f "$EMAIL_API_KEY_FILE"; then
export EMAIL_API_KEY=$(cat $EMAIL_API_KEY_FILE)
fi
+3
View File
@@ -58,6 +58,9 @@ DEFAULT_EMAIL_FROM = "SIK"
DEFAULT_EMAIL_FROM_ADDR = "noreply@sahkoinsinoorikilta.fi"
ENABLE_AUTOMATIC_EMAILS = True
# Token for Telegram bot
TELEGRAM_BOT_TOKEN = os.getenv("TG_BOT_TOKEN", "<tg token>")
# Database settings
# Only uncomment if default settings in base.py are not ok
+4
View File
@@ -32,16 +32,20 @@ services:
- DB_PORT=5432
- DB_SSL=True
- SECRET_KEY_FILE=/run/secrets/BACKEND_SECRET_KEY
- TG_BOT_TOKEN_FILE=/run/secrets/BACKEND_TG_BOT_TOKEN
- DB_PASSWD_FILE=/run/secrets/BACKEND_DB_PASSWD
- EMAIL_API_KEY_FILE=/run/secrets/BACKEND_EMAIL_API_KEY
secrets:
- BACKEND_SECRET_KEY
- BACKEND_TG_BOT_TOKEN
- BACKEND_DB_PASSWD
- BACKEND_EMAIL_API_KEY
secrets:
BACKEND_SECRET_KEY:
external: true
BACKEND_TG_BOT_TOKEN:
external: true
BACKEND_DB_PASSWD:
external: true
BACKEND_EMAIL_API_KEY:
+29 -9
View File
@@ -1,12 +1,32 @@
footer {
background-color: #f5f5f5;
margin-top: 1vh;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
#footer-div {
height:10vh;
}
.ml-auto .nav-item {
padding: 1vh;
footer {
bottom: 0;
width: 100%;
height: 60px;
margin-top: 2rem;
margin-bottom: 1rem;
}
footer .container .col .nav .nav-item {
display: inline-block;
margin-right: 3vh;
}
.lang-button {
height: 4vh;
width: 6vh;
margin-left: 1vh;
margin-right: 1vh;
}
.lang-select {
width: 10rem;
display: inline-block;
}
footer .lang-form {
margin: 1rem auto 0;
}
+19 -36
View File
@@ -1,43 +1,26 @@
{% load i18n %}
{% load static %}
{% load staticfiles %}
<link rel="stylesheet" href="{% static "css/footer.css" %}">
<footer class="footer">
<div class="container">
<div class="d-flex align-items-center justify-content-end">
<div class="p-2">
<span><i class="fa fa-copyright"></i>{% trans "Aalto-yliopiston Sähköinsinöörikilta ry" %} {% now 'Y' %}</span>
</div>
<div class="p-2">
<form class="lang-form form" action="{% url 'set_language' %}" method="post">{% csrf_token %}
<span class="form-group">
<input name="next" type="hidden" value="{{ redirect_to }}" />
<select onchange="this.form.submit()" class="lang-select form-control" name="language">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
{{ language.name_local }} ({{ language.code }})
</option>
{% endfor %}
</select>
</span>
</form>
</div>
<div class="ml-auto p-2">
<span class="nav-item">
<a href="/members"><i class="fa fa-group fa-2x"></i></a>
</span>
<span class="nav-item">
<a href="/infoscreen"><i class="fa fa-info fa-2x"></i></a>
</span>
<span class="nav-item">
<a href="/admin"><i class="fa fa-gears fa-2x"></i></a>
</span>
</div>
</div>
<footer style="text-align: center">
<div>
<form class="lang-form form" action="{% url 'set_language' %}" method="post">{% csrf_token %}
<span>
<input name="next" type="hidden" value="{{ redirect_to }}" />
<select onchange="this.form.submit()" class="lang-select form-control" name="language">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
{{ language.name_local }} ({{ language.code }})
</option>
{% endfor %}
</select>
</span>
</form>
<span>{% trans "Copyright Aalto-yliopiston Sähköinsinöörikilta ry" %} {% now 'Y' %}</span>
</div>
</footer>
-6
View File
@@ -1,6 +0,0 @@
.role-container {
background-color: aqua;
width: 200px;
text-align: center;
}
-25
View File
@@ -1,25 +0,0 @@
html {
position: relative;
min-height: 100%;
}
body {
/*Margin bottom by footer hight*/
margin-bottom: 60px;
}
h3 {
margin: 1rem 0 2rem;
}
nav {
margin-bottom: 2rem;
}
.header-content img {
max-width: 100%;
}
.dropdown-toggle {
cursor: pointer;
}
-34
View File
@@ -1,34 +0,0 @@
#footer-div {
height:10vh;
}
footer {
width: 100%;
height: 5rem; /* Set the fixed height of the footer here */
margin-top: 2rem;
}
footer .container .col .nav .nav-item {
display: inline-block;
margin-right: 3vh;
}
.lang-button {
height: 4vh;
width: 6vh;
margin-left: 1vh;
margin-right: 1vh;
}
.lang-select {
width: 10rem;
display: inline-block;
}
footer .lang-form {
margin: 1rem auto 0;
}
.footer-padder {
margin-top: 6rem; /* height of the footer element */
}
-13
View File
@@ -1,13 +0,0 @@
.header-content {
}
.header-content .logo {
}
.header-content .logo img {
display: block;
height: auto;
margin: auto;
}
-3
View File
@@ -1,3 +0,0 @@
.login.container {
margin-top: 2rem;
}
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

-39
View File
@@ -1,39 +0,0 @@
{% extends "project.html" %}
{% load i18n %}
{% load static %}
{% load staticfiles %}
{% block styles %}
<link rel="stylesheet" href="{% static "webapp/css/base.css" %}">
<link rel="stylesheet" href="{% static "webapp/css/header.css" %}">
<link rel="stylesheet" href="{% static "webapp/css/footer.css" %}">
{% endblock styles %}
{% block body %}
<div class="container">
<div class="row">
<div class="col">
{% block header %}
{% include "webapp:header.html" %}
{% endblock %}
</div>
</div>
<div class="row">
<div class="col">
{% block navigation %}
{% include "webapp:navigation.html" %}
{% endblock %}
</div>
</div>
<div class="row">
<div class="col">
{% block content %}
{% endblock %}
</div>
</div>
</div>
{% block footer %}
{% include "webapp:footer.html" %}
{% endblock footer %}
{% endblock %}
-40
View File
@@ -1,40 +0,0 @@
{% extends "webapp:base.html" %}
{% block content %}
{% load i18n %}
<div class="contact_div">
{% load static %}
<link rel="stylesheet" href="{% static "css/contact.css" %}">
<h2>{% trans "Contact" %}</h2>
{% if committees %}
{% for committee in committees %}
<!--Committee title-->
<h4>{{ committee.name }}</h4>
{% for role in committee.current_roles %}
{% for official in role.official.all %}
<div class="role-container">
<div class="row">
<div class="col">
<img src="static/img/missing.png">
</div>
</div>
<div class="row">
<div class="col">
<h5>{{role.name}}</h5>
<p>{{official.first_name}}
{{official.last_name}}
{{official.email}}</p>
</div>
</div>
</div>
{% endfor %}
{% endfor %}
{% endfor %}
{% else%}
<p>Ei Toimikuntia</p>
{% endif %}
</div>
{% endblock %}
-16
View File
@@ -1,16 +0,0 @@
{% extends "webapp:base.html" %}
{% block content %}
{% load i18n %}
<div class="event_calendar_div">
<div class="container">
<div class="row">
<div class="col">
<h2>{% trans "Event calendar" %}</h2>
</div>
</div>
</div>
</div>
{% endblock %}
-25
View File
@@ -1,25 +0,0 @@
{% load i18n %}
{% load static %}
{% load staticfiles %}
<div class="footer-padder"></div>
<footer style="text-align: center">
<div>
<form class="lang-form form" action="{% url 'set_language' %}" method="post">{% csrf_token %}
<span>
<input name="next" type="hidden" value="{{ redirect_to }}" />
<select onchange="this.form.submit()" class="lang-select form-control" name="language">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
{{ language.name_local }} ({{ language.code }})
</option>
{% endfor %}
</select>
</span>
</form>
<span>{% trans "Copyright Aalto-yliopiston Sähköinsinöörikilta ry" %} {% now 'Y' %}</span>
</div>
</footer>
-16
View File
@@ -1,16 +0,0 @@
{% extends "webapp:base.html" %}
{% block content %}
{% load i18n %}
<div class="freshmen_div">
<div class="container">
<div class="row">
<div class="col">
<h2>{% trans "Freshmen" %}</h2>
</div>
</div>
</div>
</div>
{% endblock %}
-16
View File
@@ -1,16 +0,0 @@
{% extends "webapp:base.html" %}
{% block content %}
{% load i18n %}
<div class="guild_div">
<div class="container">
<div class="row">
<div class="col">
<h2>{% trans "Kilta" %}</h2>
</div>
</div>
</div>
</div>
{% endblock %}
-7
View File
@@ -1,7 +0,0 @@
{% load i18n %}
{% load static %}
<div class="header-content">
<div class="logo">
<a href="/"><img src="{% static "webapp/img/logo_header.png" %}" alt="Aalto-yliopiston Sähköinsinöörikilta ry"></a>
</div>
</div>
-36
View File
@@ -1,36 +0,0 @@
{% extends "webapp:base.html" %}
{% load i18n %}
{% block content %}
<div class="main_page">
<div class="container">
<div class="row">
<div class="col">
<h3>{% trans "Aalto-yliopiston Sähköinsinöörikilta ry" %}</h3>
</div>
</div>
<div class="row">
<div class="col">
<h5>{% trans "This site is not yet ready." %}</h5>
</div>
</div>
<div class="row">
<div class="col">
<h6>{% trans "Are you perhaps looking for one of the following?" %}</h6>
</div>
</div>
<div class="row">
<ul>
<li><a href="/infoscreen/admin">{% trans "Infoscreen admin pane" %}</a></li>
<li><a href="/members">{% trans "Member register" %}</a></li>
<li><a href="/kaehmy">{% trans "Kaehmy application" %}</a></li>
</ul>
</div>
<div class="row">
<div class="col">
{% lorem 2 p %}
</div>
</div>
</div>
</div>
{% endblock %}
-16
View File
@@ -1,16 +0,0 @@
{% extends "webapp:base.html" %}
{% block content %}
{% load i18n %}
<div class="international_div">
<div class="container">
<div class="row">
<div class="col">
<h2>{% trans "International" %}</h2>
</div>
</div>
</div>
</div>
{% endblock %}
-16
View File
@@ -1,16 +0,0 @@
{% extends "webapp:base.html" %}
{% block content %}
{% load i18n %}
<div class="jobs_div">
<div class="container">
<div class="row">
<div class="col">
<h2>{% trans "Jobs" %}</h2>
</div>
</div>
</div>
</div>
{% endblock %}
-33
View File
@@ -1,33 +0,0 @@
{% load i18n %}
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
<ul class="navbar-nav mx-auto">
<li class="nav-item text-center">
<a class="nav-link" href="/guild">{% trans "Guild" %}</a>
</li>
<li class="nav-item text-center">
<a class="nav-link" href="/freshmen">{% trans "Freshmen" %}</a>
</li>
<li class="nav-item text-center">
<a class="nav-link" href="/event_calendar">{% trans "Event calendar" %}</a>
</li>
<li class="nav-item text-center">
<a class="nav-link" href="/international">{% trans "International" %}</a>
</li>
<li class="nav-item text-center">
<a class="nav-link" href="/sosso">{% trans "Sössö" %}</a>
</li>
<li class="nav-item text-center">
<a class="nav-item nav-link" href="/contact">{% trans "Contact" %}</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="corpDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% trans "Corporate" %}
</a>
<div class="dropdown-menu" aria-labelledby="corpDropdown">
<a class="dropdown-item" href="/jobs">{% trans "Jobs" %}</a>
<a class="dropdown-item" href="/">Yritysdadaa</a>
<a class="dropdown-item" href="/">Something else here</a>
</div>
</li>
</ul>
</nav>
-16
View File
@@ -1,16 +0,0 @@
{% extends "webapp:base.html" %}
{% block content %}
{% load i18n %}
<div class="sosso_div">
<div class="container">
<div class="row">
<div class="col">
<h2>{% trans "Sössö" %}</h2>
</div>
</div>
</div>
</div>
{% endblock %}
+13 -7
View File
@@ -281,16 +281,22 @@ class FeedViewSet(ModelViewSet):
def get_queryset(self):
if self.request.user.is_authenticated:
objs = Feed.objects.filter(deleted=False)
return Feed.objects.filter(deleted=False).order_by("-publish_time")
else:
objs = Feed.objects.filter(
deleted=False, visible=True, publish_time__lt=timezone.now()
objs = Feed.objects.filter(deleted=False, visible=True).order_by(
"-publish_time"
)
objs = objs.filter(autohide_enabled=False) | objs.filter(autohide_enabled=True, autohide__gt=timezone.now())
return objs.order_by(
"-publish_time"
)
# TODO: Bad filtering. Rewrite!
result_ids = []
for obj in objs:
if obj.autohide_enabled:
if obj.autohide > timezone.now():
result_ids.append(obj.id)
else:
result_ids.append(obj.id)
return Feed.objects.filter(id__in=result_ids).order_by("-publish_time")
def destroy(self, request, pk=None, *args, **kwargs):
try: