diff --git a/.gitignore b/.gitignore index 2e891b4..c50420d 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/app/Services/SettingsService.php b/app/Services/SettingsService.php index 0c6a23f..7a896cc 100644 --- a/app/Services/SettingsService.php +++ b/app/Services/SettingsService.php @@ -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() diff --git a/content/init/folks-template.json b/content/init/folks-template.json new file mode 100644 index 0000000..0933e36 --- /dev/null +++ b/content/init/folks-template.json @@ -0,0 +1,15 @@ +[ + { + "id": "", + "handle": "", + "avi": "/assets/images/global/default-avi.png", + "email": "", + "password": "", + "key": "", + "secret": "", + "role": "", + "created": "", + "updated": "", + "deleted": null + } +] diff --git a/content/init/settings-template.json b/content/init/settings-template.json new file mode 100644 index 0000000..a9681d8 --- /dev/null +++ b/content/init/settings-template.json @@ -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": [] +} diff --git a/public/assets/css/dash/forms.css b/public/assets/css/dash/forms.css index 733ed18..e228535 100644 --- a/public/assets/css/dash/forms.css +++ b/public/assets/css/dash/forms.css @@ -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; +} diff --git a/public/assets/css/dash/frame.css b/public/assets/css/dash/frame.css index ecf001f..5671613 100644 --- a/public/assets/css/dash/frame.css +++ b/public/assets/css/dash/frame.css @@ -54,7 +54,7 @@ a.main-nav-secondary-highlight { } img.logo-medium { - width: 140px; + width: 130px; } sup { diff --git a/public/assets/css/dash/init.css b/public/assets/css/dash/init.css index f6471c3..ed910b8 100644 --- a/public/assets/css/dash/init.css +++ b/public/assets/css/dash/init.css @@ -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; diff --git a/resources/views/forms/init-fresh.blade.php b/resources/views/forms/init-fresh.blade.php index 6f614f3..e79e9b8 100644 --- a/resources/views/forms/init-fresh.blade.php +++ b/resources/views/forms/init-fresh.blade.php @@ -4,11 +4,11 @@