PageRenderTime 24ms CodeModel.GetById 15ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/library/common/move_library_item.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 106 lines | 101 code | 5 blank | 0 comment | 4 complexity | d921d146114cb41c33340c186e71bb94 MD5 | raw file
  1<%namespace file="/message.mako" import="render_msg" />
  2<%inherit file="/base.mako"/>
  3
  4<%def name="javascripts()">
  5   ${parent.javascripts()}
  6   ${h.js("jquery.autocomplete", "autocomplete_tagging" )}
  7</%def>
  8
  9<%def name="stylesheets()">
 10    ${parent.stylesheets()}
 11    ${h.css( "autocomplete_tagging" )}
 12</%def>
 13
 14<%
 15    if source_library:
 16        source_library_id = trans.security.encode_id( source_library.id )
 17    else:
 18        source_library_id = ''
 19    if target_library:
 20        target_library_id = trans.security.encode_id( target_library.id )
 21    else:
 22        target_library_id = ''
 23%>
 24
 25%if message:
 26    ${render_msg( message, status )}
 27%endif
 28
 29<b>Move data library items</b>
 30<br/><br/>
 31<form name="move_library_item" action="${h.url_for( controller='library_common', action='move_library_item', cntrller=cntrller, item_type=item_type, make_target_current=make_target_current, use_panels=use_panels, show_deleted=show_deleted )}" method="post">
 32    <div class="toolForm" style="float: left; width: 45%; padding: 0px;">
 33        <div class="toolFormBody">
 34            <input type="hidden" name="source_library_id" value="${source_library_id}"/>
 35            %if target_library:
 36                <input type="hidden" name="target_library_id" value="${target_library_id}"/>
 37            %endif
 38            %if item_type == 'ldda':
 39                %for move_ldda in move_lddas:
 40                    <%
 41                        checked = ""
 42                        encoded_id = trans.security.encode_id( move_ldda.id )
 43                        if move_ldda.id in move_ldda_ids:
 44                            checked = " checked='checked'"
 45                    %>
 46                    <div class="form-row">
 47                        <input type="checkbox" name="item_id" id="dataset_${encoded_id}" value="${encoded_id}" ${checked}/>
 48                        <label for="dataset_${encoded_id}" style="display: inline;font-weight:normal;">${move_ldda.name}</label>
 49                    </div>
 50                %endfor
 51            %elif item_type == 'folder':
 52                <div class="form-row">
 53                    <% encoded_id = trans.security.encode_id( move_folder.id ) %>
 54                    <input type="checkbox" name="item_id" id="folder_${encoded_id}" value="${encoded_id}" checked='checked'/>
 55                    <label for="folder_${encoded_id}" style="display: inline;font-weight:normal;">${move_folder.name}</label>
 56                </div>
 57            %endif
 58        </div>
 59    </div>
 60    <div style="float: left; padding-left: 10px; font-size: 36px;">&rarr;</div>
 61    <div class="toolForm" style="float: right; width: 45%; padding: 0px;">
 62        %if target_library:
 63            <div class="toolFormTitle">Select folder within data library: ${h.truncate( target_library.name, 30 )}</div>
 64        %else:
 65            <div class="toolFormTitle">Select a data library</div>
 66        %endif
 67        <div class="toolFormBody">
 68            %if target_library:
 69                <div class="form-row">
 70                    %if len( target_folder_id_select_field.options ) > 1:
 71                        ${target_folder_id_select_field.get_html()}
 72                    %else:
 73                        %if source_library and source_library.id == target_library.id:
 74                            You are not authorized to move items within the source data library
 75                        %else:
 76                            You are not authorized to move items into the selected data library
 77                        %endif
 78                    %endif
 79                    %if source_library: 
 80                        <br/><br/>
 81                        %if target_library.id == source_library.id:
 82                            <a style="margin-left: 10px;" href="${h.url_for( controller='library_common', action='move_library_item', cntrller=cntrller, item_type=item_type, item_id=item_id, source_library_id=source_library_id, make_target_current=False, use_panels=use_panels, show_deleted=show_deleted )}">Choose another data library</a>
 83                        %else:
 84                            <a style="margin-left: 10px;" href="${h.url_for( controller='library_common', action='move_library_item', cntrller=cntrller, item_type=item_type, item_id=item_id, source_library_id=source_library_id, make_target_current=True, use_panels=use_panels, show_deleted=show_deleted )}">Choose source data library</a>
 85                        %endif
 86                    %elif not target_library_folders:
 87                        <br/><br/>
 88                        <a style="margin-left: 10px;" href="${h.url_for( controller='library_common', action='move_library_item', cntrller=cntrller, item_type=item_type, item_id=item_id, source_library_id=source_library_id, make_target_current=False, use_panels=use_panels, show_deleted=show_deleted )}">Choose another data library</a>
 89                    %endif
 90                </div>
 91            %else:
 92                <div class="form-row">
 93                    %if len( target_library_id_select_field.options ) > 1:
 94                        ${target_library_id_select_field.get_html()}
 95                    %else:
 96                        You are not authorized to move items to any data libraries
 97                    %endif
 98                </div>
 99            %endif
100        </div>
101    </div>
102    <div style="clear: both"></div>
103    <div class="form-row" align="center">
104        <input type="submit" class="primary-button" name="move_library_item_button" value="Move"/>
105    </div>
106</form>