sheercms
Version:
Sheer Cliff CMS is a simple and powerful content management system (CMS) for Node JS.
349 lines (334 loc) • 20.9 kB
HTML
<div class="row main-container package-view">
<div class="col-md-12">
<div ng-if="data.isAuthorized !== true" class="no-auth alert alert-danger">
You are not authorized to use this tool.
</div>
<div class="toolbar" ng-if="data.isAuthorized === true">
<ul>
<li ng-show="buttons.back === true">
<a href="javascript:void(0);" title="Go back to package list" ng-click="back()">
<img src="/cms/static/images/icons/32/back_arrow.png" alt="Back"/>
<span>Back</span>
</a>
</li>
<li ng-show="buttons.save === true">
<a href="javascript:void(0);" title="Save this package" ng-click="savePackage()">
<img src="/cms/static/images/icons/32/accept.png" alt="Save"/>
<span>Save</span>
</a>
</li>
<li ng-show="buttons.addGroup === true">
<a href="javascript:void(0);" title="Add a group to this package" ng-click="addItem('group')">
<img src="/cms/static/images/icons/32/page_white_stack_add.png" alt="Add Group"/>
<span>Add Group</span>
</a>
</li>
<li ng-show="buttons.addContent === true">
<a href="javascript:void(0);" title="Add a content item to this package" ng-click="addItem('content')">
<img src="/cms/static/images/icons/32/page_white_add.png" alt="Add Content Item"/>
<span>Add Content</span>
</a>
</li>
<li ng-show="buttons.addMedia === true">
<a href="javascript:void(0);" title="Add a media item to this package" ng-click="addItem('media')">
<img src="/cms/static/images/icons/32/image_add.png" alt="Add Media Item"/>
<span>Add Media</span>
</a>
</li>
<li ng-show="buttons.addContentType === true">
<a href="javascript:void(0);" title="Add a content type to this package" ng-click="addItem('type')">
<img src="/cms/static/images/icons/32/content_type_add.png" alt="Add Content Type"/>
<span>Add Type</span>
</a>
</li>
<li ng-show="buttons.addTemplate === true">
<a href="javascript:void(0);" title="Add a template to this package" ng-click="addItem('template')">
<img src="/cms/static/images/icons/32/layout_add.png" alt="Add Template"/>
<span>Add Template</span>
</a>
</li>
<li ng-show="buttons.removeItems === true">
<a href="javascript:void(0);" title="Remove the checked items from this package" ng-click="removeItems()">
<img src="/cms/static/images/icons/32/page_white_delete.png" alt="Remove Items"/>
<span>Remove Items</span>
</a>
</li>
<li ng-show="buttons.validate === true">
<a href="javascript:void(0);" title="Validate this package" ng-click="validate()">
<img src="/cms/static/images/icons/32/package_green.png" alt="Validate Package"/>
<span>Validate</span>
</a>
</li>
<li ng-show="buttons.build === true">
<a href="javascript:void(0);" title="Build this package" ng-click="build()">
<img src="/cms/static/images/icons/32/package_go.png" alt="Build Package"/>
<span>Build</span>
</a>
</li>
<li ng-show="buttons.delete === true">
<a href="javascript:void(0);" title="Delete this package" ng-click="deletePackage()">
<img src="/cms/static/images/icons/32/delete.png" alt="Delete"/>
<span>Delete</span>
</a>
</li>
<li ng-show="buttons.newPackage === true">
<a href="javascript:void(0);" title="Create a new package" ng-click="showNewPackage()">
<img src="/cms/static/images/icons/32/package_add.png" alt="New Package"/>
<span>New Package</span>
</a>
</li>
<li ng-show="buttons.install === true">
<a href="javascript:void(0);" title="Install a package" ng-click="installPackage()">
<img src="/cms/static/images/icons/32/install.png" alt="Install Package"/>
<span>Install Package</span>
</a>
</li>
<li ng-show="buttons.refresh === true">
<a href="javascript:void(0);" title="Reload the package list" ng-click="refresh()">
<img src="/cms/static/images/icons/32/update.png" alt="Refresh"/>
<span>Refresh</span>
</a>
</li>
</ul>
</div>
<div id="packages-page" ng-if="data.isAuthorized === true">
<h3>{{data.title}}</h3>
<div ng-if="data.message != null && data.message.length > 0">
<div class="alert {{data.messageType}} max-width-medium">{{data.message}}</div>
</div>
<div ng-if="data.packages.length === 0">
<div class="alert alert-warning max-width-medium">There are currently no packages. <a href="javascript:void(0);" ng-click="showNewPackage()">Create a new package.</a></div>
</div>
<div ng-if="data.view === 'list'">
<table class="table table-click table-bordered">
<thead>
<tr>
<th style="width:300px;">Name</th>
<th>Description</th>
<th style="width:200px;">Date Created</th>
<th style="width:200px;">Date Modified</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="pkg in data.packages" ng-click="editPackage(pkg._id)">
<td>
<img class="icon" ng-src="{{data.packageIcon}}" />
{{pkg.name}}
</td>
<td>{{pkg.description}}</td>
<td>{{pkg.created | date: 'yyyy-MM-dd h:mm:ss a'}}</td>
<td>{{pkg.modified | date: 'yyyy-MM-dd h:mm:ss a'}}</td>
</tr>
</tbody>
</table>
</div>
<div ng-if="data.view === 'details'">
<div ng-if="data.downloadUrl">
<a href="{{data.downloadUrl}}">Download the package zip</a>
<br/>
<br/>
</div>
<div ng-if="package.items === null || package.items.length === 0">
<div class="alert alert-warning max-width-medium">There are currently no items in this package.</div>
</div>
<div ng-if="package.items != null && package.items.length > 0">
<div class="tabs">
<ul class="tabs-head">
<li class="active"><a href="javascript:void(0);" ng-click="setTab('props')">Properties</a></li>
<li><a href="javascript:void(0);" ng-click="setTab('group')">Groups</a></li>
<li><a href="javascript:void(0);" ng-click="setTab('content')">Content</a></li>
<li><a href="javascript:void(0);" ng-click="setTab('media')">Media</a></li>
<li><a href="javascript:void(0);" ng-click="setTab('type')">Content Types</a></li>
<li><a href="javascript:void(0);" ng-click="setTab('template')">Templates</a></li>
</ul>
<div class="tabs-body">
<!-- Properties Tab -->
<div class="active">
<div class="form-group">
<label>Package Name</label>
<input type="text" class="form-control" id="pkgName" name="pkgName" ng-model="package.name" style="max-width:400px;" />
</div>
<div class="form-group">
<label>Package File Name</label>
<input type="text" class="form-control" id="pkgFileName" name="pkgFileName" ng-model="package.filename" style="max-width:600px;" />
</div>
<div class="form-group">
<label>Description</label>
<textarea class="form-control" id="pkgDescription" name="pkgDescription" ng-model="package.description" style="max-width:600px;" rows="2"></textarea>
</div>
<div class="form-group">
<label>Default Overwrite Action</label>
<select class="form-control" ng-model="package.overwrite" ng-options="a for a in data.overwriteValuesPkg" style="width:100px;"></select>
</div>
</div>
<!-- Groups Tab -->
<div>
<table class="table table-click table-bordered max-width-medium">
<thead>
<tr>
<th style="width:24px;"><input type="checkbox" ng-model="checks.allGroups" ng-change="toggleCheckAll('group')"/></th>
<th>Name</th>
<th style="width:240px;">Item ID</th>
<th style="width:100px;">Overwrite</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in package.items | filter: {itemType: 'group'}" ng-class="{invalid: item.invalid === true}">
<td><input type="checkbox" ng-model="item.checked" ng-change="toggleCheck(item)" /></td>
<td>
{{item.name}}
</td>
<td>{{item.itemId}}</td>
<td>
<select ng-model="item.overwrite" ng-options="a for a in data.overwriteValues"></select>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Content Tab -->
<div>
<table class="table table-click table-bordered max-width-medium">
<thead>
<tr>
<th style="width:24px;"><input type="checkbox" ng-model="checks.allContent" ng-change="toggleCheckAll('content')"/></th>
<th>Name</th>
<th style="width:240px;">Item ID</th>
<th style="width:100px;">Overwrite</th>
<th style="width:80px;text-align: center;">Publish</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in package.items | filter: {itemType: 'content'}" ng-class="{invalid: item.invalid === true}">
<td><input type="checkbox" ng-model="item.checked" ng-change="toggleCheck(item)" /></td>
<td>
{{item.name}}
</td>
<td>{{item.itemId}}</td>
<td>
<select ng-model="item.overwrite" ng-options="a for a in data.overwriteValues"></select>
</td>
<td style="text-align: center;">
<input type="checkbox" ng-model="item.publish" />
</td>
</tr>
</tbody>
</table>
</div>
<!-- Media Tab -->
<div>
<table class="table table-click table-bordered max-width-medium">
<thead>
<tr>
<th style="width:24px;"><input type="checkbox" ng-model="checks.allMedia" ng-change="toggleCheckAll('media')"/></th>
<th>Name</th>
<th style="width:240px;">Item ID</th>
<th style="width:100px;">Overwrite</th>
<th style="width:80px;text-align: center;">Publish</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in package.items | filter: {itemType: 'media'}" ng-class="{invalid: item.invalid == true}">
<td><input type="checkbox" ng-model="item.checked" ng-change="toggleCheck(item)" /></td>
<td>
{{item.name}}
</td>
<td>{{item.itemId}}</td>
<td>
<select ng-model="item.overwrite" ng-options="a for a in data.overwriteValues"></select>
</td>
<td style="text-align: center;">
<input type="checkbox" ng-model="item.publish" />
</td>
</tr>
</tbody>
</table>
</div>
<!-- Content Types Tab -->
<div>
<table class="table table-click table-bordered max-width-medium">
<thead>
<tr>
<th style="width:24px;"><input type="checkbox" ng-model="checks.allTypes" ng-change="toggleCheckAll('type')" /></th>
<th>Name</th>
<th style="width:240px;">Item ID</th>
<th style="width:100px;">Overwrite</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in package.items | filter: {itemType: 'type'}" ng-class="{invalid: item.invalid === true}">
<td><input type="checkbox" ng-model="item.checked" ng-change="toggleCheck(item)" /></td>
<td>
{{item.name}}
</td>
<td>{{item.itemId}}</td>
<td>
<select ng-model="item.overwrite" ng-options="a for a in data.overwriteValues"></select>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Templates Tab -->
<div>
<table class="table table-click table-bordered max-width-medium">
<thead>
<tr>
<th style="width:24px;"><input type="checkbox" ng-model="checks.allTemplates" ng-change="toggleCheckAll('template')" /></th>
<th>Name</th>
<th style="width:240px;">Item ID</th>
<th style="width:100px;">Overwrite</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in package.items | filter: {itemType: 'template'}" ng-class="{invalid: item.invalid === true}">
<td><input type="checkbox" ng-model="item.checked" ng-change="toggleCheck(item)" /></td>
<td>
{{item.name}}
</td>
<td>{{item.itemId}}</td>
<td>
<select ng-model="item.overwrite" ng-options="a for a in data.overwriteValues"></select>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/ng-template" id="InstallPackageDialog">
<div class="modal-header">
<button type="button" class="close" aria-hidden="true" ng-click="cancel()">×</button>
<h4 class="modal-title">{{dialog.title}}</h4>
</div>
<div class="modal-body">
<form id="InstallPackageForm" role="form" action="" method="post">
<div ng-if="dialog.message && dialog.message.length > 0">
<div class="alert {{dialog.messageType}}">{{dialog.message}}</div>
</div>
<div class="form-group">
<label for="installPackageFile">Upload a Package</label>
<input type="file" id="installPackageFile" name="installPackageFile" ng-file-select="onFileSelect($files)" />
<div class="progress" ng-show="uploadData.uploading === true">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="{{uploadData.uploadProgress}}" aria-valuemin="0" aria-valuemax="100" style="width: {{uploadData.uploadProgress}}%;">
{{uploadData.uploadProgress}}%
</div>
</div>
<div class="package-results">
<div ng-repeat="result in uploadData.results">
<span class="package-result-{{result.status}}">{{result.message}}</span>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary min-width" ng-disabled="uploadData.hasFiles === false" ng-click="ok()">Install</button>
<button type="button" class="btn btn-default min-width" ng-click="cancel()">Close</button>
</div>
</script>