mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-26 05:10:41 +03:00
Better limits
This commit is contained in:
parent
5a05737f8b
commit
87be28c71f
9 changed files with 23 additions and 18 deletions
|
@ -1,11 +1,13 @@
|
|||
const mongoose = require("mongoose")
|
||||
const cache = require("./cache")
|
||||
const mongoose = require("mongoose");
|
||||
const cache = require("./cache");
|
||||
const { limits } = require("../config.json");
|
||||
|
||||
const schema = new mongoose.Schema({
|
||||
id: { type: String, unique: true },
|
||||
author: Object,
|
||||
threadID: String,
|
||||
authorID: String,
|
||||
content: { type: String, maxlength: 1024 },
|
||||
content: { type: String, maxlength: limits.message },
|
||||
time: { type: Date, default: Date.now },
|
||||
deleted: { type: Boolean, default: false },
|
||||
edited: { type: Boolean, default: false },
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
const mongoose = require("mongoose")
|
||||
const { limits } = require("../config.json");
|
||||
|
||||
const schema = new mongoose.Schema({
|
||||
username: { type: String, unique: true, maxlength: 25 },
|
||||
username: { type: String, unique: true, maxlength: limits.names },
|
||||
password: String,
|
||||
id: { type: String, unique: true }
|
||||
});
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
const mongoose = require("mongoose");
|
||||
const cache = require("./cache")
|
||||
const MessageModel = require("./Message");
|
||||
const { limits } = require("../config.json");
|
||||
|
||||
const schema = new mongoose.Schema({
|
||||
id: { type: String, unique: true },
|
||||
|
||||
|
@ -8,7 +10,7 @@ const schema = new mongoose.Schema({
|
|||
authorID: String,
|
||||
author: Object,
|
||||
|
||||
title: { type: String, maxlength: 128 },
|
||||
title: { type: String, maxlength: limits.title },
|
||||
time: { type: Date, default: Date.now },
|
||||
deleted: { type: Boolean, default: false },
|
||||
edited: { type: Boolean, default: false },
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
const mongoose = require("mongoose")
|
||||
const { def_theme } = require("../config.json");
|
||||
const { def_theme, limits } = require("../config.json");
|
||||
const schema = new mongoose.Schema({
|
||||
id: { type: String, unique: true },
|
||||
discordID: { type: String, unique: true },
|
||||
name: { type: String, maxlength: 25 },
|
||||
name: { type: String, maxlength: limits.names },
|
||||
avatar: { type: String, default: "/images/avatars/default.jpg" },
|
||||
time: { type: Date, default: Date.now },
|
||||
deleted: { type: Boolean, default: false },
|
||||
edited: { type: Boolean, default: false },
|
||||
about: { type: String, default: "", maxlength: 256 },
|
||||
about: { type: String, default: "", maxlength: limits.desp },
|
||||
admin: { type: Boolean, default: false },
|
||||
theme: { type: String, default: def_theme },
|
||||
lastSeen: { type: Date, default: Date.now, select: false },
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
|
||||
<form>
|
||||
<h2 class="title" style="align-self: baseline;">Name:</h2>
|
||||
<input name="name" class="input" required maxlength="25"></input>
|
||||
<input name="name" class="input" required ></input>
|
||||
<h2 class="title" style="align-self: baseline;">Description:</h2>
|
||||
<textarea rows="4" cols="50" name="desp" maxlength="256" class="input" required></textarea>
|
||||
<textarea rows="4" cols="50" name="desp" class="input" required></textarea>
|
||||
<button class="btn-primary" style="width:100%" type="submit">Create Category!</button>
|
||||
</form>
|
||||
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
|
||||
<form>
|
||||
<h2 class="title" style="align-self: baseline;">Title:</h2>
|
||||
<input name="title" maxlength="128" class="input" required></input>
|
||||
<input name="title" class="input" required></input>
|
||||
<h2 class="title" style="align-self: baseline;">Content:</h2>
|
||||
<textarea rows="4" cols="50" maxlength="1024" name="content" class="input" required></textarea>
|
||||
<textarea rows="4" cols="50" name="content" class="input" required></textarea>
|
||||
<h2 class="title" style="align-self: baseline;">Category:</h2>
|
||||
|
||||
<select name="category">
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
|
||||
|
||||
<form action="/register" method="post">
|
||||
<input type="text" name="username" maxlength="25" placeholder="Username" class="input" required>
|
||||
<input type="password" name="password" maxlength="25" placeholder="Password" class="input" required>
|
||||
<textarea class="input" name="about" rows="4" maxlength="256" placeholder="About you... You can use markdown"></textarea>
|
||||
<input type="text" name="username" placeholder="Username" class="input" required>
|
||||
<input type="password" name="password" placeholder="Password" class="input" required>
|
||||
<textarea class="input" name="about" rows="4" placeholder="About you... You can use markdown"></textarea>
|
||||
<input type="submit" class="btn-primary" style="width:100%;" value="Register">
|
||||
</form>
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
|
||||
<div class="message" id="send-div">
|
||||
<form id="send" style="width:100%">
|
||||
<textarea rows="4" maxlength="1024" name="content" required></textarea>
|
||||
<textarea rows="4" name="content" required></textarea>
|
||||
<input name="threadID" type="hidden" value="<%= thread.id %>"></input>
|
||||
<input name="page" type="hidden" value="<%= page %>"></input>
|
||||
<button class="btn-primary">Send!</button>
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
<h1 class="title" style="text-align:center;">Edit <a class="see" href="/users/<%= member.id %>"><%= member.name %></a></h1>
|
||||
<div class="content">
|
||||
<form id="form" class="see" style="box-shadow:none">
|
||||
<input type="text" name="name" maxlength="25" placeholder="<%=member.name%>" class="input" >
|
||||
<input type="text" name="name" placeholder="<%=member.name%>" class="input" >
|
||||
|
||||
<textarea class="input" name="about" maxlength="256" rows="4" cols="60" name="content" placeholder="<%=member.about%>"></textarea>
|
||||
<textarea class="input" name="about" rows="4" cols="60" name="content" placeholder="<%=member.about%>"></textarea>
|
||||
<% if (user?.admin){ %>
|
||||
Is Admin? <input id='admin' type='checkbox' value='true' name='admin' <%=member.admin ? "checked": ""%>>
|
||||
<input id='adminHidden' type='hidden' value='false' name='admin'>
|
||||
|
|
Loading…
Reference in a new issue