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

/templates/dataset/edit_attributes.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 187 lines | 179 code | 8 blank | 0 comment | 8 complexity | a4cb9c8f4ce67b75d939274e154e6bc1 MD5 | raw file
  1<%inherit file="/base.mako"/>
  2<%namespace file="/message.mako" import="render_msg" />
  3<%namespace file="/message.mako" name="message_ns" import="javascripts" />
  4
  5<%def name="title()">${_('Edit Dataset Attributes')}</%def>
  6
  7<%def name="stylesheets()">
  8    ${h.css( "base", "autocomplete_tagging" )}
  9</%def>
 10
 11<%def name="javascripts()">
 12    ${parent.javascripts()}
 13    ${message_ns.javascripts()}
 14    ${h.js( "galaxy.base", "jquery.autocomplete", "autocomplete_tagging" )}
 15</%def>
 16
 17<%def name="datatype( dataset, datatypes )">
 18    <select name="datatype">
 19        %for ext in datatypes:
 20            %if dataset.ext == ext:
 21                <option value="${ext}" selected="yes">${_(ext)}</option>
 22            %else:
 23                <option value="${ext}">${_(ext)}</option>
 24            %endif
 25        %endfor
 26    </select>
 27</%def>
 28
 29%if message:
 30    ${render_msg( message, status )}
 31%endif
 32
 33<div class="toolForm">
 34    <div class="toolFormTitle">${_('Edit Attributes')}</div>
 35    <div class="toolFormBody">
 36        <form name="edit_attributes" action="${h.url_for( controller='dataset', action='edit', dataset_id=dataset_id )}" method="post">
 37            <div class="form-row">
 38                <label>
 39                    Name:
 40                </label>
 41                <div style="float: left; width: 250px; margin-right: 10px;">
 42                    <input type="text" name="name" value="${data.get_display_name()}" size="40"/>
 43                </div>
 44                <div style="clear: both"></div>
 45            </div>
 46            <div class="form-row">
 47                <label>
 48                    Info:
 49                </label>
 50                <div style="float: left; width: 250px; margin-right: 10px;">
 51                    <input type="text" name="info" value="${data.info}" size="40"/>
 52                </div>
 53                <div style="clear: both"></div>
 54            </div>
 55            %if trans.get_user() is not None:
 56                <div class="form-row">                    
 57                    <label>
 58                        Annotation / Notes:
 59                    </label>
 60                    <div style="float: left; width: 250px; margin-right: 10px;">
 61                        <textarea name="annotation" cols="40" rows="2">${data_annotation}</textarea>
 62                    </div>
 63                    <div style="clear: both"></div>
 64                    <div class="toolParamHelp">Add an annotation or notes to a dataset; annotations are available when a history is viewed.</div>
 65                </div>
 66            %endif
 67            %for name, spec in data.metadata.spec.items():
 68                %if spec.visible:
 69                    <div class="form-row">
 70                        <label>
 71                            ${spec.desc}:
 72                        </label>
 73                        <div style="float: left; width: 250px; margin-right: 10px;">
 74                            ${data.metadata.get_html_by_name( name, trans=trans )}
 75                        </div>
 76                        <div style="clear: both"></div>
 77                    </div>
 78                %endif
 79            %endfor
 80            <div class="form-row">
 81                <input type="submit" name="save" value="${_('Save')}"/>
 82            </div>
 83        </form>
 84        <form name="auto_detect" action="${h.url_for( controller='dataset', action='edit', dataset_id=dataset_id )}" method="post">
 85            <div class="form-row">
 86                <div style="float: left; width: 250px; margin-right: 10px;">
 87                    <input type="submit" name="detect" value="${_('Auto-detect')}"/>
 88                </div>
 89                <div class="toolParamHelp" style="clear: both;">
 90                    This will inspect the dataset and attempt to correct the above column values if they are not accurate.
 91                </div>
 92            </div>
 93        </form>
 94        %if data.missing_meta():
 95            <div class="form-row">
 96                <div class="errormessagesmall">${_('Required metadata values are missing. Some of these values may not be editable by the user. Selecting "Auto-detect" will attempt to fix these values.')}</div>
 97            </div>
 98        %endif
 99    </div>
100</div>
101<p />
102<% converters = data.get_converter_types() %>
103%if len( converters ) > 0:
104    <div class="toolForm">
105        <div class="toolFormTitle">${_('Convert to new format')}</div>
106        <div class="toolFormBody">
107            <form name="convert_data" action="${h.url_for( controller='dataset', action='edit', dataset_id=dataset_id )}" method="post">
108                <div class="form-row">
109                    <div style="float: left; width: 250px; margin-right: 10px;">
110                        <select name="target_type">
111                            %for key, value in converters.items():
112                                <option value="${key}">${value.name}</option>
113                            %endfor
114                        </select>
115                    </div>
116                    <div class="toolParamHelp" style="clear: both;">
117                        This will create a new dataset with the contents of this dataset converted to a new format. 
118                    </div>
119                    <div style="clear: both"></div>
120                </div>
121                <div class="form-row">
122                    <input type="submit" name="convert_data" value="${_('Convert')}"/>
123                </div>
124            </form>
125        </div>
126    </div>
127    <p />
128%endif
129
130<div class="toolForm">
131    <div class="toolFormTitle">${_('Change data type')}</div>
132    <div class="toolFormBody">
133        %if data.datatype.allow_datatype_change:
134            <form name="change_datatype" action="${h.url_for( controller='dataset', action='edit', dataset_id=dataset_id )}" method="post">
135                <div class="form-row">
136                    <label>
137                        ${_('New Type')}:
138                    </label>
139                    <div style="float: left; width: 250px; margin-right: 10px;">
140                        ${datatype( data, datatypes )}
141                    </div>
142                    <div class="toolParamHelp" style="clear: both;">
143                        ${_('This will change the datatype of the existing dataset but <i>not</i> modify its contents. Use this if Galaxy has incorrectly guessed the type of your dataset.')}
144                    </div>
145                    <div style="clear: both"></div>
146                </div>
147                <div class="form-row">
148                    <input type="submit" name="change" value="${_('Save')}"/>
149                </div>
150            </form>
151        %else:
152            <div class="form-row">
153                <div class="warningmessagesmall">${_('Changing the datatype of this dataset is not allowed.')}</div>
154            </div>
155        %endif
156    </div>
157</div>
158<p />
159
160%if trans.app.security_agent.can_manage_dataset( current_user_roles, data.dataset ):
161    <%namespace file="/dataset/security_common.mako" import="render_permission_form" />
162    ${render_permission_form( data.dataset, data.get_display_name(), h.url_for( controller='dataset', action='edit', dataset_id=dataset_id ), all_roles )}
163%elif trans.user:
164    <div class="toolForm">
165        <div class="toolFormTitle">View Permissions</div>
166        <div class="toolFormBody">
167            <div class="form-row">
168                %if data.dataset.actions:
169                    <ul>
170                        %for action, roles in trans.app.security_agent.get_permissions( data.dataset ).items():
171                            %if roles:
172                                <li>${action.description}</li>
173                                <ul>
174                                    %for role in roles:
175                                        <li>${role.name}</li>
176                                    %endfor
177                                </ul>
178                            %endif
179                        %endfor
180                    </ul>
181                %else:
182                    <p>This dataset is accessible by everyone (it is public).</p>
183                %endif
184            </div>
185        </div>
186    </div>
187%endif