This commit is contained in:
Ryan Burnette 2020-09-09 00:08:25 -04:00
parent 9a5d97caad
commit d78b0fe8a2
27 changed files with 29222 additions and 0 deletions

4
html/.jshintrc Normal file
View File

@ -0,0 +1,4 @@
{
"node": true,
"esversion": 8
}

6
html/.prettierrc Normal file
View File

@ -0,0 +1,6 @@
{
"trailingComma": "none",
"tabWidth": 2,
"singleQuote": true,
"proseWrap": "always"
}

View File

@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

7
html/config.toml Normal file
View File

@ -0,0 +1,7 @@
baseURL = "http://example.org/"
languageCode = "en-us"
title = "cdadmin"
disableKinds = ["RSS"]
[permalinks]
pages = "/:filename/"

119
html/content/signin.html Normal file
View File

@ -0,0 +1,119 @@
---
title: Sign In
type: page
---
<style>
html,
body {
height: 100%;
}
body {
display: -ms-flexbox;
display: -webkit-box;
display: flex;
-ms-flex-align: center;
-ms-flex-pack: center;
-webkit-box-align: center;
align-items: center;
-webkit-box-pack: center;
justify-content: center;
padding-top: 40px;
padding-bottom: 40px;
background-color: #f5f5f5;
}
.app {
width: 100%;
max-width: 330px;
padding: 15px;
margin: 0 auto;
}
.form-signin .checkbox {
font-weight: 400;
}
.form-signin .form-control {
position: relative;
box-sizing: border-box;
height: auto;
padding: 10px;
font-size: 16px;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type='email'] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type='password'] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
</style>
<div class="app">
<form class="form-signin text-center" @submit="submit($event)">
<label for="inputEmail" class="sr-only">Email address</label>
<input
type="email"
id="inputEmail"
class="form-control"
placeholder="Email address"
required
autofocus
v-model="email"
/>
<br />
<button class="btn btn-lg btn-primary btn-block" type="submit">
Sign in
</button>
</form>
</div>
<script src="/axios.js"></script>
<script src="/vue.js"></script>
<script src="/messages.js"></script>
<script>
var app = new Vue({
data: {
email: ''
},
methods: {
submit: function (ev) {
var _this = this;
if (ev) {
ev.preventDefault();
}
axios
.post('/api/authentication/signin', {
email: _this.email
})
.then(function (response) {})
.catch(function (error) {
console.log(_this.email);
window.postMessage('Something went wrong. Please try again.');
});
}
}
});
var token = window.localStorage.getItem('token');
if (token) {
axios
.get('/api/authentication/me', {
headers: {
Authorization: 'Bearer ' + token
}
})
.then(function (response) {
window.location.href = '/';
})
.catch(function (error) {
window.localStorage.removeItem('token');
app.$mount('.app');
});
} else {
app.$mount('.app');
}
</script>

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}">
{{ partial "head.html" . }}
<body>
<!-- prettier-ignore -->
{{ block "main" . }}
{{ end }}
</body>
</html>

View File

@ -0,0 +1 @@
list

View File

@ -0,0 +1 @@
default single

View File

@ -0,0 +1 @@
{{ define "main" }} {{ .Content }} {{ end }}

View File

View File

@ -0,0 +1 @@
<link rel="stylesheet" href="/bootstrap.min.css" />

View File

@ -0,0 +1,5 @@
<header class="header">
<div class="container">
<h1>cdadmin</h1>
</div>
</header>

3311
html/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

16
html/package.json Normal file
View File

@ -0,0 +1,16 @@
{
"name": "html",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.20.0",
"bootstrap": "^4.5.2",
"vue": "^2.6.12"
}
}

3
html/public/axios.min.js vendored Normal file

File diff suppressed because one or more lines are too long

7
html/public/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
list

1
html/public/index.html Normal file
View File

@ -0,0 +1 @@
list

View File

@ -0,0 +1,2 @@

21
html/public/sitemap.xml Normal file
View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>http://example.org/categories/</loc>
</url>
<url>
<loc>http://example.org/</loc>
</url>
<url>
<loc>http://example.org/signin/</loc>
</url>
<url>
<loc>http://example.org/tags/</loc>
</url>
</urlset>

View File

@ -0,0 +1 @@
list

11965
html/public/vue.js Normal file

File diff suppressed because it is too large Load Diff

6
html/public/vue.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1742
html/static/axios.js Normal file

File diff suppressed because it is too large Load Diff

7
html/static/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

14
html/static/messages.js Normal file
View File

@ -0,0 +1,14 @@
(function () {
'use strict';
var app = new Vue({
data: {
messages: []
}
});
window.cdadmin = window.cdadmin || {};
window.cdadmin.pushMessage = function (str) {
window.alert(str);
};
})();

11965
html/static/vue.js Normal file

File diff suppressed because it is too large Load Diff