diff --git a/app/Http/Controllers/TableController.php b/app/Http/Controllers/TableController.php index cae1bc7..b1629fe 100644 --- a/app/Http/Controllers/TableController.php +++ b/app/Http/Controllers/TableController.php @@ -22,9 +22,10 @@ class TableController extends Controller /** @var Table $tableModel */ $tableModel = $user->tables()->where('name', $table)->first(); + // make it possible to show other revisions if ($input->has('rev')) { $rev = (int)$input->rev; - $revision = $tableModel->revisions()->orderBy('created_at')->skip($rev)->first(); + $revision = $tableModel->revisions()->orderBy('created_at')->skip($rev - 1)->first(); if ($revision === null) abort(404, "No such revision"); } else { $revision = $tableModel->revision; diff --git a/app/Models/User.php b/app/Models/User.php index 8988e78..ad09db3 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -177,4 +177,9 @@ class User extends Authenticatable return parent::__get($name); } + + public function ownsTable(Table $table) + { + return $table->owner_id == $this->id; + } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 0af6463..44d8fb8 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -49,11 +49,20 @@ class AppServiceProvider extends ServiceProvider $classes = trim($classes); $title = trim($title); + $notooltip = false; + + if (strpos($title, 'sr:') === 0) { + $notooltip = true; + $title = substr($title, 3); + } + $sr = str_replace('~', ' ', e($title)); - $tit = str_replace('~', '', e(trim($title, ' \r\n\t:,'))); + $tit = str_replace('~', '', e(trim($title, " \r\n\t:,"))); return '' . $sr . '' . - ''; + ''; } else { return ''; } diff --git a/public/fonts/fa-dtbl-1-preview.html b/public/fonts/fa-dtbl-1-preview.html index 076266b..e950de0 100644 --- a/public/fonts/fa-dtbl-1-preview.html +++ b/public/fonts/fa-dtbl-1-preview.html @@ -170,7 +170,7 @@ .fa-clock-o:before, .fa-cloud-upload:before, .fa-code-fork:before, -.fa-comments:before, +.fa-comment:before, .fa-download:before, .fa-eye:before, .fa-eye-slash:before, @@ -183,6 +183,7 @@ .fa-globe:before, .fa-google:before, .fa-history:before, +.fa-inbox:before, .fa-key-modern:before, .fa-link:before, .fa-pencil:before, @@ -232,7 +233,7 @@ .fa-clock-o:before { content: "\f106"; } .fa-cloud-upload:before { content: "\f107"; } .fa-code-fork:before { content: "\f108"; } -.fa-comments:before { content: "\f109"; } +.fa-comment:before { content: "\f109"; } .fa-download:before { content: "\f10a"; } .fa-eye:before { content: "\f10b"; } .fa-eye-slash:before { content: "\f10c"; } @@ -245,32 +246,33 @@ .fa-globe:before { content: "\f113"; } .fa-google:before { content: "\f114"; } .fa-history:before { content: "\f115"; } -.fa-key-modern:before { content: "\f116"; } -.fa-link:before { content: "\f117"; } -.fa-pencil:before { content: "\f118"; } -.fa-pencil-square-o:before { content: "\f119"; } -.fa-question-circle:before { content: "\f11a"; } -.fa-quote-left:before { content: "\f11b"; } -.fa-reply:before { content: "\f11c"; } -.fa-rss:before { content: "\f11d"; } -.fa-search:before { content: "\f11e"; } -.fa-share-alt:before { content: "\f11f"; } -.fa-sign-in:before { content: "\f120"; } -.fa-sign-out:before { content: "\f121"; } -.fa-sliders:before { content: "\f122"; } -.fa-sort:before { content: "\f123"; } -.fa-sort-asc:before { content: "\f124"; } -.fa-sort-desc:before { content: "\f125"; } -.fa-star:before { content: "\f126"; } -.fa-star-o:before { content: "\f127"; } -.fa-table:before { content: "\f128"; } -.fa-th-list:before { content: "\f129"; } -.fa-times:before { content: "\f12a"; } -.fa-trash:before { content: "\f12b"; } -.fa-trash-o:before { content: "\f12c"; } -.fa-user-circle-o:before { content: "\f12d"; } -.fa-user-plus:before { content: "\f12e"; } -.fa-wrench:before { content: "\f12f"; } +.fa-inbox:before { content: "\f116"; } +.fa-key-modern:before { content: "\f117"; } +.fa-link:before { content: "\f118"; } +.fa-pencil:before { content: "\f119"; } +.fa-pencil-square-o:before { content: "\f11a"; } +.fa-question-circle:before { content: "\f11b"; } +.fa-quote-left:before { content: "\f11c"; } +.fa-reply:before { content: "\f11d"; } +.fa-rss:before { content: "\f11e"; } +.fa-search:before { content: "\f11f"; } +.fa-share-alt:before { content: "\f120"; } +.fa-sign-in:before { content: "\f121"; } +.fa-sign-out:before { content: "\f122"; } +.fa-sliders:before { content: "\f123"; } +.fa-sort:before { content: "\f124"; } +.fa-sort-asc:before { content: "\f125"; } +.fa-sort-desc:before { content: "\f126"; } +.fa-star:before { content: "\f127"; } +.fa-star-o:before { content: "\f128"; } +.fa-table:before { content: "\f129"; } +.fa-th-list:before { content: "\f12a"; } +.fa-times:before { content: "\f12b"; } +.fa-trash:before { content: "\f12c"; } +.fa-trash-o:before { content: "\f12d"; } +.fa-user-circle-o:before { content: "\f12e"; } +.fa-user-plus:before { content: "\f12f"; } +.fa-wrench:before { content: "\f130"; } @@ -286,7 +288,7 @@