Adds media views and controllers
This commit is contained in:
38
src/Umbraco.Web.UI.Client/src/views/media/create.html
Normal file
38
src/Umbraco.Web.UI.Client/src/views/media/create.html
Normal file
@@ -0,0 +1,38 @@
|
||||
<div class="umb-dialog" ng-controller="Umbraco.Editors.MediaCreateController">
|
||||
<div class="umb-dialog-body" auto-scale="90">
|
||||
<p class="umb-abstract">Create a page under {{currentNode.name}}</p>
|
||||
|
||||
<ul class="umb-actions">
|
||||
<li class="action">
|
||||
<ul class="umb-actions-child">
|
||||
|
||||
<li ng-repeat="docType in allowedTypes">
|
||||
<a href="#content/edit/{{currentNode.id}}?doctype={{docType.alias}}&create=true" ng-click="hideNavigation()"><i class="icon-large icon-{{docType.cssClass}}"></i>
|
||||
<span class="menu-label">
|
||||
{{docType.name}}
|
||||
<small>
|
||||
{{docType.description}}
|
||||
</small>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="add">
|
||||
<a href="#settings/documenttype/create/{{currentNode.id}}?doctype={{docType.alias}}&create=true" ng-click="hideNavigation()"><i class="icon-large icon-plus"></i>
|
||||
<span class="menu-label">
|
||||
Create a new document type
|
||||
<small>
|
||||
Design and configure a new document type
|
||||
</small>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="btn-toolbar umb-btn-toolbar">
|
||||
<button class="btn" ng-click="hideDialog()">Do something else</button>
|
||||
</div>
|
||||
</div>
|
||||
22
src/Umbraco.Web.UI.Client/src/views/media/edit.controller.js
Normal file
22
src/Umbraco.Web.UI.Client/src/views/media/edit.controller.js
Normal file
@@ -0,0 +1,22 @@
|
||||
function mediaEditController($scope, $routeParams, contentResource, notificationsService) {
|
||||
if ($routeParams.create)
|
||||
$scope.content = contentResource.getContentScaffold($routeParams.id, $routeParams.doctype);
|
||||
else
|
||||
$scope.content = contentResource.getContent($routeParams.id);
|
||||
|
||||
|
||||
$scope.saveAndPublish = function (cnt) {
|
||||
cnt.publishDate = new Date();
|
||||
contentResource.publishContent(cnt);
|
||||
notificationsService.success("Published", "Content has been saved and published");
|
||||
};
|
||||
|
||||
$scope.save = function (cnt) {
|
||||
cnt.updateDate = new Date();
|
||||
contentResource.saveContent(cnt);
|
||||
notificationsService.success("Saved", "Content has been saved");
|
||||
};
|
||||
}
|
||||
|
||||
angular.module("umbraco")
|
||||
.controller("Umbraco.Editors.ContentEditController", mediaEditController);
|
||||
36
src/Umbraco.Web.UI.Client/src/views/media/edit.html
Normal file
36
src/Umbraco.Web.UI.Client/src/views/media/edit.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<umb-panel ng-controller="Umbraco.Editors.MediaEditController">
|
||||
<umb-header tabs="content.tabs">
|
||||
<div class="span4">
|
||||
<input type="text" placeholder="Enter a page title" headline ng-model="content.name" />
|
||||
</div>
|
||||
|
||||
<div class="span8">
|
||||
<div class="btn-toolbar pull-right umb-btn-toolbar">
|
||||
<div class="btn-group">
|
||||
<a class="btn" ng-click="preview(content)"
|
||||
data-shortcut="ctrl+s">Preview page</a>
|
||||
</div>
|
||||
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-success" href="#" ng-click="saveAndPublish(content)"
|
||||
prevent-default data-shortcut="ctrl+p">Publish</a>
|
||||
|
||||
<a class="btn btn-success dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
|
||||
<li><a href="#" ng-click="save(content)"
|
||||
prevent-default data-shortcut="ctrl+s">Save draft</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</umb-header>
|
||||
|
||||
<umb-tab-view>
|
||||
<umb-tab title="{{tab.label}}" id="{{elementId}}" rel="{{tab.id}}" ng-repeat="tab in content.tabs">
|
||||
<umb-property ng-repeat="model in tab.properties"></umb-property>
|
||||
</umb-tab>
|
||||
</umb-tab-view>
|
||||
</umb-panel>
|
||||
@@ -0,0 +1,6 @@
|
||||
function mediaCreateController ($scope, $routeParams,contentTypeResource) {
|
||||
$scope.allowedTypes = contentTypeResource.getAllowedTypes($scope.currentNode.id);
|
||||
}
|
||||
|
||||
angular.module('umbraco')
|
||||
.controller("Umbraco.Editors.ContentCreateController", mediaCreateController);
|
||||
Reference in New Issue
Block a user