diff --git a/app/dashboard/site/template/index.js b/app/dashboard/site/template/index.js index cd7e2d3fd58..a0b32d6de35 100644 --- a/app/dashboard/site/template/index.js +++ b/app/dashboard/site/template/index.js @@ -178,7 +178,7 @@ TemplateEditor.route("/:templateSlug/local-editing") ); }); - TemplateEditor.route('/:templateSlug/download') + TemplateEditor.route('/:templateSlug/download-zip') .get(function (req, res) { // create a zip file of the template on the fly and send it to the user @@ -207,8 +207,10 @@ TemplateEditor.route("/:templateSlug/local-editing") archive.append(views[view].content, { name: view }); } + const package = Template.package.generate(req.blog.id, template, views); + // append the template JSON as 'package.json' - archive.append(JSON.stringify(template, null, 2), { name: 'package.json' }); + archive.append(package, { name: 'package.json' }); // Finalize the archive archive.finalize(); @@ -280,14 +282,14 @@ TemplateEditor.route("/:templateSlug/photo") }); -TemplateEditor.route("/:templateSlug/share") +TemplateEditor.route("/:templateSlug/download") .get(function (req, res) { - res.locals.title = `Share - ${req.template.name}`; + res.locals.title = `Download - ${req.template.name}`; res.locals.shareURL = `${req.protocol}://${req.hostname}/sites/share-template/${res.locals.template.shareID}`; - res.locals.breadcrumbs.add("Share", "share"); + res.locals.breadcrumbs.add("Download", "download"); - res.render("dashboard/template/share"); + res.render("dashboard/template/download"); }) .post(parse, function (req, res, next) { if (req.template.shareID) { diff --git a/app/dashboard/site/template/source-code.js b/app/dashboard/site/template/source-code.js index 9e622107680..ae9e6ca0cd4 100644 --- a/app/dashboard/site/template/source-code.js +++ b/app/dashboard/site/template/source-code.js @@ -10,7 +10,7 @@ SourceCode.param("viewSlug", require("./load/template-views")); SourceCode.param("viewSlug", require("./load/template-view")); SourceCode.use((req, res, next) => { - res.locals.breadcrumbs.add("Edit source", "/source-code"); + res.locals.breadcrumbs.add("Edit", "/source-code"); next(); }) diff --git a/app/views/css/buttons.css b/app/views/css/buttons.css index b7d9726b76a..1ff6d2d61f7 100644 --- a/app/views/css/buttons.css +++ b/app/views/css/buttons.css @@ -85,6 +85,11 @@ a.close-button:hover > span, margin-right: 4px; } +.template-button span { + vertical-align: middle;position:relative;top:-0.1em; + margin-right: 4px; +} + .template-button.right-aligned svg { margin-right: 0; margin-left: 4px; diff --git a/app/views/dashboard/site-preview.css b/app/views/dashboard/site-preview.css index c8d024880ac..0b27e2179a7 100644 --- a/app/views/dashboard/site-preview.css +++ b/app/views/dashboard/site-preview.css @@ -2,6 +2,7 @@ overflow: hidden; width: 100%; height: 0; + background: #fff; padding-bottom: 66.6666666667%; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 -1px 0 rgba(0, 0, 0, .11), diff --git a/app/views/dashboard/template/download.html b/app/views/dashboard/template/download.html new file mode 100644 index 00000000000..6c5d5e98aa9 --- /dev/null +++ b/app/views/dashboard/template/download.html @@ -0,0 +1,7 @@ +

Download

+ +

Download a zip file containing the template's files:

+ +

Download (.zip)

+ +

You can unzip the contents of this file and place it in your Templates folder to edit the template using your favorite text editor.

\ No newline at end of file diff --git a/app/views/dashboard/template/index.html b/app/views/dashboard/template/index.html index 63cd04a52f5..cec8c9a6f96 100644 --- a/app/views/dashboard/template/index.html +++ b/app/views/dashboard/template/index.html @@ -1 +1,101 @@ -Hey \ No newline at end of file +

Templates

+ +
+ + {{#currentTemplate}} + {{> template-grid-link}} + {{/currentTemplate}} + + {{#yourTemplates}} + {{> template-grid-link}} + {{/yourTemplates}} + + {{#blotTemplates}} + {{> template-grid-link}} + {{/blotTemplates}} +
+ + + \ No newline at end of file diff --git a/app/views/dashboard/template/settings.html b/app/views/dashboard/template/settings.html index ba4d27b926a..44f1dfe9862 100644 --- a/app/views/dashboard/template/settings.html +++ b/app/views/dashboard/template/settings.html @@ -34,11 +34,11 @@ - Edit source + Edit - - - Share + + + Download - diff --git a/app/views/dashboard/template/template-navbar-list.html b/app/views/dashboard/template/template-navbar-list.html index cc41a641a19..fd193f6e777 100644 --- a/app/views/dashboard/template/template-navbar-list.html +++ b/app/views/dashboard/template/template-navbar-list.html @@ -2,20 +2,7 @@ {{#currentTemplate}} {{> template-row}} {{/currentTemplate}} - -
- -
- -
- - - New template - - -
- - + {{#templatesInYourFolder.length}}

In folder


@@ -43,6 +30,18 @@

In folder

{{> template-row}} {{/pastTemplates}} +
+ +
+ +
+ + + New template + + +
+
Deleted templates
Disable template