Skip to content

Commit

Permalink
rename gallery to idr_gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed Mar 14, 2022
1 parent e43141f commit 6b65843
Show file tree
Hide file tree
Showing 42 changed files with 57 additions and 101 deletions.
58 changes: 7 additions & 51 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,65 +25,21 @@ Install the app using `pip <https://pip.pypa.io/en/stable/>`_:

::

$ pip install -U omero-gallery
$ pip install -U idr-gallery

Add gallery custom app to your installed web apps:

::

$ omero config append omero.web.apps '"omero_gallery"'
$ omero config append omero.web.apps '"idr_gallery"'

Now restart OMERO.web as normal.


OMERO.gallery overview
======================

This application supports 2 alternative views of your data in OMERO, which can
be chosen and customised via config settings:

* Default UI (no config): Browse `Group > Project > Dataset > Image`
* Categories UI: Show categories of interest. Allow filtering by map annotations.

For both views, public access can be enabled
`as described here <https://docs.openmicroscopy.org/latest/omero/sysadmins/public.html>`_,
otherwise users will see the standard web login screen.
Once logged-in (as a regular user or public user), the data displayed will
include all data accessible to that user via the normal OMERO permissions.


Default UI
----------

This view supports minimal functionality required for browsing the hierarchy
from Groups -> Projects -> Datasets -> Images. Screen/Plate/Well data is
not supported in this UI.

The home page will display all the available groups that the user can access, with a random
thumbnail from each group. The number of Projects, Datasets and Images within each group
will also be displayed.

.. image:: https://ome.github.io/omero-gallery/images/gallery.png


On browsing into a group, the Projects and 'orphaned' Datasets will be shown in a similar layout.

.. image:: https://ome.github.io/omero-gallery/images/show_group.png

Projects are shown with 5 thumbnails from each Dataset. Clicking 'All Images' will load all the remaining thumbnails
from a chosen Dataset (or you can browse to the Dataset itself by clicking the Dataset name link).

.. image:: https://ome.github.io/omero-gallery/images/show_project.png

Clicking a thumbnail will take you directly to the full image viewer.

.. image:: https://ome.github.io/omero-gallery/images/webgateway_viewer.png


Categories UI
-------------
IDR.gallery overview
====================

This view was originally developed for use in the IDR and can be seen at
This UI was developed for use in the IDR and can be seen at
https://idr.openmicroscopy.org/. In the IDR, a "Study" is a Project or Screen
and they are annotated with Key-Value data in the form of Map Annotations,
for example ``Study Type: 3D-tracking``.
Expand All @@ -98,8 +54,8 @@ https://github.com/ome/omero-mapr/ is installed then you can:
* Find Studies containing Images that match queries on their Map Annotations.


Configuring the Categories UI
-----------------------------
Configuring the UI
------------------

**omero.web.gallery.category_queries:**
To enable the Categories UI, you must set ``omero.web.gallery.category_queries``.
Expand Down
1 change: 1 addition & 0 deletions idr_gallery/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default_app_config = 'idr_gallery.apps.GalleryAppConfig'
6 changes: 3 additions & 3 deletions omero_gallery/apps.py → idr_gallery/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
#
#
# Copyright (c) 2016 University of Dundee.
# Copyright (c) 2016-2022 University of Dundee.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
Expand All @@ -28,5 +28,5 @@


class GalleryAppConfig(AppConfig):
name = "omero_gallery"
label = "gallery"
name = "idr_gallery"
label = "idr_gallery"
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
("Logo image and link. e.g."
" {'src':'url.png','href':'www.url', 'alt':'Image alt text'}"
" href can be URL name for reverse(url_name). If href is omitted,"
" it will default to 'webgallery_index'")],
" it will default to 'idr_gallery_index'")],

