From ec9bb252c15749d74da958cffe9a87da340ea966 Mon Sep 17 00:00:00 2001 From: Dave Shoreman Date: Fri, 10 Oct 2014 21:27:01 +0100 Subject: [PATCH] Add slug to categories Forgot to give categories a slug before, so this adds it. While we're at it, we'll remove vim's swapfiles from the repo too. --- .gitignore | 2 ++ models/.Product.php.swp | Bin 12288 -> 0 bytes models/category/columns.yaml | 4 ++++ models/category/fields.yaml | 7 +++++++ models/product/.columns.yaml.swp | Bin 12288 -> 0 bytes updates/create_categories_table.php | 1 + 6 files changed, 14 insertions(+) delete mode 100644 models/.Product.php.swp delete mode 100644 models/product/.columns.yaml.swp diff --git a/.gitignore b/.gitignore index 48b8bf9..3dec0e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ vendor/ +*.swp +*.swo diff --git a/models/.Product.php.swp b/models/.Product.php.swp deleted file mode 100644 index 25504c73b36ba7754b93a60d1f8553101326f7fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2zfTlF6vqcG{TZl?7NcIWa1j>81OuWb8Wojb%vcByKKT2rY7sVjL1T(t%SBKm+VkRI`D`=?KxfDDiUGC&5%02v?y|F;1X_OLZ9abLd7!Ti|Mam+92KnBPF86X2>fDDiU zGC&5%02v?yWPl9pK?A~N?DYZ09vwvS`2WB8`~TY!#=e3t;4}CD-hxfA4xWQ&;3=2^ zx4{W;9Q1)7hZ*}0K7o(mJ=g&2paGUa2uk1%7y-w???a5e0vlirNN@`bfnM+nb^ZkJ zz$SPCRzX_-9`sKolL0b72FL&zAOmE843L4nY~V5D*s^_c7D*FFKEEoAtOikIY)pCD z=zhz1M*YiJX`SJg=UM~fEJ?eP?!&mOJcn0e-!Wd`^Qtt>2Ti)uVRBFR7aq#StWdG! z6WouL8erS!7KAavsZ9yLf%x1)mOf9M2dDjHZfC3>MBz^J(%3H3NckdEWBQ<+72!t9kl< kS^A7(E12C(og!y8W}LB$m(eKCeNmS>6prLwKb3Lz2NkYj)c^nh diff --git a/models/category/columns.yaml b/models/category/columns.yaml index 27ce3f6..c2e55a7 100644 --- a/models/category/columns.yaml +++ b/models/category/columns.yaml @@ -9,6 +9,10 @@ columns: title: label: Title searchable: true + slug: + label: Slug + searchable: false description: label: Description searchable: false + invisible: true diff --git a/models/category/fields.yaml b/models/category/fields.yaml index 1ed3807..89b5696 100644 --- a/models/category/fields.yaml +++ b/models/category/fields.yaml @@ -6,6 +6,13 @@ fields: title: label: Title required: true + slug: + label: Slug + required: true + attributes: + data-input-preset: 'input[name="Category[title]"]' + data-input-preset-type: 'slug' + data-input-preset-closest-parent: 'form' description: label: Description type: textarea diff --git a/models/product/.columns.yaml.swp b/models/product/.columns.yaml.swp deleted file mode 100644 index 6660ffc0ebdcc4c4ab1bfa753fd41c614e098c67..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2y^9nv7>BcpcBi712ok;8oAU!!2Ca4r56(jFqY@=Mlf4aOK1ebLhoGgUjfH}( zjjexxAox!x))w|x`okNe?13@_a1s;;wym^!N*=m@KR=3w4%Kpk7fp$TNAMg8{ z?@mAHeS9KB>L-QMnabJvyQs9)j>&!0 zh2a2YlohGAJ}O<2R!NAG!d6-CSN2q97jDS_8lZvNKo!O}?kLD8q&;Sk401eOp4bT7$(7=CUAe24v0=1rM>%G$Uz2ExwksS@t01eOp4bT7$&;Sk4 z01eOp4bZ>|G@w!;;w2$IgZlgb?EU}ic_BW5x8MzU1zv&*JO+=zJ+KTegEQdgIU&A- zFW>`s4W5AnY=Azv3eJLk?DuW9?+NtABhvs4&;Sk401eOp4bT7$(7-=7AiL(Za>+!E ztd3=Hl@_xpt47+!a$Wf#x5`w7=~UGW)2AxL^H7uT8gKqgu_*TtN#($4bZL_;nU4Q1 zxz|=F0o9mbyKMMjFt6W>URAG?x8n1JqCxb zJ52EA{Fu#wkH2tj*z9J~ShSbhW4u_)`->Z*engine = 'InnoDB'; $table->increments('id'); $table->string('title')->index(); + $table->string('slug')->unique(); $table->string('description')->nullable(); $table->timestamps(); });