diff --git a/community/community/widgets/Avatar.html b/community/community/widgets/Avatar.html index 59f59a91..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 488cbe9e..40e0e8ba 100644 --- a/community/hooks.py +++ b/community/hooks.py @@ -141,15 +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": "/user/", "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 = [] @@ -170,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 c9869a5c..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 = `/user/${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 2b7b54ec..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/InstructorSection.html b/community/lms/widgets/InstructorSection.html index 9c96c294..c478e452 100644 --- a/community/lms/widgets/InstructorSection.html +++ b/community/lms/widgets/InstructorSection.html @@ -1,6 +1,6 @@
{{ widgets.Avatar(member=instructor, avatar_class="avatar-medium") }} - {{ instructor.full_name }} + {{ instructor.full_name }}
Course Creator
diff --git a/community/lms/widgets/MemberCard.html b/community/lms/widgets/MemberCard.html index 77f00556..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 f9ba6524..8fe25df4 100644 --- a/community/lms/widgets/Reviews.html +++ b/community/lms/widgets/Reviews.html @@ -19,7 +19,7 @@