Skip to content

Commit

Permalink
feat: better styles in customer portal
Browse files Browse the repository at this point in the history
  • Loading branch information
agritheory committed Feb 26, 2024
1 parent c383888 commit 2a20610
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
42 changes: 42 additions & 0 deletions electronic_payments/www/me.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.footer-logo-extension {
display: none;
}

.footer-powered {
display: none;
}

.portal-widget {
/* position: absolute; */
top: 5px;
right: 5px;
bottom: 5px;
left: 5px;
border-radius: 5px;
box-shadow: 0px 1px 2px rgba(25, 39, 52, 0.05), 0px 0px 4px rgba(25, 39, 52, 0.1);
padding: 15px;
margin: 5px;
min-height: 60px;
}

.portal-widget-col {
width: auto;
min-width: 40%;
}

a.portal-widget-col {
position: relative;
text-decoration: none;
}

.portal-widget-col h5 {
position: absolute;
top: 23px;
margin-left: 5px;
display: inline;
}

.widget-row {
margin-top: 10px;
margin-bottom: 20px;
}
29 changes: 29 additions & 0 deletions electronic_payments/www/me.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{% extends "templates/web.html" %}

{% block title %}{{ _("My Account") }}{% endblock %}
{% block header %}<h1>{{ _("My Account") }}</h1>{% endblock %}

{% block page_content %}

<div class="row widget-row">

{% for item in sidebar_items -%}

<a href="{{ item.route }}" class="col-sm-4 portal-widget-col">
<div class="portal-widget">
<div class="whitespace-nowrap">
<span class="indicator-pill whitespace-nowrap green">
</span>
<h5>{{ _(item.title or item.label) }}</h5>
</div>
</div>
</a>
{%- endfor %}
<a href="/update-password" class="col-sm-4 portal-widget-col">
<div class="portal-widget">
<h5>{{ _("Reset Password") }}</h5>
</div>
</a>
</div>
<!-- no-cache -->
{% endblock %}
8 changes: 8 additions & 0 deletions electronic_payments/www/me.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import frappe


def get_context(context):
if frappe.session.user == "Guest":
frappe.throw(frappe._("You need to be logged in to access this page"), frappe.PermissionError)

context.show_sidebar = True

0 comments on commit 2a20610

Please sign in to comment.