Skip to content

Commit 1087aff

Browse files
committed
check if new script is available
1 parent 1f4fc42 commit 1087aff

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

omeroweb/webclient/templates/webclient/scripts/split_view_figure.html

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ <h2 style="color: red">{{ warning }}</h2>
199199
<option value="Image Name" selected="True" >Image Name</option>
200200
<option value="Datasets" >Datasets</option>
201201
<option value="Tags" >Tags</option>
202-
<option value="Custom" >Custom</option>
202+
{% if custom_labels_supported %}
203+
<option value="Custom" >Custom</option>
204+
{% endif %}
203205
</select>
204206
</td>
205207
{% for c in channels %}
@@ -226,22 +228,24 @@ <h2 style="color: red">{{ warning }}</h2>
226228
</td>
227229
</tr>
228230
</table>
229-
230-
<hr />
231-
232-
<div title="Custom label" class="customLabelInput" align="center" style="display:none;position:relative;left:float;">
233-
Custom label:
234-
<input type="text" name="Custom_Label" value="" />
235-
<select name="Image_Custom_Label_List" style="margin-right:20px;display:none;">
236-
<option value="All" selected="True">All Images</option>
237-
{% for imgData in imgDict %}
238-
<option value="{{ imgData.id }}">{{imgData.name}}</option>
239-
{% endfor %}
240-
</select>
241-
</div>
242-
<div title="All custom labels" class="allLabels" style="display:none">
243-
<input type="text" name="All_labels" value="" />
244-
</div>
231+
{% if custom_labels_supported %}
232+
<hr />
233+
234+
<div title="Custom label" class="customLabelInput" align="center" style="display:none;position:relative;left:float;">
235+
Custom label:
236+
<input type="text" name="Custom_Label" value="" />
237+
<select name="Image_Custom_Label_List" style="margin-right:20px;display:none;">
238+
<option value="All" selected="True">All Images</option>
239+
{% for imgData in imgDict %}
240+
<option value="{{ imgData.id }}">{{imgData.name}}</option>
241+
{% endfor %}
242+
</select>
243+
</div>
244+
<div title="All custom labels" class="allLabels" style="display:none">
245+
<input type="text" name="All_labels" value="" />
246+
</div>
247+
{% endif %}
248+
custom_labels_supported {{ custom_labels_supported }}
245249
{% endblock %}
246250

247251
<!---------------------------- FIGURE PREVIEW ---------------------->

omeroweb/webclient/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4410,6 +4410,11 @@ def loadImageTags(imageIds):
44104410
if scriptId < 0:
44114411
raise AttributeError("No script found for path '%s'" % scriptPath)
44124412

4413+
if scriptName == "SplitView":
4414+
# Check we have script that supports custom labels
4415+
params = scriptService.getParams(scriptId)
4416+
context["custom_labels_supported"] = "All_labels" in params.inputs
4417+
44134418
context["template"] = template
44144419
context["scriptId"] = scriptId
44154420
return context

0 commit comments

Comments
 (0)