105 lines
2.5 KiB
Markdown
105 lines
2.5 KiB
Markdown
---
|
|
title: 'New Entry'
|
|
template: post-form
|
|
access:
|
|
site.login: true
|
|
login_redirect_here: true
|
|
form:
|
|
name: new-entry
|
|
action: /post
|
|
enctype: multipart/form-data
|
|
fields:
|
|
-
|
|
name: title
|
|
label: Title
|
|
type: text
|
|
autofocus: true
|
|
validate:
|
|
required: true
|
|
|
|
-
|
|
name: date
|
|
label: Date & Time
|
|
type: datetime
|
|
default: now
|
|
format: 'Y-m-d H:i'
|
|
validate:
|
|
required: true
|
|
|
|
-
|
|
name: content
|
|
label: "What happened today?"
|
|
type: textarea
|
|
rows: 10
|
|
validate:
|
|
required: true
|
|
|
|
-
|
|
name: photos
|
|
label: Photos (max 4)
|
|
type: file
|
|
multiple: true
|
|
destination: 'user://pages/01.tracker'
|
|
limit: 4
|
|
accept:
|
|
- 'image/*'
|
|
|
|
-
|
|
name: lat
|
|
label: Latitude
|
|
type: text
|
|
placeholder: 'tap "Get Location" below'
|
|
|
|
-
|
|
name: lng
|
|
label: Longitude
|
|
type: text
|
|
placeholder: ''
|
|
|
|
-
|
|
name: location_city
|
|
label: City
|
|
type: text
|
|
placeholder: 'e.g. Kyoto'
|
|
|
|
-
|
|
name: location_country
|
|
label: Country
|
|
type: text
|
|
placeholder: 'e.g. Japan'
|
|
|
|
-
|
|
name: weather_temp_c
|
|
type: hidden
|
|
|
|
-
|
|
name: weather_desc
|
|
type: hidden
|
|
|
|
buttons:
|
|
-
|
|
type: submit
|
|
value: Post Entry
|
|
classes: btn-post
|
|
|
|
process:
|
|
-
|
|
add-page-by-form:
|
|
parent: '/tracker'
|
|
slug: "{{ form.value.date|date('Y-m-d') }}"
|
|
template: 'entry'
|
|
frontmatter:
|
|
title: '{{ form.value.title }}'
|
|
date: '{{ form.value.date }}'
|
|
lat: '{{ form.value.lat }}'
|
|
lng: '{{ form.value.lng }}'
|
|
location_city: '{{ form.value.location_city }}'
|
|
location_country: '{{ form.value.location_country }}'
|
|
weather_temp_c: '{{ form.value.weather_temp_c }}'
|
|
weather_desc: '{{ form.value.weather_desc }}'
|
|
-
|
|
message: 'Entry posted successfully!'
|
|
-
|
|
reset: true
|
|
---
|