rebuilt create/edit page template, added navigation, turned on logout mehthod
parent
b75d045eec
commit
72c9b3f9e6
@ -0,0 +1,96 @@
|
|||||||
|
{% extends "dash/_frame.twig" %}
|
||||||
|
{#
|
||||||
|
if page is in 'edit' mode, set variables
|
||||||
|
if not, just make them empty
|
||||||
|
#}
|
||||||
|
{% if mode == 'edit' %}
|
||||||
|
{% set id = page['id'] %}
|
||||||
|
{% set uuid = page['uuid'] %}
|
||||||
|
{% set slug = page['slug'] %}
|
||||||
|
{% set feature = page['feature'] %}
|
||||||
|
{% set _title = page['title'] %}
|
||||||
|
{% set tags = page['tags'] %}
|
||||||
|
{% set content = page['content'] %}
|
||||||
|
{% else %}
|
||||||
|
{% set id = '' %}
|
||||||
|
{% set uuid = '' %}
|
||||||
|
{% set slug = '' %}
|
||||||
|
{% set feature = '' %}
|
||||||
|
{% set title = '' %}
|
||||||
|
{% set tags = '' %}
|
||||||
|
{% set content = '' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
{{ title }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block stylesheets %}
|
||||||
|
<link rel="stylesheet" type="text/css" href="/assets/css/dash.css?=adfdf">
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block mainContent %}
|
||||||
|
<div id="post-edit-index" data-index="{{ id }}" data-uuid="{{ uuid }}" data-slug="{{ slug }}">
|
||||||
|
<div id="post-edit-index-wrapper">
|
||||||
|
<div id="post-feature">
|
||||||
|
{% if page['feature'] == null %}
|
||||||
|
<div id="featured-image-drop">
|
||||||
|
DRAG AND DROP IMAGE OR
|
||||||
|
<label for="featured-image-upload"></label>
|
||||||
|
CLICK TO CHOSE
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div id="featured-new-image-btn">
|
||||||
|
<button id="new-feature-upload">
|
||||||
|
<svg id="new-feature-upload" viewbox="0 0 20 20" class="icons"><use xlink:href="/assets/images/global/sprite.svg#entypo-image-inverted"/></svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div id="featured-image-drop">
|
||||||
|
<img id="featured-image" src="{{ feature }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="post-header">
|
||||||
|
<div id="post-header-wrapper" class="columns">
|
||||||
|
<div id="post-title" class="column">
|
||||||
|
<label>TITLE</label>
|
||||||
|
<textarea id="post_title" type="text" name="post_title" class="post-edit" placeholder="TITLE">
|
||||||
|
{{- _title -}}
|
||||||
|
</textarea>
|
||||||
|
<label>CREATED</label>
|
||||||
|
<br/>
|
||||||
|
<span id="post-date" type="text">
|
||||||
|
PRETTY DATE
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div id="post-meta" class="column">
|
||||||
|
<label>TAGS</label>
|
||||||
|
<textarea id="post_tags" type="text" name="post_tags" class="form-control" placeholder="tags [comma seperated]">
|
||||||
|
{{- tags -}}
|
||||||
|
</textarea>
|
||||||
|
<label>OPTIONS</label>
|
||||||
|
{% apply spaceless %}
|
||||||
|
{{ include("dash/partials/options.twig") }}
|
||||||
|
{% endapply %}
|
||||||
|
<input id="featured-image-upload" type="file" name="featured-image-upload"/>
|
||||||
|
<input id="post-image-upload" type="file" name="post-image-upload"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="edit-post">
|
||||||
|
{% apply spaceless %}
|
||||||
|
{{ include("dash/partials/editor.twig") }}
|
||||||
|
{% endapply %}
|
||||||
|
<div id="edit-post-wrapper">
|
||||||
|
<pre><code id="edit-post-text" contenteditable="true"> {{- content -}}</code></pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block javascripts %}
|
||||||
|
<script src="/assets/scripts/dash.min.js" type="text/javascript"></script>
|
||||||
|
{% endblock %}
|
@ -0,0 +1,45 @@
|
|||||||
|
<div id="edit-control">
|
||||||
|
<button id="edit-bold" class="content-editor-btn-text editor-button" title="bold">B</button>
|
||||||
|
<button id="edit-italic" class="content-editor-btn-text editor-button" title="italic">I</button>
|
||||||
|
<button id="edit-strikethrough" class="content-editor-btn-text editor-button" title="strikethrough">D</button>
|
||||||
|
<button id="edit-link" class="content-editor-btn-icon editor-button" title="insert link">
|
||||||
|
<svg id="edit-link" viewbox="0 0 20 20" class="icons">
|
||||||
|
<use id="edit-link" xlink:href="/assets/images/global/sprite.svg#entypo-link"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<button id="edit-header1" class="content-editor-btn-text editor-button" title="header 1">H1</button>
|
||||||
|
<button id="edit-header2" class="content-editor-btn-text editor-button" title="header 2">H2</button>
|
||||||
|
<button id="edit-header3" class="content-editor-btn-text editor-button" title="header 3">H3</button>
|
||||||
|
<button id="edit-image" class="content-editor-btn-icon editor-button" title="insert image">
|
||||||
|
<svg id="edit-image" viewbox="0 0 20 20" class="icons">
|
||||||
|
<use id="edit-image" xlink:href="/assets/images/global/sprite.svg#entypo-image"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
{% if mode == "edit" %}
|
||||||
|
<button id="edit-update" class="post-sumbit-btn submit-start editor-button" data-action='blog-update' data-id=page.id type='submit' title="bold">
|
||||||
|
<svg id="submit-update" viewbox="0 0 20 20" class="icons">
|
||||||
|
<use id="submit-update" xlink:href="/assets/images/global/sprite.svg#entypo-save" data-action='blog-update' data-id="{{ page['uuid'] }}"/>
|
||||||
|
</svg>
|
||||||
|
<svg id="submit-good" class="icon-hide" viewbox="0 0 20 20" class="icons">
|
||||||
|
<use xlink:href="/assets/images/global/sprite.svg#entypo-thumbs-up"/>
|
||||||
|
</svg>
|
||||||
|
<svg id="submit-error" class="icon-hide" viewbox="0 0 20 20" class="icons">
|
||||||
|
<use xlink:href="/assets/images/global/sprite.svg#entypo-thumbs-down"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<button id="edit-delete" class="content-editor-btn-icon editor-button submit-delete" for="post-delete" title='delete post'>
|
||||||
|
<svg id="edit-delete" viewbox="0 0 20 20" class="icons">
|
||||||
|
<use id="edit-delete" xlink:href="/assets/images/global/sprite.svg#entypo-cross"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
{% else %}
|
||||||
|
<button id="edit-save" class="post-sumbit-btn submit-start editor-button" data-action='blog-add' type='submit'>
|
||||||
|
<svg id="submit-save" class="icon-hide" viewbox="0 0 20 20" class="icons">
|
||||||
|
<use id="submit-save" xlink:href="/assets/images/global/sprite.svg#entypo-plus"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
@ -0,0 +1,5 @@
|
|||||||
|
<div id="dash-menu">
|
||||||
|
<a id="settings" href="/dashboard/settings" >Settings</a> .
|
||||||
|
<a id="navigation" href="/dashboard/navigation" >Navigation</a> .
|
||||||
|
<a id="navigation" href="/dashboard/logout" >Log Out</a>
|
||||||
|
</div>
|
@ -0,0 +1,35 @@
|
|||||||
|
{% if page['menu'] %}
|
||||||
|
{% set menu = 'true' %}
|
||||||
|
{% else %}
|
||||||
|
{% set menu = 'false' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if page['featured'] %}
|
||||||
|
{% set featured = 'true' %}
|
||||||
|
{% else %}
|
||||||
|
{% set featured = 'false' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if page['published'] %}
|
||||||
|
{% set published = 'true' %}
|
||||||
|
{% else %}
|
||||||
|
{% set published = 'false' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div id="post-options">
|
||||||
|
<button id="option-menu-pin" class="option-inactive post-option-btn" data-active="{{ menu }}" title='Pin to Menu'>
|
||||||
|
<svg id="option-page-icon" viewbox="0 0 20 20" class="icons">
|
||||||
|
<use id="option-page-icon" xlink:href="/assets/images/global/sprite.svg#entypo-pin"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<button id="option-feature" class="option-inactive post-option-btn" data-active="{{ featured }}" title='Feature'>
|
||||||
|
<svg id="option-feature-icon" viewbox="0 0 20 20" class="icons">
|
||||||
|
<use id="option-feature-icon" xlink:href="/assets/images/global/sprite.svg#entypo-star"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<button id="option-published" class="option-inactive post-option-btn" data-active="{{ published }}" title='Published'>
|
||||||
|
<svg id="option-published-icon" viewbox="0 0 20 20" class="icons">
|
||||||
|
<use id="option-published-icon" xlink:href="/assets/images/global/sprite.svg#entypo-eye"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
Loading…
Reference in New Issue