瀏覽代碼

changes to get PHP contact form working, but call back to js not functional yet

tags/v1.0.0
Frank (inchiostro0 6 年之前
父節點
當前提交
780da44508

static/css/style.css → assets/css/style.css 查看文件


static/js/script.js → assets/js/script.js 查看文件

@@ -63,7 +63,8 @@ jQuery(function ($) {
/* Portfolio Filtering Hook
/* ========================================================================= */

var mixer = mixitup('.portfolio-items-wrapper');
if ($('.portfolio-items-wrapper').length)
mixitup('.portfolio-items-wrapper');

/* ========================================================================= */
/* Testimonial Carousel
@@ -95,7 +96,7 @@ jQuery(function ($) {
to determine if there was an error or not */
var error = false;
var name = $('#name').val();
var email_real = $('#email_real').val();
var email = $('#email').val();
var subject = $('#subject').val();
var message = $('#message').val();

@@ -118,9 +119,9 @@ jQuery(function ($) {
}
if (email.length == 0 || email.indexOf('@') == '-1') {
var error = true;
$('#email_real').css("border-color", "#D8000C");
$('#email').css("border-color", "#D8000C");
} else {
$('#email_real').css("border-color", "#666");
$('#email').css("border-color", "#666");
}
if (subject.length == 0) {
var error = true;
@@ -147,9 +148,7 @@ jQuery(function ($) {
/* using the jquery's post(ajax) function and a lifesaver
function serialize() which gets all the data from the form
we submit it to send_email.php */
$.post("php/mailer.php", $("#contact-form").serialize(), function (result) {
//log the result from the script
console.log(result);
$.post("sendmail.php", $("#contact-form").serialize(), function (result) {
//and after the ajax request ends we check the text returned
if (result == 'sent') {
//if the mail is sent remove the submit paragraph
@@ -307,4 +306,6 @@ function initialize() {
map.setMapTypeId('roadatlas');
}

google.maps.event.addDomListener(window, "load", initialize);
// Check init google maps only if "google" has been defined.
if("google" in window)
google.maps.event.addDomListener(window, "load", initialize);

+ 6
- 1
exampleSite/config.toml 查看文件

@@ -44,7 +44,12 @@ theme = "meghna-hugo"
[params]
home= "Home"
logo = "images/logo.png"
gmapAPI = "https://maps.googleapis.com/maps/api/js?key=AIzaSyBI14J_PNWVd-m0gnUBkjmhoQyNyd7nllA"
gmapAPI = "https://maps.googleapis.com/maps/api/js?key=AIzaSyCcABaamniA6OL5YvYSpB3pFMNrXwXnLwU&libraries=places"
# Meta data
description = "Airspace Hugo theme"
author = "Themefisher"
# Google Analitycs
googleAnalitycsID = "Your ID"
custom_css = ["css/custom.css"]

# Banner Section

+ 1
- 0
exampleSite/content/blog/are-you-doing-the-right-way.md 查看文件

@@ -3,6 +3,7 @@ title: "Are You Doing the Right Way"
date: 2018-09-12T14:51:12+06:00
author: John Doe
image: images/blog/blog-post-3.jpg
description : "This is meta description"
---

Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a.

+ 1
- 0
exampleSite/content/blog/simple-image-post.md 查看文件

@@ -3,6 +3,7 @@ title: "Simple Image Post"
date: 2018-09-12T12:52:36+06:00
image: images/blog/blog-post-1.jpg
author: Jamica Jock
description : "This is meta description"
---

Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a.

+ 1
- 0
exampleSite/content/blog/simple-post-title.md 查看文件

@@ -3,6 +3,7 @@ title: "Simple Post Title"
date: 2018-09-12T14:39:16+06:00
author: Somrat
image: images/blog/blog-post-2.jpg
description : "This is meta description"
---



+ 12
- 9
layouts/_default/baseof.html 查看文件

@@ -1,11 +1,14 @@
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
<body>
{{- partial "header.html" . -}}
<div id="content">
<html class="no-js" lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">
{{- partial "header.html" . -}}

{{"<!-- body start -->" | safeHTML}}

<body id="body" data-spy="scroll" data-target=".navbar" data-offset="50">
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>
</html>
</div>
{{- partial "footer.html" . -}}
</body>

</html>

+ 3
- 1
layouts/_default/list.html 查看文件

@@ -1,3 +1,5 @@
{{ define "main" }}

{{ partial "header.html" . }}

{{ partial "navigation.html" . }}
@@ -31,4 +33,4 @@
</section>
{{"<!-- /blog -->" | safeHTML}}

{{ partial "footer.html" . }}
{{ end }}

+ 3
- 1
layouts/_default/single.html 查看文件

@@ -1,3 +1,5 @@
{{ define "main" }}

{{ partial "header.html" . }}

{{ partial "navigation.html" . }}
@@ -22,4 +24,4 @@
</div>
</section>

{{ partial "footer.html" . }}
{{ end }}

+ 23
- 21
layouts/index.html 查看文件

@@ -1,31 +1,33 @@
{{ partial "header.html" . }}
{{ partial "preloader.html" . }}
{{ partial "hero-area.html" . }}
{{ define "main" }}

{{ partial "navigation.html" . }}
{{ partial "header.html" . }}
{{ partial "preloader.html" . }}
{{ partial "hero-area.html" . }}

{{ partial "about.html" . }}
{{ partial "navigation.html" . }}

{{ partial "cta.html" . }}
{{ partial "about.html" . }}

{{ partial "service.html" . }}
{{ partial "skill.html" . }}
{{ partial "cta.html" . }}

{{ partial "portfolio.html" . }}
{{ partial "service.html" . }}
{{ partial "skill.html" . }}

{{ partial "counter.html" . }}
{{ partial "portfolio.html" . }}

{{ partial "team.html" . }}
{{ partial "pricing.html" . }}
{{ partial "counter.html" . }}

{{ partial "testimonial.html" . }}
{{ partial "team.html" . }}
{{ partial "pricing.html" . }}

{{ partial "blog.html" . }}
{{ partial "contact.html" . }}
{{ partial "testimonial.html" . }}

{{ partial "footer.html" . }}
{{ partial "blog.html" . }}
{{ partial "contact.html" . }}

{{ end }}

+ 11
- 1
layouts/partials/footer.html 查看文件

@@ -53,7 +53,17 @@
{{"<!-- wow.min Script -->" | safeHTML}}
<script type="text/javascript" src="{{ "plugins/wow/dist/wow.min.js" | absURL}}"></script>
{{"<!-- Custom js -->" | safeHTML}}
<script type="text/javascript" src="{{ "js/script.js" | absURL}}"></script>
{{ $script := resources.Get "js/script.js" | minify}}
<script src="{{ $script.Permalink }}"></script>
{{ "<!-- google analitycs -->" | safeHTML }}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{ .Site.Params.googleAnalitycsID }}', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>

+ 0
- 0
layouts/partials/head.html 查看文件


+ 7
- 6
layouts/partials/header.html 查看文件

@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html class="no-js" lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}">
<meta name="author" content="{{ $.Site.Params.author }}">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
{{ "<!-- Mobile Specific Meta -->" | safeHTML }}
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ .Hugo.Generator }}
@@ -27,8 +27,9 @@
<link rel="stylesheet" href="{{"plugins/slick-carousel/slick/slick.css"|absURL}}">
<link rel="stylesheet" href="{{"plugins/slick-carousel/slick/slick-theme.css"|absURL}}">
{{"<!-- Main Stylesheet -->"|safeHTML}}
<link rel="stylesheet" href="{{"css/style.css"|absURL}}">
{{ "<!-- Custom CSS -->" | safeHTML }}
{{ $styles := resources.Get "css/style.css" | minify}}
<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen">
{{ range .Site.Params.custom_css }}
<link rel="stylesheet" href="{{ . | absURL }}">
{{ end }}

+ 1
- 1
theme.toml 查看文件

@@ -3,7 +3,7 @@ license = "CC BY 3.0"
licenselink = "https://creativecommons.org/licenses/by/3.0/"
description = "Hugo port of the Themefisher’s Meghna Template"
homepage = "https://github.com/themefisher/meghna-hugo"
tags = ['landing-page', 'business', 'agency-template', 'themefisher', 'hugo-theme', 'hugo-templates', 'bootstrap', 'blog', 'responsive', 'portfolio', 'single-page', 'dark', 'clean', 'simple', 'company', 'creative', 'contact-form', 'custom-themes', 'mobile']
tags = ['landing-page', 'google-analytics', 'fast', 'modern', 'minimal', 'minimalistic', 'business', 'agency-template', 'themefisher', 'hugo-theme', 'hugo-templates', 'bootstrap', 'blog', 'responsive', 'portfolio', 'single-page', 'dark', 'clean', 'simple', 'company', 'creative', 'contact-form', 'custom-themes', 'mobile']
features = ['bootstrap','responsive']
min_version = "0.48"


Loading…
取消
儲存