diff --git a/api-doc/dev/classes/Alddesign-Crudkit-Classes-Lookup.html b/api-doc/dev/classes/Alddesign-Crudkit-Classes-Lookup.html index 8cf08be..9fa1a14 100644 --- a/api-doc/dev/classes/Alddesign-Crudkit-Classes-Lookup.html +++ b/api-doc/dev/classes/Alddesign-Crudkit-Classes-Lookup.html @@ -1312,7 +1312,7 @@

@@ -1357,7 +1357,14 @@

Parameters
: string
-

Defindes whats the value of the label (that is displayed)'lookup', 'lookup-all', 'const', 'count', 'sum'

+

Defines which value(s) the lookup should fetch from the related table´s column:

+
    +
  • 'lookup': fetches the value of $tableFieldname from a single record: typically used when the filters result in a single record
  • +
  • 'lookup-all': fetches the values of $tableFieldname from multiple records and glues them together with $lookupAllSeparator: typically used when the filters result in multiple records
  • +
  • 'const': fetches a constant value defined by $value: makes sense if you dont want to show data from another table, but to crate some sort of link to it
  • +
  • 'count': fetches records from the other table and counts them
  • +
  • 'sum': fetches the values of $tableFieldname from multiple records sums them up: typically used when creating totals. Requires $tableFieldname to be a numeric field.
  • +
@@ -1366,7 +1373,7 @@
Parameters
: string
-

The text of the label for the action

+

The text of the label for this Lookup

@@ -1450,7 +1457,7 @@

@@ -1494,7 +1501,7 @@

@@ -1547,7 +1554,7 @@

@@ -1651,7 +1658,7 @@

@@ -1695,7 +1702,7 @@

@@ -1791,7 +1798,7 @@

@@ -1848,7 +1855,7 @@

@@ -1892,7 +1899,7 @@

@@ -1936,7 +1943,7 @@

@@ -1980,7 +1987,7 @@

@@ -2024,7 +2031,7 @@

@@ -2068,7 +2075,7 @@

@@ -2112,7 +2119,7 @@

@@ -2156,7 +2163,7 @@

@@ -2200,7 +2207,7 @@

@@ -2244,7 +2251,7 @@

@@ -2288,7 +2295,7 @@

@@ -2332,7 +2339,7 @@

@@ -2376,7 +2383,7 @@

@@ -2420,7 +2427,7 @@

diff --git a/api-doc/dev/classes/Alddesign-Crudkit-Classes-PageDescriptor.html b/api-doc/dev/classes/Alddesign-Crudkit-Classes-PageDescriptor.html index d8ae3e2..1125883 100644 --- a/api-doc/dev/classes/Alddesign-Crudkit-Classes-PageDescriptor.html +++ b/api-doc/dev/classes/Alddesign-Crudkit-Classes-PageDescriptor.html @@ -657,7 +657,7 @@

 : PageDescriptor -
Defines which columns are shown as link form list to card page (defaul = first column of Tables PK)
+
Defines which columns are shown as link form the list page to the card page.
setCategory() @@ -699,7 +699,7 @@

 : PageDescriptor

-
Defines which columns are shown in which order on list pages (defaul = all, order = as defined in tables).
+
Defines which columns are shown in which order on list pages.
setTitleText() @@ -1950,7 +1950,7 @@

@@ -2121,7 +2121,7 @@

@@ -2188,7 +2188,7 @@

@@ -2251,7 +2251,7 @@

@@ -2316,7 +2316,7 @@

@@ -2382,7 +2382,7 @@

@@ -3504,7 +3504,7 @@

@@ -3565,7 +3565,7 @@

@@ -3628,7 +3628,7 @@

@@ -3689,7 +3689,7 @@

@@ -3750,7 +3750,7 @@

@@ -3811,7 +3811,7 @@

@@ -3872,7 +3872,7 @@

@@ -3934,7 +3934,7 @@

@@ -3996,7 +3996,7 @@

@@ -4058,7 +4058,7 @@

@@ -4120,7 +4120,7 @@

@@ -4524,18 +4524,17 @@

-

Defines which columns are shown as link form list to card page (defaul = first column of Tables PK)

