From e802363f6d75e6296baa91508664f0e16a1509fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Orze=C5=82?= Date: Thu, 15 Oct 2015 12:59:07 +0200 Subject: [PATCH] Cleaning up stuff and removing SimpleForm dependencies --- .dependencies | 24 ++++--- CHANGELOG.md | 7 +++ README.md | 2 + blueprints.yaml | 2 +- config/plugins/email.yaml | 13 ++++ config/plugins/simple_form.yaml | 43 ------------- pages/05.contact/contact.md | 18 ------ pages/05.contact/form.md | 63 +++++++++++++++++++ .../thankyou/formdata.md} | 0 9 files changed, 102 insertions(+), 70 deletions(-) create mode 100644 config/plugins/email.yaml delete mode 100644 config/plugins/simple_form.yaml delete mode 100755 pages/05.contact/contact.md create mode 100755 pages/05.contact/form.md rename pages/{thankyou/default.md => 05.contact/thankyou/formdata.md} (100%) diff --git a/.dependencies b/.dependencies index f247f0a..ff8f5bb 100644 --- a/.dependencies +++ b/.dependencies @@ -7,10 +7,14 @@ git: url: https://github.com/getgrav/grav-plugin-error path: user/plugins/error branch: master - simple_form: - url: https://github.com/nunopress/grav-plugin-simple_form - path: user/plugins/simple_form - branch: master + email: + url: https://github.com/getgrav/grav-plugin-email + path: user/plugins/email + branch: master + form: + url: https://github.com/getgrav/grav-plugin-form + path: user/plugins/form + branch: master twenty: url: https://github.com/getgrav/grav-theme-twenty path: user/themes/twenty @@ -20,10 +24,14 @@ links: src: grav-plugin-problems path: user/plugins/problems scm: github - simple_form: - src: grav-plugin-simple_form - path: user/plugins/simple_form - scm: github + email: + src: grav-plugin-email + path: user/plugins/email + scm: github + form: + src: grav-plugin-form + path: user/plugins/form + scm: github error: src: grav-plugin-error path: user/plugins/error diff --git a/CHANGELOG.md b/CHANGELOG.md index a52534e..cddbd11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# v1.0.3 +## 10/15/2015 + +1. [](#new) + * Removed SimpleForm plugin support due to constant compatibility problems + * Added support for Email and Form plugins + # v1.0.1 ## 09/21/2015 diff --git a/README.md b/README.md index d5b6073..78aee8d 100644 --- a/README.md +++ b/README.md @@ -40,3 +40,5 @@ This will install the Twenty theme into your `/user/themes` directory within Gra You can find more information bout this process, including manual installation instructions, by visiting the [project page for the stand-alone Grav theme](https://github.com/getgrav/grav-theme-twenty). +# Contact Form Configuration +For contact form configuration instructions please refer to [official documentatnion](http://learn.getgrav.org/advanced/contact-form). Make sure you installed Email and Form plugin though. diff --git a/blueprints.yaml b/blueprints.yaml index a896e8c..473b83d 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Twenty Site -version: 1.0.2 +version: 1.0.3 description: "Twenty is a free and responsive theme for **Grav**. It's a port of **Twenty** template by HTML5 UP." icon: group author: diff --git a/config/plugins/email.yaml b/config/plugins/email.yaml new file mode 100644 index 0000000..6638ebf --- /dev/null +++ b/config/plugins/email.yaml @@ -0,0 +1,13 @@ +enabled: true +from: your@email.here +to: your@email.here +mailer: + engine: mail + smtp: + server: localhost + port: 25 + encryption: none + user: '' + password: '' + sendmail: + bin: '/usr/sbin/sendmail' diff --git a/config/plugins/simple_form.yaml b/config/plugins/simple_form.yaml deleted file mode 100644 index f2726fd..0000000 --- a/config/plugins/simple_form.yaml +++ /dev/null @@ -1,43 +0,0 @@ -enabled: true - -fields: - name: - type: "text" - title: "Name" - default: "" - placeholder: "Name" - class: "" - required: true - - email: - type: "email" - title: "Email" - default: "" - placeholder: "Email" - class: "" - required: true - - subject: - type: "subject" - title: "Subject" - default: "" - placeholder: "Subject" - class: "" - required: true - - message: - type: "textarea" - title: "Message" - default: "" - placeholder: "Message" - class: "" - required: true - - submit: - type: "submit" - title: "Submit" - default: "" - class: "" - -messages: - success: "Your message has been sent." diff --git a/pages/05.contact/contact.md b/pages/05.contact/contact.md deleted file mode 100755 index fab9ce0..0000000 --- a/pages/05.contact/contact.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: Get In Touch -description: Use the form below to give /dev/null a piece of your mind. -body_class: contact -icon: envelope -simple_form: - token: "your token goes here" - template_file: "simple_form" - redirect_to: /thankyou -buttons: - - text: Take My Money - url: '#' - class: special - - text: LOL Wut - url: '#' -menu: after_article ---- -Proin a ullamcorper elit, et sagittis turpis integer ut fermentum. \ No newline at end of file diff --git a/pages/05.contact/form.md b/pages/05.contact/form.md new file mode 100755 index 0000000..4006b7e --- /dev/null +++ b/pages/05.contact/form.md @@ -0,0 +1,63 @@ +--- +title: Get In Touch +description: Use the form below to give /dev/null a piece of your mind. +body_class: contact +icon: envelope +form: + name: my-nice-form + fields: + - name: name + label: Name + framework_size: half + placeholder: Name + autofocus: on + autocomplete: on + type: text + validate: + required: true + + - name: email + framework_size: half + label: Email + placeholder: name@example.com + type: text + validate: + rule: email + required: true + + - name: message + framework_size: full + label: Message + size: long + placeholder: Your message here + type: textarea + validate: + required: true + + buttons: + - type: submit + value: Submit + + process: + - email: + from: "{{ config.plugins.email.from }}" + to: + - "{{ config.plugins.email.from }}" + - "{{ form.value.email }}" + subject: "[Feedback] {{ form.value.name|e }}" + body: "{% include 'forms/data.html.twig' %}" + - save: + fileprefix: feedback- + dateformat: Ymd-His-u + extension: txt + body: "{% include 'forms/data.txt.twig' %}" + - message: Thank you for your feedback! + - display: thankyou +buttons: + - text: Take My Money + url: '#' + class: special + - text: LOL Wut + url: '#' +menu: after_article +--- diff --git a/pages/thankyou/default.md b/pages/05.contact/thankyou/formdata.md similarity index 100% rename from pages/thankyou/default.md rename to pages/05.contact/thankyou/formdata.md