Add WebCms
This commit is contained in:
@@ -0,0 +1,151 @@
|
||||
[
|
||||
{
|
||||
"name": "Rich text editor",
|
||||
"alias": "rte",
|
||||
"view": "rte",
|
||||
"icon": "icon-article"
|
||||
},
|
||||
{
|
||||
"name": "Image",
|
||||
"alias": "media",
|
||||
"view": "media",
|
||||
"icon": "icon-picture"
|
||||
},
|
||||
{
|
||||
"name": "Image wide",
|
||||
"alias": "media_wide",
|
||||
"view": "media",
|
||||
"render": "/App_Plugins/Grid/Editors/Render/media_wide.cshtml",
|
||||
"icon": "icon-picture"
|
||||
},
|
||||
{
|
||||
"name": "Image wide cropped",
|
||||
"alias": "media_wide_cropped",
|
||||
"view": "media",
|
||||
"render": "media",
|
||||
"icon": "icon-picture",
|
||||
"config": {
|
||||
"size": {
|
||||
"width": 1920,
|
||||
"height": 700
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Image rounded",
|
||||
"alias": "media_round",
|
||||
"view": "media",
|
||||
"render": "/App_Plugins/Grid/Editors/Render/media_round.cshtml",
|
||||
"icon": "icon-picture"
|
||||
},
|
||||
{
|
||||
"name": "Image w/ text right",
|
||||
"alias": "media_text_right",
|
||||
"view": "/App_Plugins/Grid/Editors/Views/media_with_description.html",
|
||||
"render": "/App_Plugins/Grid/Editors/Render/media_text_right.cshtml",
|
||||
"icon": "icon-picture"
|
||||
},
|
||||
{
|
||||
"name": "Macro",
|
||||
"alias": "macro",
|
||||
"view": "macro",
|
||||
"icon": "icon-settings-alt"
|
||||
},
|
||||
{
|
||||
"name": "Embed",
|
||||
"alias": "embed",
|
||||
"view": "embed",
|
||||
"render": "/App_Plugins/Grid/Editors/Render/embed_videowrapper.cshtml",
|
||||
"icon": "icon-movie-alt"
|
||||
},
|
||||
{
|
||||
"name": "Banner Headline",
|
||||
"alias": "banner_headline",
|
||||
"view": "textstring",
|
||||
"icon": "icon-coin",
|
||||
"config": {
|
||||
"style": "font-size: 36px; line-height: 45px; font-weight: bold; text-align:center",
|
||||
"markup": "<h1 style='font-size:62px;text-align:center'>#value#</h1>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Banner Tagline",
|
||||
"alias": "banner_tagline",
|
||||
"view": "textstring",
|
||||
"icon": "icon-coin",
|
||||
"config": {
|
||||
"style": "font-size: 25px; line-height: 35px; font-weight: normal; text-align:center",
|
||||
"markup": "<h2 style='font-weight: 100; font-size: 40px;text-align:center'>#value#</h2>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Headline",
|
||||
"alias": "headline",
|
||||
"view": "textstring",
|
||||
"icon": "icon-coin",
|
||||
"config": {
|
||||
"style": "font-size: 36px; line-height: 45px; font-weight: bold",
|
||||
"markup": "<h1>#value#</h1>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Headline centered",
|
||||
"alias": "headline_centered",
|
||||
"view": "textstring",
|
||||
"icon": "icon-coin",
|
||||
"config": {
|
||||
"style": "font-size: 30px; line-height: 45px; font-weight: bold; text-align:center;",
|
||||
"markup": "<h1 style='text-align:center;'>#value#</h1>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Abstract",
|
||||
"alias": "abstract",
|
||||
"view": "textstring",
|
||||
"icon": "icon-coin",
|
||||
"config": {
|
||||
"style": "font-size: 16px; line-height: 20px; font-weight: bold;",
|
||||
"markup": "<h3>#value#</h3>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Paragraph",
|
||||
"alias": "paragraph",
|
||||
"view": "textstring",
|
||||
"icon": "icon-font",
|
||||
"config": {
|
||||
"style": "font-size: 16px; line-height: 20px; font-weight: light;",
|
||||
"markup": "<p>#value#</p>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Quote",
|
||||
"alias": "quote",
|
||||
"view": "textstring",
|
||||
"icon": "icon-quote",
|
||||
"config": {
|
||||
"style": "border-left: 3px solid #ccc; padding: 10px; color: #ccc; font-family: serif; font-variant: italic; font-size: 18px",
|
||||
"markup": "<blockquote>#value#</blockquote>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Quote with description",
|
||||
"alias": "quote_D",
|
||||
"view": "/App_Plugins/Grid/Editors/Views/quote_with_description.html",
|
||||
"render": "/App_Plugins/Grid/Editors/Render/quote_with_description.cshtml",
|
||||
"icon": "icon-quote",
|
||||
"config": {
|
||||
"style": "border-left: 3px solid #ccc; padding: 10px; color: #ccc; font-family: serif; font-variant: italic; font-size: 18px"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Code",
|
||||
"alias": "code",
|
||||
"view": "textstring",
|
||||
"icon": "icon-code",
|
||||
"config": {
|
||||
"style": "overflow: auto;padding: 6px 10px;border: 1px solid #ddd;border-radius: 3px;background-color: #f8f8f8;font-size: .9rem;font-family: 'Courier 10 Pitch', Courier, monospace;line-height: 19px;",
|
||||
"markup": "<pre>#value#</pre>"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,5 @@
|
||||
@inherits Umbraco.Web.Mvc.UmbracoViewPage<dynamic>
|
||||
|
||||
<div class="video-wrapper">
|
||||
@Html.Raw(Model.value)
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
@inherits Umbraco.Web.Mvc.UmbracoViewPage<dynamic>
|
||||
|
||||
@if (Model.value != null)
|
||||
{
|
||||
var url = Model.value.image;
|
||||
if(Model.editor.config != null && Model.editor.config.size != null){
|
||||
url += "?width=" + Model.editor.config.size.width;
|
||||
url += "&height=" + Model.editor.config.size.height;
|
||||
|
||||
if(Model.value.focalPoint != null){
|
||||
url += "¢er=" + Model.value.focalPoint.top +"," + Model.value.focalPoint.left;
|
||||
url += "&mode=crop";
|
||||
}
|
||||
}
|
||||
|
||||
<img class="round center" src="@url" alt="@Model.value.caption">
|
||||
|
||||
if (Model.value.caption != null)
|
||||
{
|
||||
<strong>@Model.value.caption</strong>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
@inherits Umbraco.Web.Mvc.UmbracoViewPage<dynamic>
|
||||
|
||||
@if (Model.value != null)
|
||||
{
|
||||
var url = Model.value.image;
|
||||
if(Model.editor.config != null && Model.editor.config.size != null){
|
||||
url += "?width=" + Model.editor.config.size.width;
|
||||
url += "&height=" + Model.editor.config.size.height;
|
||||
|
||||
if(Model.value.focalPoint != null){
|
||||
url += "¢er=" + Model.value.focalPoint.top +"," + Model.value.focalPoint.left;
|
||||
url += "&mode=crop";
|
||||
}
|
||||
}
|
||||
|
||||
<div class="equalizer">
|
||||
<div class="col-sm-8 column">
|
||||
<div class="equal center">
|
||||
<img class="wide" src="@url" alt="@Model.value.caption">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (Model.value.headline != null)
|
||||
{
|
||||
<div class="col-sm-4 column">
|
||||
<div class="equal">
|
||||
<p class="small vcenter">
|
||||
<strong>@Model.value.headline</strong>
|
||||
<br>
|
||||
@Model.value.paragraph
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (Model.value.paragraph != null)
|
||||
{
|
||||
<div class="col-md-4 column">
|
||||
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
@inherits Umbraco.Web.Mvc.UmbracoViewPage<dynamic>
|
||||
|
||||
@if (Model.value != null)
|
||||
{
|
||||
var url = Model.value.image;
|
||||
if(Model.editor.config != null && Model.editor.config.size != null){
|
||||
url += "?width=" + Model.editor.config.size.width;
|
||||
url += "&height=" + Model.editor.config.size.height;
|
||||
|
||||
if(Model.value.focalPoint != null){
|
||||
url += "¢er=" + Model.value.focalPoint.top +"," + Model.value.focalPoint.left;
|
||||
url += "&mode=crop";
|
||||
}
|
||||
}
|
||||
|
||||
<img class="wide" src="@url" alt="@Model.value.caption">
|
||||
|
||||
if (Model.value.caption != null)
|
||||
{
|
||||
<p class="caption">@Model.value.caption</p>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
@inherits Umbraco.Web.Mvc.UmbracoViewPage<dynamic>
|
||||
|
||||
@if (Model.editor.config.markup != null)
|
||||
{
|
||||
string markup = Model.editor.config.markup.ToString();
|
||||
|
||||
markup = markup.Replace("#value#", Model.value.ToString());
|
||||
markup = markup.Replace("#style#", Model.editor.config.style.ToString());
|
||||
|
||||
<text>
|
||||
@Html.Raw(markup)
|
||||
</text>
|
||||
}
|
||||
else
|
||||
{
|
||||
<text>
|
||||
<div class="equalizer">
|
||||
<div class="col-sm-8">
|
||||
<div class="equal center">
|
||||
<blockquote>@Model.value.quote</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="equal">
|
||||
<p class="small vcenter">
|
||||
<strong>@Model.value.headline</strong>
|
||||
<br>
|
||||
@Model.value.description
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</text>
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<div ng-controller="Umbraco.PropertyEditors.Grid.MediaController">
|
||||
|
||||
<div class="usky-editor-placeholder" ng-click="setImage()" ng-if="control.value === null">
|
||||
<i class="icon icon-picture"></i>
|
||||
<div ng-id="!control.$inserted" class="help-text">Click to insert image</div>
|
||||
</div>
|
||||
|
||||
<div ng-if="control.value">
|
||||
<div style="width:49%;display:inline-block">
|
||||
<img
|
||||
ng-if="url"
|
||||
ng-click="setImage()"
|
||||
ng-src="{{url}}"
|
||||
class="fullSizeImage" />
|
||||
</div>
|
||||
<div style="width:49%;display:inline-block;vertical-align:bottom;">
|
||||
<textarea
|
||||
rows="1"
|
||||
umb-auto-resize
|
||||
umb-auto-focus
|
||||
class="textstring input-block-level" id="{{control.uniqueId}}_text"
|
||||
ng-model="control.value.headline"
|
||||
ng-attr-style="{{control.editor.config.style}}" style="font-weight:bold; font-size:17px;" placeholder="Image headline..."></textarea>
|
||||
<textarea
|
||||
rows="1"
|
||||
umb-auto-resize
|
||||
class="textstring input-block-level" id="{{control.uniqueId}}_text"
|
||||
ng-model="control.value.paragraph"
|
||||
ng-attr-style="{{control.editor.config.style}}" placeholder="Image description..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,21 @@
|
||||
<div ng-controller="Umbraco.PropertyEditors.Grid.TextStringController">
|
||||
<textarea
|
||||
rows="1"
|
||||
umb-auto-resize
|
||||
umb-auto-focus
|
||||
class="textstring input-block-level" id="{{control.uniqueId}}_text"
|
||||
ng-model="control.value.quote"
|
||||
ng-attr-style="{{control.editor.config.style}}" placeholder="Write quote here..."></textarea>
|
||||
<textarea
|
||||
rows="1"
|
||||
umb-auto-resize
|
||||
class="textstring input-block-level" id="{{control.uniqueId}}_text"
|
||||
ng-model="control.value.headline"
|
||||
ng-attr-style="{{control.editor.config.style}}" placeholder="Write headerline here..."></textarea>
|
||||
<textarea
|
||||
rows="1"
|
||||
umb-auto-resize
|
||||
class="textstring input-block-level" id="{{control.uniqueId}}_text"
|
||||
ng-model="control.value.description"
|
||||
ng-attr-style="{{control.editor.config.style}}" placeholder="Write description here..."></textarea>
|
||||
</div>
|
||||
@@ -0,0 +1,31 @@
|
||||
function modelsBuilderController($scope, umbRequestHelper, $log, $http, modelsBuilderResource) {
|
||||
|
||||
$scope.generate = function() {
|
||||
$scope.generating = true;
|
||||
umbRequestHelper.resourcePromise(
|
||||
$http.post(umbRequestHelper.getApiUrl("modelsBuilderBaseUrl", "BuildModels")),
|
||||
'Failed to generate.')
|
||||
.then(function (result) {
|
||||
$scope.generating = false;
|
||||
$scope.dashboard = result;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.reload = function () {
|
||||
$scope.ready = false;
|
||||
modelsBuilderResource.getDashboard().then(function (result) {
|
||||
$scope.dashboard = result;
|
||||
$scope.ready = true;
|
||||
});
|
||||
};
|
||||
|
||||
function init() {
|
||||
modelsBuilderResource.getDashboard().then(function(result) {
|
||||
$scope.dashboard = result;
|
||||
$scope.ready = true;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
}
|
||||
angular.module("umbraco").controller("Umbraco.Dashboard.ModelsBuilderController", modelsBuilderController);
|
||||
@@ -0,0 +1,41 @@
|
||||
<div id="modelsBuilder" ng-controller="Umbraco.Dashboard.ModelsBuilderController">
|
||||
|
||||
<div ng-show="ready" style="float: right;">
|
||||
<button type="button" class="btn" ng-click="reload()"><span>Reload</span></button>
|
||||
</div>
|
||||
|
||||
<h3>Models Builder</h3>
|
||||
|
||||
<div ng-show="!ready">
|
||||
Loading...
|
||||
</div>
|
||||
|
||||
<div ng-show="ready">
|
||||
<div ng-bind-html-unsafe="dashboard.text"></div>
|
||||
|
||||
<div ng-if="dashboard.outOfDateModels">
|
||||
<p>Models are <strong>out-of-date</strong>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div ng-if="dashboard.canGenerate">
|
||||
<div ng-if="dashboard.generateCausesRestart">
|
||||
<p style="color: red; font-weight: bold;">Generating models will restart the application.</p>
|
||||
</div>
|
||||
<div ng-show="!generating">
|
||||
<button type="button" ng-click="generate()" class="btn btn-danger">
|
||||
<span>Generate models</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="umb-loader-wrapper" ng-show="generating">
|
||||
<div class="umb-loader"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-if="dashboard.lastError" style="margin-top: 32px;" ng-show="!generating">
|
||||
<span style="color: red; font-weight: bold;">Last generation failed with the following error:</span>
|
||||
<pre style="width: 80%; white-space: pre-line; background: #f8f8f8; padding: 4px; font-size: small;">{{dashboard.lastError}}</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,23 @@
|
||||
function modelsBuilderResource($q, $http, umbRequestHelper) {
|
||||
|
||||
return {
|
||||
getModelsOutOfDateStatus: function () {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get(umbRequestHelper.getApiUrl("modelsBuilderBaseUrl", "GetModelsOutOfDateStatus")),
|
||||
"Failed to get models out-of-date status");
|
||||
},
|
||||
|
||||
buildModels: function () {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.post(umbRequestHelper.getApiUrl("modelsBuilderBaseUrl", "BuildModels")),
|
||||
"Failed to build models");
|
||||
},
|
||||
|
||||
getDashboard: function () {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get(umbRequestHelper.getApiUrl("modelsBuilderBaseUrl", "GetDashboard")),
|
||||
"Failed to get dashboard");
|
||||
}
|
||||
};
|
||||
}
|
||||
angular.module("umbraco.resources").factory("modelsBuilderResource", modelsBuilderResource);
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
//array of files we want to inject into the application on app_start
|
||||
javascript: [
|
||||
'~/App_Plugins/ModelsBuilder/modelsbuilder.controller.js',
|
||||
'~/App_Plugins/ModelsBuilder/modelsbuilder.resource.js'
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user