Commit graph

108 commits

Author SHA1 Message Date
Anand Chitipothu
96e98ac976 fix: return 404 from portal pages
- Fixed it by making the context.py handle the PageDoesNotExistError instead
  of DoesNotExistError

Fixes #12804
2021-04-06 11:52:06 +05:30
Faris Ansari
901cbc98f0 fix: Support calling get_context without a param 2021-03-18 14:14:34 +05:30
Rushabh Mehta
4c32dc3765 fix(tests): routing, permission and other fixes 2020-12-24 14:48:40 +05:30
Faris Ansari
2d1592f244 fix: Apply context from hooks at the end
Applying context from hooks at the end ensures that any context values
that are set from hooks are not overridden by the framework.
2020-10-05 19:46:35 +05:30
Faris Ansari
b9123593d8 fix: Set default twitter:card value to summary 2020-10-05 19:44:13 +05:30
Faris Ansari
f9ae45441c fix: Better metatags fallback
- Set metatag title from context.title
2020-10-05 19:43:22 +05:30
Faris Ansari
3b2819b0d8 fix: Set _context_dict always 2020-09-10 12:44:39 +00:00
Faris Ansari
d7a648f7bf fix: Show message for invalid _sidebar.json 2020-08-12 15:49:48 +05:30
Faris Ansari
9890ae6ff2 fix: Canonical URL
Must obey hostname value in config.
2020-07-16 13:23:16 +05:30
Chinmay D. Pai
1fbec2c8a6
fix: prevent rendering arbitrary html
prevents xss inside:

* awesome bar
* base template

the base template rendering issue causes site-wide xss, which can be
prevented by html-escaping the canonical url that is placed inside <head>

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-07-08 12:22:37 +05:30
Suraj Shetty
f52a0f863e
Merge branch 'develop' into website-fixes-2020-06-15 2020-06-16 10:57:11 +05:30
mergify[bot]
981eb23cf5
Merge pull request #10604 from CaseSolvedUK/canonical-10240
feat: Add canonical head link for SEO [v13]
2020-06-15 16:41:04 +00:00
Faris Ansari
a0860c1ac9 fix: Pass context so that it can be inspected in hook methods 2020-06-15 11:57:34 +05:30
Richard Case
afa82f6ce2 fix: metatags for social media SEO 2020-06-08 09:43:22 +00:00
Richard Case
abc3d96829 feat: Add canonical head link for SEO 2020-06-06 01:18:26 +00:00
Faris Ansari
5b1dacb6a1 feat: Set base_template for routes by regex
The default `base_template` for any web route was `templates/web.html`
by default. Now, you can set the `base_template` for routes by a regex
pattern via hooks (using the key `base_template_map`). For e.g, you can
set `templates/doc.html` for routes that match the pattern `docs.*`
2020-05-24 07:33:46 +05:30
Faris Ansari
9c7f01b59d fix: Style 2020-04-25 20:51:29 +05:30
Faris Ansari
caa068932c Merge branch 'develop' of https://github.com/frappe/frappe into page-builder-tailwind 2020-04-24 23:48:29 +05:30
Rushabh Mehta
982600fab0 fix(metatags): Better Meta Tags for Web Page and Web View 2020-04-19 22:02:03 +05:30
Faris Ansari
2431767fdf feat: Page Builder based on Tailwind
- Website Theme based on: Bootstrap 4, Tailwind
- Web Page: Page Builder
- Web Template: Create templates for web pages
- Added some common Web Templates
- Components: Standard components directly usable in Jinja
- Purge Tailwind Classes in Production
- PostCSS Config to support tailwind
2020-04-18 15:02:56 +05:30
Faris Ansari
6b282db8a0 fix: Web View Rendering
- Extract title from h1 if it doesn't contain jinja
- Add _context_dict to context to be able to inspect it in templates
- Add inspect macro to inspect any variable
- Better defaults for controller_row template

