Skip to content

Commit

Permalink
Do not display the select across if single page #1524
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <[email protected]>
  • Loading branch information
tdruez committed Jan 20, 2025
1 parent 08bba22 commit 760ee90
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 25 deletions.
18 changes: 10 additions & 8 deletions scanpipe/templates/scanpipe/modals/projects_archive_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@
{{ archive_form.remove_output.label }}
</label>
</div>
<hr>
<div class="field">
<label class="checkbox" for="{{ archive_form.select_across.id_for_label }}">
<input type="checkbox" name="{{ archive_form.select_across.name }}" id="{{ archive_form.select_across.id_for_label }}">
Include all {{ paginator.count|intcomma }} projects
</label>
<p class="help">{{ outputs_download_form.select_across.help_text }}</p>
</div>
{% if page_obj.paginator.num_pages > 1 %}
<hr>
<div class="field">
<label class="checkbox" for="{{ archive_form.select_across.id_for_label }}">
<input type="checkbox" name="{{ archive_form.select_across.name }}" id="{{ archive_form.select_across.id_for_label }}">
Include all {{ paginator.count|intcomma }} projects
</label>
<p class="help">{{ outputs_download_form.select_across.help_text }}</p>
</div>
{% endif %}
</section>
<input type="hidden" name="{{ archive_form.url_query.name }}" value="{{ request.GET.urlencode }}">
<input type="hidden" name="action" value="archive">
Expand Down
18 changes: 10 additions & 8 deletions scanpipe/templates/scanpipe/modals/projects_download_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
{{ outputs_download_form.output_format }}
</div>
</div>
<hr>
<div class="field">
<label class="checkbox" for="{{ outputs_download_form.select_across.id_for_label }}">
<input type="checkbox" name="{{ outputs_download_form.select_across.name }}" id="{{ outputs_download_form.select_across.id_for_label }}">
Include all {{ paginator.count|intcomma }} projects
</label>
<p class="help">{{ outputs_download_form.select_across.help_text }}</p>
</div>
{% if page_obj.paginator.num_pages > 1 %}
<hr>
<div class="field">
<label class="checkbox" for="{{ outputs_download_form.select_across.id_for_label }}">
<input type="checkbox" name="{{ outputs_download_form.select_across.name }}" id="{{ outputs_download_form.select_across.id_for_label }}">
Include all {{ paginator.count|intcomma }} projects
</label>
<p class="help">{{ outputs_download_form.select_across.help_text }}</p>
</div>
{% endif %}
</section>
<input type="hidden" name="{{ outputs_download_form.url_query.name }}" value="{{ request.GET.urlencode }}">
<input type="hidden" name="action" value="download">
Expand Down
18 changes: 10 additions & 8 deletions scanpipe/templates/scanpipe/modals/projects_report_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
{{ report_form.model_name }}
</div>
</div>
<hr>
<div class="field">
<label class="checkbox" for="{{ report_form.select_across.id_for_label }}">
<input type="checkbox" name="{{ report_form.select_across.name }}" id="{{ report_form.select_across.id_for_label }}">
Include all {{ paginator.count|intcomma }} projects
</label>
<p class="help">{{ report_form.select_across.help_text }}</p>
</div>
{% if page_obj.paginator.num_pages > 1 %}
<hr>
<div class="field">
<label class="checkbox" for="{{ report_form.select_across.id_for_label }}">
<input type="checkbox" name="{{ report_form.select_across.name }}" id="{{ report_form.select_across.id_for_label }}">
Include all {{ paginator.count|intcomma }} projects
</label>
<p class="help">{{ report_form.select_across.help_text }}</p>
</div>
{% endif %}
</section>
<input type="hidden" name="{{ report_form.url_query.name }}" value="{{ request.GET.urlencode }}">
<input type="hidden" name="action" value="report">
Expand Down
2 changes: 1 addition & 1 deletion scanpipe/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ class ProjectListView(
):
model = Project
filterset_class = ProjectFilterSet
paginate_by = settings.SCANCODEIO_PAGINATE_BY.get("project", 20)
template_name = "scanpipe/project_list.html"
prefetch_related = [
"labels",
Expand All @@ -572,7 +573,6 @@ class ProjectListView(
),
),
]
paginate_by = settings.SCANCODEIO_PAGINATE_BY.get("project", 20)
table_columns = [
"name",
{
Expand Down

0 comments on commit 760ee90

Please sign in to comment.