Page MenuHomeSoftware Heritage

Add “Save code now” to the Visits page
Closed, MigratedEdits Locked


When looking at the “Visits” tab for a given origin, you can see when the last visit was made. If you are monitoring your own project, it is probably then that you would notice “Oh, it’s been quite some time” and have the desire to see a more recent copy made. The easiest would probably to add a button labeled “Save now!” right next to the last visit date.

(This was noticed during demos at DGD-I seminar on September 2022.)

Event Timeline

anlambert triaged this task as Normal priority.Sep 26 2022, 12:38 PM

I think it is better to reuse the "Save again" button from code tab.

The following change in the origin visits template seems to do the job, see screenshot below.

diff --git a/swh/web/browse/templates/browse-origin-visits.html b/swh/web/browse/templates/browse-origin-visits.html
index 3870f70d..afbf7c50 100644
--- a/swh/web/browse/templates/browse-origin-visits.html
+++ b/swh/web/browse/templates/browse-origin-visits.html
@@ -14,6 +14,7 @@ See top-level LICENSE file for more information
 {% block header %}
 {{ block.super }}
 {% render_bundle 'origin_visits' %}
+{% render_bundle 'save_code_now' %}
 {% endblock %}
 {% block swh-browse-content %}
@@ -22,6 +23,10 @@ See top-level LICENSE file for more information
+  <div class="float-right">
+    {% include "includes/take-new-snapshot.html" %}
+  </div>
     <li class="d-inline-block">
       <b>Total number of visits: </b>{{ origin_visits|length }}

It would do nicely. Thanks! :)

anlambert claimed this task.