mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 20:59:11 +00:00
added contact us
This commit is contained in:
37
website/templates/js/contact.js
Normal file
37
website/templates/js/contact.js
Normal file
@@ -0,0 +1,37 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
$('.btn-send').click(function() {
|
||||
var email = $('[name="email"]').val();
|
||||
var message = $('[name="message"]').val();
|
||||
|
||||
if(!(email && message)) {
|
||||
msgprint("Please enter both your email and message so that we \
|
||||
can get back to you. Thanks!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!valid_email(email)) {
|
||||
msgprint("You seem to have written your name instead of your email. \
|
||||
Please enter a valid email address so that we can get back.");
|
||||
$('[name="email"]').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#contact-alert").toggle(false);
|
||||
erpnext.send_message({
|
||||
subject: $('[name="subject"]').val(),
|
||||
sender: email,
|
||||
message: message,
|
||||
callback: function(r) {
|
||||
msgprint(r.message);
|
||||
$(':input').val('');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var msgprint = function(txt) {
|
||||
if(txt) $("#contact-alert").html(txt).toggle(true);
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
{% extends "html/page.html" %}
|
||||
|
||||
{% block title %}
|
||||
About Us
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="layout-wrapper">
|
||||
<div class="layout-main">
|
||||
{% if obj.doc.company_introduction %}
|
||||
{{ obj.doc.company_introduction }}
|
||||
{% endif %}
|
||||
{{ obj.doc.company_introduction or "Some Introduction about your company that you would like your website visitor to know. More people than you think will read your About page. People always like to know who the are doing business with. Be authentic and avoid using jargon like 'value added services' etc. Be sure to update your company history and list of key team members in Website > About Us Settings" }}
|
||||
{% if obj.doclist.get({"doctype":"Company History"}) %}
|
||||
<h3>{{ obj.doc.company_history_heading or "Company History" }}</h3>
|
||||
<table class="table table-bordered" style="width: 100%; table-layout: fixed">
|
||||
@@ -24,11 +26,11 @@
|
||||
<table class="table table-bordered" style="width: 100%; table-layout: fixed">
|
||||
<tbody>
|
||||
{% for d in obj.doclist.get({"doctype":"Employee"}) %}
|
||||
<tr>
|
||||
<tr itemscope itemtype="http://schema.org/Person">
|
||||
<td style="text-align:right; width: 30%;">
|
||||
<img src="{{ d.image }}" style=""></td>
|
||||
<td><h4>{{ d.employee_name }}</h4>
|
||||
{{ d.bio }}</td>
|
||||
<img src="{{ d.image }}" style="" itemprop="image"></td>
|
||||
<td><h4 itemprop="name">{{ d.employee_name }}</h4>
|
||||
<div itemprop="description">{{ d.bio }}</div></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
56
website/templates/pages/contact.html
Normal file
56
website/templates/pages/contact.html
Normal file
@@ -0,0 +1,56 @@
|
||||
{% extends "html/page.html" %}
|
||||
|
||||
{% block javascript %}
|
||||
{% include "js/contact.js" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}
|
||||
Contact Us
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="layout-wrapper">
|
||||
<div class="layout-main">
|
||||
<div class="web-form span5 pull-left">
|
||||
{{ obj.doc.introduction or "<h3>Contact Us</h3>"}}
|
||||
<div class="span4" style="margin-left:0px;">
|
||||
<p id="contact-alert" class="alert"
|
||||
style="display: none;"> </p>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<p><select class="span4" name="subject">
|
||||
{% for option in obj.doc.query_options %}
|
||||
<option value="{{ option }}">{{ option }}</option>
|
||||
{% endfor %}
|
||||
</select></p>
|
||||
<p><input class="span4" name="email" type="text" placeholder="Your Email Address" /></p>
|
||||
<p><textarea class="span4" rows="10" name="message"></textarea></p>
|
||||
<p><button class="btn btn-primary btn-send">Send</button></p>
|
||||
</div>
|
||||
{% if obj.doc.address %}
|
||||
<div class="pull-right span3" itemscope itemtype="http://schema.org/PostalAddress">
|
||||
<h4>{{ obj.address.address_title }}</h4>
|
||||
{% if obj.address.address_line1 %}
|
||||
<p itemprop="streetAddress">{{ obj.address.address_line1 }}</p>
|
||||
{% endif %}
|
||||
{% if obj.address.address_line2 %}
|
||||
<p itemprop="streetAddress">{{ obj.address.address_line2 }}</p>
|
||||
{% endif %}
|
||||
{% if obj.address.city %}
|
||||
<p itemprop="addressLocality">{{ obj.address.city }}</p>
|
||||
{% endif %}
|
||||
{% if obj.address.state %}
|
||||
<p itemprop="addressRegion">{{ obj.address.state }}</p>
|
||||
{% endif %}
|
||||
{% if obj.address.pincode %}
|
||||
<p itemprop="postalCode">{{ obj.address.pincode }}</p>
|
||||
{% endif %}
|
||||
{% if obj.address.country %}
|
||||
<p itemprop="addressCountry">{{ obj.address.country }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user