Browse Source

Added upgrade process

pull/11/head
Chris 7 years ago
parent
commit
c90c08b904
  1. 7
      app/Providers/AppServiceProvider.php
  2. 6
      database/seeds/SettingsSeeder.php
  3. 18
      public/css/app.css
  4. 2
      public/js/app.js
  5. 4
      public/mix-manifest.json
  6. 2
      resources/assets/js/app.js
  7. 17
      resources/assets/sass/_app.scss
  8. 2
      resources/views/item.blade.php

7
app/Providers/AppServiceProvider.php

@ -30,6 +30,13 @@ class AppServiceProvider extends ServiceProvider
if($bg_image = Setting::fetch('background_image')) { if($bg_image = Setting::fetch('background_image')) {
$alt_bg = ' style="background-image: url('.asset('storage/'.$bg_image).')"'; $alt_bg = ' style="background-image: url('.asset('storage/'.$bg_image).')"';
} }
// check version to see if an upgrade is needed
$db_version = Setting::fetch('version');
$app_version = config('app.version');
if(version_compare($app_version, $db_version) == 1) { // app is higher than db, so need to run migrations etc
Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true, '--seed' => true));
}
} }
view()->share('alt_bg', $alt_bg); view()->share('alt_bg', $alt_bg);

6
database/seeds/SettingsSeeder.php

@ -36,7 +36,10 @@ class SettingsSeeder extends Seeder
$setting_group->save(); $setting_group->save();
} }
if(!Setting::find(1)) { if($version = Setting::find(1)) {
$version->value = config('app.version');
$version->save();
} else {
$setting = new Setting; $setting = new Setting;
$setting->id = 1; $setting->id = 1;
$setting->group_id = 1; $setting->group_id = 1;
@ -47,6 +50,7 @@ class SettingsSeeder extends Seeder
$setting->system = true; $setting->system = true;
$setting->save(); $setting->save();
} }
if(!Setting::find(2)) { if(!Setting::find(2)) {
$setting = new Setting; $setting = new Setting;
$setting->id = 2; $setting->id = 2;

18
public/css/app.css

@ -378,6 +378,24 @@ body {
margin-top: 12px; margin-top: 12px;
} }
.item-container {
position: relative;
}
.item-container .item-edit {
color: white;
position: absolute;
bottom: 20px;
left: 8px;
width: 30px;
height: 30px;
background: rgba(0, 0, 0, 0.7);
border-radius: 50%;
text-align: center;
line-height: 30px;
display: none;
}
.message-container { .message-container {
width: 100%; width: 100%;
padding: 10px 20px; padding: 10px 20px;

2
public/js/app.js

@ -46,6 +46,7 @@ $.when( $.ready ).then(function() {
app.toggleClass('header'); app.toggleClass('header');
if(active) { if(active) {
$('.add-item').hide(); $('.add-item').hide();
$('.item-edit').hide();
$('#app').removeClass('sidebar'); $('#app').removeClass('sidebar');
$("#sortable").sortable("disable") $("#sortable").sortable("disable")
} else { } else {
@ -54,6 +55,7 @@ $.when( $.ready ).then(function() {
function() function()
{ {
$('.add-item').fadeIn(); $('.add-item').fadeIn();
$('.item-edit').fadeIn();
}, 350); }, 350);
} }

4
public/mix-manifest.json

@ -1,4 +1,4 @@
{ {
"/css/app.css": "/css/app.css?id=d47acbf87c5ae533ddf5", "/css/app.css": "/css/app.css?id=93569633795ce0c63222",
"/js/app.js": "/js/app.js?id=a809f8ee6ee8636e0f2b" "/js/app.js": "/js/app.js?id=9cbe042c4b6921658a84"
} }

2
resources/assets/js/app.js

@ -37,6 +37,7 @@ $.when( $.ready ).then(function() {
app.toggleClass('header'); app.toggleClass('header');
if(active) { if(active) {
$('.add-item').hide(); $('.add-item').hide();
$('.item-edit').hide();
$('#app').removeClass('sidebar'); $('#app').removeClass('sidebar');
$("#sortable").sortable("disable") $("#sortable").sortable("disable")
} else { } else {
@ -45,6 +46,7 @@ $.when( $.ready ).then(function() {
function() function()
{ {
$('.add-item').fadeIn(); $('.add-item').fadeIn();
$('.item-edit').fadeIn();
}, 350); }, 350);
} }

17
resources/assets/sass/_app.scss

@ -107,6 +107,20 @@ body {
.item-container { .item-container {
//width: 340px; //width: 340px;
//transition: width .35s ease-in-out; //transition: width .35s ease-in-out;
position: relative;
.item-edit {
color: white;
position: absolute;
bottom: 20px;
left: 8px;
width: 30px;
height: 30px;
background: rgba(0,0,0,0.7);
border-radius: 50%;
text-align: center;
line-height: 30px;
display: none;
}
} }
.message-container { .message-container {
width: 100%; width: 100%;
@ -166,6 +180,9 @@ body {
} }
.item-container { .item-container {
//width: 240px; //width: 240px;
.item-edit {
//display: block;
}
} }
.item, .add-item { .item, .add-item {
transform: scale(0.9); transform: scale(0.9);

2
resources/views/item.blade.php

@ -9,4 +9,6 @@
<a class="link" href="{{ $app->url }}"><i class="fas fa-arrow-alt-to-right"></i></a> <a class="link" href="{{ $app->url }}"><i class="fas fa-arrow-alt-to-right"></i></a>
</div> </div>
<a class="item-edit" href="{{ route('items.edit', $app->id) }}"><i class="fas fa-pencil"></i></a>
</section> </section>

Loading…
Cancel
Save