From b8fc0fb71c8addad7a952d224e2bfebfa4890173 Mon Sep 17 00:00:00 2001 From: kgiszewski Date: Wed, 7 Oct 2015 12:20:09 -0400 Subject: [PATCH 01/10] WIP --- Gruntfile.js | 3 +- app/controllers/config.controller.js | 13 +++ app/controllers/config.dialog.controller.js | 3 + app/less/archetype.less | 22 ++++- .../archetype.config.developer.dialog.html | 21 +++++ .../archetype.config.fieldset.dialog.html | 51 ++++++++++ app/views/archetype.config.html | 92 +------------------ .../archetype.config.stylescript.dialog.html | 20 ++++ 8 files changed, 130 insertions(+), 95 deletions(-) create mode 100644 app/controllers/config.dialog.controller.js create mode 100644 app/views/archetype.config.developer.dialog.html create mode 100644 app/views/archetype.config.fieldset.dialog.html create mode 100644 app/views/archetype.config.stylescript.dialog.html diff --git a/Gruntfile.js b/Gruntfile.js index 679fc20..86006a9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -54,6 +54,7 @@ module.exports = function(grunt) { src: [ 'app/controllers/controller.js', 'app/controllers/config.controller.js', + 'app/controllers/config.dialog.controller.js', 'app/directives/archetypeproperty.js', 'app/directives/archetypesubmitwatcher.js', 'app/directives/archetypecustomview.js', @@ -73,7 +74,7 @@ module.exports = function(grunt) { copy: { html: { cwd: 'app/views/', - src: ['archetype.html', 'archetype.default.html', 'archetype.config.html'], + src: ['archetype.html', 'archetype.default.html', 'archetype.config.html', 'archetype.config.fieldset.dialog.html', 'archetype.config.stylescript.dialog.html', 'archetype.config.developer.dialog.html'], dest: '<%= basePath %>/views', expand: true }, diff --git a/app/controllers/config.controller.js b/app/controllers/config.controller.js index 00d5826..24af51e 100644 --- a/app/controllers/config.controller.js +++ b/app/controllers/config.controller.js @@ -309,6 +309,19 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio $scope.model.value.fieldsets = fieldsets; } + $scope.showOptions = function ($event, template) { + $event.preventDefault(); + + dialogService.open({ + template: template, + show: true, + callback: function(data) { + $scope.archetypeConfigRenderModel = data; + }, + dialogData: $scope.archetypeConfigRenderModel + }); + } + //archetype css assetsService.loadCss("../App_Plugins/Archetype/css/archetype.css"); }); diff --git a/app/controllers/config.dialog.controller.js b/app/controllers/config.dialog.controller.js new file mode 100644 index 0000000..cf3009d --- /dev/null +++ b/app/controllers/config.dialog.controller.js @@ -0,0 +1,3 @@ +angular.module('umbraco').controller('ArchetypeConfigOptionsController', function ($scope) { + $scope.model = $scope.dialogData; +}); \ No newline at end of file diff --git a/app/less/archetype.less b/app/less/archetype.less index 0835a78..c04ba9f 100644 --- a/app/less/archetype.less +++ b/app/less/archetype.less @@ -387,16 +387,24 @@ } .archetypeAdvancedOptions { - margin-top: 15px; - div { - margin-bottom: 10px; - } label { - width: 400px; + width: 100%; } + + input[type=checkbox] { + margin-top: 0; + margin-right: 2px; + } + + small { + color: #b3b3b3; + } + + .archetypeFieldsetGroups { padding: 0 10px; margin-bottom: 20px; + ul { padding: 0; margin: 0; @@ -447,3 +455,7 @@ visibility: visible !important; background-color: #d0e7f1 !important; } + +.archetype-dialog { + margin: 10px; +} \ No newline at end of file diff --git a/app/views/archetype.config.developer.dialog.html b/app/views/archetype.config.developer.dialog.html new file mode 100644 index 0000000..b5623fd --- /dev/null +++ b/app/views/archetype.config.developer.dialog.html @@ -0,0 +1,21 @@ +
+
+
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+
+
\ No newline at end of file diff --git a/app/views/archetype.config.fieldset.dialog.html b/app/views/archetype.config.fieldset.dialog.html new file mode 100644 index 0000000..3ceca39 --- /dev/null +++ b/app/views/archetype.config.fieldset.dialog.html @@ -0,0 +1,51 @@ +
+
+
+ +
+ +
+ +
+
+ +
+
+ + +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+

Fieldset groups

+ If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.

+
    +
  • +
    + + + + +
    +
  • +
+ +
+
+
+
\ No newline at end of file diff --git a/app/views/archetype.config.html b/app/views/archetype.config.html index fb5f05b..8ff552f 100644 --- a/app/views/archetype.config.html +++ b/app/views/archetype.config.html @@ -83,95 +83,9 @@
- - -
-
- -
-
-

Fieldset groups

-

If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.

-
    -
  • -
    - - - - -
    -
  • -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - + + +
diff --git a/app/views/archetype.config.stylescript.dialog.html b/app/views/archetype.config.stylescript.dialog.html new file mode 100644 index 0000000..481a1f7 --- /dev/null +++ b/app/views/archetype.config.stylescript.dialog.html @@ -0,0 +1,20 @@ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
\ No newline at end of file From 9787af9ed69bcf01a38ede26ec4e2781a431493d Mon Sep 17 00:00:00 2001 From: kgiszewski Date: Wed, 7 Oct 2015 13:13:56 -0400 Subject: [PATCH 02/10] Fixup some styles and move some controller functions for the grouping --- app/controllers/config.controller.js | 10 ---------- app/controllers/config.dialog.controller.js | 10 ++++++++++ app/less/archetype.less | 1 - app/views/archetype.config.developer.dialog.html | 11 ++++------- app/views/archetype.config.fieldset.dialog.html | 2 +- app/views/archetype.config.stylescript.dialog.html | 2 +- 6 files changed, 16 insertions(+), 20 deletions(-) diff --git a/app/controllers/config.controller.js b/app/controllers/config.controller.js index 24af51e..3b90511 100644 --- a/app/controllers/config.controller.js +++ b/app/controllers/config.controller.js @@ -234,16 +234,6 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio } } - //handles a fieldset group add - $scope.addFieldsetGroup = function () { - $scope.archetypeConfigRenderModel.fieldsetGroups.push({ name: "" }); - } - - //handles a fieldset group removal - $scope.removeFieldsetGroup = function ($index) { - $scope.archetypeConfigRenderModel.fieldsetGroups.splice($index, 1); - } - //helper to ini the render model function initConfigRenderModel() { diff --git a/app/controllers/config.dialog.controller.js b/app/controllers/config.dialog.controller.js index cf3009d..df84050 100644 --- a/app/controllers/config.dialog.controller.js +++ b/app/controllers/config.dialog.controller.js @@ -1,3 +1,13 @@ angular.module('umbraco').controller('ArchetypeConfigOptionsController', function ($scope) { $scope.model = $scope.dialogData; + + //handles a fieldset group add + $scope.addFieldsetGroup = function () { + $scope.model.fieldsetGroups.push({ name: "" }); + } + + //handles a fieldset group removal + $scope.removeFieldsetGroup = function ($index) { + $scope.model.fieldsetGroups.splice($index, 1); + } }); \ No newline at end of file diff --git a/app/less/archetype.less b/app/less/archetype.less index c04ba9f..e90773a 100644 --- a/app/less/archetype.less +++ b/app/less/archetype.less @@ -400,7 +400,6 @@ color: #b3b3b3; } - .archetypeFieldsetGroups { padding: 0 10px; margin-bottom: 20px; diff --git a/app/views/archetype.config.developer.dialog.html b/app/views/archetype.config.developer.dialog.html index b5623fd..16ae3be 100644 --- a/app/views/archetype.config.developer.dialog.html +++ b/app/views/archetype.config.developer.dialog.html @@ -1,16 +1,13 @@
-
+
- - +
- - +
- - +
diff --git a/app/views/archetype.config.fieldset.dialog.html b/app/views/archetype.config.fieldset.dialog.html index 3ceca39..11b8ff2 100644 --- a/app/views/archetype.config.fieldset.dialog.html +++ b/app/views/archetype.config.fieldset.dialog.html @@ -33,7 +33,7 @@

Fieldset groups

- If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.

+ If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.
  • diff --git a/app/views/archetype.config.stylescript.dialog.html b/app/views/archetype.config.stylescript.dialog.html index 481a1f7..733a2df 100644 --- a/app/views/archetype.config.stylescript.dialog.html +++ b/app/views/archetype.config.stylescript.dialog.html @@ -1,5 +1,5 @@
    -
    +
    From 3fdfa2b2c6ac1da167f643fb33ef5d04e8def8a0 Mon Sep 17 00:00:00 2001 From: kgiszewski Date: Wed, 7 Oct 2015 13:19:24 -0400 Subject: [PATCH 03/10] Removed the 'name' label as it takes up a fair bit of space and is sort of redundant --- app/less/archetype.less | 3 ++- app/views/archetype.config.fieldset.dialog.html | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/less/archetype.less b/app/less/archetype.less index e90773a..8a9f2bf 100644 --- a/app/less/archetype.less +++ b/app/less/archetype.less @@ -407,9 +407,10 @@ ul { padding: 0; margin: 0; + margin-top: 15px; li { - margin-bottom: 10px; + label { width: 120px; } diff --git a/app/views/archetype.config.fieldset.dialog.html b/app/views/archetype.config.fieldset.dialog.html index 11b8ff2..d5b4c9f 100644 --- a/app/views/archetype.config.fieldset.dialog.html +++ b/app/views/archetype.config.fieldset.dialog.html @@ -37,7 +37,6 @@
    • - From e465861da6d5181c6e7a442931d9c9383dde212c Mon Sep 17 00:00:00 2001 From: kgiszewski Date: Wed, 7 Oct 2015 13:57:49 -0400 Subject: [PATCH 04/10] Add cancel/apply buttons --- app/controllers/config.dialog.controller.js | 6 +++++- app/views/archetype.config.developer.dialog.html | 11 +++++++++++ app/views/archetype.config.fieldset.dialog.html | 9 +++++++++ app/views/archetype.config.stylescript.dialog.html | 9 +++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/app/controllers/config.dialog.controller.js b/app/controllers/config.dialog.controller.js index df84050..c057730 100644 --- a/app/controllers/config.dialog.controller.js +++ b/app/controllers/config.dialog.controller.js @@ -1,5 +1,5 @@ angular.module('umbraco').controller('ArchetypeConfigOptionsController', function ($scope) { - $scope.model = $scope.dialogData; + $scope.model = angular.copy($scope.dialogData); //handles a fieldset group add $scope.addFieldsetGroup = function () { @@ -10,4 +10,8 @@ angular.module('umbraco').controller('ArchetypeConfigOptionsController', functio $scope.removeFieldsetGroup = function ($index) { $scope.model.fieldsetGroups.splice($index, 1); } + + $scope.apply = function(index) { + $scope.submit($scope.model); + } }); \ No newline at end of file diff --git a/app/views/archetype.config.developer.dialog.html b/app/views/archetype.config.developer.dialog.html index 16ae3be..2ee687b 100644 --- a/app/views/archetype.config.developer.dialog.html +++ b/app/views/archetype.config.developer.dialog.html @@ -14,5 +14,16 @@
      + +
      + + Cancel + + + + +
    \ No newline at end of file diff --git a/app/views/archetype.config.fieldset.dialog.html b/app/views/archetype.config.fieldset.dialog.html index d5b4c9f..0d2e037 100644 --- a/app/views/archetype.config.fieldset.dialog.html +++ b/app/views/archetype.config.fieldset.dialog.html @@ -46,5 +46,14 @@
    +
    + + Cancel + + + +
    \ No newline at end of file diff --git a/app/views/archetype.config.stylescript.dialog.html b/app/views/archetype.config.stylescript.dialog.html index 733a2df..11f5f6f 100644 --- a/app/views/archetype.config.stylescript.dialog.html +++ b/app/views/archetype.config.stylescript.dialog.html @@ -16,5 +16,14 @@
+
+ + Cancel + + + +
\ No newline at end of file From a4f371a4ca8330381daff19f0fdb663e2c2eb788 Mon Sep 17 00:00:00 2001 From: kgiszewski Date: Wed, 7 Oct 2015 15:34:30 -0400 Subject: [PATCH 05/10] Enforce one dialog at a time. --- app/controllers/config.controller.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/config.controller.js b/app/controllers/config.controller.js index 3b90511..57c7f7d 100644 --- a/app/controllers/config.controller.js +++ b/app/controllers/config.controller.js @@ -302,6 +302,8 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio $scope.showOptions = function ($event, template) { $event.preventDefault(); + dialogService.closeAll(); + dialogService.open({ template: template, show: true, From bd4398ff284ee9b67b5c590948cd267a25d85f8f Mon Sep 17 00:00:00 2001 From: kgiszewski Date: Wed, 7 Oct 2015 15:42:00 -0400 Subject: [PATCH 06/10] Bump version to 1.11 and some minor edits --- app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs | 4 ++-- app/views/archetype.config.developer.dialog.html | 1 - app/views/archetype.config.html | 4 +++- config/meta.json | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs b/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs index c3f9401..34b1003 100644 --- a/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs +++ b/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs @@ -1,4 +1,4 @@ using System.Reflection; -[assembly: AssemblyVersion("1.10")] -[assembly: AssemblyFileVersion("1.10")] +[assembly: AssemblyVersion("1.11")] +[assembly: AssemblyFileVersion("1.11")] diff --git a/app/views/archetype.config.developer.dialog.html b/app/views/archetype.config.developer.dialog.html index 2ee687b..d2e242f 100644 --- a/app/views/archetype.config.developer.dialog.html +++ b/app/views/archetype.config.developer.dialog.html @@ -23,7 +23,6 @@ -
\ No newline at end of file diff --git a/app/views/archetype.config.html b/app/views/archetype.config.html index 8ff552f..4364709 100644 --- a/app/views/archetype.config.html +++ b/app/views/archetype.config.html @@ -1,4 +1,6 @@
+

Archetype

+

Lorem

  • @@ -83,7 +85,7 @@
    - +
    diff --git a/config/meta.json b/config/meta.json index a5ebfb1..b88d7bf 100644 --- a/config/meta.json +++ b/config/meta.json @@ -1,6 +1,6 @@ { "name": "Archetype", - "version": "1.10", + "version": "1.11", "url": "http://github.com/imulus/archetype/", "author": "Imulus - Kevin Giszewski - Tom Fulton - Lee Kelleher - Matt Brailsford - Kenn Jacobsen - Et. Al.", "authorUrl": "http://imulus.com/", From 0e9bef90487437149f9e8cd8ce5e215fd3844518 Mon Sep 17 00:00:00 2001 From: kgiszewski Date: Wed, 7 Oct 2015 16:11:15 -0400 Subject: [PATCH 07/10] Add logo asset, add headlines to dialogs --- Gruntfile.js | 8 +++++++- app/less/archetype.less | 7 +++++++ app/views/archetype.config.developer.dialog.html | 1 + app/views/archetype.config.fieldset.dialog.html | 1 + app/views/archetype.config.html | 11 ++++++----- .../archetype.config.stylescript.dialog.html | 1 + assets/logo_50.png | Bin 0 -> 2537 bytes 7 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 assets/logo_50.png diff --git a/Gruntfile.js b/Gruntfile.js index 86006a9..169b38f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -78,6 +78,12 @@ module.exports = function(grunt) { dest: '<%= basePath %>/views', expand: true }, + assets: { + cwd: 'assets/', + src: ['logo_50.png'], + dest: '<%= basePath %>/assets', + expand: true + }, dll: { cwd: 'app/Umbraco/Umbraco.Archetype/bin/Debug/', src: 'Archetype.dll', @@ -215,7 +221,7 @@ module.exports = function(grunt) { }); - grunt.registerTask('default', ['clean', 'less', 'concat', 'assemblyinfo', 'msbuild:dist', 'copy:dll', 'copy:config', 'copy:html']); + grunt.registerTask('default', ['clean', 'less', 'concat', 'assemblyinfo', 'msbuild:dist', 'copy:dll', 'copy:assets', 'copy:config', 'copy:html']); grunt.registerTask('nuget', ['clean:tmp', 'default', 'copy:nuget', 'template:nuspec', 'nugetpack', 'clean:tmp']); grunt.registerTask('umbraco', ['clean:tmp', 'default', 'copy:umbraco', 'umbracoPackage', 'clean:tmp']); diff --git a/app/less/archetype.less b/app/less/archetype.less index 8a9f2bf..8b0ce5a 100644 --- a/app/less/archetype.less +++ b/app/less/archetype.less @@ -306,6 +306,13 @@ .archetypeConfig { margin-bottom: 20px; + .archetype-headline { + + img { + margin-right: 5px; + } + } + ul { list-style: none; } diff --git a/app/views/archetype.config.developer.dialog.html b/app/views/archetype.config.developer.dialog.html index d2e242f..2cfe0cd 100644 --- a/app/views/archetype.config.developer.dialog.html +++ b/app/views/archetype.config.developer.dialog.html @@ -1,5 +1,6 @@
    +

    Developer Options

    diff --git a/app/views/archetype.config.fieldset.dialog.html b/app/views/archetype.config.fieldset.dialog.html index 0d2e037..b4cf7f9 100644 --- a/app/views/archetype.config.fieldset.dialog.html +++ b/app/views/archetype.config.fieldset.dialog.html @@ -1,5 +1,6 @@
    +

    Global Fieldset Options

    diff --git a/app/views/archetype.config.html b/app/views/archetype.config.html index 4364709..0c5ad7e 100644 --- a/app/views/archetype.config.html +++ b/app/views/archetype.config.html @@ -1,6 +1,7 @@
    -

    Archetype

    -

    Lorem

    +

    Archetype

    +

    At a minimum your Archetype needs at least one fieldset with at least one property. You can configure it to allow for multiple types of fieldsets within a single Archetype and you can even add another Archetype as a property. Please use the link below for the full manual:

    +

    Archetype Manual

    • @@ -85,9 +86,9 @@
      - - - + + +
      diff --git a/app/views/archetype.config.stylescript.dialog.html b/app/views/archetype.config.stylescript.dialog.html index 11f5f6f..542d30f 100644 --- a/app/views/archetype.config.stylescript.dialog.html +++ b/app/views/archetype.config.stylescript.dialog.html @@ -1,5 +1,6 @@
      +

      Custom Style/Script Options

      diff --git a/assets/logo_50.png b/assets/logo_50.png new file mode 100644 index 0000000000000000000000000000000000000000..c5aa9dc4e851299b2cc4aa0d93650c21e9ccbde3 GIT binary patch literal 2537 zcmaJ@dpwiv8=oekawrlNGZJccVAz~8n?o8ot*Ml;M;6<&o^8yeawt-SLWP&SD#=+X zk>pUMcx(M?q$b5%h^QRi4&Ldl-rpa;e$VIgJokOwpYQj3UH5f;|9FmU@o-tHtfLHr z!IrwYlD%asZvI`QAp7b%Bvr{4Z9aw0_W?urkqiicIWoZ@0O7`F>;}961~Y1J2Ve_> z!I3OqI-gG6ObiCuW{i1^nUKwuv0*S<2O*ac90u?aLBMVn#|}AOe-nvdG3}6B@l*_z z>jZ?dTtyJzBl7SK7KH^9m`DeEgsqS$6JP^;213XV=kSO^JLETAqHI5Zj7B29LHJ>I z$bX8WQ@0?TKnOtK%`m87j3owPi8aHTTUc3HZ9w2KSPUA2Lt}9$tQFB5N5o(d-yftb z8^jDDdXt^M=aNNs$WT6?OGKk1BO}cs&CNh)HyTSI5au;-IFt;5;ze=z3?YicGx(uE z26({`i_2$$9K^gLBM21m?U1rc|G5I2`%{*~``#v5!_Yzo7mYQ;%wOpTkV^gkP&WG~ zn#cDB{;l_a3iEuUxB%K4;DG`tST?v2gZWfkq7wu#_#os9g5f{9xFrCHXuviM7U`eqiIg%~O zB-x>}IpznK30EhpB%lwy1`6YMW3T&<{GZ}zb5dhN}0@;XfS0=K4T?^@#df&Os zU)SRFOD6-!Z-3fW7W_0mz>&EflG$4Ow;fwyFogg&vZJrCw{P3_ za9=--XMaAA;upN#sNS0#irKi7wegVg1bh)S3Hi=ZK1FHUOT_|*(9Ia5uQTV4V2zAu zjcFFxI3haN9J_|P}l)`iu>MCTxK5j&*d3Dp9V1K}O$nBSJgzs0VX28|-582Aw!owG2 z!JSW!+cYigcklP<@AF;U0~=lV+q+{z`b%vag$C7J;_NdT&IjR2_R8<+WRL9tLusFbsw#i_S@?`VR)9%^L5-8jUQnX-S6BlYTt1=qi|%K z$-_PpvZp}0JY}$YPRD=E9h1o6;3T3aGPPQtoOX$AIwbylboTa{x3L`JSH6q0t)%VXeHDcte0CVQtRLuT}&uxqRw%bo|rW9jSVo#*&o~L(m zlEDKysZ~?xsvRzH1RWisZyu~VJd$n@!Bx)%kGwH zliJ!VtyMN3RDt7-?vH0HidJg%xSppIW(zIwo!v_}hKC+eEJ^~vzDLx%x?oHD zuA}jB=O4oM1LC#T*~fC z$@^~Hs;B*F^5)X(?*1ST|KH!u$SC#OYOjXMdal3oRR*gbh~FnrfYQg~!Qy8McU{}llg{p>;R%k8Lf^%M(( zxXD>VrHc>q-WEH~Eq{3~Q@pLE$9G~~-;J-SsnX&<=+-LQ(-m3I-Y2+C7L<9SGp{6M(hx(c`|}D5~w%YS+95MDB-kCll7F! ziVQjXY3Ya>?vcyb{qh0L#Q4YUJqE8rvKt%pV!wknGvp@go=k?-1+1q|<^Wx!U#U$2&^?e%Vho{dAD-80b!IkE9#!x0Qhuyp>pVMG>QTFfwu5~geKOja;^N{7N0p3RHeK0pZeOi&Y8M2083nD=7@Mge iq|~zJ26}ETSOU8}V0*?@ZuOS=pD#Cx2f3US822|5!9bn> literal 0 HcmV?d00001 From 645198444b9ecc2f645d31d7596cecf2b1300763 Mon Sep 17 00:00:00 2001 From: kgiszewski Date: Wed, 7 Oct 2015 16:28:00 -0400 Subject: [PATCH 08/10] Add dll version to the config page --- .../Api/ArchetypeDataTypeController.cs | 17 +++++++++++++++-- app/controllers/config.controller.js | 6 ++++++ app/less/archetype.less | 8 ++++++++ .../archetypePropertyEditorResource.js | 5 +++++ app/views/archetype.config.html | 4 ++-- 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs index 75d3003..ba2816a 100644 --- a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs +++ b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs @@ -1,16 +1,16 @@ using System.Collections.Generic; using System; +using System.Diagnostics; using System.Linq; using System.Net; +using System.Reflection; using System.Web.Http; using AutoMapper; using Umbraco.Core.Models; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Mvc; using Umbraco.Web.Editors; -using Umbraco.Core.PropertyEditors; using Archetype.Extensions; -using Newtonsoft.Json; namespace Archetype.Api { @@ -53,5 +53,18 @@ namespace Archetype.Api var dataTypeDisplay = Mapper.Map(dataType); return new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = dataTypeDisplay.PreValues, contentTypeAlias = contentTypeAlias, propertyTypeAlias = propertyTypeAlias, archetypeAlias = archetypeAlias, nodeId = nodeId }; } + + public object GetDllVersion() + { + return new {dllVersion = _version()}; + } + + private string _version() + { + var asm = Assembly.GetExecutingAssembly(); + var fvi = FileVersionInfo.GetVersionInfo(asm.Location); + + return fvi.FileVersion; + } } } diff --git a/app/controllers/config.controller.js b/app/controllers/config.controller.js index 57c7f7d..615d45e 100644 --- a/app/controllers/config.controller.js +++ b/app/controllers/config.controller.js @@ -11,6 +11,12 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio //ini the model $scope.model.value = $scope.model.value || defaultFieldsetConfigModel; + $scope.dllVersion = ""; + + archetypePropertyEditorResource.getDllVersion().then(function(data){ + $scope.dllVersion = data.dllVersion; + }); + //ini the render model initConfigRenderModel(); diff --git a/app/less/archetype.less b/app/less/archetype.less index 8b0ce5a..627a084 100644 --- a/app/less/archetype.less +++ b/app/less/archetype.less @@ -311,6 +311,14 @@ img { margin-right: 5px; } + + small { + margin-left: 5px; + } + } + + .manual-link { + color: blue; } ul { diff --git a/app/resources/archetypePropertyEditorResource.js b/app/resources/archetypePropertyEditorResource.js index a335fe2..463a028 100644 --- a/app/resources/archetypePropertyEditorResource.js +++ b/app/resources/archetypePropertyEditorResource.js @@ -31,6 +31,11 @@ angular.module('umbraco.resources').factory('archetypePropertyEditorResource', f return ""; }); + }, + getDllVersion: function() { + return umbRequestHelper.resourcePromise( + $http.get("backoffice/ArchetypeApi/ArchetypeDataType/GetDllVersion", { cache: true }), 'Failed to retrieve dll version' + ); } } }); diff --git a/app/views/archetype.config.html b/app/views/archetype.config.html index 0c5ad7e..ebb2854 100644 --- a/app/views/archetype.config.html +++ b/app/views/archetype.config.html @@ -1,7 +1,7 @@
      -

      Archetype

      +

      Archetype{{dllVersion}}

      At a minimum your Archetype needs at least one fieldset with at least one property. You can configure it to allow for multiple types of fieldsets within a single Archetype and you can even add another Archetype as a property. Please use the link below for the full manual:

      -

      Archetype Manual

      +

      Archetype Manual

      • From e3a2b66022283771356145a295d3f47145a32831 Mon Sep 17 00:00:00 2001 From: kgiszewski Date: Wed, 7 Oct 2015 17:11:26 -0400 Subject: [PATCH 09/10] Version css and js files --- .gitignore | 3 +++ Gruntfile.js | 29 +++++++++++++++++++++++------ app/controllers/controller.js | 1 + app/less/archetype.less | 2 +- package.json | 3 ++- 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 1bb174e..aab6533 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,9 @@ tmp/ pkg/*.nupkg pkg/*.zip +*_versioned* + + [Dd]ebug/ [Bb]uild/ [Rr]elease/ diff --git a/Gruntfile.js b/Gruntfile.js index 169b38f..21d41f3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,13 +1,30 @@ module.exports = function(grunt) { require('load-grunt-tasks')(grunt); - var path = require('path') - + var path = require('path'); + + grunt.loadNpmTasks('grunt-string-replace'); + grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), pkgMeta: grunt.file.readJSON('config/meta.json'), dest: grunt.option('target') || 'dist', basePath: path.join('<%= dest %>', 'App_Plugins', '<%= pkgMeta.name %>'), + 'string-replace': { + version: { + files: { + "app/controllers/controller_versioned.js": "app/controllers/controller.js", + "app/less/archetype_versioned.less": "app/less/archetype.less" + }, + options: { + replacements: [{ + pattern: /{{VERSION}}/g, + replacement: '/* Version <%= pkgMeta.version %> */' + }] + } + } + }, + watch: { options: { spawn: false, @@ -16,7 +33,7 @@ module.exports = function(grunt) { less: { files: ['app/**/*.less'], - tasks: ['less:dist'] + tasks: ['string-replace', 'less:dist'] }, js: { @@ -41,7 +58,7 @@ module.exports = function(grunt) { paths: ["app/less", "lib/less", "vendor"], }, files: { - '<%= basePath %>/css/archetype.css': 'app/less/archetype.less', + '<%= basePath %>/css/archetype.css': 'app/less/archetype_versioned.less', } } }, @@ -52,7 +69,7 @@ module.exports = function(grunt) { }, dist: { src: [ - 'app/controllers/controller.js', + 'app/controllers/controller_versioned.js', 'app/controllers/config.controller.js', 'app/controllers/config.dialog.controller.js', 'app/directives/archetypeproperty.js', @@ -221,7 +238,7 @@ module.exports = function(grunt) { }); - grunt.registerTask('default', ['clean', 'less', 'concat', 'assemblyinfo', 'msbuild:dist', 'copy:dll', 'copy:assets', 'copy:config', 'copy:html']); + grunt.registerTask('default', ['clean', 'string-replace', 'less', 'concat', 'assemblyinfo', 'msbuild:dist', 'copy:dll', 'copy:assets', 'copy:config', 'copy:html']); grunt.registerTask('nuget', ['clean:tmp', 'default', 'copy:nuget', 'template:nuspec', 'nugetpack', 'clean:tmp']); grunt.registerTask('umbraco', ['clean:tmp', 'default', 'copy:umbraco', 'umbracoPackage', 'clean:tmp']); diff --git a/app/controllers/controller.js b/app/controllers/controller.js index b48ee09..264ea27 100644 --- a/app/controllers/controller.js +++ b/app/controllers/controller.js @@ -1,3 +1,4 @@ +{{VERSION}} angular.module("umbraco").controller("Imulus.ArchetypeController", function ($scope, $http, $filter, assetsService, angularHelper, notificationsService, $timeout, fileManager, entityResource, archetypeService, archetypeLabelService, archetypeCacheService, archetypePropertyEditorResource) { //$scope.model.value = ""; diff --git a/app/less/archetype.less b/app/less/archetype.less index 627a084..bd73f8d 100644 --- a/app/less/archetype.less +++ b/app/less/archetype.less @@ -1,4 +1,4 @@ -/* TODO: clean this up */ +{{VERSION}} .archetypeEditor { width: 98%; diff --git a/package.json b/package.json index 3601308..4032a92 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "url": "https://github.com/imulus/Archetype.git" }, "devDependencies": { - "grunt-msbuild": "^0.1.12" + "grunt-msbuild": "^0.1.12", + "grunt-string-replace": "^1.2.0" } } From 21b933a0dc1ecb157f94cf8777661b4dc01aaaaa Mon Sep 17 00:00:00 2001 From: kgiszewski Date: Wed, 7 Oct 2015 17:34:35 -0400 Subject: [PATCH 10/10] Version HTML --- Gruntfile.js | 29 ++++++++++++++++--- .../archetype.config.developer.dialog.html | 1 + .../archetype.config.fieldset.dialog.html | 1 + app/views/archetype.config.html | 1 + .../archetype.config.stylescript.dialog.html | 1 + app/views/archetype.default.html | 1 + app/views/archetype.html | 1 + 7 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 21d41f3..5c10764 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,12 +14,23 @@ module.exports = function(grunt) { version: { files: { "app/controllers/controller_versioned.js": "app/controllers/controller.js", - "app/less/archetype_versioned.less": "app/less/archetype.less" + "app/less/archetype_versioned.less": "app/less/archetype.less", + "app/views/archetype.config.developer.dialog_versioned.html": "app/views/archetype.config.developer.dialog.html", + "app/views/archetype.config.stylescript.dialog_versioned.html": "app/views/archetype.config.stylescript.dialog.html", + "app/views/archetype.config.fieldset.dialog_versioned.html": "app/views/archetype.config.fieldset.dialog.html", + "app/views/archetype.config_versioned.html": "app/views/archetype.config.html", + "app/views/archetype_versioned.html": "app/views/archetype.html", + "app/views/archetype.default_versioned.html": "app/views/archetype.default.html", + }, options: { replacements: [{ pattern: /{{VERSION}}/g, replacement: '/* Version <%= pkgMeta.version %> */' + }, + { + pattern: /{{VERSION_HTML}}/g, + replacement: '' }] } } @@ -91,9 +102,19 @@ module.exports = function(grunt) { copy: { html: { cwd: 'app/views/', - src: ['archetype.html', 'archetype.default.html', 'archetype.config.html', 'archetype.config.fieldset.dialog.html', 'archetype.config.stylescript.dialog.html', 'archetype.config.developer.dialog.html'], - dest: '<%= basePath %>/views', - expand: true + src: [ + 'archetype_versioned.html', + 'archetype.default_versioned.html', + 'archetype.config_versioned.html', + 'archetype.config.fieldset.dialog_versioned.html', + 'archetype.config.stylescript.dialog_versioned.html', + 'archetype.config.developer.dialog_versioned.html' + ], + dest: '<%= basePath %>/views/', + expand: true, + rename: function(dest, src) { + return dest + src.replace('_versioned',''); + } }, assets: { cwd: 'assets/', diff --git a/app/views/archetype.config.developer.dialog.html b/app/views/archetype.config.developer.dialog.html index 2cfe0cd..9803230 100644 --- a/app/views/archetype.config.developer.dialog.html +++ b/app/views/archetype.config.developer.dialog.html @@ -1,3 +1,4 @@ +{{VERSION_HTML}}

        Developer Options

        diff --git a/app/views/archetype.config.fieldset.dialog.html b/app/views/archetype.config.fieldset.dialog.html index b4cf7f9..c58eee2 100644 --- a/app/views/archetype.config.fieldset.dialog.html +++ b/app/views/archetype.config.fieldset.dialog.html @@ -1,3 +1,4 @@ +{{VERSION_HTML}}

        Global Fieldset Options

        diff --git a/app/views/archetype.config.html b/app/views/archetype.config.html index ebb2854..4e078d6 100644 --- a/app/views/archetype.config.html +++ b/app/views/archetype.config.html @@ -1,3 +1,4 @@ +{{VERSION_HTML}}

        Archetype{{dllVersion}}

        At a minimum your Archetype needs at least one fieldset with at least one property. You can configure it to allow for multiple types of fieldsets within a single Archetype and you can even add another Archetype as a property. Please use the link below for the full manual:

        diff --git a/app/views/archetype.config.stylescript.dialog.html b/app/views/archetype.config.stylescript.dialog.html index 542d30f..46da912 100644 --- a/app/views/archetype.config.stylescript.dialog.html +++ b/app/views/archetype.config.stylescript.dialog.html @@ -1,3 +1,4 @@ +{{VERSION_HTML}}

        Custom Style/Script Options

        diff --git a/app/views/archetype.default.html b/app/views/archetype.default.html index d9dbac3..0a76e13 100644 --- a/app/views/archetype.default.html +++ b/app/views/archetype.default.html @@ -1,3 +1,4 @@ +{{VERSION_HTML}}
          diff --git a/app/views/archetype.html b/app/views/archetype.html index 63b1114..2276365 100644 --- a/app/views/archetype.html +++ b/app/views/archetype.html @@ -1 +1,2 @@ +{{VERSION_HTML}}