"omero.web.gallery.footer_html":
["FOOTER_HTML",
Expand Down
4 changes: 2 additions & 2 deletions omero_gallery/settings.py → idr_gallery/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

# We can directly manipulate the settings
# E.g. link to the 'top links' in webclient page header
# 'webgallery_index' is name in urls.py
# settings.TOP_LINKS.append(["Gallery", "webgallery_index"])
# 'idr_gallery_index' is name in urls.py
# settings.TOP_LINKS.append(["Gallery", "idr_gallery_index"])
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{% url 'webgallery_index' %}">OMERO.gallery</a>
<a class="navbar-brand" href="{% url 'idr_gallery_index' %}">OMERO.gallery</a>
</div>
<div class="navbar-collapse collapse pull-right">
<!-- <form class="navbar-form navbar-right" role="form"> -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{% extends "webgallery/categories/base.html" %}
{% extends "idr_gallery/categories/base.html" %}

{% block content %}

Expand All @@ -9,7 +9,7 @@
var FILTER_MAPR_KEYS = {{ filter_mapr_keys|safe }};
var TITLE_KEYS = {{ TITLE_KEYS|safe }};
var STUDY_SHORT_NAME = {{ STUDY_SHORT_NAME|safe }};
const GALLERY_INDEX = "{% url 'webgallery_index' %}";
const GALLERY_INDEX = "{% url 'idr_gallery_index' %}";
const BASE_URL = "{{ base_url }}";
const CATEGORY_QUERIES = {{ category_queries|safe }};
var SUPER_CATEGORY {% if super_category %} = {{ super_category|safe }} {% endif %};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{% extends "webgallery/categories/base.html" %}
{% extends "idr_gallery/categories/base.html" %}

{% block content %}

Expand Down Expand Up @@ -72,7 +72,7 @@ <h2 class="search-by">Search by:</h2>
{% if category %}
href="{% url 'gallery_super_category' super_category=category %}"
{% else %}
href="{% url 'webgallery_index' %}"
href="{% url 'idr_gallery_index' %}"
{% endif %}
>X</a>
</div>
Expand All @@ -99,7 +99,7 @@ <h2 class="search-by">Search by:</h2>
// Various global constants from omero config set...
var FILTER_KEYS = {{ filter_keys|escape|safe }};
var FILTER_MAPR_KEYS = {{ filter_mapr_keys|escape|safe }};
const GALLERY_INDEX = "{% url 'webgallery_index' %}";
const GALLERY_INDEX = "{% url 'idr_gallery_index' %}";
const BASE_URL = "{{ base_url }}";
const CATEGORY_QUERIES = {{ category_queries|escape|safe }};
var TITLE_KEYS = {{ TITLE_KEYS|escape|safe }};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "webgallery/base/base.html" %}
{% extends "idr_gallery/base/base.html" %}

{% block title %}
OMERO.web Gallery
Expand All @@ -21,7 +21,7 @@ <h1>Welcome to OMERO Gallery</h1>
<h2>{{ g.name }}</h2>
<p class="pull-left">
{% if g.image %}
<a href="{% url 'webgallery_show_group' g.id %}">
<a href="{% url 'idr_gallery_show_group' g.id %}">
<img class="img-thumbnail" title="{{ g.image.name }}" style="width:96px; height:96px"
src="{% url 'webgateway_render_thumbnail' g.image.id 96 %}"/>
</a>
Expand All @@ -35,7 +35,7 @@ <h2>{{ g.name }}</h2>
</ul>
<div class="clearfix"></div>
<p style="margin-left:20px">
<a class="btn btn-default" href="{% url 'webgallery_show_group' g.id %}" role="button">View details &raquo;</a>
<a class="btn btn-default" href="{% url 'idr_gallery_show_group' g.id %}" role="button">View details &raquo;</a>
</p>
</div>
<div class="clearfix"></div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "webgallery/base/base.html" %}
{% extends "idr_gallery/base/base.html" %}

{% block title %}
{{ dataset.getName }}
Expand All @@ -9,7 +9,7 @@

{% if dataset.getParent %}
{% with p=dataset.getParent %}
Back to: <a href="{% url 'webgallery_show_project' p.id %}">{{ p.getName }}</a>
Back to: <a href="{% url 'idr_gallery_show_project' p.id %}">{{ p.getName }}</a>
{% endwith %}
{% endif %}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "webgallery/base/base.html" %}
{% extends "idr_gallery/base/base.html" %}

{% block title %}
OMERO.web Gallery
Expand All @@ -18,7 +18,7 @@ <h1>{{ group.name }}</h1>
<h2>{{ p.name }}</h2>
<p class="pull-left">
{% if p.image %}
<a href="{% url 'webgallery_show_project' p.id %}">
<a href="{% url 'idr_gallery_show_project' p.id %}">
<img class="img-thumbnail" title="{{ p.image.name }}" style="width:96px; height:96px"
src="{% url 'webgateway_render_thumbnail' p.image.id 96 %}"/>
</a>
Expand All @@ -31,7 +31,7 @@ <h2>{{ p.name }}</h2>
</ul>
<div class="clearfix"></div>
<p style="margin-left:20px">
<a class="btn btn-default" href="{% url 'webgallery_show_project' p.id %}" role="button">View details &raquo;</a>
<a class="btn btn-default" href="{% url 'idr_gallery_show_project' p.id %}" role="button">View details &raquo;</a>
</p>
</div>
<div class="clearfix"></div>
Expand All @@ -47,7 +47,7 @@ <h2>{{ p.name }}</h2>
<h2>{{ p.name }}</h2>
<p class="pull-left">
{% if p.image %}
<a href="{% url 'webgallery_show_dataset' p.id %}">
<a href="{% url 'idr_gallery_show_dataset' p.id %}">
<img class="img-thumbnail" title="{{ p.image.name }}" style="width:96px; height:96px"
src="{% url 'webgateway_render_thumbnail' p.image.id 96 %}"/>
</a>
Expand All @@ -59,7 +59,7 @@ <h2>{{ p.name }}</h2>
</ul>
<div class="clearfix"></div>
<p style="margin-left:20px">
<a class="btn btn-default" href="{% url 'webgallery_show_dataset' p.id %}" role="button">View details &raquo;</a>
<a class="btn btn-default" href="{% url 'idr_gallery_show_dataset' p.id %}" role="button">View details &raquo;</a>
</p>
</div>
<div class="clearfix"></div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "webgallery/base/base.html" %}
{% extends "idr_gallery/base/base.html" %}

