Commit 06dfef72 authored by Tobias Buckdahn's avatar Tobias Buckdahn

Added form to propose techniques, linked in menu

parent d3b19ce4
......@@ -135,7 +135,7 @@ media:
auto_metadata_exif: false
upload_limit: 52428800
session:
enabled: false
enabled: true
initialize: true
timeout: 1800
name: brickcamp
......
......@@ -5,14 +5,11 @@ icon: icon.png
content:
items:
# - '@page.descendants': '/techs/rotations'
# - '@page.descendants': '/techs/offsets'
# - '@page.descendants': '/techs/patterns'
# - '@page.descendants': '/techs/shapes'
- '@page.self': '/parts'
- '@page.descendants': '/techs/order-by/part-count'
# - '@page.descendants': '/techs/volume'
- '@page.descendants': '/techs/order-by/volume'
- '@page.descendants': '/techs/order-by/date'
- '@page.self': '/techs/add'
filter:
published: true
---
---
title: Propose Tech
icon: icon.png
image: image.png
form:
name: propose_tech
fields:
-
id: propose_tech_title
name: title
label: 'Title'
placeholder: 'Brick 2 x 4 with Magic'
type: text
validate:
required: true
-
id: propose_tech_email
name: email
type: honeypot
-
id: propose_tech_source
name: source
label: 'Source URL'
placeholder: 'https://example.com/all-about-magic-brick-2x4'
type: url
validate:
required: true
-
id: propose_tech_function
name: function
type: checkboxes
label: 'Function'
options:
rotation: 'Rotation'
offset: 'Offset'
pattern: 'Pattern'
shape: 'Shape'
else: 'Something else (see Comment)'
validate:
required: true
-
id: propose_tech_comment
name: comment
label: 'Comment'
placeholder: 'Add details or explanation if needed.'
type: textarea
-
name: image
label: 'Image'
type: file
multiple: true
accept:
- 'image/*'
destination: 'user/data/files'
avoid_overwriting: true
validate:
required: false
-
id: propose_tech_name
name: name
type: honeypot
-
id: propose_tech_person
name: person
label: 'E-Mail'
placeholder: 'me@example.com'
type: email
description: "Optional. If questions arise, help is needed ... or just to Thank You."
buttons:
-
type: submit
value: Submit Proposal
process:
- email:
subject: "[Brick.Camp] Proposed Tech named \"{{ form.value.title|e }}\""
body: "{% include 'partials/mail/add.html.twig' %}"
attachments:
- image
- message: "Thanks for your proposal!"
- reset: true
---
In case you find an interesting technique missing on this site, please submit it here.
\ No newline at end of file
This diff is collapsed.
---
title: Support Us
image: image.png
sitemap:
ignore: true
pageconfig:
parent: /tech/drafts
pagefrontmatter:
visible: true
status: draft
template: tech
form:
name: addpage-tech
fields:
-
name: title
label: Title
type: text
validate:
required: true
-
name: image
label: 'Image to upload'
type: file
multiple: false
accept:
- 'image/*'
destination: '@self'
-
name: taxonomy.part
label: 'Part IDs (comma separated)'
type: text
-
name: email
type: honeypot
buttons:
-
type: submit
value: Submit
process:
-
addpage: null
-
redirect: '@self'
---
\ No newline at end of file
---
title: Support
image: image.png
sitemap:
ignore: true
form:
name: addpage-tech
fields:
-
name: title
label: Title
type: text
validate:
required: true
-
name: image
label: 'Image to upload'
type: file
multiple: false
accept:
- 'image/*'
destination: '@self'
-
name: taxonomy.part
label: 'Parts'
description: 'Coma-seperated list of part IDs'
type: text
-
name: email
type: honeypot
buttons:
-
type: submit
value: Submit
process:
-
redirect: '@self'
---
\ No newline at end of file
......@@ -8,15 +8,17 @@ menu-items:
- '@page.self': '/techs/offsets'
- '@page.self': '/techs/patterns'
- '@page.self': '/techs/shapes'
- '@page.self': '/techs/add'
- '@page.self': '/techs/more'
order:
by: default
dir: asc
# custom:
# - techs/parts
# - techs/rotations
# - techs/patterns
# - techs/shapes
# - techs/offsets
custom:
- 'rotations'
- 'offsets'
- 'patterns'
- 'shapes'
- 'add'
- 'more'
url_taxonomy_filters: false
---
......@@ -33,7 +33,8 @@ html {
text-decoration: underline;
}
#header .navbar-nav .nav-item:last-child .d-none {
#header .navbar-nav .nav-item:nth-last-child(1) .d-none,
#header .navbar-nav .nav-item:nth-last-child(2) .d-none {
display: none !important;
}
......@@ -267,3 +268,10 @@ form .dropzone .dz-preview .dz-error-message::after{
.dz-success-mark svg #Oval-2{
fill:green;
}
.form-description {
display: block;
margin-top: .25rem;
font-size: 80%;
/* color: #6c757d; */
}
\ No newline at end of file
......@@ -10,7 +10,7 @@
<div class="container">
<a class="navbar-brand mr-1" href="{{ base_url == '' ? '/' : base_url }}" alt="{{ config.site.title }}">
<img src="{{ media['theme://images/logo_icon.svg'].url }}" class="img-fluid" title="Home" alt="{{ config.site.title }}" width="32px" height="32px">
<span class="brand-text">{{ config.site.title }}</span>
<span class="brand-text d-none d-lg-inline">{{ config.site.title }}</span>
</a>
<div class="collapse navbar-collapse">
......
Hi BrickCamp,<br/>
<br/>
I want to submit the following entry to the website: <br/>
<br/>
{% include 'partials/mail/data.html.twig' %}
<br/>
This message was sent via <a href="https://brick.camp/">a form on BrickCamp</a>.<br/>
<br/>
Greetings<br/>
The BrickCamp Form Bot
\ No newline at end of file
{% macro render_field(form, fields, scope) %}
{% import _self as self %}
{% for index, field in fields %}
{% set input = attribute(field, "input@") %}
{% if input is null or input == true %}
{% if form.value(scope ~ field.name) %}
{% block field %}
<div>
{% block field_label %}
<strong>{{ field.label|t|e }}</strong>:
{% endblock %}
{% block field_value %}
{% if field.type == 'checkboxes' %}
{% set use_keys = field.use is defined and field.use == 'keys' %}
{% for key,value in form.value(scope ~ field.name) %}
{% set index = (use_keys ? key : value) %}
{{ field.options[index]|e ~ ', ' }}
{% endfor %}
{% elseif field.type == 'checkbox' %}
{{ (form.value(scope ~ field.name) == 1) ? "PLUGIN_FORM.YES"|t|e : "PLUGIN_FORM.NO"|t|e }}
{% elseif field.type == 'select' %}
{{ field.options[form.value(scope ~ field.name)]|e }}
{% elseif field.type == 'file' %}
<em>See attachment</em>
{% else %}
{{ string(form.value(scope ~ field.name))|nl2br }}
{% endif %}
{% endblock %}
</div>
{% endblock %}
{% endif %}
{% else %}
{% if field.fields %}
{% set new_scope = field.nest_id ? scope ~ field.name ~ '.' : scope %}
{{ self.render_field(form, field.fields, new_scope) }}
{% endif %}
{% endif %}
{% endfor %}
{% endmacro %}
{% import _self as macro %}
{{ macro.render_field(form, form.fields, '') }}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment