placeholder table action buttons
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -177,4 +177,9 @@ class User extends Authenticatable
|
||||
|
||||
return parent::__get($name);
|
||||
}
|
||||
|
||||
public function ownsTable(Table $table)
|
||||
{
|
||||
return $table->owner_id == $this->id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 '<span class="sr-only">' . $sr . '</span>' .
|
||||
'<i class="' . e($classes) . '" title="' . $tit . '" aria-hidden=true></i>';
|
||||
'<i class="' . e($classes) . '" '.
|
||||
($notooltip ? '' : 'title="' . $tit . '"') .
|
||||
' aria-hidden=true></i>';
|
||||
} else {
|
||||
return '<i class="' . e(trim($arg)) . '" aria-hidden=true></i>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user