Co-Authored-By: Suraj Shetty <surajshetty3416@gmail.com>
2020-03-24 15:12:24 +05:30
Faris Ansari
15324e9fe3
fix: Add wrapper and block for overrides (#7889) 2019-07-15 16:55:25 +05:30
Faris Ansari
51ece4a920 feat: Flip sitemap switch
BREAKING CHANGE
A route is added to the sitemap if no_sitemap is not set.
This PR reverses this design. Because sitemap should contain publicly accessible pages and not utility pages.
Also, having lots of utility pages on sitemap does more harm than good.
2019-03-19 15:12:28 +05:30
Faris Ansari
abdca68068 fix: Route check 2019-02-26 23:19:19 +05:30
Faris Ansari
08f5174934 fix: Handle falsy homepage route 2019-02-21 14:01:23 +05:30
Faris Ansari
7bd2d9e9dc refactor: Website Meta Tag
Meta Tags are now decoupled from docs and are maintained per route basis
They will be tracked in Website Route Meta doctype where the `name`
is the `route`, it keeps track of a list of `key` and `value` in a table

Remove Meta Tag table from Web Page, add Set Meta Tag button helper.
2019-02-16 19:02:22 +05:30
Faris Ansari
8e55ecccb7 feat: Introduce Website Meta Tag
- Child Table to store meta tags with key and value
- Used in Web Page
- Remove redundant description field in Web Page
and patch it into Website Meta Tag
2019-02-14 00:49:10 +05:30
Faris Ansari
b6d5607ebc Merge branch 'develop' of https://github.com/frappe/frappe into website-bootstrap-4 2019-02-01 00:06:21 +05:30
Faris Ansari
6e3dca6563 fix: Add more meta tags from standard properties 2019-01-31 21:53:09 +05:30
Chinmay Pai
825b0120fa fix(login): redirect user from login page if already logged in (#6689)
* fix(login): redirect user from login page if already logged in

the user should not be able to access the login page if a user session already exists. closes #6500.

Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>

* fix(test-website): fix website test

what is the point in writing tests if they don't really work/function as intended?

Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>

* fix(regex): do not replace '\' in rules

that defeats the entire purpose of creating rules, wtf?

Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>

* fix(test_website): change user using set_user()

Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>

* redirect: prefix string with r to escape string literals

Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>
2018-12-31 13:46:55 +05:30
Prateeksha Singh
cfec4c13df [build-docs][context] look for _sidebar.json in parent directories (#5715)
* [build-docs][context] look for _sidebar.json in parent directories

* [build-docs] stop sidebar search at /www dir

* [website-render] use look_for_sidebar_json hook

* [website-sidebar] add hooks check
2018-07-02 21:51:02 +05:30
Rushabh Mehta
90188a99c5
[feature] add website_redirects hook (#5692) 2018-06-20 12:10:07 +05:30
Raghavendra Kamath
9c096a7496 Add image in metablock for blog (#5292) 2018-03-27 21:58:39 +05:30
Raghavendra Kamath
c561bf97d7 Add social media meta tags in blog post page (#4948)
* make changes in the blog templates

* Add the inline styles to website.less
I also tweaked the design a bit, added h1 for header and increased the spacing a bit.

* Remove inline style and add css to less file

also added some spacing to make the blogpost look good by default.

* make the headings bold

* Add meta tags for social media in blog post page
2018-01-31 18:35:48 +05:30
Rushabh Mehta
c519122929 [docs] Build docs in an app (#3796)
* [docs] to be rendered in website

* [docs] generating-docs.md

* [fix] codacy

* [docs] minor updates

* [fix] routing
2017-07-28 11:43:16 +05:30
Rushabh Mehta
a9a33434b6 [minor] website_sidebar will pull sidebar for any website page 2017-07-07 10:45:47 +05:30
Rushabh Mehta
f5b975305d [regional] ability to load country-wise js for forms 2017-06-27 17:30:50 +05:30
Rushabh Mehta
0fbaf93f89 [fix] set title_prefix if set in website settings, fixes frappe/erpnext#4848 (#3294)
* [fix] set title_prefix if set in website settings, fixes frappe/erpnext#4848

* Update context.py
2017-05-18 12:21:03 +05:30
Rushabh Mehta
28b38d45e7 [fix] patches 2017-03-08 11:57:33 +05:30
Rushabh Mehta
1e7229c45f [enhance] global search in website (#2810)
* [enhance] global search in website

* [fix] create table query

* [website] navbar search in header if set

* [minor] navbar_search in website settings
2017-03-07 16:37:50 +05:30
Rushabh Mehta
6dff729d88 [enhance] Web View settings in DocType (#2798)
* [enhance] add web view settings doctype

* [enhance] add web view settings doctype

* [fix] default for checks (?)

* [fix] framework json

* [fix] missing return

* [fix] hooks for website_generators
2017-03-05 11:12:32 +05:30
Rushabh Mehta
75855de5bb [minor] fixes to web form, listview, add portal items via hooks 2017-02-28 17:49:45 +05:30
Rushabh Mehta
c0ef741ce8 [hot] fix socket js 2017-02-24 16:01:30 +05:30
Rushabh Mehta
6bac96704c [minor] better title extraction for web page 2017-01-04 12:34:44 +05:30
Rushabh Mehta
a99575f6c6 [fix] [test] 2016-12-23 11:05:21 +05:30
Rushabh Mehta
6b637203f9 [minor] remove document_flow.py, use _sidebar.json and fix frappe/erpnext#7300 2016-12-23 09:42:15 +05:30
Faris Ansari
1fa7835661 [fix] redirect to 'Not Permitted' page (#2367) 2016-11-25 16:06:16 +05:30
Omar Ali
d100c7f0c5 excepting frappe.Redirect exception from exception handling (#2348) 2016-11-21 16:45:43 +05:30
Omar Ali
b30780dc2a fixing when webpage get_context has any exception (#2338) 2016-11-18 14:06:27 +05:30
Rushabh Mehta
e2778c350c [web-sidebar] fixes to permissions 2016-10-03 17:29:08 +05:30