@@ -1,3 +1,6 @@ | |||||
# -*- coding: utf-8 -*- | |||||
from __future__ import unicode_literals | |||||
source_link = "https://github.com/frappe/frappe" | source_link = "https://github.com/frappe/frappe" | ||||
docs_base_url = "https://frappe.github.io/frappe" | docs_base_url = "https://frappe.github.io/frappe" | ||||
@@ -25,7 +28,10 @@ ERP for managing small and medium sized businesses. | |||||
docs_version = "7.x.x" | docs_version = "7.x.x" | ||||
def get_context(context): | def get_context(context): | ||||
context.brand_html = ('<img class="brand-logo" src="'+context.docs_base_url | |||||
+'/assets/img/frappe-bird-white.png"> Frappé Framework</img>') | |||||
context.top_bar_items = [ | context.top_bar_items = [ | ||||
{"label": "Developer Tutorials", "url": context.docs_base_url + "/user", "right": 1}, | |||||
{"label": "API Documentation", "url": context.docs_base_url + "/current", "right": 1} | |||||
{"label": "Tutorials", "url": context.docs_base_url + "/user", "right": 1}, | |||||
{"label": "API", "url": context.docs_base_url + "/current", "right": 1}, | |||||
{"label": "Forum", "url": 'https://discuss.erpnext.com', "right": 1} | |||||
] | ] |
@@ -2,15 +2,6 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and contributors | # Copyright (c) 2015, Frappe Technologies and contributors | ||||
# For license information, please see license.txt | # For license information, please see license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | |||||
import json | |||||
from frappe import _ | |||||
from frappe.utils import get_url, call_hook_method | |||||
from urllib import urlencode | |||||
from frappe.integration_broker.doctype.integration_service.integration_service import IntegrationService | |||||
import urllib | |||||
""" | """ | ||||
# Integrating PayPal | # Integrating PayPal | ||||
@@ -63,9 +54,18 @@ More Details: | |||||
""" | """ | ||||
from __future__ import unicode_literals | |||||
import frappe | |||||
import json | |||||
from frappe import _ | |||||
from frappe.utils import get_url, call_hook_method | |||||
from urllib import urlencode | |||||
from frappe.integration_broker.doctype.integration_service.integration_service import IntegrationService | |||||
import urllib | |||||
class PayPalSettings(IntegrationService): | class PayPalSettings(IntegrationService): | ||||
service_name = "PayPal" | service_name = "PayPal" | ||||
supported_currencies = ["AUD", "BRL", "CAD", "CZK", "DKK", "EUR", "HKD", "HUF", "ILS", "JPY", "MYR", "MXN", | supported_currencies = ["AUD", "BRL", "CAD", "CZK", "DKK", "EUR", "HKD", "HUF", "ILS", "JPY", "MYR", "MXN", | ||||
"TWD", "NZD", "NOK", "PHP", "PLN", "GBP", "RUB", "SGD", "SEK", "CHF", "THB", "TRY", "USD"] | "TWD", "NZD", "NOK", "PHP", "PLN", "GBP", "RUB", "SGD", "SEK", "CHF", "THB", "TRY", "USD"] | ||||
@@ -79,19 +79,19 @@ class PayPalSettings(IntegrationService): | |||||
def validate(self): | def validate(self): | ||||
if not self.flags.ignore_mandatory: | if not self.flags.ignore_mandatory: | ||||
self.validate_paypal_credentails() | self.validate_paypal_credentails() | ||||
def on_update(self): | def on_update(self): | ||||
pass | pass | ||||
def enable(self): | def enable(self): | ||||
call_hook_method('payment_gateway_enabled', gateway=self.service_name) | call_hook_method('payment_gateway_enabled', gateway=self.service_name) | ||||
if not self.flags.ignore_mandatory: | if not self.flags.ignore_mandatory: | ||||
self.validate_paypal_credentails() | self.validate_paypal_credentails() | ||||
def validate_transaction_currency(self, currency): | def validate_transaction_currency(self, currency): | ||||
if currency not in self.supported_currencies: | if currency not in self.supported_currencies: | ||||
frappe.throw(_("Please select another payment method. {0} does not support transactions in currency '{1}'").format(self.service_name, currency)) | frappe.throw(_("Please select another payment method. {0} does not support transactions in currency '{1}'").format(self.service_name, currency)) | ||||
def get_paypal_params_and_url(self): | def get_paypal_params_and_url(self): | ||||
params = { | params = { | ||||
"USER": self.api_username, | "USER": self.api_username, | ||||
@@ -124,7 +124,7 @@ class PayPalSettings(IntegrationService): | |||||
except Exception: | except Exception: | ||||
frappe.throw(_("Invalid payment gateway credentials")) | frappe.throw(_("Invalid payment gateway credentials")) | ||||
def get_payment_url(self, **kwargs): | def get_payment_url(self, **kwargs): | ||||
setattr(self, "use_sandbox", kwargs.get("use_sandbox", 0)) | setattr(self, "use_sandbox", kwargs.get("use_sandbox", 0)) | ||||
@@ -169,13 +169,13 @@ def get_service_details(): | |||||
<div> | <div> | ||||
<p> Steps to configure Service | <p> Steps to configure Service | ||||
<ol> | <ol> | ||||
<li> Get PayPal api credentials from link: | |||||
<li> Get PayPal api credentials from link: | |||||
<a href="https://developer.paypal.com/docs/classic/api/apiCredentials/" target="_blank"> | <a href="https://developer.paypal.com/docs/classic/api/apiCredentials/" target="_blank"> | ||||
https://developer.paypal.com/docs/classic/api/apiCredentials/ | https://developer.paypal.com/docs/classic/api/apiCredentials/ | ||||
</a> | </a> | ||||
</li> | </li> | ||||
<br> | <br> | ||||
<li> Setup credentials on PayPal settings doctype. | |||||
<li> Setup credentials on PayPal settings doctype. | |||||
Click on | Click on | ||||
<button class="btn btn-default btn-xs disabled"> PayPal Settings </button> | <button class="btn btn-default btn-xs disabled"> PayPal Settings </button> | ||||
top right corner | top right corner | ||||
@@ -2,13 +2,6 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and contributors | # Copyright (c) 2015, Frappe Technologies and contributors | ||||
# For license information, please see license.txt | # For license information, please see license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | |||||
from frappe.utils import get_url, call_hook_method | |||||
from frappe import _ | |||||
import urllib, json | |||||
from frappe.integration_broker.doctype.integration_service.integration_service import IntegrationService | |||||
""" | """ | ||||
# Integrating RazorPay | # Integrating RazorPay | ||||
@@ -58,6 +51,13 @@ For razorpay payment status is Authorized | |||||
""" | """ | ||||
from __future__ import unicode_literals | |||||
import frappe | |||||
from frappe.utils import get_url, call_hook_method | |||||
from frappe import _ | |||||
import urllib, json | |||||
from frappe.integration_broker.doctype.integration_service.integration_service import IntegrationService | |||||
class RazorpaySettings(IntegrationService): | class RazorpaySettings(IntegrationService): | ||||
service_name = "Razorpay" | service_name = "Razorpay" | ||||
supported_currencies = ["INR"] | supported_currencies = ["INR"] | ||||
@@ -373,13 +373,22 @@ pre { | |||||
color: #4f4fa4; | color: #4f4fa4; | ||||
} | } | ||||
.navbar { | .navbar { | ||||
max-width: 870px; | |||||
background-color: #36414C !important; | |||||
margin-left: auto; | margin-left: auto; | ||||
margin-right: auto; | margin-right: auto; | ||||
} | } | ||||
.navbar .container { | |||||
max-width: 870px; | |||||
} | |||||
.navbar .brand-logo { | |||||
width: 30px; | |||||
margin-top: -4px; | |||||
margin-right: 7px; | |||||
} | |||||
.navbar a { | .navbar a { | ||||
font-size: 16px; | font-size: 16px; | ||||
font-weight: normal; | font-weight: normal; | ||||
color: #fff !important; | |||||
} | } | ||||
.navbar a.navbar-brand { | .navbar a.navbar-brand { | ||||
font-weight: bold; | font-weight: bold; | ||||
@@ -143,8 +143,8 @@ pre { | |||||
} | } | ||||
.navbar { | .navbar { | ||||
//background-color: @navbar-bg !important; | |||||
//background-color: @text-color !important; | |||||
// background-color: @navbar-bg !important; | |||||
background-color: @text-color !important; | |||||
// border-bottom: 3px solid @border-color !important; | // border-bottom: 3px solid @border-color !important; | ||||
// position: absolute; | // position: absolute; | ||||
// top:0; | // top:0; | ||||
@@ -153,14 +153,24 @@ pre { | |||||
// max-width:870px; | // max-width:870px; | ||||
// margin:0 auto; | // margin:0 auto; | ||||
max-width: 870px; | |||||
margin-left: auto; | margin-left: auto; | ||||
margin-right: auto; | margin-right: auto; | ||||
.container { | |||||
max-width: 870px; | |||||
} | |||||
.brand-logo { | |||||
width: 30px; | |||||
margin-top: -4px; | |||||
margin-right: 7px; | |||||
} | |||||
} | } | ||||
.navbar a { | .navbar a { | ||||
font-size: 16px; | font-size: 16px; | ||||
font-weight: normal; | font-weight: normal; | ||||
//color: #fff !important; | |||||
color: #fff !important; | |||||
&.navbar-brand{ | &.navbar-brand{ | ||||
font-weight: bold; | font-weight: bold; | ||||
} | } | ||||
@@ -84,7 +84,7 @@ | |||||
Forum</a> | Forum</a> | ||||
</li> | </li> | ||||
<li> | <li> | ||||
<a href="https://frappe.io/apps"> | |||||
<a href="https://community.erpnext.com/apps"> | |||||
Frappe Apps</a> | Frappe Apps</a> | ||||
</li> | </li> | ||||
</ul> | </ul> | ||||
@@ -5,6 +5,7 @@ Call from command line: | |||||
bench setup-docs app path | bench setup-docs app path | ||||
""" | """ | ||||
from __future__ import unicode_literals | |||||
import os, json, frappe, shutil, re | import os, json, frappe, shutil, re | ||||
from frappe.website.context import get_context | from frappe.website.context import get_context | ||||
@@ -38,6 +39,7 @@ class setup_docs(object): | |||||
"icon": self.hooks.get("app_icon")[0], | "icon": self.hooks.get("app_icon")[0], | ||||
"email": self.hooks.get("app_email")[0], | "email": self.hooks.get("app_email")[0], | ||||
"headline": self.docs_config.headline, | "headline": self.docs_config.headline, | ||||
"brand_html": getattr(self.docs_config, 'brand_html', None), | |||||
"sub_heading": self.docs_config.sub_heading, | "sub_heading": self.docs_config.sub_heading, | ||||
"source_link": self.docs_config.source_link, | "source_link": self.docs_config.source_link, | ||||
"hide_install": getattr(self.docs_config, "hide_install", False), | "hide_install": getattr(self.docs_config, "hide_install", False), | ||||
@@ -316,7 +318,8 @@ class setup_docs(object): | |||||
target_filename = os.path.join(self.target, target_path_fragment.strip('/')) | target_filename = os.path.join(self.target, target_path_fragment.strip('/')) | ||||
context.brand_html = context.top_bar_items = context.favicon = None | |||||
context.brand_html = context.app.brand_html | |||||
context.top_bar_items = context.favicon = None | |||||
self.docs_config.get_context(context) | self.docs_config.get_context(context) | ||||
@@ -341,9 +344,6 @@ class setup_docs(object): | |||||
if pages[parent_route]: | if pages[parent_route]: | ||||
context.parents = [pages[parent_route]] | context.parents = [pages[parent_route]] | ||||
if not context.favicon: | |||||
context.favicon = "/assets/img/favicon.ico" | |||||
context.only_static = True | context.only_static = True | ||||
context.base_template_path = "templates/autodoc/base_template.html" | context.base_template_path = "templates/autodoc/base_template.html" | ||||
@@ -413,6 +413,7 @@ class setup_docs(object): | |||||
# always overwrite octicons.css to fix the path | # always overwrite octicons.css to fix the path | ||||
"css/octicons/octicons.css": "css/octicons/octicons.css", | "css/octicons/octicons.css": "css/octicons/octicons.css", | ||||
"images/frappe-bird-grey.svg": "img/frappe-bird-grey.svg", | "images/frappe-bird-grey.svg": "img/frappe-bird-grey.svg", | ||||
"images/favicon.png": "img/favicon.png", | |||||
"images/background.png": "img/background.png", | "images/background.png": "img/background.png", | ||||
"images/smiley.png": "img/smiley.png", | "images/smiley.png": "img/smiley.png", | ||||
"images/up.png": "img/up.png" | "images/up.png": "img/up.png" | ||||
@@ -435,13 +436,13 @@ class setup_docs(object): | |||||
for path in files: | for path in files: | ||||
with open(path, "r") as css_file: | with open(path, "r") as css_file: | ||||
text = css_file.read() | |||||
text = unicode(css_file.read(), 'utf-8') | |||||
with open(path, "w") as css_file: | with open(path, "w") as css_file: | ||||
if "docs.css" in path: | if "docs.css" in path: | ||||
css_file.write(text.replace("/assets/img/", | css_file.write(text.replace("/assets/img/", | ||||
self.docs_base_url + '/assets/img/')) | |||||
self.docs_base_url + '/assets/img/').encode('utf-8')) | |||||
else: | else: | ||||
css_file.write(text.replace("/assets/frappe/", self.docs_base_url + '/assets/')) | |||||
css_file.write(text.replace("/assets/frappe/", self.docs_base_url + '/assets/').encode('utf-8')) | |||||
edit_link = ''' | edit_link = ''' | ||||