PageRenderTime 19ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/dataset/display.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 111 lines | 86 code | 17 blank | 8 comment | 10 complexity | 82307df84fc4414395bb9c0efdf11497 MD5 | raw file
  1## Because HDAs do not have many of the properties that other sharable items have, we need to override most of the default code for display.
  2<%inherit file="/display_base.mako"/>
  3<%namespace file="/display_common.mako" import="*" />
  4<%namespace file="/tagging_common.mako" import="render_individual_tagging_element, render_community_tagging_element" />
  5
  6<%def name="javascripts()">
  7    ${parent.javascripts()}
  8</%def>
  9
 10<%def name="init()">
 11<%
 12	self.has_left_panel=False
 13	self.has_right_panel=True
 14	self.message_box_visible=False
 15	self.active_view="user"
 16	self.overlay_visible=False
 17%>
 18</%def>
 19
 20<%def name="title()">
 21    Galaxy | ${get_class_display_name( item.__class__ )} | ${get_item_name( item ) | h}
 22</%def>
 23
 24<%def name="render_item_links( data )">
 25    ## Provide links to save data and import dataset.
 26    <a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk tooltip" title="Save dataset"></a>
 27        <a 
 28            href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}"
 29            class="icon-button import tooltip" 
 30            title="Import dataset"></a>
 31</%def>
 32
 33<%def name="render_item( data, data_to_render )">
 34    %if truncated:
 35        <div class="warningmessagelarge">
 36            This dataset is large and only the first megabyte is shown below. | 
 37            <a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a>
 38        </div>    
 39    %endif
 40    ## TODO: why is the default font size so small?
 41    <pre style="font-size: 135%">${ data_to_render | h }</pre>
 42</%def>
 43
 44
 45<%def name="center_panel()">
 46    <div class="unified-panel-header" unselectable="on">
 47		<div class="unified-panel-header-inner">
 48				${get_class_display_name( item.__class__ )}
 49			| ${get_item_name( item ) | h}
 50	    </div>
 51    </div>
 52    
 53    <div class="unified-panel-body">
 54        <div style="overflow: auto; height: 100%;">        
 55            <div class="page-body">
 56                <div style="float: right">
 57                    ${self.render_item_links( item )}
 58                </div>
 59                <div>
 60                    ${self.render_item_header( item )}
 61                </div>
 62                
 63                ${self.render_item( item, item_data )}
 64            </div>
 65        </div>
 66    </div>
 67</%def>
 68
 69<%def name="right_panel()">
 70    <div class="unified-panel-header" unselectable="on">
 71        <div class="unified-panel-header-inner">
 72            About this ${get_class_display_name( item.__class__ )}
 73        </div>
 74    </div>
 75    
 76    <div class="unified-panel-body">
 77        <div style="overflow: auto; height: 100%;">
 78            <div style="padding: 10px;">
 79                <h4>Author</h4>
 80                
 81                <p>${item.history.user.username | h}</p>
 82                
 83                <div><img src="http://www.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=identicon&s=150"></div>
 84
 85                ## Page meta. 
 86                
 87                ## No links for datasets right now.
 88        
 89                ## Tags.
 90                <p>
 91                <h4>Tags</h4>
 92                <p>
 93                ## Community tags.
 94                <div>
 95                    Community:
 96                    ${render_community_tagging_element( tagged_item=item, tag_click_fn='community_tag_click', use_toggle_link=False )}
 97                    %if len ( item.tags ) == 0:
 98                        none
 99                    %endif
100                </div>
101                ## Individual tags.
102                <p>
103                <div>
104                    Yours:
105                    ${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )}
106                </div>
107            </div>    
108        </div>
109    </div>
110
111</%def>