PageRenderTime 28ms CodeModel.GetById 21ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/admin/external_service/common.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 47 lines | 46 code | 0 blank | 1 comment | 1 complexity | 0b39f15f365396ec1d85f72527aefd33 MD5 | raw file
 1<%def name="render_external_service( external_service )">
 2    <div class="toolForm">
 3        <div class="toolFormTitle">External service</div>
 4        <div class="form-row">
 5            <label>Name:</label>
 6            ${external_service.name}
 7            ##<a href="${h.url_for( controller='external_service', action='view_external_service', id=trans.security.encode_id( external_service.id ) )}">${external_service.name}</a>
 8            <div style="clear: both"></div>
 9        </div>
10        <div class="form-row">
11            <label>Description:</label>
12            ${external_service.description}
13            <div style="clear: both"></div>
14        </div>
15        <div class="form-row">
16            <label>Version:</label>
17            ${external_service.version}
18            <div style="clear: both"></div>
19        </div>
20        <div class="form-row">
21            <label>External service type:</label>
22            %if trans.app.external_service_types.all_external_service_types.has_key( external_service.external_service_type_id ):
23                ${trans.app.external_service_types.all_external_service_types[ external_service.external_service_type_id ].name}
24            %else:
25                ${'Error loading external_service type: %s' % external_service.external_service_type_id}
26            %endif
27            <div style="clear: both"></div>
28        </div>
29        %if external_service.external_service_type_id != 'none':
30            %for field_index, field in enumerate( external_service.form_definition.fields ):
31                <% 
32                    field_value = external_service.form_values.content.get( field['name'], '' )
33                    if field[ 'type' ] == 'PasswordField':
34                        field_value = '*' * len( field_value )
35                %>
36                <div class="form-row">
37                    <label>${field[ 'label' ]}:</label>
38                    ${field_value}
39                </div>
40            %endfor
41        %else:
42            <div class="form-row">
43                External service information is not set, click the <b>Edit external service</b> button to set it.
44            </div>
45        %endif
46    </div>
47</%def>