Fix #5 Blueprints for admin and other fixes

pull/12/head
Karol Orzeł 7 years ago
parent 92e9e3faa6
commit 29487b7196
  1. 15
      blueprints.yaml
  2. 70
      blueprints/asset/file.yaml
  3. 33
      blueprints/blog.yaml
  4. 157
      blueprints/default.yaml
  5. 2
      blueprints/form.yaml
  6. 40
      blueprints/item.yaml
  7. 27
      blueprints/modular.yaml
  8. 7
      blueprints/modular/features.yaml
  9. 80
      templates/blog.html.twig

@ -11,18 +11,3 @@ demo: http://demo.getgrav.org/deliver-skeleton/
keywords: deliver, theme, modern, fast, responsive, html5, css3
bugs: https://github.com/getgrav/grav-theme-deliver/issues
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

@ -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

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

@ -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'

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

@ -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:

@ -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

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

@ -1,48 +1,46 @@
{% embed 'partials/base.html.twig' %}
{% set collection = page.collection() %}
{% set base_url = page.url %}
{% set feed_url = base_url %}
{% if base_url == '/' %}
{% set base_url = '' %}
{% endif %}
{% if base_url == base_url_relative %}
{% set feed_url = base_url~'/'~page.slug %}
{% endif %}
{% block content %}
{% set blog_image = page.media.images|first %}
{% 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;">
{% else %}
<div class="blog-header">
{% set collection = page.collection() %}
{% set base_url = page.url %}
{% set feed_url = base_url %}
{% if base_url == '/' %}
{% set base_url = '' %}
{% endif %}
{% if base_url == base_url_relative %}
{% set feed_url = base_url~'/'~page.slug %}
{% endif %}
{% block content %}
{% set blog_image = page.media.images|first %}
{% 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;">
{% else %}
<div class="blog-header">
{% endif %}
{{ page.content }}
{{ page.content }}
</div>
{% if config.plugins.breadcrumbs.enabled %}
{% include 'partials/breadcrumbs.html.twig' %}
{% endif %}
<div class="content-wrapper blog-content-list g-grid pure-g-r">
<div id="listing" class="g-block pure-u-2-3">
{% for child in collection %}
{% include 'partials/blog_item.html.twig' with {'page':child, 'truncate':true} %}
{% endfor %}
{% if config.plugins.pagination.enabled and collection.params.pagination %}
{% include 'partials/pagination.html.twig' with {'pagination':collection.params.pagination} %}
{% endif %}
</div>
{% if config.plugins.breadcrumbs.enabled %}
{% include 'partials/breadcrumbs.html.twig' %}
{% endif %}
<div class="content-wrapper blog-content-list g-grid pure-g-r">
<div id="listing" class="g-block pure-u-2-3">
{% for child in collection %}
{% include 'partials/blog_item.html.twig' with {'page':child, 'truncate':true} %}
{% endfor %}
{% if config.plugins.pagination.enabled and collection.params.pagination %}
{% include 'pagination.html.twig' with {'pagination':collection.params.pagination} %}
{% endif %}
</div>
<div id="sidebar" class="g-block size-1-3 pure-u-1-3">
{% include 'partials/sidebar.html.twig' %}
</div>
<div id="sidebar" class="g-block size-1-3 pure-u-1-3">
{% include 'partials/sidebar.html.twig' %}
</div>
</div>
{% endblock %}
{% endembed %}
{% endembed %}

Loading…
Cancel
Save