updated styling and MOAR TEMPLATING

This commit is contained in:
mrjvs
2018-11-17 20:45:04 +01:00
parent fae7ab99c4
commit 1df15b58a2
11 changed files with 91 additions and 54 deletions

View File

@@ -189,7 +189,7 @@ section.bigCardWrapper .bigCard.bigCardPartWrapper {
}
/* components - buttons */
button {
button, .btn, .btn-alt {
margin: 0;
padding: 0;
border: 0;
@@ -198,14 +198,14 @@ button {
font-size: 1em;
cursor: pointer;
}
button.btn {
.btn, button {
background: #673db6;
color: white;
padding: 12px 80px;
border-radius: 10px;
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.17);
}
button.btn-alt {
.btn-alt {
background: white;
padding: 10px 45px;
color: #673db6;
@@ -213,8 +213,9 @@ button.btn-alt {
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
border-radius: 5px;
}
button.btn:hover, button.btn-alt:hover {
.btn:hover, button:hover, .btn-alt:hover {
background: #553099;
color: white;
}
/* components - inputs */

View File

@@ -72,7 +72,7 @@ header h3 {
margin-left: 3em;
}
.smallCard h3 {
font-size: 1.5em !important;
font-size: 1.5em;
margin: 0;
}

View File

@@ -0,0 +1,16 @@
/* news cards */
.smallCard {
padding: 20px;
border: 1px solid rgb(165, 165, 165);
border-radius: 10px;
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
position: relative;
margin: .5em;
width: calc(50% - 1em );
box-sizing: border-box;
display: inline-block;
}
.smallCard h3 {
font-size: 1.5em;
margin: 0;
}

View File

@@ -81,10 +81,10 @@ router.post('/admin/api/v1/register', adminUserMiddleware.adminAuthNeeded, (req,
});
// saving to database
newUser.save().then(() => {
newUser.save().then((user) => {
apiHelper.sendReturn(res, {
username: req.user.username,
role: req.user.role ? req.user.role : undefined
username: user.username,
role: user.role ? user.role : undefined
});
return;
}).catch((rejection) => {

View File

@@ -1,8 +1,18 @@
const mongoose = require('mongoose');
// fix database deprecation warnings
mongoose.set('useCreateIndex', true);
mongoose.set('useNewUrlParser', true);
// setup database connection
mongoose.connect(require('./config.json').database.url);
const connection = mongoose.connection;
connection.on('error', console.error.bind(console, 'connection error:'));
const adminUser = require('./models/admin-user');
const newUser = new adminUser.adminUserModel({
username: 'admin',
password: 'root'
password: 'rootroot'
});
newUser.save().then(() => {

View File

@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{> head }}
{{> head-common }}
<body>
{{> navbar }}
{{> nav-default }}
<div>
<h1>Admin panel here</h1>
<h2>register</h2>
<form action="/admin/api/v1/register" method="POST">
@@ -122,6 +122,6 @@
<br>
<a href="/admin/api/v1/logout">Logout</a>
{{> footer }}
{{> footer-default }}
</body>
</html>

View File

@@ -1,3 +0,0 @@
<footer class="footer">
<p>&copy; 2018 Pretendo</p>
</footer>

View File

@@ -1,14 +0,0 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="an accurate-as-possible server emulation project for nintendo network-enabled devices">
<link rel="icon" href="/assets/favicon.ico">
<link rel="apple-touch-icon" href="/assets/favicon.ico">
<link rel="mask-icon" href="/assets/images/pretendo-logo.svg">
<link href="https://fonts.googleapis.com/css?family=Overpass+Mono|Space+Mono" rel="stylesheet">
<link rel="stylesheet" href="/assets/css/pretendo.css">
<link rel="stylesheet" href="/assets/css/icons.css">
<script defer src="https://use.fontawesome.com/releases/v5.0.10/js/all.js" integrity="sha384-slN8GvtUJGnv6ca26v8EzVaR9DC58QEwsIk9q1QXdCU8Yu8ck/tL/5szYlBbqmS+" crossorigin="anonymous"></script>

View File

@@ -1 +0,0 @@

View File

@@ -1,7 +1,29 @@
<h1>Latest posts</h1>
{{#each posts }}
<strong>{{ this.title }}</strong>
<p>{{ this.content }}</p>
<a href="{{ this.url }}">link</a>
<br><br>
{{/each}}
<!DOCTYPE html>
<html lang="en">
<head>
{{> head-common }}
<!-- page specific -->
<link rel="stylesheet" href="/assets/css/pretendo-news.css">
</head>
<body class="flex">
{{> nav-default }}
<div class="contentWrapper bgLinesSmall">
<div class="bgExtrude"></div>
<section class="bigCardWrapper">
<div class="bigCard">
<p class="txt-highlight">Litteral fuck ton</p>
<h1 class="txt-title">All updates</h1><!--
{{#each posts }}
--><article class="smallCard">
<h3 class="txt-smallHeading">{{ this.title }}</h3>
<p>{{ this.content }}</p>
<a class="btn-alt" href="{{ this.url }}">Read more</a>
</article><!--
{{/each}}
-->
</div>
</section>
{{> footer-default }}
</body>
</html>

View File

@@ -1,22 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{> head }}
<body>
{{> navbar }}
<h1>{{ post.title }}</h1>
<p>{{ post.date }}</p>
<p>{{ post.category }}</p>
<article>
{{{ post.content }}}
</article>
<p>{{ post.author.name }} - {{ post.author.description }}</p>
<img src="{{ post.author.profilePicture }}">
{{> footer }}
{{> head-common }}
<!-- page specific -->
</head>
<body class="flex">
{{> nav-default }}
<div class="contentWrapper bgLinesSmall">
<div class="bgExtrude"></div>
<section class="bigCardWrapper">
<div class="bigCard">
<p class="txt-highlight">{{ post.category }} &mdash; {{ post.date }}</p>
<h1 class="txt-title">{{ post.title }}</h1>
{{{ post.content }}}
<div class="profile">
<img class="profileIcon" src="{{ post.author.profilePicture }}">
<div class="profileText">
<h2 class="txt-smallHeading">{{ post.author.name }}</h2>
<p>{{ post.author.description }}</p>
</div>
</div>
</div>
</section>
{{> footer-default }}
</body>
</html>