+

Defines which columns are shown as link form the list page to the card page.

public setCardLinkColumns(array<string|int, string> $cardLinkColumnNames) : PageDescriptor -
$pageDescriptor->setCardLinkColumns(["id", "name"]);
-
+

By the default its the first column of the table´s primary key.

Parameters
@@ -4545,7 +4544,9 @@
Parameters
: array<string|int, string>

- +

Array of column names

+
+
@@ -4868,17 +4869,19 @@

-

Defines which columns are shown in which order on list pages (defaul = all, order = as defined in tables).

+

Defines which columns are shown in which order on list pages.

public setSummaryColumns(array<string|int, string> $summaryColumnNames) : PageDescriptor - +

By default all columns are shown in the order they are defined in the table.

+
+

Parameters
@@ -4886,7 +4889,9 @@
Parameters
: array<string|int, string>
- +

Array of column names.

+
+
@@ -4924,7 +4929,7 @@

@@ -4996,7 +5001,7 @@

diff --git a/api-doc/dev/classes/Alddesign-Crudkit-Controllers-CrudkitController.html b/api-doc/dev/classes/Alddesign-Crudkit-Controllers-CrudkitController.html index 47001f9..201660b 100644 --- a/api-doc/dev/classes/Alddesign-Crudkit-Controllers-CrudkitController.html +++ b/api-doc/dev/classes/Alddesign-Crudkit-Controllers-CrudkitController.html @@ -150,6 +150,13 @@

+
+ CRUDKIT_VERSION + +  = 'v1.0.0-rc.1' +
+
+
$authHelper @@ -162,13 +169,6 @@

 : PageStore

-
- -
- $version - -  : string -
@@ -351,6 +351,41 @@

+
+

+ Constants + +

+
+

+ CRUDKIT_VERSION + +

+ + + + + + private + string + CRUDKIT_VERSION + = 'v1.0.0-rc.1' + + + + +

The CRUDKit version

+
+ + + +
+
@@ -425,40 +460,6 @@

- -
-

- $version - - - -

- - - - - private - string - $version - = 'v1.0.0' - - -

The CRUDKit version.

-
- - -

diff --git a/api-doc/dev/classes/Alddesign-Crudkit-CrudkitServiceProvider.html b/api-doc/dev/classes/Alddesign-Crudkit-CrudkitServiceProvider.html index 91c30b8..3de35a7 100644 --- a/api-doc/dev/classes/Alddesign-Crudkit-CrudkitServiceProvider.html +++ b/api-doc/dev/classes/Alddesign-Crudkit-CrudkitServiceProvider.html @@ -114,7 +114,7 @@

@@ -238,7 +238,7 @@

@@ -270,7 +270,7 @@

@@ -302,7 +302,7 @@

@@ -334,7 +334,7 @@

@@ -366,7 +366,7 @@

@@ -402,7 +402,7 @@

@@ -498,7 +498,7 @@

@@ -547,7 +547,7 @@

@@ -580,7 +580,7 @@

