partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 672e9df5857fec08b814a25b153dd9af7d014903
parent d1e60799c98f5a3aa6b2de91a6c3a7db7d56583b
Author: Felicitus <felicitus@felicitus.org>
Date:   Sun,  2 Aug 2015 19:38:44 +0200

Made fields in the property grid wrappable to support long texts, fixed date rendering

Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/css/PartKeepr.css | 4++++
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartDisplay.js | 16+++++++++++++---
Msrc/PartKeepr/PartBundle/Entity/Part.php | 10+++++-----
3 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/css/PartKeepr.css b/src/PartKeepr/FrontendBundle/Resources/public/css/PartKeepr.css @@ -37,4 +37,8 @@ .x-title-wrappable-text small { font-size: 14px; line-height: 16px; +} + +.x-wrappable-grid .x-grid-cell-inner { + white-space: normal; } \ No newline at end of file diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartDisplay.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartDisplay.js @@ -28,7 +28,14 @@ Ext.define('PartKeepr.PartDisplay', { displayName: i18n("Comment") }, createDate: { - displayName: i18n("Create Date") + displayName: i18n("Create Date"), + type: 'date', + renderer: function (v) + { + "use strict"; + var format = Ext.getDateFormat(); + return Ext.Date.format(v, format); + } }, status: { displayName: i18n("Status") @@ -37,7 +44,8 @@ Ext.define('PartKeepr.PartDisplay', { displayName: i18n("Condition") }, needsReview: { - displayName: i18n("Needs Review") + displayName: i18n("Needs Review"), + type: 'boolean' }, projects: { displayName: i18n("Projects") @@ -125,10 +133,12 @@ Ext.define('PartKeepr.PartDisplay', { } }, hideHeaders: true, + nameColumnWidth: 150, title: { height: 'auto', cls: 'x-title-wrappable-text' }, + cls: 'x-wrappable-grid', sourceConfig: this.fieldConfigs }); @@ -157,7 +167,7 @@ Ext.define('PartKeepr.PartDisplay', { for (var i in recordData) { if (this.fieldConfigs[i]) { - if (recordData[i] !== null) { + if (typeof recordData[i] === "string") { values[i] = htmlentities(recordData[i]); // phpjs } else { values[i] = recordData[i]; diff --git a/src/PartKeepr/PartBundle/Entity/Part.php b/src/PartKeepr/PartBundle/Entity/Part.php @@ -162,7 +162,7 @@ class Part extends BaseEntity /** * The part status for this part * @ORM\Column(type="string",nullable=true) - * + * @Groups({"default"}) * @var string */ private $status; @@ -170,7 +170,7 @@ class Part extends BaseEntity /** * Defines if the part needs review * @ORM\Column(type="boolean") - * + * @Groups({"default"}) * @var boolean */ private $needsReview; @@ -178,7 +178,7 @@ class Part extends BaseEntity /** * Defines the condition of the part * @ORM\Column(type="string",nullable=true) - * + * @Groups({"default"}) * @var string */ private $partCondition; @@ -186,7 +186,7 @@ class Part extends BaseEntity /** * The create date+time for this part * @ORM\Column(type="datetime",nullable=true) - * + * @Groups({"default"}) * @var \DateTime */ private $createDate; @@ -199,7 +199,7 @@ class Part extends BaseEntity /** * The internal part number * @ORM\Column(type="string",nullable=true) - * + * @Groups({"default"}) * @var string */ private $internalPartNumber;