Fix #5 Blueprints for admin and other fixes

This commit is contained in:
Karol Orzeł 2015-10-09 10:52:00 +02:00
parent 92e9e3faa6
commit 29487b7196
9 changed files with 58 additions and 369 deletions

View file

@ -11,18 +11,3 @@ demo: http://demo.getgrav.org/deliver-skeleton/
keywords: deliver, theme, modern, fast, responsive, html5, css3 keywords: deliver, theme, modern, fast, responsive, html5, css3
bugs: https://github.com/getgrav/grav-theme-deliver/issues bugs: https://github.com/getgrav/grav-theme-deliver/issues
license: MIT license: MIT
form:
validation: loose
fields:
dropdown.enabled:
type: toggle
label: Dropdown in navbar
highlight: 1
default: 0
options:
1: Enabled
0: Disabled
validate:
type: bool

View file

@ -1,70 +0,0 @@
media:
video:
mp4: video/mp4
mov: video/quicktime
m4v: video/x-m4v
swf: video/x-flv
image:
jpg: image/jpeg
jpeg: image/jpeg
png: image/png
gif: image/gif
file:
txt: text/plain
doc: application/msword
html: text/html
pdf: application/pdf
zip: application/zip
gz: application/gzip
form:
key: filename
fields:
upload:
type: upload
label: Upload
allow:
@media.*.keys
accept:
@media.*.values
filename:
type: text
label: Filename
type:
type: hidden
default: video
name:
type: unset
description:
type: textarea
label: Description
url:
type: unset
path:
type: unset
thumb:
type: unset
width:
type: text
label: Width
height:
type: text
label: Height
mime:
type: hidden
default: 'application/octet-stream'
modified:
type: unset

View file

@ -1,8 +1,19 @@
title: Blog title: Blog
@extends: default @extends:
type: default
context: blueprints://pages
child_type: item child_type: item
title: Default
rules:
slug:
pattern: "[a-z][a-z0-9_\-]+"
min: 2
max: 80
form: form:
fields: fields:
tabs: tabs:
@ -10,6 +21,12 @@ form:
active: 1 active: 1
fields: fields:
advanced:
fields:
overrides:
fields:
header.child_type:
default: item
blog: blog:
type: tab type: tab
title: Blog List title: Blog List
@ -28,9 +45,8 @@ form:
default: 5 default: 5
validate: validate:
required: true required: true
pattern: "[1-9][0-9]*"
validate:
type: int type: int
min: 1
header.content.order.by: header.content.order.by:
type: select type: select
@ -52,16 +68,9 @@ form:
header.content.pagination: header.content.pagination:
type: toggle type: toggle
label: Order label: Pagination
highlight: 1
default: 1 default: 1
options: options:
1: Enabled 1: Enabled
0: Disabled 0: Disabled
header.pagination:
type: hidden
default: true
header.blog_url:
type: hidden
default: ''

View file

@ -1,157 +0,0 @@
title: Default
rules:
slug:
pattern: "[a-z][a-z0-9_\-]+"
min: 2
max: 80
form:
fields:
type:
type: hidden
label: Page Type
default: default
tabs:
type: tabs
active: 1
fields:
content:
type: tab
title: Content
fields:
route:
type: select
label: Parent
@data-options: '\Grav\Common\Page\Pages::parents'
@data-default: '\Grav\Plugin\admin::route'
options:
'': '- Root -'
order:
type: text
label: Ordering
validate:
type: int
min: 0
folder:
type: text
label: Folder
validate:
type: slug
# required: true
header.title:
type: text
label: Title
validate:
required: true
content:
type: textarea
label: Content
header.process:
type: checkboxes
label: Process
default: [markdown: true, twig: true]
options:
markdown: Markdown
twig: Twig
use: keys
meta:
type: tab
title: Meta
fields:
header.description:
type: textarea
label: Description
validate:
max: 120
header.keywords:
type: text
label: Keywords
validate:
max: 120
header.robots:
type: checkboxes
label: Robots
options:
noindex: No index
nofollow: No follow
use: keys
overrides:
type: tab
title: Overrides
fields:
header.menu:
type: text
label: Menu
header.slug:
type: text
label: Alias
validate:
rule: slug
header.cache_enable:
type: toggle
label: Caching
highlight: 1
options:
'': Global
1: Enabled
0: Disabled
validate:
type: bool
header.routable:
type: toggle
label: Access by URL
highlight: 1
default: ''
options:
'': Global
1: Enabled
0: Disabled
validate:
type: bool
header.child_type:
type: select
label: Default Child Type
default: default
@data-options: '\Grav\Common\Page\Pages::types'
header.order_by:
type: hidden
header.order_manual:
type: hidden
validate:
type: commalist
media:
type: tab
title: Media
fields:
files:
type: spacer
title: Files
media:
type: list
add: Add file
@import: 'medium/file'

