Add copyright/copyrightURL support and display it in the release view

This commit is contained in:
emeric
2018-09-21 14:00:15 +02:00
parent c464200644
commit f5f6136159
13 changed files with 139 additions and 19 deletions
+22
View File
@@ -94,6 +94,28 @@ Release::refresh()
}
}
boost::optional<std::string> copyright = release->getCopyright();
boost::optional<std::string> copyrightURL = release->getCopyrightURL();
t->setCondition("if-has-copyright-or-copyright-url", copyright || copyrightURL);
if (copyrightURL)
{
t->setCondition("if-has-copyright-url", true);
Wt::WLink link(*copyrightURL);
link.setTarget(Wt::LinkTarget::NewWindow);
Wt::WAnchor* anchor = t->bindNew<Wt::WAnchor>("copyright-url", link);
anchor->setTextFormat(Wt::TextFormat::Plain);
anchor->setText(Wt::WString::fromUTF8(*copyrightURL));
}
if (copyright)
{
t->setCondition("if-has-copyright", true);
t->bindString("copyright", Wt::WString::fromUTF8(*copyright), Wt::TextFormat::Plain);
}
{
auto artists = release->getArtists();
if (artists.size() > 1)