From 17e2ea2cc5b603cdc52b490deb8f4fdfd768b35e Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 15 Jan 2019 09:54:05 +0530 Subject: [PATCH] fix: Cleanup Blog, List, Comment templates for Bootstrap 4 - Bootstrap 4 class migration --- frappe/hooks.py | 2 +- frappe/public/build.json | 9 +-- frappe/public/less/indicator.less | 1 - .../scss/{bootstrap-4.scss => website.scss} | 41 +++++-------- frappe/templates/autodoc/macros.html | 4 +- frappe/templates/includes/blog/blogger.html | 24 ++++---- .../templates/includes/comments/comment.html | 31 +++++----- .../templates/includes/comments/comments.html | 20 ++++--- frappe/templates/includes/footer/footer.html | 6 +- .../includes/footer/footer_items.html | 51 ++++++++-------- .../includes/footer/footer_powered.html | 2 +- frappe/templates/includes/list/filters.html | 4 +- frappe/templates/includes/list/list.html | 35 ++++++----- .../templates/includes/list/row_template.html | 4 +- frappe/templates/includes/macros.html | 19 ++++++ .../includes/oauth_confirmation.html | 4 +- .../templates/includes/search_template.html | 2 +- frappe/templates/includes/web_sidebar.html | 33 ++++------ frappe/templates/print_formats/standard.html | 2 +- .../print_formats/standard_macros.html | 4 +- .../blog_post/templates/blog_post.html | 60 +++++++++++-------- .../blog_post/templates/blog_post_row.html | 42 ++++++------- .../templates/help_article_row.html | 2 +- .../doctype/web_form/templates/web_form.html | 20 +++---- package.json | 2 +- yarn.lock | 8 +-- 26 files changed, 217 insertions(+), 215 deletions(-) rename frappe/public/scss/{bootstrap-4.scss => website.scss} (70%) create mode 100644 frappe/templates/includes/macros.html diff --git a/frappe/hooks.py b/frappe/hooks.py index 19503a1b2a..67ab997661 100644 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -48,7 +48,7 @@ web_include_js = [ ] web_include_css = [ - "assets/css/bootstrap-4-web.css" + "assets/css/frappe-web-b4.css" ] website_route_rules = [ diff --git a/frappe/public/build.json b/frappe/public/build.json index 26c4519b34..1d786ced7c 100755 --- a/frappe/public/build.json +++ b/frappe/public/build.json @@ -10,10 +10,11 @@ "public/less/chat.less", "public/less/form_grid.less", "node_modules/frappe-datatable/dist/frappe-datatable.css" - ], - "css/bootstrap-4-web.css": [ - "public/scss/bootstrap-4.scss" - ], + ], + "css/frappe-web-b4.css": [ + "public/scss/website.scss", + "public/less/indicator.less" + ], "concat:js/moment-bundle.min.js": [ "node_modules/moment/min/moment-with-locales.min.js", "node_modules/moment-timezone/builds/moment-timezone-with-data.min.js" diff --git a/frappe/public/less/indicator.less b/frappe/public/less/indicator.less index 3388a3a7e6..c703f42d83 100644 --- a/frappe/public/less/indicator.less +++ b/frappe/public/less/indicator.less @@ -3,7 +3,6 @@ .indicator, .indicator-right { background:none; - font-size:12px; vertical-align:middle; font-weight:bold; color:#6c7680; diff --git a/frappe/public/scss/bootstrap-4.scss b/frappe/public/scss/website.scss similarity index 70% rename from frappe/public/scss/bootstrap-4.scss rename to frappe/public/scss/website.scss index 96d94a1176..9b519ef1c3 100644 --- a/frappe/public/scss/bootstrap-4.scss +++ b/frappe/public/scss/website.scss @@ -44,7 +44,10 @@ body { } .breadcrumb { - font-size: 0.75rem; + font-size: 0.75rem; + padding-left: 0; + padding-right: 0; + background-color: white; } a.card { @@ -59,32 +62,6 @@ img { @extend .d-none; } -.video-background { - width: 100vw; - position: absolute; - top: 0; - left: 0; - z-index: -1; - - &-overlay { - position: absolute; - top: 0; - left: 0; - right: 0; - width: 100%; - height: 100%; - background-color: var(--dark); - opacity: 0.4; - } -} - -.hero-section { - background-image: url("/assets/rigpl_theme/images/hero-image.jpg"); - background-size: cover; - background-position-y: 15%; - background-position-y: 27%; -} - .btn-primary { color: $white; } @@ -93,6 +70,16 @@ img { text-decoration: underline; } +.web-footer { + padding: 5rem 0; + min-height: 140px; + border-top: 1px solid $border-color; +} + +.no-underline { + text-decoration: none !important; +} + // .standard-image { // width: 100%; // height: 0; diff --git a/frappe/templates/autodoc/macros.html b/frappe/templates/autodoc/macros.html index e77f83fb58..4e7c34be16 100644 --- a/frappe/templates/autodoc/macros.html +++ b/frappe/templates/autodoc/macros.html @@ -47,12 +47,12 @@ {%- endmacro %} {% macro version(name) %} - + Version {{ autodoc.get_version(name) }} {% endmacro %} {% macro source_link(app, file_path, tree=False) %} - Source {% endmacro %} diff --git a/frappe/templates/includes/blog/blogger.html b/frappe/templates/includes/blog/blogger.html index 20da365e16..71abcdf89f 100644 --- a/frappe/templates/includes/blog/blogger.html +++ b/frappe/templates/includes/blog/blogger.html @@ -1,13 +1,13 @@ -
-
-
- -
+{% from "frappe/templates/includes/macros.html" import square_image_with_fallback %} + +
+ {{ square_image_with_fallback(src=blogger_info.avatar, size='72px', alt=blogger_info.full_name, class='align-self-start mr-3') }} +
+
+ {{ blogger_info.full_name }} +
+ {% if blogger_info.bio %} +

{{ blogger_info.bio }}

+ {% endif %}
-
-

- {{ blogger_info.full_name }} -

-

{%if blogger_info.bio %}{{ blogger_info.bio }}{% endif %}

-
-
+
\ No newline at end of file diff --git a/frappe/templates/includes/comments/comment.html b/frappe/templates/includes/comments/comment.html index e0f923b2e0..6872c72625 100644 --- a/frappe/templates/includes/comments/comment.html +++ b/frappe/templates/includes/comments/comment.html @@ -1,15 +1,18 @@ -
-
-
- -
+{% from "frappe/templates/includes/macros.html" import square_image_with_fallback %} + +
+ {{ square_image_with_fallback(src=frappe.get_gravatar(comment.sender), size='48px', alt=comment.sender_full_name, class='align-self-start mr-3') }} +
+
+ + {{ comment.sender_full_name }} + + + {{ comment.creation | global_date_format }} + +
+
+ {{ comment.content | markdown }} +
-
-
{{ comment.sender_full_name }} - - {{ comment.creation|global_date_format }} - -
-
{{ comment.content|markdown }}
-
-
+
\ No newline at end of file diff --git a/frappe/templates/includes/comments/comments.html b/frappe/templates/includes/comments/comments.html index bde4972c5b..f521ec5f36 100644 --- a/frappe/templates/includes/comments/comments.html +++ b/frappe/templates/includes/comments/comments.html @@ -1,6 +1,6 @@ -
+
{% if comment_text %} -
{{ comment_text }}
+
{{ comment_text }}
{% endif %} {% if not comment_list %}
@@ -9,8 +9,10 @@ {% endif %}
- {% for comment in comment_list %} - {% include "templates/includes/comments/comment.html" %} + {% for comment in comment_list %} +
+ {% include "templates/includes/comments/comment.html" %} +
{% endfor %}
@@ -22,13 +24,13 @@
- {{ _("Add Comment") }} + {{ _("Add Comment") }}