Using the user fullname when rendering a sketch.
Also refactored the portal page for sketches and moved the common code to the lms_sketch doctype module.
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<div class="sketch-preview mb-5">
|
||||
<span class="sketch-ts">{{ sketch.modified }}</span>
|
||||
<a href="/sketches/sketch?sketch={{sketch.name}}">{{sketch.title}}</a>
|
||||
By {{sketch.owner}}
|
||||
By {{sketch.owner_name}}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
import frappe
|
||||
from ...lms.doctype.lms_sketch.lms_sketch import get_recent_sketches
|
||||
|
||||
def get_context(context):
|
||||
context.no_cache = 1
|
||||
context.sketches = get_sketches()
|
||||
context.sketches = get_recent_sketches()
|
||||
|
||||
def get_sketches():
|
||||
sketches = frappe.get_all(
|
||||
"LMS Sketch",
|
||||
fields=['name', 'title', 'owner', 'modified'],
|
||||
order_by='modified desc',
|
||||
page_length=100
|
||||
)
|
||||
for s in sketches:
|
||||
s['owner'] = s['owner'].split("@")[0]
|
||||
return sketches
|
||||
|
||||
Reference in New Issue
Block a user