diff --git a/api-doc/dev/js/searchIndex.js b/api-doc/dev/js/searchIndex.js index 23c60ac..ecbc6fc 100644 --- a/api-doc/dev/js/searchIndex.js +++ b/api-doc/dev/js/searchIndex.js @@ -1043,12 +1043,12 @@ Search.appendIndex( }, { "fqsen": "\\Alddesign\\Crudkit\\Classes\\PageDescriptor\u003A\u003AsetSummaryColumns\u0028\u0029", "name": "setSummaryColumns", - "summary": "Defines\u0020which\u0020columns\u0020are\u0020shown\u0020in\u0020which\u0020order\u0020on\u0020list\u0020pages\u0020\u0028defaul\u0020\u003D\u0020all,\u0020order\u0020\u003D\u0020as\u0020defined\u0020in\u0020tables\u0029.", + "summary": "Defines\u0020which\u0020columns\u0020are\u0020shown\u0020in\u0020which\u0020order\u0020on\u0020list\u0020pages.", "url": "classes/Alddesign-Crudkit-Classes-PageDescriptor.html#method_setSummaryColumns" }, { "fqsen": "\\Alddesign\\Crudkit\\Classes\\PageDescriptor\u003A\u003AsetCardLinkColumns\u0028\u0029", "name": "setCardLinkColumns", - "summary": "Defines\u0020which\u0020columns\u0020are\u0020shown\u0020as\u0020link\u0020form\u0020list\u0020to\u0020card\u0020page\u0020\u0028defaul\u0020\u003D\u0020first\u0020column\u0020of\u0020Tables\u0020PK\u0029", + "summary": "Defines\u0020which\u0020columns\u0020are\u0020shown\u0020as\u0020link\u0020form\u0020the\u0020list\u0020page\u0020to\u0020the\u0020card\u0020page.", "url": "classes/Alddesign-Crudkit-Classes-PageDescriptor.html#method_setCardLinkColumns" }, { "fqsen": "\\Alddesign\\Crudkit\\Classes\\PageDescriptor\u003A\u003AsetTitleText\u0028\u0029", @@ -1981,10 +1981,10 @@ Search.appendIndex( "summary": "", "url": "classes/Alddesign-Crudkit-Controllers-CrudkitController.html#method_ajaxCustom" }, { - "fqsen": "\\Alddesign\\Crudkit\\Controllers\\CrudkitController\u003A\u003A\u0024version", - "name": "version", + "fqsen": "\\Alddesign\\Crudkit\\Controllers\\CrudkitController\u003A\u003ACRUDKIT_VERSION", + "name": "CRUDKIT_VERSION", "summary": "", - "url": "classes/Alddesign-Crudkit-Controllers-CrudkitController.html#property_version" + "url": "classes/Alddesign-Crudkit-Controllers-CrudkitController.html#constant_CRUDKIT_VERSION" }, { "fqsen": "\\Alddesign\\Crudkit\\Controllers\\CrudkitController\u003A\u003A\u0024pageStore", "name": "pageStore", diff --git a/api-doc/user/classes/Alddesign-Crudkit-Classes-Lookup.html b/api-doc/user/classes/Alddesign-Crudkit-Classes-Lookup.html index 29c35a3..2ab1650 100644 --- a/api-doc/user/classes/Alddesign-Crudkit-Classes-Lookup.html +++ b/api-doc/user/classes/Alddesign-Crudkit-Classes-Lookup.html @@ -1264,7 +1264,7 @@

@@ -1309,7 +1309,14 @@

Parameters
: string
-

Defindes whats the value of the label (that is displayed)'lookup', 'lookup-all', 'const', 'count', 'sum'

+

Defines which value(s) the lookup should fetch from the related table´s column:

+
    +
  • 'lookup': fetches the value of $tableFieldname from a single record: typically used when the filters result in a single record
  • +
  • 'lookup-all': fetches the values of $tableFieldname from multiple records and glues them together with $lookupAllSeparator: typically used when the filters result in multiple records
  • +
  • 'const': fetches a constant value defined by $value: makes sense if you dont want to show data from another table, but to crate some sort of link to it
  • +
  • 'count': fetches records from the other table and counts them
  • +
  • 'sum': fetches the values of $tableFieldname from multiple records sums them up: typically used when creating totals. Requires $tableFieldname to be a numeric field.
  • +
@@ -1318,7 +1325,7 @@
Parameters
: string
-

The text of the label for the action

+

The text of the label for this Lookup

@@ -1402,7 +1409,7 @@

@@ -1446,7 +1453,7 @@

@@ -1499,7 +1506,7 @@

@@ -1603,7 +1610,7 @@

@@ -1647,7 +1654,7 @@

@@ -1743,7 +1750,7 @@

@@ -1800,7 +1807,7 @@

@@ -1844,7 +1851,7 @@

@@ -1888,7 +1895,7 @@

@@ -1932,7 +1939,7 @@

@@ -1976,7 +1983,7 @@

@@ -2020,7 +2027,7 @@

@@ -2064,7 +2071,7 @@

@@ -2108,7 +2115,7 @@

@@ -2152,7 +2159,7 @@

@@ -2196,7 +2203,7 @@

@@ -2240,7 +2247,7 @@

@@ -2284,7 +2291,7 @@

@@ -2328,7 +2335,7 @@

@@ -2372,7 +2379,7 @@

diff --git a/api-doc/user/classes/Alddesign-Crudkit-Classes-PageDescriptor.html b/api-doc/user/classes/Alddesign-Crudkit-Classes-PageDescriptor.html index ca78d55..17aad3c 100644 --- a/api-doc/user/classes/Alddesign-Crudkit-Classes-PageDescriptor.html +++ b/api-doc/user/classes/Alddesign-Crudkit-Classes-PageDescriptor.html @@ -356,7 +356,7 @@

 : PageDescriptor -
Defines which columns are shown as link form list to card page (defaul = first column of Tables PK)
+
Defines which columns are shown as link form the list page to the card page.
setCategory() @@ -398,7 +398,7 @@

 : PageDescriptor

-
Defines which columns are shown in which order on list pages (defaul = all, order = as defined in tables).
+
Defines which columns are shown in which order on list pages.
setTitleText() @@ -527,7 +527,7 @@

@@ -698,7 +698,7 @@

@@ -765,7 +765,7 @@

@@ -828,7 +828,7 @@

@@ -893,7 +893,7 @@

@@ -959,7 +959,7 @@

@@ -1178,7 +1178,7 @@

@@ -1239,7 +1239,7 @@

@@ -1302,7 +1302,7 @@

@@ -1363,7 +1363,7 @@

@@ -1424,7 +1424,7 @@

@@ -1485,7 +1485,7 @@

@@ -1546,7 +1546,7 @@

@@ -1608,7 +1608,7 @@

@@ -1670,7 +1670,7 @@

@@ -1732,7 +1732,7 @@

@@ -1794,7 +1794,7 @@

@@ -2198,18 +2198,17 @@

-

Defines which columns are shown as link form list to card page (defaul = first column of Tables PK)

+

Defines which columns are shown as link form the list page to the card page.

public setCardLinkColumns(array<string|int, string> $cardLinkColumnNames) : PageDescriptor -
$pageDescriptor->setCardLinkColumns(["id", "name"]);
-
+

By the default its the first column of the table´s primary key.

Parameters
@@ -2219,7 +2218,9 @@
Parameters
: array<string|int, string>

- +

Array of column names

+
+

@@ -2542,17 +2543,19 @@

-

Defines which columns are shown in which order on list pages (defaul = all, order = as defined in tables).

+

Defines which columns are shown in which order on list pages.

public setSummaryColumns(array<string|int, string> $summaryColumnNames) : PageDescriptor - +

By default all columns are shown in the order they are defined in the table.

+
+

Parameters
@@ -2560,7 +2563,9 @@
Parameters
: array<string|int, string>
- +

Array of column names.

+
+
@@ -2598,7 +2603,7 @@

diff --git a/api-doc/user/classes/Alddesign-Crudkit-CrudkitServiceProvider.html b/api-doc/user/classes/Alddesign-Crudkit-CrudkitServiceProvider.html index 127777f..3155785 100644 --- a/api-doc/user/classes/Alddesign-Crudkit-CrudkitServiceProvider.html +++ b/api-doc/user/classes/Alddesign-Crudkit-CrudkitServiceProvider.html @@ -114,7 +114,7 @@

@@ -238,7 +238,7 @@

@@ -270,7 +270,7 @@

@@ -302,7 +302,7 @@

@@ -334,7 +334,7 @@

@@ -366,7 +366,7 @@

@@ -402,7 +402,7 @@

@@ -498,7 +498,7 @@

@@ -547,7 +547,7 @@

@@ -580,7 +580,7 @@

diff --git a/api-doc/user/js/searchIndex.js b/api-doc/user/js/searchIndex.js index fa78431..9fd4a81 100644 --- a/api-doc/user/js/searchIndex.js +++ b/api-doc/user/js/searchIndex.js @@ -613,12 +613,12 @@ Search.appendIndex( }, { "fqsen": "\\Alddesign\\Crudkit\\Classes\\PageDescriptor\u003A\u003AsetSummaryColumns\u0028\u0029", "name": "setSummaryColumns", - "summary": "Defines\u0020which\u0020columns\u0020are\u0020shown\u0020in\u0020which\u0020order\u0020on\u0020list\u0020pages\u0020\u0028defaul\u0020\u003D\u0020all,\u0020order\u0020\u003D\u0020as\u0020defined\u0020in\u0020tables\u0029.", + "summary": "Defines\u0020which\u0020columns\u0020are\u0020shown\u0020in\u0020which\u0020order\u0020on\u0020list\u0020pages.", "url": "classes/Alddesign-Crudkit-Classes-PageDescriptor.html#method_setSummaryColumns" }, { "fqsen": "\\Alddesign\\Crudkit\\Classes\\PageDescriptor\u003A\u003AsetCardLinkColumns\u0028\u0029", "name": "setCardLinkColumns", - "summary": "Defines\u0020which\u0020columns\u0020are\u0020shown\u0020as\u0020link\u0020form\u0020list\u0020to\u0020card\u0020page\u0020\u0028defaul\u0020\u003D\u0020first\u0020column\u0020of\u0020Tables\u0020PK\u0029", + "summary": "Defines\u0020which\u0020columns\u0020are\u0020shown\u0020as\u0020link\u0020form\u0020the\u0020list\u0020page\u0020to\u0020the\u0020card\u0020page.", "url": "classes/Alddesign-Crudkit-Classes-PageDescriptor.html#method_setCardLinkColumns" }, { "fqsen": "\\Alddesign\\Crudkit\\Classes\\PageDescriptor\u003A\u003AsetTitleText\u0028\u0029", diff --git a/src/Classes/Lookup.php b/src/Classes/Lookup.php index 462b062..7379196 100644 --- a/src/Classes/Lookup.php +++ b/src/Classes/Lookup.php @@ -48,11 +48,16 @@ class Lookup * @param TableDescriptor $table the reference table for the lookup * @param string $tableFieldname the fieldname in the recerence table * @param array $filterDefinitions fitlers for the reference talbe - * @param string $valueType Defindes whats the value of the label (that is displayed)'lookup', 'lookup-all', 'const', 'count', 'sum' - * @param string $label The text of the label for the action + * @param string $valueType Defines which value(s) the lookup should fetch from the related table´s column: + * * 'lookup': fetches the value of $tableFieldname from a single record: typically used when the filters result in a single record + * * 'lookup-all': fetches the values of $tableFieldname from multiple records and glues them together with $lookupAllSeparator: typically used when the filters result in multiple records + * * 'const': fetches a constant value defined by $value: makes sense if you dont want to show data from another table, but to crate some sort of link to it + * * 'count': fetches records from the other table and counts them + * * 'sum': fetches the values of $tableFieldname from multiple records sums them up: typically used when creating totals. Requires $tableFieldname to be a numeric field. + * @param string $label The text of the label for this Lookup * @param string $position Position on card page. 'before-field', 'after-field', 'to-field' * @param string $fieldname The reference field for $position - * @param string $page Specifiy a page for drillDown + * @param string $page Specifiy a page for drillDown (klick) * @param bool $cardPage Shows the related record in a card page (fitlers have to return exactly one record!) * @param string $value The value for $valueType 'const' * diff --git a/src/Classes/PageDescriptor.php b/src/Classes/PageDescriptor.php index 4f56384..4a487f9 100644 --- a/src/Classes/PageDescriptor.php +++ b/src/Classes/PageDescriptor.php @@ -367,8 +367,11 @@ public function setMenu(bool $value = true) { $this->menu = $value; return public function setItemsPerPage(int $value = -1) { $this->itemsPerPage = $value; return $this; } /** - * Defines which columns are shown in which order on list pages (defaul = all, order = as defined in tables). - * @param string[] $summaryColumnNames + * Defines which columns are shown in which order on list pages. + * + * By default all columns are shown in the order they are defined in the table. + * + * @param string[] $summaryColumnNames Array of column names. * @stackable * * @return PageDescriptor @@ -389,12 +392,10 @@ public function setSummaryColumns(array $summaryColumnNames) } /** - * Defines which columns are shown as link form list to card page (defaul = first column of Tables PK) + * Defines which columns are shown as link form the list page to the card page. + * By the default its the first column of the table´s primary key. * - * ```php - * $pageDescriptor->setCardLinkColumns(["id", "name"]); - * ``` - * @param string[] $cardLinkColumnNames + * @param string[] $cardLinkColumnNames Array of column names * @return PageDescriptor * @stackable */ diff --git a/src/Controllers/CrudkitController.php b/src/Controllers/CrudkitController.php index 29b988c..784540a 100644 --- a/src/Controllers/CrudkitController.php +++ b/src/Controllers/CrudkitController.php @@ -30,11 +30,11 @@ class CrudkitController extends \App\Http\Controllers\Controller { #region Main Endpoints - /** @var string $version The CRUDKit version. */ - private $version = 'v1.0.0'; - /** @var PageStore $pageStore All the pages. */ + /** @var string The CRUDKit version */ + private const CRUDKIT_VERSION = 'v1.0.0-rc.1'; + /** @var PageStore All the pages. */ private $pageStore = null; - /** @var AuthHelper $authHelper Holding user/permission related data. */ + /** @var AuthHelper Holding user/permission related data. */ private $authHelper = null; /** @@ -51,7 +51,7 @@ public function __construct() { //Make these variables available in all views View::share('texts', CHelper::getTexts()); - View::share('version', $this->version); + View::share('version', self::CRUDKIT_VERSION); $this->localTimeZone = new DateTimeZone(config('crudkit.local_timezone', 'UTC')); } diff --git a/src/CrudkitServiceProvider.php b/src/CrudkitServiceProvider.php index 1e4e620..30143d8 100644 --- a/src/CrudkitServiceProvider.php +++ b/src/CrudkitServiceProvider.php @@ -10,6 +10,7 @@ use Alddesign\Crudkit\Classes\RestrictionSet; use Alddesign\Crudkit\Classes\RestrictionSetEntry; use Alddesign\Crudkit\Classes\Startpage; +use Alddesign\Crudkit\Classes\Action; use Alddesign\Crudkit\Classes\TableDescriptor; use Alddesign\Crudkit\Classes\PageDescriptor; use Alddesign\Crudkit\Classes\PageStore; @@ -99,20 +100,20 @@ private function defineTables() [ 'author' => (new TableDescriptor('author', ['id'], true)) ->addColumn('id', 'Id', 'integer', ['readonly' => true]) - ->addColumn('name', 'Name', 'text', []) + ->addColumn('name', 'Name', 'text', ['required' => true]) ->addColumn('birthday', 'Birthday', 'date', []) ->addColumn('active', 'Active', 'bool', []) , 'book' => (new TableDescriptor('book', ['id'], true)) ->addColumn('id', 'Id', 'integer', ['readonly' => true]) - ->addColumn('name', 'Name', 'text', []) + ->addColumn('name', 'Name', 'text', ['required' => true]) ->addColumn('description', 'Description', 'text', []) ->addColumn('author_id', 'Author id', 'integer', []) ->addColumn('price', 'Price', 'float', []) ->addColumn('cover', 'Cover', 'image', []), 'sale' => ((new TableDescriptor('sale', ['id'], true)) ->addColumn('id', 'Id', 'integer', ['readonly' => true, 'create' => false]) - ->addColumn('book_id', 'Book Id', 'integer', []) + ->addColumn('book_id', 'Book Id', 'integer', ['required' => true]) ->addColumn('date', 'Date', 'date', [])) ]; // !!! Do not remove this line. Otherwise /auto-generate wont work !!! @@ -152,7 +153,7 @@ private function definePages() //### Example code - works with the demo database ### //Custom action - $seachCallback = function($record, $pageDescriptor, $action) + $seachCallback = function($record, PageDescriptor $pageDescriptor, Action $action) { $authorName = urlencode($record['name']); header('Location: ' . 'https://wikipedia.org/wiki/Special:Search?search=' . $authorName); @@ -160,7 +161,7 @@ private function definePages() }; //Show prices only to the admin - $onOpenAuthorListCallback = function(&$pageDescriptor, &$tableDescriptor, &$records) + $onOpenAuthorListCallback = function(PageDescriptor &$pageDescriptor, TableDescriptor &$tableDescriptor, &$records) { if(session('crudkit-userid') !== 'admin') { @@ -170,21 +171,23 @@ private function definePages() } }; - //Main code + //Defining a Lookup column: As the name suggests it looks someting up: in this case the name of the author. It uses relation from book.author_id to author.id $authorLookup = new Lookup($this->tables['author'], 'name', [new FilterDefinition('id', '=', 'field', 'author_id')], 'lookup', 'Author Name', 'after-field', 'author_id', 'author', true); + //Main code return [ - 'author' => (new PageDescriptor('Author', 'author', $this->tables['author'])) + 'author' => (new PageDescriptor('Authors', 'author', $this->tables['author'])) ->setCardLinkColumns(['name']) ->addAction('search-on-wikipedia', 'Search on Wikipedia', 'Search', $seachCallback) , - 'book' => (new PageDescriptor('Book', 'book', $this->tables['book'])) + 'book' => (new PageDescriptor('Books', 'book', $this->tables['book'])) ->setCardLinkColumns(['name']) ->addSection('Additional Data', 'cover', 'price') - ->addLookupColumn('author', $authorLookup) + ->addLookupColumn('author_name', $authorLookup) + ->setTitleText('(New Book)', ['create']) ->onOpenList($onOpenAuthorListCallback) , - 'sale' => (new PageDescriptor('Sale', 'sale', $this->tables['sale'])) + 'sale' => (new PageDescriptor('Sales', 'sale', $this->tables['sale'])) ->setCardLinkColumns([]) ]; // !!! Do not remove this line. Otherwise /auto-generate wont work !!! diff --git a/src/config/crudkit.php b/src/config/crudkit.php index 9550461..188d466 100644 --- a/src/config/crudkit.php +++ b/src/config/crudkit.php @@ -6,7 +6,7 @@ 'password' => 'admin', //### General ### - 'language' => 'de', + 'language' => 'en', //'en' and 'de' are implemented by default. To add your own laguage, take a look at crudkit-texts.php 'app_name' => 'CRUDKit', 'app_name_url'=> 'app', //Your Laravel APP_URL plus this name is the URL to your crudkit. Do not use 'crudkit' or the name of another laravel app. 'icons' => //Favicon icon paths. Relative to the laravel public folder. Its recommended to provide 32,64,128 and 192px (multidevice support) @@ -32,16 +32,16 @@ 'export_all_columns' => true, //true = Exports all columns defined for the table, false = exports only summary columns (list) 'export_enum_label' => true, //true = Exports the Enum label, false = Exports the actual value 'export_lookups' => true, - 'startpage' => + 'startpage' => //The page (view) which is loaded when you open http://example.com/app_name_url/ [ - 'page-id' => 'contact', + 'page-id' => 'book', 'type' => 'list', 'parameters' => [] ], - 'formats_ui' => //Defines how certain datatypes should be displayed + 'formats_ui' => //Defines how certain datatypes should be displayed. PHP format: https://www.php.net/manual/en/datetime.format.php [ - 'datetime' => 'd.m.Y H:i:s', - 'date' => 'd.m.Y', + 'datetime' => 'm/d/Y H:i:s', //de: d.m.Y H:i:s + 'date' => 'm/d/Y', 'time' => 'H:i:s', 'decimal_places' => 2, 'thousands_separator' => '.', diff --git a/src/demo-database/db.sqlite b/src/demo-database/db.sqlite index d803b23..654c070 100644 Binary files a/src/demo-database/db.sqlite and b/src/demo-database/db.sqlite differ diff --git a/src/views/card_actions-top.blade.php b/src/views/card_actions-top.blade.php index c5f1981..8e96841 100644 --- a/src/views/card_actions-top.blade.php +++ b/src/views/card_actions-top.blade.php @@ -5,7 +5,7 @@ @endif {{-- Delete --}} @if ($deleteAllowed) - @if($confirmDelete) + @if(!$confirmDelete)  {{$texts['delete']}} @else {{-- Modal?! --}} @@ -13,14 +13,14 @@