Skip to content

Commit

Permalink
Redesign of config view. Fixes #964
Browse files Browse the repository at this point in the history
  • Loading branch information
tidyui committed Dec 28, 2019
1 parent e8305ff commit 60ad1bc
Show file tree
Hide file tree
Showing 11 changed files with 233 additions and 109 deletions.
2 changes: 2 additions & 0 deletions core/Piranha.Manager.Core/Models/ConfigModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ public class ConfigModel
public string MediaCDN { get; set; }
public int PageRevisions { get; set; }
public int PostRevisions { get; set; }
public bool DefaultCollapsedBlocks { get; set; }
public bool DefaultCollapsedBlockGroupHeaders { get; set; }
}
}
6 changes: 5 additions & 1 deletion core/Piranha.Manager.Core/Services/ConfigService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public ConfigModel Get()
PostsExpires = config.CacheExpiresPosts,
MediaCDN = config.MediaCDN,
PageRevisions = config.PageRevisions,
PostRevisions = config.PostRevisions
PostRevisions = config.PostRevisions,
DefaultCollapsedBlocks = config.ManagerDefaultCollapsedBlocks,
DefaultCollapsedBlockGroupHeaders = config.ManagerDefaultCollapsedBlockGroupHeaders
};
}
}
Expand All @@ -57,6 +59,8 @@ public void Save(ConfigModel model)
{
config.HierarchicalPageSlugs = model.HierarchicalPageSlugs;
config.ManagerExpandedSitemapLevels = model.ExpandedSitemapLevels;
config.ManagerDefaultCollapsedBlocks = model.DefaultCollapsedBlocks;
config.ManagerDefaultCollapsedBlockGroupHeaders = model.DefaultCollapsedBlockGroupHeaders;
config.ArchivePageSize = model.ArchivePageSize;
config.CacheExpiresPages = model.PagesExpires;
config.CacheExpiresPosts = model.PostsExpires;
Expand Down
287 changes: 189 additions & 98 deletions core/Piranha.Manager/Areas/Manager/Pages/ConfigEdit.cshtml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions core/Piranha.Manager/assets/dist/css/full.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions core/Piranha.Manager/assets/dist/css/slim.min.css

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions core/Piranha.Manager/assets/dist/js/piranha.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ piranha.config = new Vue({
postsExpires: null,
mediaCDN: null,
pageRevisions: null,
postRevisions: null
postRevisions: null,
defaultCollapsedBlocks: false,
defaultCollapsedBlockGroupHeaders: false
}
},
methods: {
Expand All @@ -32,6 +34,8 @@ piranha.config = new Vue({
self.model.mediaCDN = result.mediaCDN;
self.model.pageRevisions = result.pageRevisions;
self.model.postRevisions = result.postRevisions;
self.model.defaultCollapsedBlocks = result.defaultCollapsedBlocks;
self.model.defaultCollapsedBlockGroupHeaders = result.defaultCollapsedBlockGroupHeaders;
})
.catch(function (error) { console.log("error:", error ); });
},
Expand All @@ -51,7 +55,9 @@ piranha.config = new Vue({
postsExpires: self.model.postsExpires,
mediaCDN: self.model.mediaCDN,
pageRevisions: self.model.pageRevisions,
postRevisions: self.model.postRevisions
postRevisions: self.model.postRevisions,
defaultCollapsedBlocks: self.model.defaultCollapsedBlocks,
defaultCollapsedBlockGroupHeaders: self.model.defaultCollapsedBlockGroupHeaders
})
})
.then(function (response) { return response.json(); })
Expand Down
2 changes: 1 addition & 1 deletion core/Piranha.Manager/assets/dist/js/piranha.config.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/Piranha.Manager/assets/dist/js/piranha.contentedit.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Vue.component("region", {
" <div class='row'>" +
" <div class='form-group' :class='{ \"col-sm-6\": field.meta.isHalfWidth, \"col-sm-12\": !field.meta.isHalfWidth }' v-for='field in item.fields'>" +
" <label>{{ field.meta.name }}</label>" +
" <div v-if='field.meta.description != null' v-html='field.meta.description' class='field-description small text-muted'></div>" +
" <div class='field-body'>" +
" <div :id='\"tb-\" + field.meta.uid' class='component-toolbar'></div>" +
" <component v-if='field.model != null' v-bind:is='field.meta.component' v-bind:uid='item.uid' v-bind:meta='field.meta' v-bind:toolbar='\"tb-\" + field.meta.uid' v-bind:model='field.model' v-on:update-title='updateTitle($event)'></component>" +
Expand Down

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions core/Piranha.Manager/assets/src/js/piranha.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ piranha.config = new Vue({
postsExpires: null,
mediaCDN: null,
pageRevisions: null,
postRevisions: null
postRevisions: null,
defaultCollapsedBlocks: false,
defaultCollapsedBlockGroupHeaders: false
}
},
methods: {
Expand All @@ -32,6 +34,8 @@ piranha.config = new Vue({
self.model.mediaCDN = result.mediaCDN;
self.model.pageRevisions = result.pageRevisions;
self.model.postRevisions = result.postRevisions;
self.model.defaultCollapsedBlocks = result.defaultCollapsedBlocks;
self.model.defaultCollapsedBlockGroupHeaders = result.defaultCollapsedBlockGroupHeaders;
})
.catch(function (error) { console.log("error:", error ); });
},
Expand All @@ -51,7 +55,9 @@ piranha.config = new Vue({
postsExpires: self.model.postsExpires,
mediaCDN: self.model.mediaCDN,
pageRevisions: self.model.pageRevisions,
postRevisions: self.model.postRevisions
postRevisions: self.model.postRevisions,
defaultCollapsedBlocks: self.model.defaultCollapsedBlocks,
defaultCollapsedBlockGroupHeaders: self.model.defaultCollapsedBlockGroupHeaders
})
})
.then(function (response) { return response.json(); })
Expand Down
14 changes: 14 additions & 0 deletions core/Piranha.Manager/assets/src/scss/inc/_cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,18 @@
border-radius: 0;
}
}
}

#config {
.card-body {
padding: 0;

.list-group {
padding: .75rem 0;

.list-group-item {
border-color: $body-bg;
}
}
}
}

0 comments on commit 60ad1bc

Please sign in to comment.