Small tweaks on the macro dialog

This commit is contained in:
perploug
2013-09-25 15:15:52 +02:00
parent 8a3f1e6fbf
commit 123e70ae21
3 changed files with 26 additions and 30 deletions

View File

@@ -12,7 +12,7 @@ function InsertMacroController($scope, entityResource, macroResource, umbPropEdi
/** changes the view to edit the params of the selected macro */ /** changes the view to edit the params of the selected macro */
function editParams() { function editParams() {
//get the macro params if there are any //get the macro params if there are any
macroResource.getMacroParameters($scope.selectedMacro) macroResource.getMacroParameters($scope.selectedMacro.id)
.then(function (data) { .then(function (data) {
//go to next page if there are params otherwise we can just exit //go to next page if there are params otherwise we can just exit
@@ -49,9 +49,11 @@ function InsertMacroController($scope, entityResource, macroResource, umbPropEdi
}); });
//need to find the macro alias for the selected id //need to find the macro alias for the selected id
var macroAlias = _.find($scope.macros, function (item) { var macroAlias = $scope.selectedMacro.alias;
return item.id == $scope.selectedMacro;
}).alias; /* _.find($scope.macros, function (item) {
return item.id == $scope.selectedMacro.id;
}).alias;*/
//get the syntax based on the rendering engine //get the syntax based on the rendering engine
var syntax; var syntax;

View File

@@ -1,27 +1,27 @@
<form novalidate name="insertMacroForm" ng-submit="submitForm()" ng-controller="Umbraco.Dialogs.InsertMacroController"> <form novalidate name="insertMacroForm" ng-submit="submitForm()" ng-controller="Umbraco.Dialogs.InsertMacroController">
<div class="umb-panel" val-show-validation> <div class="umb-panel" val-show-validation>
<div class="umb-panel-header"> <div class="umb-panel-footer">
<div class="umb-el-wrap umb-panel-buttons"> <div class="btn-toolbar umb-btn-toolbar pull-right">
<div class="btn-toolbar umb-btn-toolbar"> <button type="button" class="btn btn-link" ng-click="close()">Cancel</button>
<button type="button" class="btn" ng-click="close()">Cancel</button>
<button type="submit" class="btn btn-primary">Ok</button> <button type="submit" class="btn btn-primary">Ok</button>
</div> </div>
</div> </div>
</div>
<div class="umb-panel-body umb-scrollable" auto-scale="1"> <div class="umb-panel-body no-header umb-scrollable" auto-scale="1">
<div class="umb-control-group" ng-switch="wizardStep"> <div class="umb-control-group" ng-switch="wizardStep">
<div class="umb-pane" ng-switch-when="macroSelect"> <div class="umb-pane" ng-switch-when="macroSelect">
<label for="macroName">Choose a macro</label> <label for="macroName">Choose a macro</label>
<select name="selectedMacro" ng-model="$parent.selectedMacro" ng-options="m.id as m.name for m in macros" required> <select class="umb-editor" ng-change="submitForm()" name="selectedMacro" ng-model="$parent.selectedMacro" ng-options="m as m.name for m in macros" required>
<option value="">-- Choose macro --</option> <option value="">Choose macro...</option>
</select> </select>
</div> </div>
<div class="umb-pane" ng-switch-when="paramSelect"> <div class="umb-pane" ng-switch-when="paramSelect">
<h5>{{$parent.selectedMacro.name}}</h5>
<ul class="unstyled"> <ul class="unstyled">
<li ng-repeat="param in $parent.macroParams"> <li ng-repeat="param in $parent.macroParams">
@@ -29,7 +29,6 @@
<label>{{param.name}}</label> <label>{{param.name}}</label>
<umb-editor model="param"></umb-editor> <umb-editor model="param"></umb-editor>
</div> </div>
</li> </li>
</ul> </ul>

View File

@@ -1,18 +1,7 @@
<div class="umb-panel" ng-controller="Umbraco.Dialogs.MacroPickerController"> <div class="umb-panel" ng-controller="Umbraco.Dialogs.MacroPickerController">
<div class="umb-panel-header">
<div class="umb-el-wrap umb-panel-buttons">
<div class="btn-toolbar umb-btn-toolbar">
<input type="button" ng-click="submit(dialogData)" class="btn btn-primary" value="select" />
</div>
</div>
</div>
<div class="umb-panel-body umb-scrollable" auto-scale="1" ng-switch on="dialogMode">
<div class="umb-panel-body no-header umb-scrollable" ng-switch on="dialogMode">
<div class="umb-control-group"> <div class="umb-control-group">
<div ng-switch-when="list" ng-swicth-default class="tab-content form-horizontal umb-el-wrap"> <div ng-switch-when="list" ng-swicth-default class="tab-content form-horizontal umb-el-wrap">
<ul class="nav nav-tabs nav-stacked"> <ul class="nav nav-tabs nav-stacked">
<li ng-repeat="macro in macros"> <li ng-repeat="macro in macros">
@@ -23,9 +12,10 @@
</ul> </ul>
</div> </div>
<div ng-switch-when="configure" class="tab-content form umb-el-wrap"> <div ng-switch-when="configure" class="tab-content form umb-el-wrap">
<h5>woot {{dialogData.macro.name}}</h5>
<div class="umb-pane" ng-repeat="model in dialogData.macro.properties"> <div class="umb-pane" ng-repeat="model in dialogData.macro.properties">
<label class="control-label" ng-hide="model.hideLabel" for="{{model.alias}}">{{model.label}} <label class="control-label" ng-hide="model.hideLabel" for="{{model.alias}}">{{model.label}}
</label> </label>
@@ -33,11 +23,16 @@
<div class="controls" <div class="controls"
ng-include="model.editorView"> ng-include="model.editorView">
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="umb-panel-footer">
<div class="umb-el-wrap umb-panel-buttons">
<div class="btn-toolbar umb-btn-toolbar">
<input type="button" ng-click="submit(dialogData)" class="btn btn-primary" value="select" />
</div>
</div>
</div> </div>
</div> </div>