added labels to forms (#102), init templates added

added some labels to login and set up forms for better accesibility and
clarity about what info is being requested.

found a bug in setting where the site would error out if it can't find
the correct config files instead of going to set up, so when config
files aren't present, it loads template files to continue to process.
still thinking about a better fix for this

also discovered that the init files needed for a fresh install had been
removed, so those are back in place
This commit is contained in:
ro 2024-05-08 15:55:27 -06:00
parent 770959137a
commit e09d85292a
No known key found for this signature in database
GPG key ID: 29B551CDBD4D3B50
10 changed files with 104 additions and 22 deletions

2
.gitignore vendored
View file

@ -46,10 +46,12 @@ public/assets/images/*
!content/
content/*
!content/init
!content/themes
content/themes/*
!content/themes/fipamo-default-v2
!content/themes/fipamo-default-v2/*
*.DS_Store
*.codekit3

View file

@ -16,15 +16,33 @@ class SettingsService
public function __construct(DocService $docService, ContentService $contentService)
{
$this->folks = json_decode(file_get_contents(env('FOLKS_PATH')), true);
$this->tags = json_decode(file_get_contents(env('TAGS_PATH')), true);
$this->docs = $docService;
$this->contents = $contentService;
//if config files aren't avaiable, load templates
if (file_exists(env('FOLKS_PATH'))) {
$this->folks = json_decode(file_get_contents(env('FOLKS_PATH')), true);
} else {
$this->folks = json_decode(file_get_contents('../content/init/folks-template.json'), true);
}
if (file_exists(env('TAGS_PATH'))) {
$this->tags = json_decode(file_get_contents(env('TAGS_PATH')), true);
} else {
$this->tags = [];
}
}
protected function loadSettings()
{
return json_decode(file_get_contents(env('SETTINGS_PATH')), true);
$settings = [];
//if config files aren't avaiable, load templates
if (file_exists(env('SETTINGS_PATH'))) {
$settings = json_decode(file_get_contents(env('SETTINGS_PATH')), true);
} else {
$settings = json_decode(
file_get_contents('../content/init/settings-template.json'),
true
);
}
return $settings;
}
public function getSettings()

View file

@ -0,0 +1,15 @@
[
{
"id": "",
"handle": "",
"avi": "/assets/images/global/default-avi.png",
"email": "",
"password": "",
"key": "",
"secret": "",
"role": "",
"created": "",
"updated": "",
"deleted": null
}
]

View file

@ -0,0 +1,31 @@
{
"global": {
"base_url": "http://your.domain",
"title": "This is a Title",
"descriptions": "Because it should be easy.",
"background": "/assets/images/global/default-bg.jpg",
"private": "true",
"renderOnSave": "false",
"theme": "fipamo-default",
"display_limit": 5,
"last_backup": null,
"externalAPI": "false",
"dynamicRender": "false"
},
"library_stats": {
"current_index": 1
},
"email": {
"active": "none",
"smtp": {
"domain": "",
"email": "",
"password": ""
},
"mailgun": {
"domain": "",
"api-key": ""
}
},
"menu": []
}

View file

@ -52,3 +52,25 @@ select {
font: 25px var(--base-type);
color: var(--black);
}
form input.inline {
width: auto;
border-radius: 0 5px 5px 0;
}
form label {
color: var(--secondary);
}
form label.inline {
background: var(--secondary);
display: inline-block;
height: 30px;
color: var(--primary);
padding: 5px;
border-radius: 5px 0 0 5px;
font-weight: bold;
width: 90px;
vertical-align: top;
margin-right: 1px;
}

View file

@ -54,7 +54,7 @@ a.main-nav-secondary-highlight {
}
img.logo-medium {
width: 140px;
width: 130px;
}
sup {

View file

@ -21,7 +21,6 @@ section.restore-backup {
}
section.login form input {
width: 95%;
height: 30px;
padding: 5px;
margin-bottom: 10px;
@ -67,7 +66,6 @@ section.restore-fresh form button {
}
section.restore-fresh form input {
width: 95%;
height: 30px;
padding: 5px;
margin-bottom: 10px;
@ -79,7 +77,6 @@ section.restore-backup form button {
}
section.restore-backup form input {
width: 95%;
height: 30px;
padding: 5px;
margin-bottom: 10px;

View file

@ -4,11 +4,11 @@
</a>
</div>
<form id="init-form" method="POST" onsubmit="return false;">
<input type="text" name="new_member_handle" id="new_member_handle" placeholder="handle"/>
<input type="text" name="new_member_email" id="new_member_email" placeholder="email"/>
<input type="text" name="new_member_pass" id="new_member_pass" placeholder="password"/>
<input type="text" name="new_member_pass2" id="new_member_pass2" placeholder="password confirm"/>
<input type="text" name="new_member_title" id="new_member_title" placeholder="title"/>
<label class="inline">handle</label><input type="text" class="inline" name="new_member_handle" id="new_member_handle" placeholder="handle"/>
<label class="inline">email</label><input type="text" class="inline" name="new_member_email" id="new_member_email" placeholder="email"/>
<label class="inline">password</label><input type="password" class="inline" name="new_member_pass" id="new_member_pass" placeholder="password"/>
<label class="inline">confirm</label><input type="password" class="inline" name="new_member_pass2" id="new_member_pass2" placeholder="password confirm"/>
<label class="inline">site title</label><input type="text" class="inline" name="new_member_title" id="new_member_title" placeholder="title"/>
<button id="init-blog" data-action='blog-init' type='submit'>SET UP YOUR SITE</button>
<br/><br/>
<button class="init-option" id="init-switch-restore">RESTORE FROM BACKUP</button>

View file

@ -4,9 +4,9 @@
</a>
</div>
<form id="init-restore" method="POST">
<input type="text" name="restore_former_url" id="restore_former_url" placeholder="previous site url"/>
<input type="text" name="restore_member_handle" id="restore_member_handle" placeholder="handle"/>
<input type="password" name="restore_member_pass" id="restore_member_pass" placeholder="password"/>
<label class="inline">previous</label><input type="text" class="inline" name="restore_former_url" id="restore_former_url" placeholder="previous site url"/>
<label class="inline">handle</label><input type="text" class="inline" name="restore_member_handle" id="restore_member_handle" placeholder="handle"/>
<label class="inline">password</label><input type="password"class="inline" name="restore_member_pass" id="restore_member_pass" placeholder="password"/>
<div>
<label>Grab your backup zip</label>
<input id="backup-upload" type="file" name="backup-upload" placeholder="Backup Zip"/>

View file

@ -4,15 +4,12 @@
</div>
<form action="/login" method="post" enctype="multipart/form-data">
@csrf
<input type="text" name="handle" class="form-control" placeholder="Handle" required/>
<input type="password" name="password" class="form-control" placeholder="Password" required/>
<label class="inline">handle</label><input type="text" name="handle" class="inline" placeholder="Handle" required/>
<label class="inline">password</label><input type="password" name="password" class="inline" placeholder="Password" required/>
@if($errors->any())
<input type="submit" value="{{$errors->first()}}" name="submit_button">
@else
<input type="submit" value="Knock Knock" name="submit_button">
@endif
<a href="/dashboard/reset-password">?</a>
</form>
</section>