Wired up Archetype's labels with the fields.

Using the fieldset and property's index/position to set the alias/ID.

+ small CSS tweak
This commit is contained in:
leekelleher
2014-02-02 17:00:22 +00:00
parent 3921d1340c
commit 92e2c070f8
3 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ angular.module("umbraco").directive('archetypeProperty', function ($compile, $ht
scope.model.config = config;
//some items need an alias
scope.model.alias = "scope-" + scope.$id;
scope.model.alias = "archetype-property-" + scope.fieldsetIndex + "-" + scope.propertyConfigIndex;
//watch for changes since there is no two-way binding with the local model.value
scope.$watch('model.value', function (newValue, oldValue) {
+2
View File
@@ -45,6 +45,7 @@
float: left;
width: 80%;
margin-bottom: 0;
margin-left: 5px;
padding: 0;
}
}
@@ -91,6 +92,7 @@
.archetypeEditor .archetypeDeveloperModel
{
font-family: monospace;
width: 98%;
min-height: 100px;
margin-bottom: 10px;
+3 -3
View File
@@ -1,13 +1,13 @@
<div class="archetypeEditor ng-class:model.config.customCssClass" ng-controller="Imulus.ArchetypeController">
<textarea class="archetypeDeveloperModel" ng-show="model.config.developerMode" ng-model="archetypeRenderModel"></textarea>
<div class="archetypeFieldsetToolbar" ng-show="model.config.fieldsets.length > 1 && model.config.hideFieldsetToolbar != '1'">
<ul>
<ul>
<li ng-repeat="fieldsetModel in model.config.fieldsets" ng-click="addRow(fieldsetModel.alias)">
<i class="fieldsetIcon icon ng-class:fieldsetModel.icon"></i>
<span>{{fieldsetModel.label}}</span>
</li>
</ul>
</div>
</div>
<ul ui-sortable="sortableOptions" ng-model="archetypeRenderModel.fieldsets">
<li ng-repeat="fieldset in archetypeRenderModel.fieldsets" ng-hide="fieldset.remove">
@@ -30,7 +30,7 @@
<div class="arechetypeCollapser animate-hide" ng-hide="fieldset.collapse">
<form class="form-inline">
<div ng-class="{archetypePropertyError: getPropertyValidity($parent.$index, property.alias) === false}" class="archetypeProperty control-group" ng-repeat="property in fieldsetConfigModel.properties">
<label ng-hide="archetypeConfig.hidePropertyLabels == '1'" class="control-label" for="archetype-property-{{property.alias}}">
<label ng-hide="archetypeConfig.hidePropertyLabels == '1'" class="control-label" for="archetype-property-{{$parent.$index}}-{{$index}}">
<span>{{property.label}}</span>
<div class="archetypeFieldsetHelpText" ng-show="property.helpText">
<em>{{property.helpText}}</em>