aboutsummaryrefslogtreecommitdiff
path: root/mod/page.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'mod/page.cxx')
-rw-r--r--mod/page.cxx58
1 files changed, 23 insertions, 35 deletions
diff --git a/mod/page.cxx b/mod/page.cxx
index 706d052..1061788 100644
--- a/mod/page.cxx
+++ b/mod/page.cxx
@@ -373,47 +373,35 @@ namespace brep
}
}
- // TR_TAGS
+ // TR_TOPICS
//
- void TR_TAGS::
+ void TR_TOPICS::
operator() (serializer& s) const
{
- if (!tags_.empty () || project_)
- {
- s << TR(CLASS="tags")
- << TH << "tags" << ~TH
- << TD
- << SPAN(CLASS="value");
-
- auto print = [&s, this] (const string& t)
- {
- s << A
- << HREF
- << tenant_dir (root_, tenant_) << "?packages="
- << mime_url_encode (t)
- << ~HREF
- << t
- << ~A;
- };
-
- bool pt (project_ != nullptr &&
- find (tags_.begin (), tags_.end (), *project_) == tags_.end ());
-
- if (pt)
- print (project_->string ());
-
- for (const string& t: tags_)
- {
- if (&t != &tags_[0] || pt)
- s << " ";
+ // Omit the element if there are no topics.
+ //
+ if (topics_.empty ())
+ return;
- print (t);
- }
+ s << TR(CLASS="topics")
+ << TH << "topics" << ~TH
+ << TD
+ << SPAN(CLASS="value");
- s << ~SPAN
- << ~TD
- << ~TR;
+ for (const string& t: topics_)
+ {
+ s << A
+ << HREF
+ << tenant_dir (root_, tenant_) << "?packages="
+ << mime_url_encode (t)
+ << ~HREF
+ << t
+ << ~A;
}
+
+ s << ~SPAN
+ << ~TD
+ << ~TR;
}
// TR_DEPENDS