root/galaxy-central/templates/library/common/ldda_info.mako

リビジョン 2, 13.0 KB (コミッタ: hatakeyama, 14 年 前)

import galaxy-central

行番号 
1<%inherit file="/base.mako"/>
2<%namespace file="/message.mako" import="render_msg" />
3<%namespace file="/library/common/common.mako" import="render_template_fields" />
4<%
5    from galaxy import util
6    from galaxy.web.controllers.library_common import branch_deleted, get_containing_library_from_library_dataset
7    from galaxy.web.framework.helpers import time_ago
8
9    if ldda == ldda.library_dataset.library_dataset_dataset_association:
10        current_version = True
11    else:
12        current_version = False
13    if ldda.user:
14        uploaded_by = ldda.user.email
15    else:
16        uploaded_by = 'anonymous'
17    if trans.user_is_admin() and cntrller == 'library_admin':
18        can_modify = can_manage = True
19    elif cntrller in [ 'library', 'requests' ]:
20        can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, ldda.library_dataset )
21        can_manage = trans.app.security_agent.can_manage_library_item( current_user_roles, ldda.library_dataset )
22    else:
23        can_modify = can_manage = False
24%>
25
26<%def name="javascripts()">
27    ${parent.javascripts()}
28</%def>
29
30%if current_version:
31    <b><i>This is the latest version of this library dataset</i></b>
32%else:
33    <font color="red"><b><i>This is an expired version of this library dataset</i></b></font>
34%endif
35<p/>
36
37<ul class="manage-table-actions">
38    <li>
39        <a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}"><span>Browse this data library</span></a>
40    </li>
41</ul>
42
43%if message:
44    ${render_msg( message, status )}
45%endif
46
47<div class="toolForm">
48    <div class="toolFormTitle">
49        Information about <div class="menubutton popup" id="dataset-${ldda.id}-popup">${ldda.name}</div>
50        %if not library.deleted and not branch_deleted( ldda.library_dataset.folder ) and not ldda.library_dataset.deleted:
51            <div popupmenu="dataset-${ldda.id}-popup">
52                %if can_modify:
53                    <a class="action-button" href="${h.url_for( controller='library_common', action='ldda_edit_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a>
54                    %if not info_association:
55                        <a class="action-button" href="${h.url_for( controller='library_common', action='add_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), ldda_id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add template</a>
56                    %else:
57                        <a class="action-button" href="${h.url_for( controller='library_common', action='edit_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), ldda_id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit template</a>
58                        <a class="action-button" href="${h.url_for( controller='library_common', action='delete_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), ldda_id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Delete template</a>
59                    %endif
60                %endif
61                %if can_manage:
62                    <a class="action-button" href="${h.url_for( controller='library_common', action='ldda_permissions', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit permissions</a>
63                %endif
64                %if current_version and can_modify:
65                    <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), replace_id=trans.security.encode_id( ldda.library_dataset.id ) )}">Upload a new version of this dataset</a>
66                %endif
67                %if cntrller=='library' and ldda.has_data():
68                    <a class="action-button" href="${h.url_for( controller='library_common', action='act_on_multiple_datasets', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), ldda_ids=trans.security.encode_id( ldda.id ), do_action='import_to_history', use_panels=use_panels, show_deleted=show_deleted )}">Import this dataset into your current history</a>
69                    <a class="action-button" href="${h.url_for( controller='library_common', action='download_dataset_from_folder', cntrller=cntrller, id=trans.security.encode_id( ldda.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Download this dataset</a>
70                %endif
71            </div>
72        %endif
73    </div>
74    <div class="toolFormBody">
75        %if ldda.message:
76            <div class="form-row">
77                <label>Message:</label>
78                <pre>${ldda.message}</pre>
79                <div style="clear: both"></div>
80            </div>
81        %endif
82        <div class="form-row">
83            <label>Uploaded by:</label>
84            ${uploaded_by}
85            <div style="clear: both"></div>
86        </div>
87        <div class="form-row">
88            <label>Date uploaded:</label>
89            ${ldda.create_time.strftime( "%Y-%m-%d" )}
90            <div style="clear: both"></div>
91        </div>
92        <div class="form-row">
93            <label>File size:</label>
94            ${ldda.get_size( nice_size=True )}
95            <div style="clear: both"></div>
96        </div>
97        <div class="form-row">
98            <label>Data type:</label>
99            ${ldda.ext}
100            <div style="clear: both"></div>
101        </div>
102        <div class="form-row">
103            <label>Build:</label>
104            ${ldda.dbkey}
105            <div style="clear: both"></div>
106        </div>
107        <div class="form-row">
108            <label>Miscellaneous information:</label>
109            ${ldda.info}
110            <div style="clear: both"></div>
111        </div>
112        <div class="form-row">
113            <div>${ldda.blurb}</div>
114        </div>
115        %for name, spec in ldda.metadata.spec.items():
116            <div class="form-row">
117                <label>${spec.desc.replace( ' (click box & select)', '' )}:</label>
118                <%
119                    metadata_val = ldda.metadata.get( name )
120                    if isinstance( metadata_val, trans.model.MetadataFile ):
121                        metadata_val = metadata_val.file_name
122                    elif isinstance( metadata_val, list ):
123                        metadata_val = ', '.join( metadata_val )
124                %>
125                ${metadata_val}
126                <div style="clear: both"></div>
127            </div>
128        %endfor
129        %if ldda.peek != "no peek":
130            <div class="form-row">
131               <div id="info${ldda.id}" class="historyItemBody">
132                    <label>Peek:</label>
133                    <div><pre id="peek${ldda.id}" class="peek">${ldda.display_peek()}</pre></div>
134                </div>
135            </div>
136        %endif
137        %if trans.user_is_admin() and cntrller == 'library_admin':
138            <div class="form-row">
139                <label>Disk file:</label>
140                ${ldda.file_name}
141                <div style="clear: both"></div>
142            </div>
143        %endif
144    </div>
145</div>
146%if widgets:
147    ${render_template_fields( cntrller=cntrller, item_type='ldda', library_id=library_id, widgets=widgets, widget_fields_have_contents=widget_fields_have_contents, info_association=info_association, inherited=inherited, folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), ldda_id=trans.security.encode_id( ldda.id ), editable=False )}
148%endif
149%if trans.user_is_admin() and cntrller == 'library_admin':
150    %if associated_hdas:
151        <p/>
152        <b>Active (undeleted) history items that use this library dataset's disk file</b>
153        <div class="toolForm">
154            <table class="grid">
155                <thead>
156                    <tr>
157                        <th>History</th>
158                        <th>History Item</th>
159                        <th>Last Updated</th>
160                        <th>User</th>
161                    </tr>
162                </thead>
163                %for hda in associated_hdas:
164                    <tr>
165                        <td>
166                            %if hda.history:
167                                <a target="_blank" href="${h.url_for( controller='history', action='view', id=trans.security.encode_id( hda.history_id ) )}">${hda.history.get_display_name()}</a>
168                            %else:
169                                no history
170                            %endif
171                        </td>
172                        <td>${hda.get_display_name()}</td>
173                        <td>${time_ago( hda.update_time )}</td>
174                        <td>
175                            %if hda.history and hda.history.user:
176                                ${hda.history.user.email}
177                            %else:
178                                anonymous
179                            %endif
180                        </td>
181                    </tr>
182                %endfor
183            </table>
184        </div>
185        <p/>
186    %endif
187    %if associated_lddas:
188        <p/>
189        <b>Other active (undeleted) library datasets that use this library dataset's disk file</b>
190        <div class="toolForm">
191            <table class="grid">
192                <thead>
193                    <tr>
194                        <th>Library</th>
195                        <th>Library Folder</th>
196                        <th>Library Dataset</th>
197                        <th>Last Updated</th>
198                        <th>User</th>
199                    </tr>
200                </thead>
201                %for copied_ldda in associated_lddas:
202                    <% containing_library = get_containing_library_from_library_dataset( trans, copied_ldda.library_dataset ) %>
203                    <tr>
204                        <td>
205                            <%
206                                if containing_library:
207                                    library_display_name = containing_library.get_display_name()
208                                else:
209                                    library_display_name = 'no library'
210                            %>
211                            %if containing_library:
212                                <a href="${h.url_for( controller='library_common', action='browse_library', id=trans.security.encode_id( containing_library.id ), cntrller=cntrller, use_panels=use_panels )}">${library_display_name}</a>
213                            %else:
214                                ${library_display_name}
215                            %endif
216                        </td>
217                        <td>
218                            <%
219                                library_dataset = copied_ldda.library_dataset
220                                folder = library_dataset.folder
221                                folder_display_name = folder.get_display_name()
222                                if folder_display_name == library_display_name:
223                                    folder_display_name = 'library root'
224                            %>
225                            ${folder_display_name}
226                            ${copied_ldda.library_dataset.folder.get_display_name()}
227                        </td>
228                        <td>${copied_ldda.get_display_name()}</td>
229                        <td>${time_ago( copied_ldda.update_time )}</td>
230                        <td>
231                            %if copied_ldda.user:
232                                ${copied_ldda.user.email}
233                            %else:
234                                anonymous
235                            %endif
236                        </td>
237                    </tr>
238                %endfor
239            </table>
240        </div>
241        <p/>
242    %endif
243%endif
244%if current_version:
245    <% expired_lddas = [ e_ldda for e_ldda in ldda.library_dataset.expired_datasets ] %>
246    %if expired_lddas:
247        <br/>
248        <div class="toolFormTitle">Expired versions of ${ldda.name}</div>
249        %for expired_ldda in expired_lddas:
250            <div class="form-row">
251                <a href="${h.url_for( controller='library_common', action='ldda_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( expired_ldda.library_dataset.folder.id ), id=trans.security.encode_id( expired_ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">${expired_ldda.name}</a>
252            </div>
253        %endfor
254    %endif
255%endif
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。