diff options
| author | 2023-07-01 19:20:20 +0200 | |
|---|---|---|
| committer | 2023-07-01 19:20:20 +0200 | |
| commit | c423cc7425edb22d7a9594309297cb838d458267 (patch) | |
| tree | 12196df7e2b93d53e13857f8da1161eb3f9da6d8 /html.c | |
| parent | Updated TODO. (diff) | |
| download | snac2-c423cc7425edb22d7a9594309297cb838d458267.tar.gz snac2-c423cc7425edb22d7a9594309297cb838d458267.tar.xz snac2-c423cc7425edb22d7a9594309297cb838d458267.zip | |
Added CSS classes to notification and people pages.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 28 |
1 files changed, 20 insertions, 8 deletions
| @@ -1302,11 +1302,13 @@ xs_str *html_timeline(snac *snac, const xs_list *list, int local, int skip, int | |||
| 1302 | d_char *html_people_list(snac *snac, d_char *os, d_char *list, const char *header, const char *t) | 1302 | d_char *html_people_list(snac *snac, d_char *os, d_char *list, const char *header, const char *t) |
| 1303 | { | 1303 | { |
| 1304 | xs *s = xs_str_new(NULL); | 1304 | xs *s = xs_str_new(NULL); |
| 1305 | xs *h = xs_fmt("<h2>%s</h2>\n", header); | 1305 | xs *h = xs_fmt("<h2 class=\"snac-header\">%s</h2>\n", header); |
| 1306 | char *p, *actor_id; | 1306 | char *p, *actor_id; |
| 1307 | 1307 | ||
| 1308 | s = xs_str_cat(s, h); | 1308 | s = xs_str_cat(s, h); |
| 1309 | 1309 | ||
| 1310 | s = xs_str_cat(s, "<div class=\"snac-posts\">\n"); | ||
| 1311 | |||
| 1310 | p = list; | 1312 | p = list; |
| 1311 | while (xs_list_iter(&p, &actor_id)) { | 1313 | while (xs_list_iter(&p, &actor_id)) { |
| 1312 | xs *md5 = xs_md5_hex(actor_id, strlen(actor_id)); | 1314 | xs *md5 = xs_md5_hex(actor_id, strlen(actor_id)); |
| @@ -1394,6 +1396,8 @@ d_char *html_people_list(snac *snac, d_char *os, d_char *list, const char *heade | |||
| 1394 | } | 1396 | } |
| 1395 | } | 1397 | } |
| 1396 | 1398 | ||
| 1399 | s = xs_str_cat(s, "</div>\n"); | ||
| 1400 | |||
| 1397 | return xs_str_cat(os, s); | 1401 | return xs_str_cat(os, s); |
| 1398 | } | 1402 | } |
| 1399 | 1403 | ||
| @@ -1464,24 +1468,29 @@ xs_str *html_notifications(snac *snac) | |||
| 1464 | if (strcmp(v, n_time) > 0) { | 1468 | if (strcmp(v, n_time) > 0) { |
| 1465 | /* unseen notification */ | 1469 | /* unseen notification */ |
| 1466 | if (stage == NHDR_NONE) { | 1470 | if (stage == NHDR_NONE) { |
| 1467 | xs *s1 = xs_fmt("<h2>%s</h2>\n", L("New")); | 1471 | xs *s1 = xs_fmt("<h2 class=\"snac-header\">%s</h2>\n", L("New")); |
| 1468 | s = xs_str_cat(s, s1); | 1472 | s = xs_str_cat(s, s1); |
| 1469 | 1473 | ||
| 1474 | s = xs_str_cat(s, "<div class=\"snac-posts\">\n"); | ||
| 1475 | |||
| 1470 | stage = NHDR_NEW; | 1476 | stage = NHDR_NEW; |
| 1471 | } | 1477 | } |
| 1472 | } | 1478 | } |
| 1473 | else { | 1479 | else { |
| 1474 | /* already seen notification */ | 1480 | /* already seen notification */ |
| 1475 | if (stage != NHDR_OLD) { | 1481 | if (stage != NHDR_OLD) { |
| 1476 | xs *s1 = xs_fmt("<h2>%s</h2>\n", L("Already seen")); | 1482 | if (stage == NHDR_NEW) |
| 1483 | s = xs_str_cat(s, "</div>\n"); | ||
| 1484 | |||
| 1485 | xs *s1 = xs_fmt("<h2 class=\"snac-header\">%s</h2>\n", L("Already seen")); | ||
| 1477 | s = xs_str_cat(s, s1); | 1486 | s = xs_str_cat(s, s1); |
| 1478 | 1487 | ||
| 1488 | s = xs_str_cat(s, "<div class=\"snac-posts\">\n"); | ||
| 1489 | |||
| 1479 | stage = NHDR_OLD; | 1490 | stage = NHDR_OLD; |
| 1480 | } | 1491 | } |
| 1481 | } | 1492 | } |
| 1482 | 1493 | ||
| 1483 | s = xs_str_cat(s, "<div>\n"); | ||
| 1484 | |||
| 1485 | const char *label = type; | 1494 | const char *label = type; |
| 1486 | 1495 | ||
| 1487 | if (strcmp(type, "Create") == 0) | 1496 | if (strcmp(type, "Create") == 0) |
| @@ -1490,7 +1499,8 @@ xs_str *html_notifications(snac *snac) | |||
| 1490 | if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0) | 1499 | if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0) |
| 1491 | label = L("Finished poll"); | 1500 | label = L("Finished poll"); |
| 1492 | 1501 | ||
| 1493 | xs *s1 = xs_fmt("<p><b>%s by <a href=\"%s\">%s</a></b>:</p>\n", | 1502 | xs *s1 = xs_fmt("<div class=\"snac-post-with-desc\">\n" |
| 1503 | "<p><b>%s by <a href=\"%s\">%s</a></b>:</p>\n", | ||
| 1494 | label, actor_id, a_name); | 1504 | label, actor_id, a_name); |
| 1495 | s = xs_str_cat(s, s1); | 1505 | s = xs_str_cat(s, s1); |
| 1496 | 1506 | ||
| @@ -1511,9 +1521,11 @@ xs_str *html_notifications(snac *snac) | |||
| 1511 | } | 1521 | } |
| 1512 | 1522 | ||
| 1513 | if (stage == NHDR_NONE) { | 1523 | if (stage == NHDR_NONE) { |
| 1514 | xs *s1 = xs_fmt("<h2>%s</h2>\n", L("None")); | 1524 | xs *s1 = xs_fmt("<h2 class=\"snac-header\">%s</h2>\n", L("None")); |
| 1515 | s = xs_str_cat(s, s1); | 1525 | s = xs_str_cat(s, s1); |
| 1516 | } | 1526 | } |
| 1527 | else | ||
| 1528 | s = xs_str_cat(s, "</div>\n"); | ||
| 1517 | 1529 | ||
| 1518 | s = html_user_footer(s); | 1530 | s = html_user_footer(s); |
| 1519 | 1531 | ||