Commit 0fa4a2be authored by Eerik Sven Puudist's avatar Eerik Sven Puudist

Merge branch '38-cleanup' into 'master'

Resolve "cleanup"

Closes #38

See merge request !33
parents 8d5ac7b1 677e3356
Pipeline #83589085 failed with stages
in 3 minutes and 10 seconds
......@@ -7,3 +7,5 @@ docs/.~*.vue
db-backups/
production-db-backups/
/.idea/
**/secrets.py
.term-list-item[data-v-1f5ed2dd]{color:#cd5a07;text-decoration:none}[data-v-1f5ed2dd]::-webkit-scrollbar{display:none}.selected-term div a span{color:navy!important;font-weight:900}.intro[data-v-1c47b224]{font-size:1.3em}.btn[data-v-1c47b224]{min-width:40px}#logo-box[data-v-1c47b224]{display:inline-block}img[data-v-1c47b224]{vertical-align:middle}#logoText[data-v-1c47b224]{display:inline-block;vertical-align:middle;color:#cd5a07;font-size:3.2em}.comment-section-header[data-v-3e166468],.form-header[data-v-645df39b]{font-weight:400}.v-expansion-panel[data-v-3e166468]{box-shadow:none;-webkit-box-shadow:none}.application .theme--light.v-expansion-panel .v-expansion-panel__container[data-v-3e166468],.theme--light .v-expansion-panel .v-expansion-panel__container[data-v-3e166468]{background-color:inherit}#further-explanation[data-v-3e166468],#pls-header[data-v-3e166468]{color:#cd5a07}.expansion-panel__header{padding-left:inherit}.grand-error>b{color:var(--v-primary-base);font-size:large}
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>lexicon</title><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Material+Icons"><link href=/css/app.07ea93e2.css rel=preload as=style><link href=/css/chunk-vendors.185e0cae.css rel=preload as=style><link href=/js/app.6e72ec8d.js rel=preload as=script><link href=/js/chunk-vendors.fd7386ed.js rel=preload as=script><link href=/css/chunk-vendors.185e0cae.css rel=stylesheet><link href=/css/app.07ea93e2.css rel=stylesheet></head><body><noscript><strong>We're sorry but lexicon doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.fd7386ed.js></script><script src=/js/app.6e72ec8d.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>lexicon</title><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Material+Icons"><link href=/css/app.2d32696a.css rel=preload as=style><link href=/css/chunk-vendors.cf291f0c.css rel=preload as=style><link href=/js/app.fb094a86.js rel=preload as=script><link href=/js/chunk-vendors.186543e6.js rel=preload as=script><link href=/css/chunk-vendors.cf291f0c.css rel=stylesheet><link href=/css/app.2d32696a.css rel=stylesheet></head><body><noscript><strong>We're sorry but lexicon doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.186543e6.js></script><script src=/js/app.fb094a86.js></script></body></html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<template>
<v-container>
<v-layout>
<v-flex xs12 sm6 offset-sm3>
<v-card>
<v-card-text>
<v-container>
<form @submit.prevent="onSingIn">
<v-layout>
<v-flex>
<h2>Logi sisse</h2>
</v-flex>
</v-layout>
<v-layout>
<v-flex>
<v-text-field
name="username"
label="Kasutajanimi"
id="username"
v-model="username"
required></v-text-field>
<v-text-field
name="password"
label="Salasõna"
id="password"
type="password"
v-model="password"
required></v-text-field>
<v-btn type="submit">Logi sisse</v-btn>
</v-flex>
</v-layout>
</form>
</v-container>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
</v-container>
</template>
<script>
export default {
data () {
return {
username: '',
password: ''
}
},
methods: {
onSingIn () {
// Vuex
console.log(this.password)
}
}
}
</script>
<template>
<v-container>
<v-layout>
<v-flex xs12 sm6 offset-sm3>
<v-card>
<v-card-text>
<v-container>
<form @submit.prevent="onSingUp">
<v-layout>
<v-flex>
<h2>Registreeru kasutajaks</h2>
</v-flex>
</v-layout>
<v-layout>
<v-flex>
<v-text-field
name="username"
label="Kasutajanimi"
id="username"
v-model="username"
required></v-text-field>
<v-text-field
name="email"
label="Email"
id="email"
type="email"
v-model="email"
required></v-text-field>
<v-text-field
name="password"
label="Salasõna"
id="password"
type="password"
v-model="password"
required></v-text-field>
<v-text-field
name="confirmPassword"
label="Salasõna uuesti"
id="confirmPassword"
type="password"
v-model="confirmPassword"
:rules="[comparePasswords]"
></v-text-field>
<v-btn type="submit">Registreeru</v-btn>
</v-flex>
</v-layout>
</form>
</v-container>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
</v-container>
</template>
<script>
export default {
data () {
return {
username: '',
email: '',
password: '',
confirmPassword: ''
}
},
computed: {
comparePasswords () {
if (this.password !== this.confirmPassword) { return 'Salasõnad ei kattu' } else { return '' }
}
},
methods: {
onSingUp () {
// Vuex
console.log(this.password, this.confirmPassword)
}
}
}
</script>
<template>
<div>
<v-tabs>
<v-tabs-bar class="cyan" dark>
<v-tabs-item ripple>
Item
</v-tabs-item>
<v-tabs-item ripple>
Item 2
</v-tabs-item>
<v-tabs-slider color="yellow"></v-tabs-slider>
</v-tabs-bar>
<v-tabs-items>
<v-tabs-content
>
<v-card flat>
<v-card-text>text</v-card-text>
</v-card>
</v-tabs-content>
</v-tabs-items>
</v-tabs>
<v-container>
<v-layout>
<v-flex>
{{ user }}
</v-flex>
</v-layout>
</v-container>
</div>
</template>
<script>
export default {
data () {
return {
}
},
computed: {
user () {
console.log(this.$store.getters.loadedUsers, 'yes')
return this.$store.getters.loadedUsers
}
}
}
</script>
......@@ -3,7 +3,6 @@ import Router from 'vue-router'
import Home from './components/Home.vue'
import Term from './components/Term'
import TermList from './components/TermList'
import LetterToAdmin from './components/LetterToAdmin'
import SandBox from './components/SandBox'
......@@ -33,45 +32,6 @@ export default new Router({
path: '/kiri-haldajale',
name: 'LetterToAdmin',
component: LetterToAdmin
},
{
path: '/loetelu',
name: 'TermList',
component: TermList
}
// { // THIS IS EXAMPLE ABOUT LAZY COMPONENT LOADING
// path: '/about',
// name: 'about',
// // route level code-splitting
// // this generates a separate chunk (about.[hash].js) for this route
// // which is lazy-loaded when the route is visited.
// component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
// }
// {
// path: '/registreeru',
// name: 'SignUp',
// component: SignUp
// },
// {
// path: '/logi-sisse',
// name: 'SignIn',
// component: SignIn
// },
// {
// path: '/kasutajaleht',
// name: 'UserPage',
// component: UserPage
// },
// {
// path: '/kasutajale',
// name: 'InfoForUser',
// component: InfoForUser
// },
// {
// path: '/haldajale',
// name: 'ForAdmin',
// component: ForAdmin
// }
]
// mode: 'history'
})
.idea
*.sqlite3
\ No newline at end of file
*.sqlite3
# Add `secrets.py` to the same directory
SECRET_KEY = 'SOMETHING'
DEPLOY_KEY = 'SOMETHING'
from django.utils.log import DEFAULT_LOGGING
import edhamma.secrets
from .settings import *
SECRET_KEY = edhamma.secrets.SECRET_KEY
DEPLOY_KEY = edhamma.secrets.DEPLOY_KEY
DEBUG = False
TEMPLATE_DEBUG = DEBUG
......
......@@ -38,7 +38,6 @@ urlpatterns = [
path('__debug__/', include(debug_toolbar.urls)),
path('haldus/', admin.site.urls),
path('api-auth/', include('rest_framework.urls')),
path('juhendid/', include('guides.urls')),
path('nested_admin/', include('nested_admin.urls')),
path('deploy/', include('administration.deploy.urls')),
......
from django.contrib import admin
from .models import Guide
admin.site.register(Guide)
from django.apps import AppConfig
class GuidesConfig(AppConfig):
name = 'guides'
# Generated by Django 2.0.1 on 2018-02-07 11:59
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Guide',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('header', models.CharField(max_length=200)),
('content', models.TextField()),
],
),
]
# Generated by Django 2.0.1 on 2018-05-14 14:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('guides', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='guide',
name='header',
field=models.CharField(max_length=200, unique=True),
),
]
from django.db import models
class Guide(models.Model):
header = models.CharField(max_length=200, unique=True)
content = models.TextField()
def __str__(self):
return self.header
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
<script src="main.js"></script>
</head>
<body>
<h2>{{ guide.header }} 2</h2>
<p>{{ html | safe }}</p>
</body>
</html>
\ No newline at end of file
from django.test import TestCase
# Create your tests here.
from django.urls import path
from .views import guide
urlpatterns = [
path('<header>', guide),
]
\ No newline at end of file
from django.shortcuts import render
from markdown import markdown
from .models import Guide
def guide(request, header):
guide = Guide.objects.filter(header=header.capitalize())[0]
html = markdown(guide.content)
return render(request, 'guides/guide.html', {'guide': guide, 'html': html})
Markdown is supported
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