diff --git a/LICENSE.txt b/LICENSE.txt index 69978e57efb..23e45c00eae 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -17,4 +17,9 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Some icons found in Galaxy are from the Silk Icons set, available under +the Creative Commons Attribution 2.5 License, from: + +http://www.famfamfam.com/lab/icons/silk/ diff --git a/datatypes_conf.xml.sample b/datatypes_conf.xml.sample index 7db33f2e7d7..23974aab8b6 100644 --- a/datatypes_conf.xml.sample +++ b/datatypes_conf.xml.sample @@ -140,6 +140,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + diff --git a/templates/base_panels.mako b/templates/base_panels.mako index 29a2dee470e..08516467652 100644 --- a/templates/base_panels.mako +++ b/templates/base_panels.mako @@ -1,6 +1,18 @@ ## This needs to be on the first line, otherwise IE6 goes into quirks mode +<% + self.has_left_panel=True + self.has_right_panel=True + self.message_box_visible=False + self.message_box_class="" + self.active_view=None +%> + +<%def name="init()"> + ## Override + + ## Default title <%def name="title()">Galaxy @@ -8,14 +20,30 @@ <%def name="stylesheets()"> + ## Default javascripts <%def name="javascripts()"> - + ## Default late-load javascripts @@ -27,45 +55,69 @@ - + ## Masthead <%def name="masthead()"> - + + + +## Messagebox +<%def name="message_box_content()"> ## Document + + ${self.init()} + - ${self.title()} - ${self.javascripts()} - ${self.stylesheets()} + ${self.title()} + ${self.javascripts()} + ${self.stylesheets()} - ## Background displays first -
- ## Layer iframes over backgrounds -
- ${self.masthead()} -
-
- ${self.left_panel()} -
-
-
- ${self.center_panel()} -
-
- + ## Background displays first +
+ ## Layer iframes over backgrounds +
+ ${self.masthead()} +
+
+ %if self.message_box_visible: + ${self.message_box_content()} + %endif +
+ %if self.has_left_panel: +
+ ${self.left_panel()} +
+
+ +
+ %endif +
+ ${self.center_panel()} +
+ %if self.has_right_panel: +
+ + %endif ## Allow other body level elements - ${next.body()} + ${next.body()} ## Scripts can be loaded later since they progressively add features to ## the panels, but do not change layout diff --git a/templates/dataset/copy_view.mako b/templates/dataset/copy_view.mako index 97c932bac32..ba4f265ce43 100644 --- a/templates/dataset/copy_view.mako +++ b/templates/dataset/copy_view.mako @@ -25,7 +25,7 @@ if data.id in source_dataset_ids: checked = " checked" %> -
${data.hid}: ${data.name}
+
${data.hid}: ${data.name}
%endfor @@ -41,7 +41,7 @@ if hist == trans.get_history(): cur_history_text = " (current history)" %> -
${i + 1}${cur_history_text}: ${hist.name}
+
${i + 1}${cur_history_text}: ${hist.name}
%endfor %if trans.get_user(): <% @@ -50,12 +50,12 @@ checked = " checked" %>
-
New history named:
+
New history named:
%endif
-
+

diff --git a/templates/dataset/edit_attributes.mako b/templates/dataset/edit_attributes.mako index 39936d24f4c..e5d44cbce6b 100644 --- a/templates/dataset/edit_attributes.mako +++ b/templates/dataset/edit_attributes.mako @@ -1,146 +1,188 @@ <%inherit file="/base.mako"/> -<%def name="title()">History Item Attributes +<%def name="title()">Edit Dataset Attributes <%def name="datatype( dataset, datatypes )"> - + -
-
Edit Attributes
-
-
- -
- -
- -
-
-
-
- -
- -
-
-
- %for name, spec in data.metadata.spec.items(): - %if spec.visible: +<% + if isinstance( data, trans.app.model.HistoryDatasetAssociation ): + id_name = 'id' + elif isinstance( data, trans.app.model.LibraryFolderDatasetAssociation ): + id_name = 'lid' +%> + +%if ( id_name == 'id' or trans.app.security_agent.allow_action( trans.user, data.permitted_actions.DATASET_EDIT_METADATA, dataset = data ) ): +
+
Edit Attributes
+
+ +
- -
- ${data.metadata.get_html_by_name( name )} -
-
+ +
+ +
+
- %endif - %endfor -
- -
- -
- -
- -
-
- This will inspect the dataset and attempt to correct the above column values - if they are not accurate. -
-
- %if data.missing_meta(): -
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.
- %endif -
-
- -