{% block title %}
{{ image.getName }}
Expand All @@ -8,15 +8,15 @@
{% block body %}

<div>
<a href="{% url 'webgallery_index' %}">Home</a>
<a href="{% url 'idr_gallery_index' %}">Home</a>
Logged in as: {{ ome.user.getFullName }}
</div>

<hr>

{% if image.getParent %}
{% with p=image.getParent %}
Back to: <a href="{% url 'webgallery_show_dataset' p.id %}">{{ p.getName }}</a>
Back to: <a href="{% url 'idr_gallery_show_dataset' p.id %}">{{ p.getName }}</a>
{% endwith %}
{% endif %}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "webgallery/base/base.html" %}
{% extends "idr_gallery/base/base.html" %}

{% block title %}
{{ project.getName }}
Expand All @@ -8,7 +8,7 @@
{% block body %}

<div>
<a href="{% url 'webgallery_index' %}">Home</a>
<a href="{% url 'idr_gallery_index' %}">Home</a>
Logged in as: {{ ome.user.getFullName }}
</div>

Expand All @@ -23,8 +23,8 @@ <h2>{{ project.getName }}</h2>
<ul>
{% for d in datasets %}
<li>
<a href="{% url 'webgallery_show_dataset' d.id %}">{{ d.name }}</a>
Load <a class="load_thumbs" href="{% url 'webgallery_dataset_thumbs' d.id %}">All Images</a>
<a href="{% url 'idr_gallery_show_dataset' d.id %}">{{ d.name }}</a>
Load <a class="load_thumbs" href="{% url 'idr_gallery_dataset_thumbs' d.id %}">All Images</a>
</br>
{% if d.description %}
<div>{{ d.description }}</div>
Expand Down
20 changes: 10 additions & 10 deletions omero_gallery/urls.py → idr_gallery/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,48 @@
from . import views

urlpatterns = [
# index 'home page' of the webgallery app
url(r'^$', views.index, name='webgallery_index'),
# index 'home page' of the idr_gallery app
url(r'^$', views.index, name='idr_gallery_index'),

# All settings as JSON
url(r'^gallery_settings/$', views.gallery_settings),

# group view
url(r'show_group/(?P<group_id>[0-9]+)/$',
views.show_group,
name='webgallery_show_group'),
name='idr_gallery_show_group'),

# project view
url(r'show_project/(?P<project_id>[0-9]+)/$',
views.show_project,
name='webgallery_show_project'),
name='idr_gallery_show_project'),

# dataset view
url(r'show_dataset/(?P<dataset_id>[0-9]+)/$',
views.show_dataset,
name='webgallery_show_dataset'),
name='idr_gallery_show_dataset'),
# use the same dataset view, with a different
# template that only shows thumbnails
url(r'dataset_thumbs/(?P<dataset_id>[0-9]+)/$',
views.show_dataset,
{'template': 'webgallery/dataset_thumbs.html'},
name='webgallery_dataset_thumbs'),
{'template': 'idr_gallery/dataset_thumbs.html'},
name='idr_gallery_dataset_thumbs'),

# image view
url(r'show_image/(?P<image_id>[0-9]+)/$',
views.show_image, name='webgallery_show_image'),
views.show_image, name='idr_gallery_show_image'),

# Search page shows Projects / Screens filtered by Map Annotation
url(r'^search/$', views.search, {'super_category': None}),

# list images within container. NB: not used but potentially useful
url(r'^gallery-api/(?P<obj_type>[screen|project]+)s/'
r'(?P<obj_id>[0-9]+)/images/$',
views.study_images, name='webgallery_study_image'),
views.study_images, name='idr_gallery_study_image'),

# Supports e.g. ?project=1&project=2&screen=3
url(r'^gallery-api/thumbnails/$', views.api_thumbnails,
name='webgallery_api_thumbnails'),
name='idr_gallery_api_thumbnails'),
]

for c in SUPER_CATEGORIES:
Expand Down
Loading

0 comments on commit 6b65843

Please sign in to comment.