PageRenderTime 16ms CodeModel.GetById 11ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/library/common/import_datasets_to_histories.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 106 lines | 103 code | 3 blank | 0 comment | 5 complexity | 86902a53d34a7c07ee129433ba88a85d MD5 | raw file
  1<%namespace file="/message.mako" import="render_msg" />
  2<%inherit file="/base.mako"/>
  3<%namespace file="/message.mako" import="javascripts" />
  4<%def name="title()">Import library datasets to histories</%def>
  5
  6<%def name="javascripts()">
  7    ${parent.javascripts()}
  8    ${h.js( "jquery", "galaxy.base" )}
  9    <script type="text/javascript">
 10        $(function() {
 11            $("#select-multiple").click(function() {
 12                $("#single-dest-select").val("");
 13                $("#single-destination").hide();
 14                $("#multiple-destination").show();
 15            });
 16        });
 17    </script>    
 18</%def>
 19
 20%if message:
 21    ${render_msg( message, status )}
 22%endif
 23
 24<b>Import library datasets into histories</b>
 25<br/><br/>
 26<form action="${h.url_for( controller='library_common', action='import_datasets_to_histories', cntrller=cntrller, use_panels=use_panels, show_deleted=show_deleted )}" method="post">
 27    <div class="toolForm" style="float: left; width: 45%; padding: 0px;">
 28        <div class="toolFormBody">
 29            %if source_lddas:
 30                %for source_ldda in source_lddas:
 31                    <%
 32                        checked = ""
 33                        encoded_id = trans.security.encode_id( source_ldda.id )
 34                        if source_ldda.id in ldda_ids:
 35                            checked = " checked='checked'"
 36                    %>
 37                    <div class="form-row">
 38                        <input type="checkbox" name="ldda_ids" id="dataset_${encoded_id}" value="${encoded_id}" ${checked}/>
 39                        <label for="dataset_${encoded_id}" style="display: inline;font-weight:normal;">${source_ldda.name}</label>
 40                    </div>
 41                %endfor
 42            %else:
 43                <div class="form-row">This folder has no accessible library datasets.</div>
 44            %endif
 45        </div>
 46    </div>
 47    <div style="float: left; padding-left: 10px; font-size: 36px;">&rarr;</div>
 48    <div class="toolForm" style="float: right; width: 45%; padding: 0px;">
 49        <div class="toolFormTitle">Destination Histories:</div>
 50        <div class="toolFormBody">
 51            <div class="form-row" id="single-destination">
 52                <select id="single-dest-select" name="target_history_ids">
 53                    %for i, target_history in enumerate( target_histories ):
 54                        <%
 55                            encoded_id = trans.security.encode_id( target_history.id )
 56                            if encoded_id == selected_history_id:
 57                                selected_text = " selected"
 58                            else:
 59                                selected_text = ""
 60                            if target_history == current_history:
 61                                current_history_text = " (current history)"
 62                            else:
 63                                current_history_text = ""
 64                        %>
 65                        <option value="${encoded_id}"${selected_text}>${i + 1}: ${h.truncate( target_history.name, 30 )}${current_history_text}</option>
 66                    %endfor
 67                </select>
 68                <br/><br/>
 69                <a style="margin-left: 10px;" href="javascript:void(0);" id="select-multiple">Choose multiple histories</a>
 70            </div>
 71            <div id="multiple-destination" style="display: none;">
 72                %for i, target_history in enumerate( target_histories ):
 73                    <%
 74                        encoded_id = trans.security.encode_id( target_history.id )
 75                        if target_history == current_history:
 76                            current_history_text = " (current history)"
 77                        else:
 78                            current_history_text = ""
 79                    %>
 80                    <div class="form-row">
 81                        <input type="checkbox" name="target_history_ids" id="target_history_${encoded_id}" value="${encoded_id}"/>
 82                        <label for="target_history_${encoded_id}" style="display: inline; font-weight:normal;">${i + 1}: ${target_history.name}${current_history_text}</label>
 83                    </div>
 84                %endfor
 85            </div>
 86            %if trans.get_user():
 87                <%
 88                    checked = ""
 89                    if "create_new_history" in target_history_ids:
 90                        checked = " checked='checked'"
 91                %>
 92                <hr />
 93                <div style="text-align: center; color: #888;">&mdash; OR &mdash;</div>
 94                <div class="form-row">
 95                    <label for="new_history_name" style="display: inline; font-weight:normal;">New history named:</label>
 96                    <input type="textbox" name="new_history_name" />
 97                </div>
 98            %endif
 99        </div>
100    </div>
101        <div style="clear: both"></div>
102        <div class="form-row" align="center">
103            <input type="submit" class="primary-button" name="import_datasets_to_histories_button" value="Import library datasets"/>
104        </div>
105    </form>
106</div>