kopia lustrzana https://gitlab.com/tomaszg/geostat
Merge remote-tracking branch 'origin/master'
commit
4efce13974
|
@ -324,7 +324,7 @@ void header_html() {
|
|||
std::cout << "<html lang=\"en\">\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=16\">\n";
|
||||
std::cout << " <link rel=\"stylesheet\" type=\"text/css\" href=\"geo.css?ver=17\">\n";
|
||||
std::cout << " <title>Geocaching stats</title>\n";
|
||||
std::cout << "</head>\n";
|
||||
std::cout << "<body>\n";
|
||||
|
|
12
geo.css
12
geo.css
|
@ -1,4 +1,4 @@
|
|||
@import url('https://fonts.googleapis.com/css?family=Lato|Special+Elite|Averia+Serif+Libre');
|
||||
@import url('https://fonts.googleapis.com/css?family=Lato|Averia+Serif+Libre');
|
||||
|
||||
body {
|
||||
padding: 0px;
|
||||
|
@ -352,3 +352,13 @@ details.histogram_others > summary {
|
|||
font-weight: bold;
|
||||
color: #48B;
|
||||
}
|
||||
|
||||
/* geofriends */
|
||||
|
||||
div.users {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
div.user {
|
||||
flex: 1;
|
||||
}
|
||||
|
|
|
@ -45,21 +45,18 @@ int main(int argc, char** argv) {
|
|||
user2.header();
|
||||
std::cout << "</header>\n";
|
||||
|
||||
std::cout << "<div class=\"basic_stats\">\n";
|
||||
|
||||
std::cout << "Number of caches created by " << user1.ocpl_user << " found by " << user2.ocpl_user << ": <span class=\"value\">" << caches_by_user1.size() << "</span><br>\n";
|
||||
std::cout << "Number of recommendations given: <span class=\"value\">" << std::count_if(user2.cc.begin(), user2.cc.end(), [user1](const auto& c) { return (c.recommended && c.owner_uuid == user1.ocpl_user_uuid); }) << "</span><br>\n";
|
||||
|
||||
std::cout << "Number of caches created by " << user2.ocpl_user << " found by " << user1.ocpl_user << ": <span class=\"value\">" << caches_by_user2.size() << "</span><br>\n";
|
||||
std::cout << "Number of recommendations given: <span class=\"value\">" << std::count_if(user1.cc.begin(), user1.cc.end(), [user2](const auto& c) { return (c.recommended && c.owner_uuid == user2.ocpl_user_uuid); }) << "</span><br>\n";
|
||||
|
||||
std::cout << "</div>\n";
|
||||
std::cout << "<div class=\"users\">\n";
|
||||
std::cout << "<div class=\"user\">\n";
|
||||
|
||||
// const int LIST_MAX = 100;
|
||||
short int n = 1;
|
||||
|
||||
std::cout << "<h2>Caches created by " << user1.ocpl_user << " found by " << user2.ocpl_user << "</h2>\n";
|
||||
std::cout << "<div class=\"basic_stats\">\n";
|
||||
std::cout << "Number of caches found: <span class=\"value\">" << caches_by_user1.size() << "</span><br>\n";
|
||||
std::cout << "Number of recommendations given: <span class=\"value\">" << std::count_if(user2.cc.begin(), user2.cc.end(), [user1](const auto& c) { return (c.recommended && c.owner_uuid == user1.ocpl_user_uuid); }) << "</span><br>\n";
|
||||
std::cout << "</div>\n";
|
||||
if (cc_no1 > 0) {
|
||||
std::cout << "<h2>Caches created by " << user1.ocpl_user << " found by " << user2.ocpl_user << "</h2>\n";
|
||||
std::cout << "<div class=\"histogram friendbar\">\n";
|
||||
std::cout << "<div class=\"bar\" style=\"--percent: " << 100 * caches_by_user1.size() / cc_no1 << "%;\"><span class=\"text\">" << 100 * caches_by_user1.size() / cc_no1 << "%</span></div>\n";
|
||||
std::cout << "</div>\n";
|
||||
|
@ -85,10 +82,16 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
std::cout << "</table>\n";
|
||||
}
|
||||
std::cout << "</div>\n";
|
||||
std::cout << "<div class=\"user\">\n";
|
||||
n = 1;
|
||||
std::cout << "<h2>Caches created by " << user2.ocpl_user << " found by " << user1.ocpl_user << "</h2>\n";
|
||||
std::cout << "<div class=\"basic_stats\">\n";
|
||||
std::cout << "Number of caches found: <span class=\"value\">" << caches_by_user2.size() << "</span><br>\n";
|
||||
std::cout << "Number of recommendations given: <span class=\"value\">" << std::count_if(user1.cc.begin(), user1.cc.end(), [user2](const auto& c) { return (c.recommended && c.owner_uuid == user2.ocpl_user_uuid); }) << "</span><br>\n";
|
||||
std::cout << "</div>\n";
|
||||
|
||||
if (cc_no2 > 0) {
|
||||
n = 1;
|
||||
std::cout << "<h2>Caches created by " << user2.ocpl_user << " found by " << user1.ocpl_user << "</h2>\n";
|
||||
std::cout << "<div class=\"histogram friendbar\">\n";
|
||||
std::cout << "<div class=\"bar\" style=\"--percent: " << 100 * caches_by_user2.size() / cc_no2 << "%;\"><span class=\"text\">" << 100 * caches_by_user2.size() / cc_no2 << "%</span></div>\n";
|
||||
std::cout << "</div>\n";
|
||||
|
@ -114,6 +117,8 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
}
|
||||
std::cout << "</table>\n";
|
||||
std::cout << "</div>\n";
|
||||
std::cout << "</div>\n";
|
||||
|
||||
footer_html();
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue