forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathembed_base.mako
63 lines (57 loc) · 2.85 KB
/
embed_base.mako
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
##
## Base file for generating HTML for embedded objects.
##
## parameters: item, item_data
##
<%namespace file="/display_common.mako" import="*" />
## HTML structure.
<div class='embedded-item display ${get_class_display_name( item.__class__ ).lower()}'>
<div class='title'>
${self.render_title( item )}
</div>
<div class='summary-content'>
${self.render_summary_content( item, item_data )}
</div>
<div class='expanded-content'>
<div class='item-content'></div>
</div>
</div>
## Render item links.
<%def name="render_item_links( item )">
<%
item_display_name = get_class_display_name( item.__class__ ).lower()
item_controller = "/%s" % get_controller_name( item )
item_user = get_item_user( item )
item_slug = get_item_slug( item )
display_href = h.url_for( controller=item_controller, action='display_by_username_and_slug', username=item_user.username, slug=item_slug )
%>
## Links for importing and viewing an item.
<a href="${h.url_for( controller=item_controller, action='imp', id=trans.security.encode_id( item.id ) )}" title="Import ${item_display_name}" class="icon-button import"></a>
<a class="icon-button go-to-full-screen" href="${display_href}" title="Go to ${item_display_name}"></a>
</%def>
<%def name="render_title( item )">
<%
item_display_name = get_class_display_name( item.__class__ ).lower()
item_controller = "/%s" % get_controller_name( item )
item_user = get_item_user( item )
item_slug = get_item_slug( item )
display_href = h.url_for( controller=item_controller, action='display_by_username_and_slug', username=item_user.username, slug=item_slug )
%>
<div style="float: left">
<a class="display_in_embed icon-button toggle-expand" item_id="${trans.security.encode_id( item.id )}" item_class="$item.__class__.__name__" href="${display_href}"
title="Show ${item_display_name} content"></a>
<a class="toggle icon-button" href="${display_href}" title="Hide ${item_display_name} content"></a>
</div>
<div style="float: right;">
${self.render_item_links( item )}
</div>
<h4><a class="toggle-embed" href="${display_href}" title="Show or hide ${item_display_name} content">Galaxy ${get_class_display_name( item.__class__ )} | ${get_item_name( item ) | h}</a></h4>
%if hasattr( item, "annotation") and item.annotation:
<div class="annotation">${item.annotation | h}</div>
%endif
## Use a hidden var to store the ajax URL for getting an item's content.
<input type="hidden" name="ajax-item-content-url" value="${h.url_for( controller=item_controller, action='get_item_content_async', id=trans.security.encode_id( item.id ) )}"/>
</%def>
## Methods to override to render summary content.
<%def name="render_summary_content( item, item_data )">
</%def>