aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-12-07 14:43:49 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-12-07 14:43:49 +0300
commitded07cf185540680bc9c06f174e807ba0f3f736c (patch)
treeef851e6d76fabebff67a2d1ff2beae48edbae154 /mod
parenta91334e64fee910190173f39b6048729db009e4e (diff)
Move indication that tenant is archived to timestamp field on builds and package version details pages
Diffstat (limited to 'mod')
-rw-r--r--mod/mod-builds.cxx7
-rw-r--r--mod/mod-package-version-details.cxx7
-rw-r--r--mod/page.cxx60
3 files changed, 56 insertions, 18 deletions
diff --git a/mod/mod-builds.cxx b/mod/mod-builds.cxx
index ff27c65..6b5c90f 100644
--- a/mod/mod-builds.cxx
+++ b/mod/mod-builds.cxx
@@ -694,7 +694,12 @@ handle (request& rq, response& rs)
"%Y-%m-%d %H:%M:%S %Z",
true /* special */,
true /* local */) +
- " (" + butl::to_string (now - b.timestamp, false) + " ago)");
+ " (" + butl::to_string (now - b.timestamp, false) + " ago");
+
+ if (pb.archived)
+ ts += ", archived";
+
+ ts += ')';
s << TABLE(CLASS="proplist build")
<< TBODY
diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx
index 3a1ce0a..b5d733b 100644
--- a/mod/mod-package-version-details.cxx
+++ b/mod/mod-package-version-details.cxx
@@ -618,7 +618,12 @@ handle (request& rq, response& rs)
"%Y-%m-%d %H:%M:%S %Z",
true /* special */,
true /* local */) +
- " (" + butl::to_string (now - b.timestamp, false) + " ago)");
+ " (" + butl::to_string (now - b.timestamp, false) + " ago");
+
+ if (tn->archived)
+ ts += ", archived";
+
+ ts += ')';
if (b.state == build_state::built)
build_db_->load (b, b.results_section);
diff --git a/mod/page.cxx b/mod/page.cxx
index 7352867..a671346 100644
--- a/mod/page.cxx
+++ b/mod/page.cxx
@@ -747,10 +747,27 @@ namespace brep
<< TD
<< SPAN(CLASS="value");
+ // Print the ' | ' separator if this is not the first item and reset the
+ // `first` flag to false otherwise.
+ //
+ bool first (true);
+ auto separate = [&s, &first] ()
+ {
+ if (first)
+ first = false;
+ else
+ s << " | ";
+ };
+
if (build_.state == build_state::building)
- s << SPAN(CLASS="building") << "building" << ~SPAN << " | ";
+ {
+ separate ();
+
+ s << SPAN(CLASS="building") << "building" << ~SPAN;
+ }
else
{
+
// If no unsuccessful operation results available, then print the
// overall build status. If there are any operation results available,
// then also print unsuccessful operation statuses with the links to the
@@ -761,7 +778,10 @@ namespace brep
if (build_.results.empty () || *build_.status == result_status::success)
{
assert (build_.status);
- s << SPAN_BUILD_RESULT_STATUS (*build_.status) << " | ";
+
+ separate ();
+
+ s << SPAN_BUILD_RESULT_STATUS (*build_.status);
}
if (!build_.results.empty ())
@@ -769,6 +789,9 @@ namespace brep
for (const auto& r: build_.results)
{
if (r.status != result_status::success)
+ {
+ separate ();
+
s << SPAN_BUILD_RESULT_STATUS (r.status) << " ("
<< A
<< HREF
@@ -776,28 +799,33 @@ namespace brep
<< ~HREF
<< r.operation
<< ~A
- << ") | ";
+ << ")";
+ }
}
+ separate ();
+
s << A
<< HREF << build_log_url (host_, root_, build_) << ~HREF
<< "log"
- << ~A
- << " | ";
+ << ~A;
}
}
- if (archived_)
- s << SPAN(CLASS="archived") << "archived" << ~SPAN;
- else if (build_.force == (build_.state == build_state::building
- ? force_state::forcing
- : force_state::forced))
- s << SPAN(CLASS="pending") << "pending" << ~SPAN;
- else
- s << A
- << HREF << build_force_url (host_, root_, build_) << ~HREF
- << "rebuild"
- << ~A;
+ if (!archived_)
+ {
+ separate ();
+
+ if (build_.force == (build_.state == build_state::building
+ ? force_state::forcing
+ : force_state::forced))
+ s << SPAN(CLASS="pending") << "pending" << ~SPAN;
+ else
+ s << A
+ << HREF << build_force_url (host_, root_, build_) << ~HREF
+ << "rebuild"
+ << ~A;
+ }
s << ~SPAN
<< ~TD