mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-05 14:38:26 +00:00
Merge branch 'master' of github.com:webnotes/erpnext into edge
Conflicts: hr/doctype/leave_application/locale/_messages_py.json hr/doctype/leave_block_list/locale/_messages_doc.json public/js/locale/_messages_js.json setup/doctype/email_digest/locale/_messages_doc.json setup/doctype/global_defaults/global_defaults.txt
This commit is contained in:
@@ -5,12 +5,18 @@
|
||||
div#body_div {
|
||||
padding: 0px;
|
||||
min-height: 400px;
|
||||
margin: 40px auto;
|
||||
margin: 40px auto 10px auto;
|
||||
box-shadow: 1px 1px 3px 3px #bbb;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: left;
|
||||
width: 720px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.navbar-inner {
|
||||
border: 0px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
@@ -33,9 +39,21 @@ p, li {
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
.web-footer-menu {
|
||||
margin-bottom: 7px;
|
||||
.social-icons {
|
||||
font-size: 120%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
.social-icons a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.social-icons a i:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.social-icons i {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
|
||||
.web-footer-menu ul {
|
||||
list-style: none;
|
||||
@@ -45,16 +63,8 @@ p, li {
|
||||
|
||||
.web-footer-menu ul li {
|
||||
display: inline;
|
||||
padding: 2px 15px;
|
||||
border-right: 1px solid #999;
|
||||
}
|
||||
|
||||
.web-footer-menu ul li:first-child {
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.web-footer-menu ul li:last-child {
|
||||
border-right: 0px solid #777 !important;
|
||||
padding: 2px 14px 2px 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.two-column {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-01-10 16:34:33",
|
||||
"creation": "2013-01-25 11:35:10",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-01-22 14:59:43",
|
||||
"modified": "2013-02-21 10:05:09",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -24,17 +24,14 @@
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"name": "__common__",
|
||||
"parent": "Website Settings",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"read": 1,
|
||||
"report": 0,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
"submit": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
@@ -128,6 +125,55 @@
|
||||
"label": "Footer Items",
|
||||
"options": "Top Bar Item"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "integrations",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Integrations"
|
||||
},
|
||||
{
|
||||
"description": "Add Google Analytics ID: eg. UA-89XXX57-1. Please search help on Google Analytics for more information.",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "google_analytics_id",
|
||||
"fieldtype": "Data",
|
||||
"label": "Google Analytics ID"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break_17",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "google_plus_one",
|
||||
"fieldtype": "Check",
|
||||
"label": "Google Plus One"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "facebook_share",
|
||||
"fieldtype": "Check",
|
||||
"label": "Facebook Share"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "linked_in_share",
|
||||
"fieldtype": "Check",
|
||||
"label": "Linked In Share"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "twitter_share",
|
||||
"fieldtype": "Check",
|
||||
"label": "Twitter Share"
|
||||
},
|
||||
{
|
||||
"description": "Tweet will be shared via your user account (if specified)",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "twitter_share_via",
|
||||
"fieldtype": "Data",
|
||||
"label": "Twitter Share via"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "misc_section",
|
||||
@@ -170,11 +216,25 @@
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"role": "System Manager"
|
||||
"permlevel": 0,
|
||||
"role": "System Manager",
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"role": "Website Manager"
|
||||
"permlevel": 0,
|
||||
"role": "Website Manager",
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"permlevel": 1,
|
||||
"role": "All"
|
||||
}
|
||||
]
|
||||
@@ -1,11 +1,11 @@
|
||||
# Copyright (c) 2012 Web Notes Technologies Pvt Ltd.
|
||||
# License: GNU General Public License (v3). For more information see license.txt
|
||||
|
||||
import os
|
||||
import webnotes
|
||||
import website.utils
|
||||
|
||||
def make():
|
||||
import os
|
||||
import webnotes
|
||||
import website.utils
|
||||
import startup.event_handlers
|
||||
|
||||
if not webnotes.conn:
|
||||
webnotes.connect()
|
||||
@@ -16,17 +16,45 @@ def make():
|
||||
if os.path.basename(os.path.abspath('.'))!='public':
|
||||
fname = os.path.join('public', fname)
|
||||
|
||||
if hasattr(startup.event_handlers, 'get_web_script'):
|
||||
with open(fname, 'w') as f:
|
||||
script = 'window.home_page = "%s";\n' % home_page
|
||||
script += startup.event_handlers.get_web_script()
|
||||
f.write(script)
|
||||
with open(fname, 'w') as f:
|
||||
f.write(get_web_script())
|
||||
|
||||
fname = 'css/wn-web.css'
|
||||
if os.path.basename(os.path.abspath('.'))!='public':
|
||||
fname = os.path.join('public', fname)
|
||||
|
||||
# style - wn.css
|
||||
if hasattr(startup.event_handlers, 'get_web_style'):
|
||||
with open(fname, 'w') as f:
|
||||
f.write(startup.event_handlers.get_web_style())
|
||||
with open(fname, 'w') as f:
|
||||
f.write(get_web_style())
|
||||
|
||||
def get_web_script():
|
||||
"""returns web startup script"""
|
||||
user_script = ""
|
||||
|
||||
ws = webnotes.doc("Website Settings", "Website Settings")
|
||||
|
||||
if ws.google_analytics_id:
|
||||
user_script += google_analytics_template % ws.google_analytics_id
|
||||
|
||||
user_script += (webnotes.conn.get_value('Website Script', None, 'javascript') or '')
|
||||
|
||||
return user_script
|
||||
|
||||
def get_web_style():
|
||||
"""returns web css"""
|
||||
return webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
|
||||
|
||||
google_analytics_template = """
|
||||
|
||||
// Google Analytics template
|
||||
|
||||
window._gaq = window._gaq || [];
|
||||
window._gaq.push(['_setAccount', '%s']);
|
||||
window._gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
"""
|
||||
@@ -3,7 +3,6 @@
|
||||
"",
|
||||
"Settings for Contact Us Page",
|
||||
"Cross Listing of Item in multiple groups",
|
||||
"A Product is shown on the website and is linked to an item.",
|
||||
"Product Category for website",
|
||||
"Slideshow like display for the website",
|
||||
"Page to show on the website",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{% block title %}{% endblock %}</title>
|
||||
<title>{{ title }}</title>
|
||||
<meta name="generator" content="wnframework">
|
||||
<script type="text/javascript" src="lib/js/lib/jquery/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="js/all-web.min.js"></script>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
style="margin-bottom: 0px;">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand" href="index.html">{{ brand_html }}</a>
|
||||
<a class="brand" href="/">{{ brand_html }}</a>
|
||||
<ul class="nav">
|
||||
{% for page in top_bar_items %}
|
||||
{% if not page.parent_label %}
|
||||
@@ -54,7 +54,7 @@
|
||||
</ul>
|
||||
<img src="lib/images/ui/spinner.gif" id="spinner"/>
|
||||
<ul class="nav pull-right">
|
||||
<li id="login-topbar-item"><a href="login.html">Login</a></li>
|
||||
<li id="login-topbar-item"><a href="login">Login</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,6 +67,29 @@
|
||||
</div>
|
||||
</div>
|
||||
<footer><div class="web-footer">
|
||||
{% if facebook_share or google_plus_one or twitter_share or linked_in_share %}
|
||||
<div class="social-icons" style="">
|
||||
<span style="font-size: 11px;">{{ share_text or "Share this page on: "}}</span>
|
||||
{% if google_plus_one %}
|
||||
<a href="https://plus.google.com/share?url={{ url }}"
|
||||
target="_blank"><i class="icon-google-plus"></i></a>
|
||||
{% endif %}
|
||||
{% if twitter_share %}
|
||||
<a href="https://twitter.com/intent/tweet?url={{ url }}&text={{ encoded_title }}"
|
||||
target="_blank" ><i class="icon-twitter"></i></a>
|
||||
{% endif %}
|
||||
{% if facebook_share %}
|
||||
<a href="https://www.facebook.com/sharer.php?u={{ url }}&t={{ encoded_title }}&via={{ twitter_share_via }}"
|
||||
target="_blank"><i class="icon-facebook"></i></a>
|
||||
{% endif %}
|
||||
{% if linked_in_share %}
|
||||
<a href="http://www.linkedin.com/shareArticle?mini=true&url={{ url }}&title={{ encoded_title }}"
|
||||
target="_blank"><i class="icon-linkedin"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<p style="float: right; clear: right;">
|
||||
<a style="font-size: 90%; color: #888;" href="attributions">ERPNext Powered</a></p>
|
||||
<div class="web-footer-menu"><ul>
|
||||
{% for item in footer_items %}
|
||||
<li><a href="{{ item.url }}" {{ item.target }}
|
||||
@@ -79,7 +102,6 @@
|
||||
{% if address %}
|
||||
{{ address }}
|
||||
{% endif %}
|
||||
<p><a style="font-size: 90%;" href="attributions.html">ERPNext Powered</a></p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{% extends "html/page.html" %}
|
||||
|
||||
{% block title %}{{ name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="layout-wrapper layout-wrapper-background">
|
||||
|
||||
@@ -8,14 +8,6 @@
|
||||
{% include "css/product_page.css" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}
|
||||
{% if item_name != name %}
|
||||
{{ item_name }} [{{ name }}]
|
||||
{% else %}
|
||||
{{ item_name or name }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="layout-wrapper layout-wrapper-background">
|
||||
<div class="web-content" id="content-product-{{ name }}">
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{% extends "html/outer.html" %}
|
||||
|
||||
{% set title="Not Found" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="content">
|
||||
<div class="layout-wrapper layout-main">
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
{% extends "html/page.html" %}
|
||||
|
||||
{% block title %}
|
||||
About Us
|
||||
{% endblock %}
|
||||
{% set title="About Us" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="layout-wrapper">
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}
|
||||
ERPNext - Web Based, Open Source ERP
|
||||
{% endblock %}
|
||||
{% set title="ERPNext - Web Based, Open Source ERP" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="layout-attributions">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
{% include "css/blog.css" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}Blog{% endblock %}
|
||||
{% set title="Blog" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="layout-wrapper layout-wrapper-background">
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
{% include "js/contact.js" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}
|
||||
Contact Us
|
||||
{% endblock %}
|
||||
{% set title="Contact Us" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="layout-wrapper">
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{% extends "html/outer.html" %}
|
||||
|
||||
{% set title="Error" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="content">
|
||||
<div class="layout-wrapper layout-main">
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
{% include "css/login.css" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}
|
||||
Login Page
|
||||
{% endblock %}
|
||||
{% set title="Login" %}
|
||||
|
||||
{% block body %}
|
||||
<div id='login_wrapper'>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "html/page.html" %}
|
||||
|
||||
{% block title %}Product Search{% endblock %}
|
||||
{% set title="Product Search" %}
|
||||
|
||||
{% block javascript %}
|
||||
{% include "js/product_list.js" %}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{% extends "html/outer.html" %}
|
||||
|
||||
{% set title="Unsubscribed" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="content">
|
||||
<div class="layout-wrapper layout-main">
|
||||
|
||||
@@ -162,7 +162,7 @@ def prepare_args(page_name):
|
||||
if not args:
|
||||
return False
|
||||
|
||||
args.update(get_outer_env())
|
||||
get_outer_env(page_name, args)
|
||||
|
||||
return args
|
||||
|
||||
@@ -203,7 +203,10 @@ def get_source_doc(page_name):
|
||||
|
||||
return None, None
|
||||
|
||||
def get_outer_env():
|
||||
def get_outer_env(page_name, args):
|
||||
from webnotes.utils import get_request_site_address
|
||||
from urllib import quote
|
||||
|
||||
all_top_items = webnotes.conn.sql("""\
|
||||
select * from `tabTop Bar Item`
|
||||
where parent='Website Settings' and parentfield='top_bar_items'
|
||||
@@ -242,16 +245,23 @@ def get_outer_env():
|
||||
'int':int
|
||||
})
|
||||
|
||||
args.update(ret)
|
||||
|
||||
settings = webnotes.doc("Website Settings", "Website Settings")
|
||||
for k in ["brand_html", "copyright", "address", "top_bar_background", "favicon"]:
|
||||
for k in ["brand_html", "copyright", "address", "top_bar_background", "favicon",
|
||||
"facebook_share", "google_plus_one", "twitter_share", "linked_in_share", "twitter_share_via"]:
|
||||
if k in settings.fields:
|
||||
ret[k] = settings.fields[k]
|
||||
args[k] = settings.fields.get(k)
|
||||
|
||||
if not ret.brand_html:
|
||||
ret.brand_html = "ERPNext"
|
||||
if not ret.top_bar_background:
|
||||
ret.top_bar_background = "Black"
|
||||
return ret
|
||||
if not args.brand_html:
|
||||
args.brand_html = "ERPNext"
|
||||
if not args.top_bar_background:
|
||||
args.top_bar_background = "Black"
|
||||
|
||||
args.url = quote(get_request_site_address(full_address=True), "")
|
||||
args.encoded_title = quote(args.title or "", "")
|
||||
|
||||
return args
|
||||
|
||||
def get_home_page():
|
||||
doc_name = webnotes.conn.get_value('Website Settings', None, 'home_page')
|
||||
|
||||
Reference in New Issue
Block a user