View file

@ -1,2 +0,0 @@
title: Nopad
@extends: default

View file

@ -1,40 +0,0 @@
title: Item
@extends: default
form:
fields:
tabs:
fields:
blog:
type: tab
title: Blog Item
fields:
header.date:
type: datetime
label: Date
header.taxonomy.category:
type: text
label: Category
default: blog
header.taxonomy.tag:
type: checkboxes
label: Tags
options:
demo: demo
grav: grav
matias: matias
apple: apple
sample: sample
header.username:
type: text
label: Author
header.blog_url:
type: text
label: Blog URL
default:

View file

@ -1,27 +0,0 @@
title: Modular
@extends: default
form:
fields:
tabs:
type: tabs
active: 1
fields:
content:
fields:
header.modular:
type: select
label: 'Modular page'
default: 0
options:
0: 'False'
1: 'True'
validate:
type: bool
header.order_manual:
type: text
label: Manual ordering
validate:
type: commalist

View file

@ -1,7 +0,0 @@
title: Features
@extends: default
form:
fields:
tabs:
type: tabs

View file

@ -1,22 +1,22 @@
{% embed 'partials/base.html.twig' %} {% embed 'partials/base.html.twig' %}
{% set collection = page.collection() %} {% set collection = page.collection() %}
{% set base_url = page.url %} {% set base_url = page.url %}
{% set feed_url = base_url %} {% set feed_url = base_url %}
{% if base_url == '/' %} {% if base_url == '/' %}
{% set base_url = '' %} {% set base_url = '' %}
{% endif %} {% endif %}
{% if base_url == base_url_relative %} {% if base_url == base_url_relative %}
{% set feed_url = base_url~'/'~page.slug %} {% set feed_url = base_url~'/'~page.slug %}
{% endif %} {% endif %}
{% block content %} {% block content %}
{% set blog_image = page.media.images|first %} {% set blog_image = page.media.images|first %}
{% if blog_image %} {% if blog_image %}
<div class="flush-top blog-header blog-header-image" style="background: {{ page.header.bg_color }} url({{ blog_image.url }}) no-repeat right;"> <div class="flush-top blog-header blog-header-image" style="background: {{ page.header.bg_color }} url({{ blog_image.url }}) no-repeat right;">
{% else %} {% else %}
<div class="blog-header"> <div class="blog-header">
{% endif %} {% endif %}
@ -34,7 +34,7 @@
{% endfor %} {% endfor %}
{% if config.plugins.pagination.enabled and collection.params.pagination %} {% if config.plugins.pagination.enabled and collection.params.pagination %}
{% include 'pagination.html.twig' with {'pagination':collection.params.pagination} %} {% include 'partials/pagination.html.twig' with {'pagination':collection.params.pagination} %}
{% endif %} {% endif %}
</div> </div>
<div id="sidebar" class="g-block size-1-3 pure-u-1-3"> <div id="sidebar" class="g-block size-1-3 pure-u-1-3">
@ -43,6 +43,4 @@
</div> </div>
{% endblock %} {% endblock %}
{% endembed %} {% endembed %}