diff --git a/community/community/widgets/Avatar.html b/community/community/widgets/Avatar.html index b72fc909..6450ac9f 100644 --- a/community/community/widgets/Avatar.html +++ b/community/community/widgets/Avatar.html @@ -1,5 +1,5 @@ {% set color = member.get_palette() %} - + {% if member.user_image %} diff --git a/community/hooks.py b/community/hooks.py index d3b0c798..e2d768dc 100644 --- a/community/hooks.py +++ b/community/hooks.py @@ -141,16 +141,21 @@ website_route_rules = [ {"from_route": "/courses//learn/.", "to_route": "batch/learn"}, {"from_route": "/courses//progress", "to_route": "batch/progress"}, {"from_route": "/courses//join", "to_route": "batch/join"}, - {"from_route": "/users/", "to_route": "profiles/profile"}, - {"from_route": "/users", "to_route": "profiles/profile"} ] website_redirects = [ {"source": "/update-profile", "target": "/edit-profile"}, ] -update_website_context = 'community.widgets.update_website_context' - +update_website_context = [ + 'community.widgets.update_website_context', +] +jinja = { + "methods": [ + "community.page_renderers.get_profile_url" + ], + "filters": [] +} ## Specify the additional tabs to be included in the user profile page. ## Each entry must be a subclass of community.community.plugins.ProfileTab # profile_tabs = [] @@ -171,3 +176,12 @@ community_markdown_macro_renderers = { "YouTubeVideo": "community.plugins.youtube_video_renderer", "Video": "community.plugins.video_renderer" } + +# page_renderer to manage profile pages +page_renderer = [ + "community.page_renderers.ProfileRedirectPage", + "community.page_renderers.ProfilePage" +] + +# set this to "/" to have profiles on the top-level +profile_url_prefix = "/users/" diff --git a/community/lms/web_form/profile/profile.js b/community/lms/web_form/profile/profile.js index 984fb964..8a707633 100644 --- a/community/lms/web_form/profile/profile.js +++ b/community/lms/web_form/profile/profile.js @@ -8,7 +8,7 @@ frappe.ready(function () { frappe.web_form.after_save = () => { setTimeout(() => { - window.location.href = `/users/${frappe.web_form.get_value(["username"])}`; + window.location.href = `/profile_/${frappe.web_form.get_value(["username"])}`; }) } }) diff --git a/community/lms/widgets/CourseTeaser.html b/community/lms/widgets/CourseTeaser.html index 53bc6362..280d2783 100644 --- a/community/lms/widgets/CourseTeaser.html +++ b/community/lms/widgets/CourseTeaser.html @@ -12,7 +12,7 @@ {% endif %}
{% with author = course.get_instructor() %} - {{ widgets.Avatar(member=author, avatar_class="avatar-medium") }} {{ author.full_name }} + {{ widgets.Avatar(member=author, avatar_class="avatar-medium") }} {{ author.full_name }} {% endwith %}
diff --git a/community/lms/widgets/MemberCard.html b/community/lms/widgets/MemberCard.html index 3ed9ed5d..89879cbb 100644 --- a/community/lms/widgets/MemberCard.html +++ b/community/lms/widgets/MemberCard.html @@ -11,5 +11,5 @@ Created {{ course_count }} {{ suffix }} {% endif %} - + diff --git a/community/lms/widgets/Reviews.html b/community/lms/widgets/Reviews.html index 57f08833..8fe25df4 100644 --- a/community/lms/widgets/Reviews.html +++ b/community/lms/widgets/Reviews.html @@ -19,7 +19,7 @@