- - <% converters = data.get_converter_types() %> - %if len( converters ) > 0: -

-
Convert to new format
-
-
- -
- +
+ +
+ +
+
+
+ %for name, spec in data.metadata.spec.items(): + %if spec.visible: +
+ +
+ ${data.metadata.get_html_by_name( name )} +
+
+
+ %endif + %endfor +
+ +
+ +
+
- +
-
- This will create a new dataset with the contents of this - dataset converted to a new format. + This will inspect the dataset and attempt to correct the above column values if they are not accurate.
+
+ %if data.missing_meta(): +
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.
+ %endif +
+
+

+ %if id_name == 'id': + <% converters = data.get_converter_types() %> + %if len( converters ) > 0: +

+
Convert to new format
+
+
+ +
+ +
+ +
+
+ This will create a new dataset with the contents of this dataset converted to a new format. +
+
+
+
+ +
+
+
+
+

+ %endif + %endif +

+
Change data type
+
+
+ +
+ +
+ ${datatype( data, datatypes )} +
+
+ This will change the datatype of the existing dataset + but not modify its contents. Use this if Galaxy + has incorrectly guessed the type of your dataset. +
+
+
+
+ +
+
+
+
+

+%else: +

+
View Attributes
+
+
+ Name: ${data.name}
-
-
- -
- -
-
- -

- %endif + Info: ${data.info} +

+ Data Format: ${data.ext} +
+ %for element in metadata: + ${element.spec.desc}: ${element.value[0]} +
+ %endfor +
+
+
+

+%endif - -

-
Change data type
-
-
- -
- -
- ${datatype( data, datatypes )} +%if trans.app.security_agent.allow_action( trans.user, data.permitted_actions.DATASET_MANAGE_PERMISSIONS, dataset = data ): + <%namespace file="/dataset/security_common.mako" import="render_permission_form" /> + ${render_permission_form( data.dataset, data.name, h.url_for( action='edit' ), id_name, data.id, trans.user.all_roles() )} +%elif trans.user: +
+
View permissions
+
+
+ %if data.dataset.actions: +
    + %for action, roles in trans.app.security_agent.get_dataset_permissions( data.dataset ).items(): + %if roles: +
  • ${action.description}
  • +
      + %for role in roles: +
    • ${role.description}
    • + %endfor +
    + %endif + %endfor +
+ %else: +

This dataset is accessible by everyone (it is public).

+ %endif
- -
- This will change the datatype of the existing dataset - but not modify its contents. Use this if Galaxy - has incorrectly guessed the type of your dataset. -
-
-
-
- -
- -
-
- -

-

-
Copy History Item
-
- Click here to make a copy of this history item. -
-
-

+
+
+%endif diff --git a/templates/dataset/security_common.mako b/templates/dataset/security_common.mako new file mode 100644 index 00000000000..234e8b0a369 --- /dev/null +++ b/templates/dataset/security_common.mako @@ -0,0 +1,85 @@ +<%def name="render_select( current_actions, action_key, action, all_roles )"> + <% + in_roles = [] + for a in current_actions: + if a.action == action.action: + in_roles.append( a.role ) + out_roles = filter( lambda x: x not in in_roles, all_roles ) + %> +

${action.description}

+
+ Roles associated:
+
+ +
+
+ Roles not associated:
+
+ +
+ + +<%def name="render_permission_form( obj, obj_name, form_url, id_name, id, all_roles )"> + <% + if isinstance( obj, trans.app.model.User ): + current_actions = obj.default_permissions + obj_str = 'user %s' % obj_name + elif isinstance( obj, trans.app.model.History ): + current_actions = obj.default_permissions + obj_str = 'history %s' % obj_name + elif isinstance( obj, trans.app.model.Dataset ): + current_actions = obj.actions + obj_str = 'dataset(s) %s' % obj_name + else: + current_actions = obj.dataset.actions + obj_str = 'unknown object %s' %obj_name + %> + +
+
Associate with roles and set permissions on ${obj_str}
+
+
+ +
+ %for k, v in trans.app.model.Dataset.permitted_actions.items(): +
+ ${render_select( current_actions, k, v, all_roles )} +
+ %endfor +
+ +
+
+
+
+

