partkeepr

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

commit 1138642879dae9d891c1a1bcd49020c7a451afbf
parent a1319b0368848ab982db75a12ea86dc007b651a3
Author: Felicia Hummel <felicia@partkeepr.com>
Date:   Wed, 18 Oct 2017 21:43:14 +0200

Mostly finalized default preset functionality, only thing missing is having the grids actually read the stored default preset ;)

Diffstat:
Msrc/PartKeepr/FrontendBundle/Entity/GridPreset.php | 2+-
Msrc/PartKeepr/FrontendBundle/Resources/public/css/PartKeepr.css | 7+++++--
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/ProjectRun/ProjectRunEditor.js | 8++++----
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/ColumnConfigurator/Panel.js | 5++++-
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/PresetComboBox.js | 21++++++++++++---------
5 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/src/PartKeepr/FrontendBundle/Entity/GridPreset.php b/src/PartKeepr/FrontendBundle/Entity/GridPreset.php @@ -50,7 +50,7 @@ class GridPreset extends BaseEntity * Defines if the selected grid preset is the default * * @ORM\Column(type="boolean") - * @Groups({"readonly"}) + * @Groups({"default"}) * * @var boolean */ diff --git a/src/PartKeepr/FrontendBundle/Resources/public/css/PartKeepr.css b/src/PartKeepr/FrontendBundle/Resources/public/css/PartKeepr.css @@ -55,6 +55,10 @@ background-image: url(../images/form/trigger-add.png); } +.x-form-trigger-markdefault { + background-image: url(../images/form/trigger-default.png); +} + .x-form-trigger-delete { background-image: url(../images/form/trigger-delete.png); } @@ -217,4 +221,4 @@ margin-left: -75px; height: 51px; width: 217px; background-image: url(../images/become_a_patron_button.png); -}- \ No newline at end of file +} diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/ProjectRun/ProjectRunEditor.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/ProjectRun/ProjectRunEditor.js @@ -64,7 +64,7 @@ Ext.define('PartKeepr.ProjectRunEditor', { } ], - store: this.store, + store: this.store }); var container = Ext.create("Ext.form.FieldContainer", { @@ -78,7 +78,7 @@ Ext.define('PartKeepr.ProjectRunEditor', { this.items = [ { xtype: 'displayfield', - name: 'project.name', + itemId: 'projectName', height: 20, fieldLabel: i18n("Project Name") }, { @@ -102,6 +102,6 @@ Ext.define('PartKeepr.ProjectRunEditor', { var store = this.record.parts(); this.partGrid.bindStore(store); + this.down("#projectName").setValue(this.record.get("project.name")); } -}) -; +}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/ColumnConfigurator/Panel.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/ColumnConfigurator/Panel.js @@ -74,7 +74,10 @@ Ext.define("PartKeepr.Components.Widgets.ColumnConfigurator.Panel", { } }, onMarkAsDefault: function (gridPreset) { - gridPreset.callPutAction("markAsDefault") + gridPreset.callPutAction("markAsDefault", {}, Ext.bind(this.onMarkedAsDefault, this)); + }, + onMarkedAsDefault: function () { + this.down("#gridPresetCombo").getStore().load(); }, onPresetSelect: function (configuration) { diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/PresetComboBox.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/PresetComboBox.js @@ -86,7 +86,7 @@ Ext.define("PartKeepr.PresetCombobox", { hidden: true }, default: { - cls: "x-form-trigger-default", + cls: "x-form-trigger-markdefault", weight: 4, handler: 'onMarkPresetAsDefault', scope: 'this', @@ -108,16 +108,19 @@ Ext.define("PartKeepr.PresetCombobox", { initComponent: function () { + console.log(this.markedAsDefaultProperty); if (this.allowMarkAsDefault) { - console.log("FOO1"); - console.log(config); - this.displayTpl = Ext.create('Ext.XTemplate', - '<tpl for=".">', + this.tpl = Ext.create('Ext.XTemplate', + '<ul class="x-list-plain"><tpl for=".">', + '<li role="option" class="x-boundlist-item">', + '<tpl if="'+this.markedAsDefaultProperty+' == 1">', + '<span class="web-icon fugue-icon flag"></span>', + '<tpl else>', + '<span style="width: 16px; height: 16px; display: inline-block;"></span>', + '</tpl> ', '{'+this.displayField+'}', - '<tpl if="'+this.markedAsDefaultProperty+'" = 1">', - '*', - '</tpl>', - '</tpl>' + '</li>', + '</tpl></ul>' ); }