Skip to content
Snippets Groups Projects
Commit 0ef4e7bc authored by Philip ABBET's avatar Philip ABBET
Browse files

[website] Don't allow to fork, copy, add a new version of a binary algorithm...

[website] Don't allow to fork, copy, add a new version of a binary algorithm without a shared library
parent 0f409fdb
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -32,9 +32,11 @@ ...@@ -32,9 +32,11 @@
{% ifequal request.user.username object.author.username %} {% ifequal request.user.username object.author.username %}
<!-- Share, needs to be the owner and it may not be public already --> <!-- Share, needs to be the owner and it may not be public already -->
{% if object.valid %}
{% ifnotequal object.get_sharing_display 'Public' %} {% ifnotequal object.get_sharing_display 'Public' %}
<a class="btn btn-default btn-share" href="{{ object.get_absolute_url }}#sharing" data-toggle="tooltip" data-placement="bottom" title="Share"><i class="fa fa-share-square-o fa-lg"></i></a> <a class="btn btn-default btn-share" href="{{ object.get_absolute_url }}#sharing" data-toggle="tooltip" data-placement="bottom" title="Share"><i class="fa fa-share-square-o fa-lg"></i></a>
{% endifnotequal %} {% endifnotequal %}
{% endif %}
<!-- Delete, needs to be the owner --> <!-- Delete, needs to be the owner -->
{% if object.deletable %} {% if object.deletable %}
...@@ -42,7 +44,9 @@ ...@@ -42,7 +44,9 @@
{% endif %} {% endif %}
<!-- New version, needs to be the owner --> <!-- New version, needs to be the owner -->
{% if object.valid %}
<a class="btn btn-default btn-new-version" href="{% url 'algorithms:new-version' object.name %}" data-toggle="tooltip" data-placement="bottom" title="New version"><i class="fa fa-copy fa-lg"></i></a> <a class="btn btn-default btn-new-version" href="{% url 'algorithms:new-version' object.name %}" data-toggle="tooltip" data-placement="bottom" title="New version"><i class="fa fa-copy fa-lg"></i></a>
{% endif %}
<!-- Edit, needs to be modifiable --> <!-- Edit, needs to be modifiable -->
{% if object.modifiable %} {% if object.modifiable %}
...@@ -56,12 +60,14 @@ ...@@ -56,12 +60,14 @@
<a class="btn btn-default btn-edit" href="{% url 'admin:algorithms_algorithm_change' object.id %}" data-toggle="tooltip" data-placement="bottom" title="Edit as admin"><i class="fa fa-cogs fa-lg"></i></a> <a class="btn btn-default btn-edit" href="{% url 'admin:algorithms_algorithm_change' object.id %}" data-toggle="tooltip" data-placement="bottom" title="Edit as admin"><i class="fa fa-cogs fa-lg"></i></a>
{% endif %} {% endif %}
{% if open_source and not request.user.is_anonymous %} {% if object.valid and open_source and not request.user.is_anonymous %}
<!-- Fork button, needs to be logged in --> <!-- Fork button, needs to be logged in -->
<a class="btn btn-default btn-fork" href="{% url 'algorithms:fork' object.author.username object.name object.version %}" data-toggle="tooltip" data-placement="bottom" title="Fork"><i class="fa fa-code-fork fa-lg"></i></a> <a class="btn btn-default btn-fork" href="{% url 'algorithms:fork' object.author.username object.name object.version %}" data-toggle="tooltip" data-placement="bottom" title="Fork"><i class="fa fa-code-fork fa-lg"></i></a>
{% endif %} {% endif %}
<!-- Search, works for logged-in and anonymous users --> <!-- Search, works for logged-in and anonymous users -->
{% if object.valid %}
<a class="btn btn-default btn-search" href="{% url 'search:search' %}?query=type:results%20{% if object.analysis %}analyzer{% else %}algo{% endif %}:{{ object.fullname }}" data-toggle="tooltip" data-placement="bottom" title="Search experiments"><i class="fa fa-search fa-lg"></i></a> <a class="btn btn-default btn-search" href="{% url 'search:search' %}?query=type:results%20{% if object.analysis %}analyzer{% else %}algo{% endif %}:{{ object.fullname }}" data-toggle="tooltip" data-placement="bottom" title="Search experiments"><i class="fa fa-search fa-lg"></i></a>
{% endif %}
</div> </div>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<ul id="object-tabs" class="nav nav-tabs" role="tablist"> <ul id="object-tabs" class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#viewer" role="tab" data-toggle="tab" aria-controls="viewer">Algorithm</a></li> <li role="presentation" class="active"><a href="#viewer" role="tab" data-toggle="tab" aria-controls="viewer">Algorithm</a></li>
<li role="presentation"><a {% if not algorithm.description %}title="No documentation available" {% endif %}href="#doc" role="tab" data-toggle="tab" aria-controls="doc">Documentation{% if not algorithm.description %} <i class="fa fa-warning"></i>{% endif %}</a></li> <li role="presentation"><a {% if not algorithm.description %}title="No documentation available" {% endif %}href="#doc" role="tab" data-toggle="tab" aria-controls="doc">Documentation{% if not algorithm.description %} <i class="fa fa-warning"></i>{% endif %}</a></li>
{% if owner %} {% if owner and algorithm.valid %}
<li role="presentation"><a href="#sharing" role="tab" data-toggle="tab" aria-controls="sharing">Sharing</a></li> <li role="presentation"><a href="#sharing" role="tab" data-toggle="tab" aria-controls="sharing">Sharing</a></li>
{% endif %} {% endif %}
<li role="presentation"><a href="#experiments" role="tab" data-toggle="tab" aria-controls="experiments">Experiments <span class="badge">{{ experiments.count }}</span></a></li> <li role="presentation"><a href="#experiments" role="tab" data-toggle="tab" aria-controls="experiments">Experiments <span class="badge">{{ experiments.count }}</span></a></li>
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<div role="tabpanel" class="tab-pane" id="doc"> <div role="tabpanel" class="tab-pane" id="doc">
{% doc_editor algorithm 'api_algorithms:object' %} {% doc_editor algorithm 'api_algorithms:object' %}
</div> </div>
{% if owner %} {% if owner and algorithm.valid %}
<div role="tabpanel" class="tab-pane" id="sharing"> <div role="tabpanel" class="tab-pane" id="sharing">
{% algorithm_sharing algorithm %} {% algorithm_sharing algorithm %}
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment