Add a class to links of recommended caches, show a star via CSS

sql-rework
Tomasz Golinski 2020-02-29 02:39:50 +01:00
rodzic 8d548e7002
commit 2ed5aa1dfa
4 zmienionych plików z 12 dodań i 2 usunięć

Wyświetl plik

@ -20,7 +20,10 @@ std::string Cache::link() const {
}
std::string Cache::link_name() const {
return "<a href=\"" + link() + "\">" + safe_name() + " (" + code + ")</a>";
if (recommended)
return "<a class=\"fav\" href=\"" + link() + "\">" + safe_name() + " (" + code + ")</a>";
else
return "<a href=\"" + link() + "\">" + safe_name() + " (" + code + ")</a>";
}

Wyświetl plik

@ -42,6 +42,12 @@ a:active {
text-decoration: none;
}
a.fav {
background-image: url("rating-star.png");
background-repeat: no-repeat;
padding-left: 20px;
}
table,
dl,
.heatmap {

Wyświetl plik

@ -287,7 +287,7 @@ int main(int argc, char** argv) {
std::cout << "<html>\n";
std::cout << " <head>\n";
std::cout << " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n";
std::cout << " <link rel=\"stylesheet\" type=\"text/css\" href=\"geo.css?ver=6\">\n";
std::cout << " <link rel=\"stylesheet\" type=\"text/css\" href=\"geo.css?ver=7\">\n";
std::cout << " <title>Geocaching stats</title>\n";
std::cout << "</head>\n";
std::cout << "<body>\n";

Wyświetl plik

@ -53,4 +53,5 @@ configure_file(input: 'maps/USA.png', output: 'USA.png', copy: true, install: tr
configure_file(input: 'maps/Europe.png', output: 'Europe.png', copy: true, install: true, install_dir: '.')
configure_file(input: 'maps/World.png', output: 'World.png', copy: true, install: true, install_dir: '.')
configure_file(input: 'rating-star.png', output: 'rating-star.png', copy: true, install: true, install_dir: '.')
configure_file(input: 'geo.css', output: 'geo.css', copy: true, install: true, install_dir: '.')