diff --git a/app/Models/Table.php b/app/Models/Table.php index 4cfaecb..58b21c5 100644 --- a/app/Models/Table.php +++ b/app/Models/Table.php @@ -22,6 +22,7 @@ use Riesjart\Relaquent\Model\Concerns\HasRelaquentRelationships; * @property string $description * @property string $license * @property string $origin + * @property-read string $viewPage * @property-read User $owner * @property-read Table $parentTable * @property-read Table[]|Collection $forks @@ -96,4 +97,13 @@ class Table extends Model { return $this->belongsToMany(User::class, 'discussion_follows'); } + + public function __get($name) + { + if ($name == 'viewPage') { + return route('table.view', ['user' => $this->cachedOwner()->name, 'table' => $this->name]); + } + + return parent::__get($name); + } } diff --git a/resources/assets/sass/_variables.scss b/resources/assets/sass/_variables.scss index 927e2c5..e69de29 100644 --- a/resources/assets/sass/_variables.scss +++ b/resources/assets/sass/_variables.scss @@ -1,25 +0,0 @@ - -// Body -$body-bg: white;//$gray-300; - -// Typography -$font-family-sans-serif: "IBM Plex Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif; -$font-size-base: 1rem; -$line-height-base: 1.6; - -$link-color: $gray-800; -$link-decoration: none; -$link-hover-color: darken($link-color, 15%); -$link-hover-decoration: underline; - -$card-cap-bg: lighten($primary, 5); -$card-border-color: $primary; -//$card-border-width: 2px; -$card-border-radius: 5px; -$card-inner-border-radius: 2px; - -$list-group-hover-bg: rgba($primary, .1); - -$tooltip-max-width: 300px; -$tooltip-bg: darken($primary, 20%); -$tooltip-arrow-color: $tooltip-bg; diff --git a/resources/assets/sass/app.scss b/resources/assets/sass/app.scss index 5c40212..ee61b0b 100644 --- a/resources/assets/sass/app.scss +++ b/resources/assets/sass/app.scss @@ -4,9 +4,49 @@ // Variables @import "bst-base"; -@import "variables"; + +$sp0: 0; +$sp1_2: $spacer*.25; +$sp1: $spacer*.5; +$sp3_4: $spacer*.75; +$sp1: $spacer*.5; +$sp2: $spacer*1; +$sp3: $spacer*1.5; +$sp4: $spacer*2; + + +// Body +$body-bg: white; + +// Typography +$font-family-sans-serif: "IBM Plex Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif; +$font-size-base: 1rem; +$line-height-base: 1.6; + +$link-color: $gray-800; +$link-decoration: none; +$link-hover-color: darken($link-color, 15%); +$link-hover-decoration: underline; + +$card-cap-bg: lighten($primary, 5); +$card-border-color: $primary; +//$card-border-width: 2px; +$card-border-radius: 5px; +$card-inner-border-radius: 2px; + +$list-group-hover-bg: rgba($primary, .1); + +$tooltip-max-width: 300px; +$tooltip-bg: darken($primary, 20%); +$tooltip-arrow-color: $tooltip-bg; + +$pagination-padding-y-sm: $sp1_2; +$pagination-padding-x-sm: $sp3_4; + + @import "bst-modules"; + // generic hiding class .hidden { display: none !important; @@ -14,15 +54,22 @@ // padding right for icons (must not use space next to it!) .fa-pr::before { - margin-right: ($spacer*.5); + margin-right: $sp1; } -// button in card header, adjusting margins to not stretch the header -.card-header .btn { - margin-top: -3px; - margin-bottom: -10px; +.fa-large.fa-pr::before { + margin-right: $sp2; +} + +.fa-large { + font-size: 1.6em; } +.card-header .fa-large { + margin: -.6em 0; // fix alignment +} + + html { overflow-y: scroll; } @@ -64,3 +111,51 @@ html { .card { box-shadow: 0 2px 3px rgba(black, .3); } + +.pagination-outline-light { + .page-link { + color: white; + background-color: transparent; + border: $pagination-border-width solid white; + + &:hover { + color: white; + background-color: rgba(black, .2); + border-color: white; + } + + &:focus { + z-index: 2; + outline: 0 none; + box-shadow: 0 0 0 $btn-focus-width rgba(white, .5); + } + } + + .page-item { + font-weight: normal; + + &.active .page-link { + color: white; + font-weight: bold; + background-color: rgba(black, .2); + border-color: white; + } + + &.disabled .page-link { + color: rgba(white, .6); + background-color: transparent; + border-color: white; + } + } +} + +.card-header-extra { + display:flex; + align-items: center; +} + +// special styles for buttons in card header +.card-header .btn { + @extend .btn-sm; + @extend .btn-outline-light; +} diff --git a/resources/views/user/_table-list.blade.php b/resources/views/user/_table-list.blade.php index 8953ca4..195cdab 100644 --- a/resources/views/user/_table-list.blade.php +++ b/resources/views/user/_table-list.blade.php @@ -4,7 +4,7 @@ @else @foreach($tables as $table) + href="{{$table->viewPage}}"> {{ $table->title }} @@ -24,6 +24,5 @@ @endforeach - {{ $tables->links() }} @endif diff --git a/resources/views/user/view.blade.php b/resources/views/user/view.blade.php index fcfeb74..2913748 100644 --- a/resources/views/user/view.blade.php +++ b/resources/views/user/view.blade.php @@ -14,12 +14,11 @@ {{-- Dash card --}}
-
- - {{ $user->title }} +
+ {{ $user->title }} @if(authed() && user()->is($user)) - Edit + Edit @endif
@@ -68,8 +67,8 @@ {{-- Table list card --}}
-
- +
+ @if(authed() && user()->is($user)) Your Tables @else @@ -77,8 +76,14 @@ @endif + @if ($tables->hasPages()) + + @endif + @if(authed() && user()->is($user)) - New + New @endif
diff --git a/resources/views/vendor/pagination/bootstrap-4.blade.php b/resources/views/vendor/pagination/bootstrap-4.blade.php new file mode 100644 index 0000000..d3e6aab --- /dev/null +++ b/resources/views/vendor/pagination/bootstrap-4.blade.php @@ -0,0 +1,44 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/resources/views/vendor/pagination/simple-bootstrap-4.blade.php b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php new file mode 100644 index 0000000..786a78d --- /dev/null +++ b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php @@ -0,0 +1,25 @@ +@if ($paginator->hasPages()) + +@endif