Commit 16793c51 authored by Hildegunn Elin Olaussen Nedregård's avatar Hildegunn Elin Olaussen Nedregård
Browse files

Merge branch 'master' into '#3-create-user-frontpage'

# Conflicts:
#   rodTraa/rodTraa/settings.py
#   rodTraa/rodTraa/urls.py
parents 29734aa5 874518a1
<!DOCTYPE html>
<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">
<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>
</head>
<body style="background-color: lightblue ">
{% load static%}
<nav class="navbar fixed-top navbar-expand-md bg-light navbar-light">
<!-- Brand -->
<a class="" href=" "><img src="{% static 'img/knitting.png' %}" width="40" height="40"></a>
<!-- Toggler/collapsibe Button -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Navbar links -->
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="/startpage", style="font-weight: bold">Rød tråd</a>
<li class="nav-item">
<a class="nav-link" href="#">Utfordringer</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">
</div>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Nytt innlegg</a>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/myprofile">Min profil</a>
</li>
</ul>
</div>
</nav>
{% block body %}
{% endblock body %}
</div>
</body>
</html>
{% extends 'startbase.html' %}
{% load static %}
{% block body %}
<div style="padding-top: 150px">
<h1 style="font-size:300%; font-weight: bold; position: absolute; margin-left: 10%; ">Rød tråd</h1>
<p style="font-size:150%; position: absolute; margin-left:10%; margin-top: 5%"><br><br> Registrer ny bruker <br> eller logg inn for å se <br> utfordringer og innhold <br> fra andre brukere </p>
<img src="{% static 'img/profil.png' %}" alt="" style=" width: 38%; margin-left: 45%; margin-top: 12%; transform: translateY(-50%) rotate(-10deg);">
</div>
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% load static %}
{% 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);">
<p style="font-size:150%; position: absolute; margin-left:15%; padding-top: 50px">
{{knitter.first_name}} {{ knitter.last_name }}
</p>
<img src="{% static 'img/profilepic.png' %}" style="width: 10%; margin-left: 10%; padding-top: 35px">
<div class="form-group" style="margin-left:10%; margin-top:50px">
<p><i>Litt om meg:</i></p>
<p> {{ knitter.about }} </p>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<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">
<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>
</head>
<body style="background-color:lightblue;">
{% load static%}
<nav class="navbar fixed-top navbar-expand-md bg-light navbar-light">
<!-- Brand -->
<a class="" href=" "><img src="{% static 'img/knitting.png' %}" width="40" height="40"></a>
<!-- Toggler/collapsibe Button -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Navbar links -->
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="#">Hjem</a>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Registrer</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Logg inn</a>
</li>
</ul>
</div>
</nav>
{% block body %}
{% endblock body %}
</div>
</body>
</html>
{% extends 'base.html' %}
{% load static %}
{% block body %}
{% for post in posts %}
<div style="border-radius: 20px ;margin-top: 100px;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="display: block; margin-left: auto; margin-right: auto; padding-top: 50px; width:60%">
<img style="width:100%"; src="{{ post.image.url }}">
</div>
<div style="display: block; margin-left: auto; margin-right: auto; width: 60% ">{{ post.text }}</div>
</div>
{% endfor %}
{% endblock %}
\ No newline at end of file
from django.contrib import admin
from .models import Post
# Register your models here.
admin.site.register(Post)
\ No newline at end of file
from django.apps import AppConfig
class FeedConfig(AppConfig):
name = 'apps.feed'
# Generated by Django 3.0.3 on 2020-02-23 19:51
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text', models.TextField(blank=True, max_length=4000, null=True)),
('image', models.ImageField(upload_to='')),
],
),
]
# Generated by Django 3.0.3 on 2020-02-23 19:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('feed', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='post',
name='publisher',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]
from django.db import models
from ..users.models import Knitter
# Create your models here.
class Post(models.Model):
text = models.TextField(null=True, blank=True,max_length=4000)
image = models.ImageField(null=False)
publisher = models.ForeignKey(Knitter, null=True, on_delete=models.CASCADE)
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
from django.shortcuts import render
from ..feed.models import Post
from ..users.models import Knitter
# Create your views here.
def index(request):
return render(request, "index.html")
def startpage(request):
posts = Post.objects.all()
return render(request, "startpage.html", {'posts':posts})
def myprofile(request,pk):
knitter = Knitter.objects.filter(pk=pk).first()
return render(request, "myprofile.html",{'knitter':knitter})
\ No newline at end of file
from django.contrib import admin
from .models import Knitter
# Register your models here.
admin.site.register(Knitter)
\ No newline at end of file
from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'apps.users'
# Generated by Django 3.0.3 on 2020-02-23 19:51
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='Knitter',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('about', models.CharField(blank=True, max_length=300, null=True)),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
],
options={
'verbose_name': 'user',
'verbose_name_plural': 'users',
'abstract': False,
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
]
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