forked from projects/fipamo
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:
parent
770959137a
commit
e09d85292a
10 changed files with 104 additions and 22 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -46,10 +46,12 @@ public/assets/images/*
|
||||||
|
|
||||||
!content/
|
!content/
|
||||||
content/*
|
content/*
|
||||||
|
!content/init
|
||||||
!content/themes
|
!content/themes
|
||||||
content/themes/*
|
content/themes/*
|
||||||
!content/themes/fipamo-default-v2
|
!content/themes/fipamo-default-v2
|
||||||
!content/themes/fipamo-default-v2/*
|
!content/themes/fipamo-default-v2/*
|
||||||
|
|
||||||
|
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
*.codekit3
|
*.codekit3
|
||||||
|
|
|
@ -16,15 +16,33 @@ class SettingsService
|
||||||
|
|
||||||
public function __construct(DocService $docService, ContentService $contentService)
|
public function __construct(DocService $docService, ContentService $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);
|
$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);
|
$this->tags = json_decode(file_get_contents(env('TAGS_PATH')), true);
|
||||||
$this->docs = $docService;
|
} else {
|
||||||
$this->contents = $contentService;
|
$this->tags = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function loadSettings()
|
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()
|
public function getSettings()
|
||||||
|
|
15
content/init/folks-template.json
Normal file
15
content/init/folks-template.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": "",
|
||||||
|
"handle": "",
|
||||||
|
"avi": "/assets/images/global/default-avi.png",
|
||||||
|
"email": "",
|
||||||
|
"password": "",
|
||||||
|
"key": "",
|
||||||
|
"secret": "",
|
||||||
|
"role": "",
|
||||||
|
"created": "",
|
||||||
|
"updated": "",
|
||||||
|
"deleted": null
|
||||||
|
}
|
||||||
|
]
|
31
content/init/settings-template.json
Normal file
31
content/init/settings-template.json
Normal 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": []
|
||||||
|
}
|
|
@ -52,3 +52,25 @@ select {
|
||||||
font: 25px var(--base-type);
|
font: 25px var(--base-type);
|
||||||
color: var(--black);
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ a.main-nav-secondary-highlight {
|
||||||
}
|
}
|
||||||
|
|
||||||
img.logo-medium {
|
img.logo-medium {
|
||||||
width: 140px;
|
width: 130px;
|
||||||
}
|
}
|
||||||
|
|
||||||
sup {
|
sup {
|
||||||
|
|
|
@ -21,7 +21,6 @@ section.restore-backup {
|
||||||
}
|
}
|
||||||
|
|
||||||
section.login form input {
|
section.login form input {
|
||||||
width: 95%;
|
|
||||||
height: 30px;
|
height: 30px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
@ -67,7 +66,6 @@ section.restore-fresh form button {
|
||||||
}
|
}
|
||||||
|
|
||||||
section.restore-fresh form input {
|
section.restore-fresh form input {
|
||||||
width: 95%;
|
|
||||||
height: 30px;
|
height: 30px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
@ -79,7 +77,6 @@ section.restore-backup form button {
|
||||||
}
|
}
|
||||||
|
|
||||||
section.restore-backup form input {
|
section.restore-backup form input {
|
||||||
width: 95%;
|
|
||||||
height: 30px;
|
height: 30px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<form id="init-form" method="POST" onsubmit="return false;">
|
<form id="init-form" method="POST" onsubmit="return false;">
|
||||||
<input type="text" name="new_member_handle" id="new_member_handle" placeholder="handle"/>
|
<label class="inline">handle</label><input type="text" class="inline" name="new_member_handle" id="new_member_handle" placeholder="handle"/>
|
||||||
<input type="text" name="new_member_email" id="new_member_email" placeholder="email"/>
|
<label class="inline">email</label><input type="text" class="inline" name="new_member_email" id="new_member_email" placeholder="email"/>
|
||||||
<input type="text" name="new_member_pass" id="new_member_pass" placeholder="password"/>
|
<label class="inline">password</label><input type="password" class="inline" name="new_member_pass" id="new_member_pass" placeholder="password"/>
|
||||||
<input type="text" name="new_member_pass2" id="new_member_pass2" placeholder="password confirm"/>
|
<label class="inline">confirm</label><input type="password" class="inline" 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">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>
|
<button id="init-blog" data-action='blog-init' type='submit'>SET UP YOUR SITE</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button class="init-option" id="init-switch-restore">RESTORE FROM BACKUP</button>
|
<button class="init-option" id="init-switch-restore">RESTORE FROM BACKUP</button>
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<form id="init-restore" method="POST">
|
<form id="init-restore" method="POST">
|
||||||
<input type="text" name="restore_former_url" id="restore_former_url" placeholder="previous site url"/>
|
<label class="inline">previous</label><input type="text" class="inline" 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"/>
|
<label class="inline">handle</label><input type="text" class="inline" 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">password</label><input type="password"class="inline" name="restore_member_pass" id="restore_member_pass" placeholder="password"/>
|
||||||
<div>
|
<div>
|
||||||
<label>Grab your backup zip</label>
|
<label>Grab your backup zip</label>
|
||||||
<input id="backup-upload" type="file" name="backup-upload" placeholder="Backup Zip"/>
|
<input id="backup-upload" type="file" name="backup-upload" placeholder="Backup Zip"/>
|
||||||
|
|
|
@ -4,15 +4,12 @@
|
||||||
</div>
|
</div>
|
||||||
<form action="/login" method="post" enctype="multipart/form-data">
|
<form action="/login" method="post" enctype="multipart/form-data">
|
||||||
@csrf
|
@csrf
|
||||||
<input type="text" name="handle" class="form-control" placeholder="Handle" required/>
|
<label class="inline">handle</label><input type="text" name="handle" class="inline" placeholder="Handle" required/>
|
||||||
<input type="password" name="password" class="form-control" placeholder="Password" required/>
|
<label class="inline">password</label><input type="password" name="password" class="inline" placeholder="Password" required/>
|
||||||
@if($errors->any())
|
@if($errors->any())
|
||||||
<input type="submit" value="{{$errors->first()}}" name="submit_button">
|
<input type="submit" value="{{$errors->first()}}" name="submit_button">
|
||||||
@else
|
@else
|
||||||
<input type="submit" value="Knock Knock" name="submit_button">
|
<input type="submit" value="Knock Knock" name="submit_button">
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<a href="/dashboard/reset-password">?</a>
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Reference in a new issue