+ diff --git a/templates/form.mako b/templates/form.mako index c003de02585..9fe2a413884 100644 --- a/templates/form.mako +++ b/templates/form.mako @@ -10,6 +10,10 @@ $(function(){ +%if header: + ${header} +%endif +

${form.title}
@@ -21,9 +25,11 @@ $(function(){ cls += " form-row-error" %>
+ %if input.use_label: + %endif
diff --git a/templates/history/options.mako b/templates/history/options.mako index 8725637305f..c9724ae3724 100644 --- a/templates/history/options.mako +++ b/templates/history/options.mako @@ -17,6 +17,7 @@
  • Create a new empty history
  • %endif
  • Construct workflow from the current history
  • +
  • Change default permissions for the current history
  • Share current history
  • %endif
  • Show deleted datasets in history
  • diff --git a/templates/history/permissions.mako b/templates/history/permissions.mako new file mode 100644 index 00000000000..a189523440d --- /dev/null +++ b/templates/history/permissions.mako @@ -0,0 +1,7 @@ +<%inherit file="/base.mako"/> +<%def name="title()">Change Default Permissions on New Datasets in This History +<%namespace file="/dataset/security_common.mako" import="render_permission_form" /> + +%if trans.user: + ${render_permission_form( trans.history, trans.history.name, h.url_for(), 'id', None, trans.user.all_roles() )} +%endif diff --git a/templates/history/share.mako b/templates/history/share.mako index 5e64e66756a..8728587cb45 100644 --- a/templates/history/share.mako +++ b/templates/history/share.mako @@ -1,6 +1,7 @@ <%inherit file="/base.mako"/> <%def name="title()">Share histories +%if not can_change and not cannot_change:
    Share Histories
    @@ -27,4 +28,90 @@
    -
    \ No newline at end of file +
    +%else: + +
    + %for history in histories: + + %endfor + +
    + The history or histories you've chosen to share contain datasets that the user you're sharing with does not have permission to access. These datasets are shown below. Datasets which the user already has permission to access are not shown. +
    +

    + %if can_change: +

    + The following datasets can be shared with ${email} by updating their permissions: +

    + + + %for history, datasets in can_change.items(): + + + + + %endfor +
    HistoriesDatasets
    ${history.name} + %for dataset in datasets: + ${dataset.name}
    + %endfor +
    +

    +

    + %endif + %if cannot_change: +

    + The following datasets cannot be shared with ${email} because you do not have permission to change the permissions on them. +

    + + + %for history, datasets in cannot_change.items(): + + + + + %endfor +
    HistoriesDatasets
    ${history.name} + %for dataset in datasets: + ${dataset.name}
    + %endfor +
    +

    +

    + %endif +

    + How would you like to proceed? +

    + %if can_change: + Set datasets above to public access + %if cannot_change: + (where possible) + %endif +
    + Set datasets above to private access for me and the user(s) with whom I am sharing + %if cannot_change: + (where possible) + %endif +
    + %endif + Share anyway + %if can_change: + (don't change any permissions) + %endif +
    + Don't share
    +
    +
    +

    +
    +%endif diff --git a/templates/library/browser.mako b/templates/library/browser.mako new file mode 100644 index 00000000000..e9a15c4b690 --- /dev/null +++ b/templates/library/browser.mako @@ -0,0 +1,166 @@ +<%inherit file="/base.mako"/> +<%namespace file="common.mako" import="render_dataset" /> +<%namespace file="/message.mako" import="render_msg" /> + +<%def name="title()">Import from Library +<%def name="stylesheets()"> + + + + + + + + + + +<%def name="render_folder( parent, parent_pad )"> + <% + if not trans.app.security_agent.check_folder_contents( trans.user, parent ): + return "" + pad = parent_pad + 20 + if parent_pad == 0: + expander = "/static/images/silk/resultset_bottom.png" + folder = "/static/images/silk/folder_page.png" + subfolder = False + else: + expander = "/static/images/silk/resultset_next.png" + folder = "/static/images/silk/folder.png" + subfolder = True + %> +
  • +
    + + ${parent.name} + %if parent.description: + - ${parent.description} + %endif +
    +
  • + %if subfolder: +
      + %else: +
        + %endif + %for folder in parent.active_folders: + ${render_folder( folder, pad )} + %endfor + %for dataset in parent.active_datasets: + %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.DATASET_ACCESS, dataset=dataset.dataset ): +
      • ${render_dataset( dataset )}
      • + %endif + %endfor +
      + + +

      Libraries

      + +%if msg: + ${render_msg( msg, messagetype )} +%endif + +%if not libraries: + No libraries contain datasets that you are allowed to access +%else: + <% can_access = False %> +
      +
        + %for library in libraries: + %if trans.app.security_agent.check_folder_contents( trans.user, library ): + <% can_access = True %> +
      • +
        + + + + + + + +
        + + ${library.name} + %if library.description: + - ${library.description} + %endif + FormatDbInfo
        +
        +
      • +
          + ${render_folder( library.root_folder, 0 )} +
        +
        + %endif + %endfor +
      + %if can_access: + + %else: + No libraries contain datasets that you are allowed to access + %endif +
      +%endif diff --git a/templates/library/common.mako b/templates/library/common.mako new file mode 100644 index 00000000000..d1bf6a5b6d2 --- /dev/null +++ b/templates/library/common.mako @@ -0,0 +1,91 @@ +<%doc> + Shamelessly stolen from history... this needs to be cleaned up to remove a + bunch of stuff that doesn't apply to library datasets (like state, etc). + + +## Render the dataset `data` +<%def name="render_dataset( data )"> + <% + if data.state in ['no state','',None]: + data_state = "queued" + else: + data_state = data.state + %> + %if not trans.app.security_agent.allow_action( trans.user, data.permitted_actions.DATASET_ACCESS, dataset = data.dataset ): +
      + %else: +
      + %endif + + ## Header row for history items (name, state, action buttons) +
      +
      + + %if data_state == 'running': +
      + %elif data_state != 'ok': +
      + %endif +
      + <%doc> +
      + display data + edit attributes + delete +
      + + + + + + + + +
      +
      + + view or edit attributes + +
      + + ${data.display_name()} +
      ${data.ext}${data.dbkey}${data.info}
      +
      + + ## Body for history items, extra info and actions, data "peek" +
      + %if not trans.app.security_agent.allow_action( trans.user, data.permitted_actions.DATASET_ACCESS, dataset = data.dataset ): +
      You do not have permission to view this dataset.
      + %else: +
      ${data.blurb}
      +
      + %if data.has_data: + save + %for display_app in data.datatype.get_display_types(): + <% display_links = data.datatype.get_display_links( data, display_app, app, request.base ) %> + %if len( display_links ) > 0: + | ${data.datatype.get_display_label(display_app)} + %for display_name, display_link in display_links: + ${display_name} + %endfor + %endif + %endfor + %endif +
      + %if data.peek != "no peek": +
      ${data.display_peek()}
      + %endif + %endif + ## Recurse for child datasets + %if len( data.visible_children ) > 0: +
      + There are ${len( data.visible_children )} secondary datasets. + %for idx, child in enumerate( data.visible_children ): + ${render_dataset( child )} + %endfor +
      + %endif +
      + diff --git a/templates/message.mako b/templates/message.mako index 551b60c4735..d0d31ff93e7 100644 --- a/templates/message.mako +++ b/templates/message.mako @@ -1,32 +1,43 @@ <%inherit file="/base.mako"/> <%def name="javascripts()"> -${parent.javascripts()} - + if ( parent.handle_minwidth_hint ) + { + parent.handle_minwidth_hint( -1 ); + } +
      ${message}
      + +## Render a message +<%def name="render_msg( msg, messagetype='done' )"> +
      ${msg}
      + diff --git a/templates/no_access.mako b/templates/no_access.mako new file mode 100644 index 00000000000..031cafbaf5f --- /dev/null +++ b/templates/no_access.mako @@ -0,0 +1,15 @@ +<%inherit file="/base.mako"/> + +<%def name="javascripts()"> + ${parent.javascripts()} + + + +
      ${message}
      diff --git a/templates/root/history_common.mako b/templates/root/history_common.mako index 139bf19dfb1..f09229dbd1c 100644 --- a/templates/root/history_common.mako +++ b/templates/root/history_common.mako @@ -6,7 +6,11 @@ else: data_state = data.state %> -
      + %if not trans.app.security_agent.allow_action( trans.user, data.permitted_actions.DATASET_ACCESS, dataset = data.dataset ): +
      + %else: +
      + %endif %if data.deleted:
      @@ -36,7 +40,9 @@ ## Body for history items, extra info and actions, data "peek"
      - %if data_state == "queued": + %if not trans.app.security_agent.allow_action( trans.user, data.permitted_actions.DATASET_ACCESS, dataset = data.dataset ): +
      You do not have permission to view this dataset.
      + %elif data_state == "queued":
      Job is waiting to run
      %elif data_state == "running":
      Job is currently running
      diff --git a/templates/root/index.mako b/templates/root/index.mako index f573571162b..dece4ec144c 100644 --- a/templates/root/index.mako +++ b/templates/root/index.mako @@ -1,11 +1,26 @@ <%inherit file="/base_panels.mako"/> +<%def name="init()"> +<% + self.has_left_panel=True + self.has_right_panel=True + self.active_view="analysis" +%> +%if trans.app.config.require_login and not trans.user: + +%endif + + <%def name="left_panel()">
      Tools
      - +
      @@ -13,7 +28,9 @@ ## If a specific tool id was specified, load it in the middle frame <% - if tool_id is not None: + if trans.app.config.require_login and not trans.user: + center_url = h.url_for( controller='user', action='login' ) + elif tool_id is not None: center_url = h.url_for( 'tool_runner', tool_id=tool_id, from_noframe=True ) elif m_c is not None: center_url = h.url_for( controller=m_c, action=m_a ) @@ -29,12 +46,12 @@
      History
      - +
      - \ No newline at end of file + diff --git a/templates/root/masthead.mako b/templates/root/masthead.mako index 58d8f1776db..270d9f59d3c 100644 --- a/templates/root/masthead.mako +++ b/templates/root/masthead.mako @@ -9,32 +9,65 @@ - + +
      Galaxy${brand}
      - - Info: report bugs - | wiki - | screencasts - | blog + %if not app.config.require_login or ( app.config.require_login and trans.user): + View: + analysis + | workflow + %if admin_user == "true": + | admin + %endif + + +     + %endif + + Info: report bugs + | wiki + | screencasts +     + %if app.config.use_remote_user: Logged in as ${t.user.email} %else: %if t.user: - Logged in as ${t.user.email}: manage - | logout + Logged in as ${t.user.email}: manage + %if app.config.require_login: + | logout + %else: + | logout + %endif %else: - Account: create - | login + Account: + %if app.config.allow_user_creation: + create | + %endif + login %endif %endif   +
      diff --git a/templates/root/tool_menu.mako b/templates/root/tool_menu.mako index c2d77210905..04af8526c4c 100644 --- a/templates/root/tool_menu.mako +++ b/templates/root/tool_menu.mako @@ -110,4 +110,4 @@ - \ No newline at end of file + diff --git a/templates/user/index.mako b/templates/user/index.mako index 2b11262cece..04303c9b0a4 100644 --- a/templates/user/index.mako +++ b/templates/user/index.mako @@ -8,6 +8,7 @@ %else: @@ -16,4 +17,4 @@
    • Login
    • Create new account
    -%endif \ No newline at end of file +%endif diff --git a/templates/user/permissions.mako b/templates/user/permissions.mako new file mode 100644 index 00000000000..45b44795f38 --- /dev/null +++ b/templates/user/permissions.mako @@ -0,0 +1,7 @@ +<%inherit file="/base.mako"/> +<%def name="title()">Change Default Permissions on New Histories +<%namespace file="/dataset/security_common.mako" import="render_permission_form" /> + +%if trans.user: + ${render_permission_form( trans.user, trans.user.email, h.url_for(), 'id', None, trans.user.all_roles() )} +%endif diff --git a/templates/workflow/editor.mako b/templates/workflow/editor.mako index 18d7b862fed..3b3cf7ee055 100644 --- a/templates/workflow/editor.mako +++ b/templates/workflow/editor.mako @@ -1,6 +1,18 @@ <%inherit file="/base_panels.mako"/> -<%def name="title()">Galaxy Workflow Editor +<%def name="init()"> +<% + self.active_view="workflow" + self.message_box_visible=True + self.message_box_class="warning" +%> + + +<%def name="message_box_content()"> + Workflow support is currently in beta testing. + Workflows may not work with all tools, may fail unexpectedly, and may + not be compatible with future updates to Galaxy. + <%def name="late_javascripts()"> @@ -229,7 +241,7 @@ } var close_editor = function() { - <% next_url = h.url_for( controller='root', m_c='workflow' ) %> + <% next_url = h.url_for( controller='workflow', action='index' ) %> if ( workflow && workflow.has_changes ) { do_close = function() { window.onbeforeunload = undefined; @@ -301,11 +313,12 @@ <%def name="stylesheets()"> - ${parent.stylesheets()} - - ## Also include "base.css" for styling tool menu and forms (details) + ## Include "base.css" for styling tool menu and forms (details) + ## But make sure styles for the layout take precedence + ${parent.stylesheets()} +