Commit 7da489e3 authored by Sander Høyland's avatar Sander Høyland
Browse files

PY-2019.3.3 <guffb@DESKTOP-F1O6115 Merge branch 'master'

parents c086f13d aebe02f3
......@@ -12,5 +12,12 @@
</value>
</option>
</inspection_tool>
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="rodTraa.apps.users.views.post.post_owner" />
</list>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<!DOCTYPE html>
{% load static%}
<html lang="en" xmlns:margin-left="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>Rød tråd</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" id="theme" href="{% static 'css/theme.css' %}">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="../static/css/base.css">
</head>
<body style="background-color: lightblue ">
{% load static%}
<body>
<nav class="navbar fixed-top navbar-expand-md bg-light navbar-light">
<!-- Brand -->
......@@ -26,24 +29,35 @@
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="{% url 'startpage' %}", style="font-weight: bold">Rød tråd</a>
<a class="nav-link nav-link-light" href="{% url 'startpage' %}" style="font-weight: bold">Rød tråd</a>
<li class="nav-item">
<a class="nav-link" href="{% url 'challenges' %}"> Utfordringer </a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'challenges' %}">Utfordringer</a>
<a class="nav-link" href="{% url 'events' %}"> Arrangement </a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Søk</a>
</li>
<!-- Search form -->
<div class="md-form mt-0">
<input class="form-control" type="text" placeholder="Søk etter bruker" aria-label="Search">
<form method="get" action="{% url 'search_results' %}">
<input class="form-control" type="text" placeholder="Søk etter bruker" aria-label="Search" name="q">
</form>
</div>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="{% url 'newevent' %}"> Nytt arrangement</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'postpage' %}">Nytt innlegg</a>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item">
......@@ -68,5 +82,6 @@
{% endblock body %}
</div>
<script src="{% static 'js/theme.js' %}"> </script>
</body>
</html>
{% extends 'base.html' %}
{% load static %}
{% load alignChallange %}
{% block body %}
{% for post in challengeposts %}
<div style="border-radius: 20px ;margin-top: 100px;width: 60%; margin-left: 20%; background-color: white; height: 550px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<div style="display: block; margin-left: auto; margin-right: auto; padding-top: 50px; width:60%">
{{ post.post_owner }}<br>
<img style=" max-width: 100%; max-height: 400px " src="{{ post.image.url }}">
<br><br>
<div style="border-radius: 20px ;margin-top: 20px; max-width: 60%; margin-left: auto; margin-right: auto; background-color: white; max-height: fit-content; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<div style="display: block; margin-left: auto; margin-right: auto; padding-top: 30px;">
<div style="display: block; text-align: center; margin-right: auto; margin-left: auto">{{ post.post_owner }}<br><br></div>
<img style="max-width:88%; max-height: 420px; display: block; margin-right: auto; margin-left: auto; " src="{{ post.image.url }}">
</div>
<div style="display: block; margin-left: auto; margin-right: auto; width: 60% ">{{ post.text }}</div>
<div style="display: block; text-align: center; margin-left: auto; margin-right: auto; max-width: 88% ">{{ post.text }}</div>
<br>
<a type="submit" href="{% url 'alignChallange' post.pk %}" class="btn btn-outline-info" style="margin-left: 5%; margin-bottom: 10px">
Ta utfordringen
</a>
</div>
<br>
{% endfor %}
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% load static %}
{% block body %}
<div style="padding-top: 30px">
<div style="border-radius: 20px ;margin-top: 50px;width: 60%; margin-left: 20%; background-color: white; height: 420px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<div class="container">
<p style="margin-left: 30%; padding-top: 40px; margin-bottom: 20px;font-size: x-large; "> {{ profile.name }} <br></p>
{% if profile.profilePicture %}
{% if profile.profilePicture.url == 'img/profilepic.png' %}
<img src="{% static 'img/profilepic.png' %} " style="width:15%; margin-top: -75px; margin-left: 5%; align-items: start">
{% else %}
<img src="{{ profile.profilePicture.url }}" style="max-width:20%; max-height: 20%; margin-top: -75px; margin-left: 5%; align-items: start">
{% endif %}
{% else %}
<img src="{% static 'img/profilepic.png' %} " style="width:15%; margin-top: -75px; margin-left: 5%">
{% endif %}
<div style="margin-left: 5%; margin-top: 20px;"><p style="border-bottom: 0.5px solid; width: 14%"> Litt om oss:</p> {{ profile.about }}</div>
<a href="{% url 'editprofile' %}" class="btn btn-outline-info" style=" margin-left: 25%; width: 50%; margin-bottom: -250px;font-size: 15px;"> Rediger profil </a>
</div>
</div>
</div>
{% for post in posts %}
<br><br>
<div style="border-radius: 20px ;margin-top: 20px; max-width: 60%; margin-left: auto; margin-right: auto; background-color: white; max-height: fit-content; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<div style="display: block; margin-left: auto; margin-right: auto; padding-top: 30px;">
<a style="margin-left:80%; margin-top: -20px" class="btn btn-outline-info" href="{% url 'deletepost' post.pk %}"> Slett innlegg</a>
<div style="display: block; text-align: center; margin-right: auto; margin-left: auto">{{ post.post_owner }}<br><br></div>
<img style="max-width:88%; max-height: 420px; display: block; margin-right: auto; margin-left: auto; " src="{{ post.image.url }}">
</div>
<div style="display: block; text-align: center; margin-left: auto; margin-right: auto; max-width: 88% ">{{ post.text }}</div><br>
</div>
{% endfor %}
{% endblock %}
......@@ -4,16 +4,22 @@
{% block body %}
<div style="padding-top: 50px">
<div style="border-radius: 20px ;margin-top: 50px;width: 60%; margin-left: 20%; background-color: white; height: 420px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<div style="border-radius: 20px ;margin-top: 50px;width: 60%; margin-left: 20%; background-color: white; height: 460px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<form method="post" action="{% url 'editprofile' %}" enctype="multipart/form-data" style="margin-left: 30%; padding-top: 20px">
{% csrf_token %}
{% for fields in form %}
<div> {{ fields.name }}</div>
{{ fields }}
{% endfor %}
<h4 style="margin-left: 7%"> Rediger profilen din </h4>
<p> Navn <br> {{form.name}} <br></p>
<p> Profilbilde <br> {{form.profilePicture}}<br> </p>
<button value="submit" class="btn btn-outline-info" style="margin-left: 16%; margin-top: 20px"> Lagre </button>
{% if is_privateperson %}
<p> Skriv litt om deg selv <br> {{ form.about }}<br> </p>
{% else %}
<p> Skriv litt om firmaet <br> {{ form.about }}<br> </p>
{% endif %}
<button value="submit" class="btn btn-outline-info" style="margin-left: 21%; margin-top: 0px"> Lagre </button>
</form>
</div>
</div>
......
{% extends 'base.html' %}
{% load static %}
{% load get_number_interested %}
{% load get_if_interested %}
{% block body %}
{% for post in eventposts %}
<br><br>
<div style="border-radius: 20px ;margin-top: 20px; max-width: 50%; margin-left: auto; margin-right: auto; background-color: white; max-height: fit-content; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<div style="display: block; margin-left: auto; margin-right: auto; padding-top: 30px;">
<div style=" margin-left: 70%; margin-top: -15px"> {{ post.time }} </div>
<div style="display: block; text-align: center; margin-right: auto; margin-left: auto">{{ post.post_owner }}<br><br></div>
</div>
<div style="display: block; text-align: center; margin-left: auto; margin-right: auto; max-width: 60% ">{{ post.text }} </div> <br>
<a class="btn btn-outline-info" href="{% url 'interested' post.pk %} " style="width:fit-content; margin-left: 10%" id ="Interessert"> Interessert</a>
<img style="width: 7%" src="{% static 'img/star2.png' %}">
{{ post.pk|get_number_interested }}
</div>
<br>
{% endfor %}
{% endblock %}
\ No newline at end of file
......@@ -2,32 +2,66 @@
{% load static %}
{% block body %}
<div style="padding-top: 50px">
<div style="padding-top: 30px">
<div style="border-radius: 20px ;margin-top: 50px;width: 60%; margin-left: 20%; background-color: white; height: 420px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<div class="container">
<p style="margin-left: 30%; padding-top: 60px ;font-size: x-large"> {{ profile.name }}</p>
{% if profile.profilepicture %}
<img src="{{ profile.profilePicture.url }}" style="width:15%">
<p style="margin-left: 30%; padding-top: 40px; margin-bottom: 20px;font-size: x-large; "> {{ profile.name }} <br></p>
<a style="margin-left: 30%; font-family:verdana; font-size:90%; border-bottom: 0.5px solid"> Utfordringer jeg holder på med: </a>
{% for challenge in challenges %}
<p style="margin-left:30%; margin-top: 10px "> - {{ challenge.name }}</p>
{% endfor %}
{% if profile.profilePicture %}
{% if profile.profilePicture.url == 'img/profilepic.png' %}
<img src="{% static 'img/profilepic.png' %} " style="width:15%; margin-top: -220px; margin-left: 5%; align-items: start">
{% else %}
<img src="{% static 'img/profilepic.png' %} " style="width:15%; margin-top: -75px; margin-left: 5%">
<img src="{{ profile.profilePicture.url }}" style="max-width:20%; max-height: 20%; margin-top: -220px; margin-left: 5%; align-items: start">
{% endif %}
<p style="margin-left: 5%; margin-top: 40px"><i><u> Litt om meg: </u></i><br>{{ profile.about }}</p>
{% else %}
<img src="{% static 'img/profilepic.png' %} " style="width:15%; margin-top: -220px; margin-left: 5%">
{% endif %}
<div style="margin-left: 5%; margin-top: -30px;"><p style="border-bottom: 0.5px solid; width: 14%"> Litt om meg:</p> {{ profile.about }}</div>
<a href="{% url 'editprofile' %}" class="btn btn-outline-info" style=" margin-left: 25%; width: 50%; margin-top: 80px;font-size: 15px;"> Rediger profil </a>
<a id="darkmodeKnapp" class="btn btn-outline-info" style=" margin-left: 25%; width: 50%; margin-top: 80px;font-size: 15px;"> Darkmode </a>
</div>
</div>
</div>
{% for post in posts %}
<div style="border-radius: 20px ;margin-top: 100px;width: 60%; margin-left: 20%; background-color: white; height: 550px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<div style="display: block; margin-left: auto; margin-right: auto; padding-top: 50px; width:60%">
{{ post.post_owner }}<br>
<img style="max-width:100%; max-height: 400px"; src="{{ post.image.url }}">
<br><br>
<div style="border-radius: 20px ;margin-top: 20px; max-width: 60%; margin-left: auto; margin-right: auto; background-color: white; max-height: fit-content; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<div style="display: block; margin-left: auto; margin-right: auto; padding-top: 30px;">
<a style="margin-left:80%; margin-top: -20px" class="btn btn-outline-info" href="{% url 'deletepost' post.pk %}"> Slett innlegg</a>
<div style="display: block; text-align: center; margin-right: auto; margin-left: auto">{{ post.post_owner }}<br><br></div>
<img style="max-width:88%; max-height: 420px; display: block; margin-right: auto; margin-left: auto; " src="{{ post.image.url }}">
</div>
<div style="display: block; margin-left: auto; margin-right: auto; width: 60% ">{{ post.text }}</div>
<a class="btn btn-outline-info" href="{% url 'deletepost' post.pk %}"> Slett innlegg</a>
<div style="display: block; text-align: center; margin-left: auto; margin-right: auto; max-width: 88% ">{{ post.text }}</div><br>
</div>
{% endfor %}
<script>
let darkModeKnapp = document.querySelector('#darkmodeKnapp')
darkModeKnapp.addEventListener('click', evt => {
let theme = localStorage.getItem('theme')
theme = theme ? theme : 'light';
if (theme =='light') {
theme = 'dark'
evt.target.innerHTML = 'Lightmode'
} else {
theme = 'light'
evt.target.innerHTML = 'Darkmode'
}
localStorage.setItem('theme', theme)
changeTheme()
})
</script>
{% endblock %}
{% extends 'base.html' %}
{% load static %}
{% load crispy_forms_tags %}
{% block body %}
<div style="border-radius: 20px ;margin-top: 80px;width: 60%; margin-left: 20%; margin-bottom: 30px; background-color: white; height: 450px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<form method="post" action="{% url 'newevent' %}" enctype="multipart/form-data" style="margin-left: 30%; padding-top: 20px">
{% csrf_token %}
<h2 style="margin-left: 10%"> Nytt arrangement <br></h2>
<div style="margin-top: 20px"> Hva vil du arrangere? <br>{{ form.text }} <br><br></div>
<button type="submit" class="btn btn-outline-info" style="margin-left: 16%; margin-top: 30px"> Opprett et nytt arrangement </button>
</form>
</div>
{% endblock %}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
from crispy_forms.bootstrap import HorizontalField
{% extends 'startbase.html' %}
{% load crispy_forms_tags %}
{% load static %}
{% block body %}
<div style="border-radius: 20px ;margin-top: 90px;width: 50%; margin-left: 25%; background-color: white; height: 420px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<form style="margin-left:30%; padding-top: 30px; margin-right: 30%" method="post">
{% csrf_token %}
<div class="form-group">
<header style="font-weight: bold; font-size: 20px; margin-top: 20px; margin-bottom: 30px; margin-left: 30%"> Tilbakestill Passord </header>
{{ form|crispy }}
</div>
<button type="submit" class="btn btn-outline-info"> Forespør Tilbakestilling Av Passord </button>
</form>
</div>
{% endblock %}
</html>
<!DOCTYPE html>
<html lang="en">
from crispy_forms.bootstrap import HorizontalField
{% extends 'startbase.html' %}
{% load crispy_forms_tags %}
{% load static %}
{% block body %}
<div style="border-radius: 20px ;margin-top: 90px;width: 70%; margin-left: 15%; background-color: white; height: 500px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<form style="margin-left:30%; padding-top: 30px; margin-right: 30%" method="post">
{% csrf_token %}
<div class="form-group">
<header style="font-weight: bold; font-size: 20px; margin-top: 20px; margin-bottom: 30px; margin-left: 30%"> Tilbakestill Passord </header>
{{ form|crispy }}
</div>
<button type="submit" class="btn btn-outline-info"> Tilbakestill Passord </button>
</form>
</div>
{% endblock %}
</html>
{% extends 'startbase.html' %}
{% load static %}
{% block body %}
<div class="alert alert_info" style="padding-top: 150px">
Vi har sendt deg en e-post med instruksjoner for å tilbakestille passordet!
</div>
{% endblock %}
\ No newline at end of file
......@@ -5,18 +5,13 @@
<div style="border-radius: 20px ;margin-top: 80px;width: 60%; margin-left: 20%; margin-bottom: 30px; background-color: white; height: 450px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<form method="post" action="{% url 'postpage' %}" enctype="multipart/form-data" style="margin-left: 30%; padding-top: 20px">
<h2 style="margin-left: 10%">Nytt innlegg</h2>
<small>Skriv litt om innlegget ditt her</small>
{% csrf_token %}
{% for field in form %}
<div></div>
<h2 style="margin-left: 10%">Nytt innlegg <br></h2>
<div style="margin-top: 20px"> Skriv litt om innlegget ditt her <br>{{ form.text }} <br><br></div>
<div> Last opp et bilde <br> {{ form.image }} <br> </div>
<button type="submit" class="btn btn-outline-info" style="margin-left: 16%; margin-top: 30px"> Publiser innlegg </button>
{{ field }}
{% endfor %}
<div></div>
<button type="submit" class="btn btn-outline-info" style="margin-left: 16%; margin-top: 20px"> Publiser innlegg </button>
</form>
</div>
{% endblock %}
\ No newline at end of file
......@@ -20,6 +20,9 @@ from crispy_forms.bootstrap import HorizontalField
</div>
<button type="submit" class="btn btn-primary" href="/"> Logg inn </button>
<small class="text-muted ml-2">
<a href="{% url 'password_reset' %}">Glemt Passord</a>
</small>
</form>
</div>
{% endblock %}
......
{% extends 'base.html' %}
{% load static %}
{% block body %}
<div style="border-radius: 20px ;margin-top: 100px;width: 60%; margin-left: 20%; background-color: white; min-height: 100px; overflow: hidden; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); ">
<div style="padding-top: 10px ">
<ul style="list-style: none; margin-top: 20px">
{% for user in users %}
<li style="padding: 5px">
<a id="userpage_link" href="{% url 'myprofile' user.id%}", style=" text-decoration: none ;color: #000000; margin: 10px;">{{user.username}}</a>
</li>
<hr style="margin-right: 10%">
{% endfor %}
{% endblock %}
</ul>
</div>
</div>
{% extends 'base.html' %}
{% load static %}
{% load get_number_likes %}
{% block body %}
{% for post in posts %}
<div style="border-radius: 20px ;margin-top: 100px;width: 60%; margin-left: 20%; background-color: white; height: 550px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<div style="display: block; margin-left: auto; margin-right: auto; padding-top: 50px; width:60%">
{{ post.post_owner }}<br>
<img style="max-width:100%; max-height: 400px"; src="{{ post.image.url }}">
<br><br>
<div style="border-radius: 20px ;margin-top: 20px; max-width: 60%; margin-left: auto; margin-right: auto; background-color: white; max-height: fit-content; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
<div style="display: block; margin-left: auto; margin-right: auto; padding-top: 30px;">
<div style="display: block; text-align: center; margin-right: auto; margin-left: auto">{{ post.post_owner }}<br><br></div>
<img style="max-width:88%; max-height: 420px; display: block; margin-right: auto; margin-left: auto; " src="{{ post.image.url }}">
</div>
<div style="display: block; margin-left: auto; margin-right: auto; width: 60% ">{{ post.text }}</div>
<div style="display: block; text-align: center; margin-left: auto; margin-right: auto; max-width: 60% ">{{ post.text }} </div>
<br>
<a class="btn btn-outline-info" href="{% url 'like' post.pk %} " style="width:fit-content; margin-left: 2%; margin-bottom: 10px" id ="Like"> Like</a>
<img style = "height: 50px; margin-bottom: 10px; text-align: left; margin-left: 5%" align='left' src="{% static 'img/like.png' %}">
{{ post.pk|get_number_likes }}
</div>
<br>
{% endfor %}
{% endblock %}
\ No newline at end of file
Supports Markdown
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