Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only make templates visible to users who can create algorithms #3676

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@
</a>

{% if "change_algorithm" in algorithm_perms %}
<a class="nav-link" id="v-pills-containers-tab" data-toggle="pill"
href="#templates" role="tab"
aria-controls="v-pills-containers"
aria-selected="false">
<i class="fas fa-hard-hat fa-fw"></i>&nbsp;Templates</a>
{% if perms.algorithms.add_algorithm %}
<a class="nav-link" id="v-pills-templates-tab" data-toggle="pill"
href="#templates" role="tab"
aria-controls="v-pills-templates"
aria-selected="false">
<i class="fas fa-hard-hat fa-fw"></i>&nbsp;Templates</a>
{% endif %}

<a class="nav-link" id="v-pills-containers-tab" data-toggle="pill"
href="#containers" role="tab"
Expand Down Expand Up @@ -443,22 +445,24 @@ <h2>Permission Requests</h2>

</div>

<div class="tab-pane fade" id="templates" role="tabpanel"
aria-labelledby="v-pills-containers">
{% if perms.algorithms.add_algorithm %}
<div class="tab-pane fade" id="templates" role="tabpanel"
aria-labelledby="v-pills-templates">

<h2>Algorithm Image Template</h2>
<h2>Algorithm Image Template</h2>

<p>
The template offers tailored examples for your algorithm, including input reading and output writing.
It provides a solid foundation for developing an algorithm image or setting up a GitHub repository
</p>
<p>
The template offers tailored examples for your algorithm, including input reading and output writing.
It provides a solid foundation for developing an algorithm image or setting up a GitHub repository
</p>

<a class="btn btn-primary"
href="{% url 'algorithms:image-template' slug=object.slug %}">
<i class="fa fa-download pl-1"></i> Download Algorithm Image Template
</a>
<a class="btn btn-primary"
href="{% url 'algorithms:image-template' slug=object.slug %}">
<i class="fa fa-download pl-1"></i> Download Algorithm Image Template
</a>

</div>
</div>
{% endif %}

<div class="tab-pane fade" id="containers" role="tabpanel"
aria-labelledby="v-pills-containers">
Expand Down