-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Weberistic/contentApps
Content apps
- Loading branch information
Showing
16 changed files
with
472 additions
and
368 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
...p_Plugins/uSupport/backoffice/ticketStatuses/apps/ticketStatus/ticketStatus.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
angular.module("umbraco").controller("uSupport.ticketStatus.contentApp.controller", function ($scope) { | ||
|
||
'use strict'; | ||
|
||
$scope.model.properties = [{ | ||
alias: "Color", | ||
label: "Color", | ||
view: "dropdownFlexible", | ||
value: "primary", | ||
config: { | ||
items: [ | ||
"primary", | ||
"secondary", | ||
"success", | ||
"warning", | ||
"danger", | ||
"gray" | ||
], | ||
}, | ||
validation: { | ||
mandatory: true, | ||
// pattern: "" | ||
} | ||
}, | ||
{ | ||
alias: "Active", | ||
label: "Active", | ||
description: "If tickets with this status should count as active", | ||
view: "boolean", | ||
}, | ||
{ | ||
alias: "Default", | ||
label: "Default", | ||
description: "If all new tickets should have this status as default status. (Only 1 can be default)", | ||
view: "boolean", | ||
|
||
}]; | ||
|
||
$scope.model.preview = { | ||
property: $scope.model.properties[0], | ||
page: $scope.model.page | ||
}; | ||
|
||
if (!$scope.model.create) { | ||
$scope.model.properties.forEach(function (property) { | ||
property.value = $scope.model.ticketStatus[property.alias]; | ||
}); | ||
} | ||
|
||
$scope.$watch("model.preview", function (newValue, oldValue) { | ||
$scope.model.selectedColor = newValue.property.singleDropdownValue; | ||
$scope.model.selectedName = newValue.page.title; | ||
}, true); | ||
}); |
34 changes: 34 additions & 0 deletions
34
...upport/App_Plugins/uSupport/backoffice/ticketStatuses/apps/ticketStatus/ticketStatus.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<div ng-controller="uSupport.ticketStatus.contentApp.controller as vm" class="uSupport"> | ||
<div class="uSupport-row"> | ||
<div class="uSupport-col-12"> | ||
<umb-box> | ||
<umb-box-header title="Settings"></umb-box-header> | ||
<umb-box-content> | ||
|
||
<umb-property property="property" ng-repeat="property in model.properties"> | ||
<umb-property-editor model="property"></umb-property-editor> | ||
</umb-property> | ||
|
||
<div class="umb-property uSupport-umb-property-last"> | ||
<div class="control-group umb-control-group"> | ||
<div class="control-header"> | ||
<div class="control-label"> | ||
Preview | ||
</div> | ||
</div> | ||
<div class="controls"> | ||
<div class="db umb-property-editor"> | ||
<umb-badge size="s" | ||
color="{{model.selectedColor}}"> | ||
{{model.selectedName || 'Status'}} | ||
</umb-badge> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</umb-box-content> | ||
</umb-box> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...port/App_Plugins/uSupport/backoffice/ticketTypes/apps/ticketType/ticketType.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
angular.module("umbraco").controller("uSupport.ticketType.contentApp.controller", function ( | ||
$scope, | ||
uSupportTicketTypeResources) { | ||
|
||
'use strict'; | ||
|
||
$scope.loading = true; | ||
|
||
uSupportTicketTypeResources.getAllDataTypes().then(function (dataTypes) { | ||
$scope.model.dataTypes = dataTypes; | ||
$scope.model.properties = [ | ||
{ | ||
alias: "propertyName", | ||
label: "Property name", | ||
view: "textbox" | ||
}, | ||
{ | ||
alias: "propertyDescription", | ||
label: "Property description", | ||
view: "textbox" | ||
}, | ||
{ | ||
alias: "property", | ||
label: "Property", | ||
view: "dropdownFlexible", | ||
config: { | ||
items: dataTypes | ||
} | ||
} | ||
]; | ||
|
||
if ($scope.model.ticketType.PropertyId !== 0) { | ||
uSupportTicketTypeResources.getDataTypeFromId($scope.model.ticketType.PropertyId).then(function (type) { | ||
$scope.model.properties[0].value = $scope.model.ticketType.PropertyName; | ||
$scope.model.properties[1].value = $scope.model.ticketType.PropertyDescription; | ||
$scope.model.properties[2].value = type.Name; | ||
|
||
$scope.loading = false; | ||
}); | ||
} else { | ||
$scope.loading = false; | ||
} | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
src/uSupport/App_Plugins/uSupport/backoffice/ticketTypes/apps/ticketType/ticketType.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<div ng-controller="uSupport.ticketType.contentApp.controller as vm" class="uSupport"> | ||
|
||
<umb-load-indicator ng-if="loading"></umb-load-indicator> | ||
|
||
<div class="uSupport-row" ng-if="!loading"> | ||
<div class="uSupport-col-12"> | ||
<umb-box> | ||
<umb-box-header title="Settings"></umb-box-header> | ||
<umb-box-content> | ||
|
||
<umb-property property="property" ng-repeat="property in model.properties"> | ||
<umb-property-editor model="property"></umb-property-editor> | ||
</umb-property> | ||
|
||
</umb-box-content> | ||
</umb-box> | ||
</div> | ||
</div> | ||
</div> |
93 changes: 40 additions & 53 deletions
93
src/uSupport/App_Plugins/uSupport/backoffice/ticketTypes/edit.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,43 @@ | ||
<div ng-controller="uSupport.ticketType.edit.controller as vm" class="uSupport"> | ||
|
||
<umb-load-indicator ng-if="vm.loading"></umb-load-indicator> | ||
|
||
<form novalidate val-form-manager name="formName" ng-submit="vm.save()"> | ||
<umb-editor-view ng-if="!vm.loading"> | ||
<umb-editor-header name="vm.page.title" | ||
description="vm.page.description" | ||
hideDescription="false" | ||
name-locked="false" | ||
hide-alias="false" | ||
alias="vm.page.alias" | ||
icon="vm.page.icon" | ||
hideIcon="false" | ||
show-back-button="true" | ||
on-back="vm.close()" | ||
menu="vm.page.menu"> | ||
</umb-editor-header> | ||
|
||
<umb-editor-container class="form-horizontal"> | ||
<div class="uSupport-row"> | ||
<div class="uSupport-col-12"> | ||
<umb-box> | ||
<umb-box-header title="Settings"></umb-box-header> | ||
<umb-box-content> | ||
|
||
<umb-property property="property" ng-repeat="property in vm.properties"> | ||
<umb-property-editor model="property"></umb-property-editor> | ||
</umb-property> | ||
|
||
</umb-box-content> | ||
</umb-box> | ||
</div> | ||
</div> | ||
</umb-editor-container> | ||
|
||
<umb-editor-footer> | ||
<umb-editor-footer-content-right> | ||
<umb-button type="button" | ||
button-style="link" | ||
label-key="general_close" | ||
action="vm.close()"> | ||
</umb-button> | ||
|
||
<umb-button type="submit" | ||
button-style="success" | ||
state="vm.buttonState" | ||
label-key="buttons_save" | ||
action="vm.save()"> | ||
</umb-button> | ||
</umb-editor-footer-content-right> | ||
</umb-editor-footer> | ||
|
||
</umb-editor-view> | ||
</form> | ||
<umb-load-indicator ng-if="vm.loading"></umb-load-indicator> | ||
|
||
<form novalidate val-form-manager name="formName" ng-submit="vm.save()"> | ||
<umb-editor-view ng-if="!vm.loading"> | ||
<umb-editor-header name="vm.page.title" | ||
description="vm.page.description" | ||
hideDescription="false" | ||
name-locked="false" | ||
hide-alias="false" | ||
alias="vm.page.alias" | ||
icon="vm.page.icon" | ||
hideIcon="false" | ||
show-back-button="true" | ||
on-back="vm.close()" | ||
navigation="vm.page.navigation" | ||
menu="vm.page.menu"> | ||
</umb-editor-header> | ||
|
||
<umb-editor-container class="form-horizontal"> | ||
<umb-editor-sub-views sub-views="vm.page.navigation" model="vm"></umb-editor-sub-views> | ||
</umb-editor-container> | ||
|
||
<umb-editor-footer> | ||
<umb-editor-footer-content-right> | ||
<umb-button type="button" | ||
button-style="link" | ||
label-key="general_close" | ||
action="vm.close()"> | ||
</umb-button> | ||
|
||
<umb-button type="submit" | ||
button-style="success" | ||
state="vm.buttonState" | ||
label-key="buttons_save" | ||
action="vm.save()"> | ||
</umb-button> | ||
</umb-editor-footer-content-right> | ||
</umb-editor-footer> | ||
</umb-editor-view> | ||
</form> | ||
</div> |
Oops, something went wrong.