diff --git a/frappe/config/docs.py b/frappe/config/docs.py index dd90839762..6ed99b4b01 100644 --- a/frappe/config/docs.py +++ b/frappe/config/docs.py @@ -1,3 +1,6 @@ +# -*- coding: utf-8 -*- + +from __future__ import unicode_literals source_link = "https://github.com/frappe/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" def get_context(context): + context.brand_html = (' Frappé Framework') 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} ] diff --git a/frappe/docs/assets/img/frappe-bird-white.png b/frappe/docs/assets/img/frappe-bird-white.png new file mode 100644 index 0000000000..540a1d0398 Binary files /dev/null and b/frappe/docs/assets/img/frappe-bird-white.png differ diff --git a/frappe/integrations/doctype/paypal_settings/paypal_settings.py b/frappe/integrations/doctype/paypal_settings/paypal_settings.py index 344cb43826..df6745ae9c 100644 --- a/frappe/integrations/doctype/paypal_settings/paypal_settings.py +++ b/frappe/integrations/doctype/paypal_settings/paypal_settings.py @@ -2,15 +2,6 @@ # Copyright (c) 2015, Frappe Technologies and contributors # 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 @@ -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): service_name = "PayPal" - + 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"] @@ -79,19 +79,19 @@ class PayPalSettings(IntegrationService): def validate(self): if not self.flags.ignore_mandatory: self.validate_paypal_credentails() - + def on_update(self): pass - + def enable(self): call_hook_method('payment_gateway_enabled', gateway=self.service_name) if not self.flags.ignore_mandatory: self.validate_paypal_credentails() - + def validate_transaction_currency(self, currency): 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)) - + def get_paypal_params_and_url(self): params = { "USER": self.api_username, @@ -124,7 +124,7 @@ class PayPalSettings(IntegrationService): except Exception: frappe.throw(_("Invalid payment gateway credentials")) - + def get_payment_url(self, **kwargs): setattr(self, "use_sandbox", kwargs.get("use_sandbox", 0)) @@ -169,13 +169,13 @@ def get_service_details():

Steps to configure Service

    -
  1. Get PayPal api credentials from link: +
  2. Get PayPal api credentials from link: https://developer.paypal.com/docs/classic/api/apiCredentials/

  3. -
  4. Setup credentials on PayPal settings doctype. +
  5. Setup credentials on PayPal settings doctype. Click on top right corner diff --git a/frappe/integrations/doctype/razorpay_settings/razorpay_settings.py b/frappe/integrations/doctype/razorpay_settings/razorpay_settings.py index 51a843ab6d..d44db1d995 100644 --- a/frappe/integrations/doctype/razorpay_settings/razorpay_settings.py +++ b/frappe/integrations/doctype/razorpay_settings/razorpay_settings.py @@ -2,13 +2,6 @@ # Copyright (c) 2015, Frappe Technologies and contributors # 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 @@ -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): service_name = "Razorpay" supported_currencies = ["INR"] diff --git a/frappe/public/css/docs.css b/frappe/public/css/docs.css index b143e3af85..5819bd6450 100644 --- a/frappe/public/css/docs.css +++ b/frappe/public/css/docs.css @@ -373,13 +373,22 @@ pre { color: #4f4fa4; } .navbar { - max-width: 870px; + background-color: #36414C !important; margin-left: auto; margin-right: auto; } +.navbar .container { + max-width: 870px; +} +.navbar .brand-logo { + width: 30px; + margin-top: -4px; + margin-right: 7px; +} .navbar a { font-size: 16px; font-weight: normal; + color: #fff !important; } .navbar a.navbar-brand { font-weight: bold; diff --git a/frappe/public/images/favicon.png b/frappe/public/images/favicon.png index 62ff240fb2..d66d3920f8 100644 Binary files a/frappe/public/images/favicon.png and b/frappe/public/images/favicon.png differ diff --git a/frappe/public/less/docs.less b/frappe/public/less/docs.less index a303f2b0f7..eef77ce552 100644 --- a/frappe/public/less/docs.less +++ b/frappe/public/less/docs.less @@ -143,8 +143,8 @@ pre { } .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; // position: absolute; // top:0; @@ -153,14 +153,24 @@ pre { // max-width:870px; // margin:0 auto; - max-width: 870px; margin-left: auto; margin-right: auto; + + .container { + max-width: 870px; + } + + .brand-logo { + width: 30px; + margin-top: -4px; + margin-right: 7px; + } } + .navbar a { font-size: 16px; font-weight: normal; - //color: #fff !important; + color: #fff !important; &.navbar-brand{ font-weight: bold; } diff --git a/frappe/templates/autodoc/base_template.html b/frappe/templates/autodoc/base_template.html index c04161dea6..1f39b13aa9 100644 --- a/frappe/templates/autodoc/base_template.html +++ b/frappe/templates/autodoc/base_template.html @@ -84,7 +84,7 @@ Forum
  6. - + Frappe Apps
  7. diff --git a/frappe/utils/setup_docs.py b/frappe/utils/setup_docs.py index 3992d30ea8..23b3a483fd 100644 --- a/frappe/utils/setup_docs.py +++ b/frappe/utils/setup_docs.py @@ -5,6 +5,7 @@ Call from command line: bench setup-docs app path """ +from __future__ import unicode_literals import os, json, frappe, shutil, re from frappe.website.context import get_context @@ -38,6 +39,7 @@ class setup_docs(object): "icon": self.hooks.get("app_icon")[0], "email": self.hooks.get("app_email")[0], "headline": self.docs_config.headline, + "brand_html": getattr(self.docs_config, 'brand_html', None), "sub_heading": self.docs_config.sub_heading, "source_link": self.docs_config.source_link, "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('/')) - 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) @@ -341,9 +344,6 @@ class setup_docs(object): if pages[parent_route]: context.parents = [pages[parent_route]] - if not context.favicon: - context.favicon = "/assets/img/favicon.ico" - context.only_static = True 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 "css/octicons/octicons.css": "css/octicons/octicons.css", "images/frappe-bird-grey.svg": "img/frappe-bird-grey.svg", + "images/favicon.png": "img/favicon.png", "images/background.png": "img/background.png", "images/smiley.png": "img/smiley.png", "images/up.png": "img/up.png" @@ -435,13 +436,13 @@ class setup_docs(object): for path in files: 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: if "docs.css" in path: css_file.write(text.replace("/assets/img/", - self.docs_base_url + '/assets/img/')) + self.docs_base_url + '/assets/img/').encode('utf-8')) 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 = '''