diff options
| author | 2024-02-14 22:56:56 +0100 | |
|---|---|---|
| committer | 2024-02-14 22:56:56 +0100 | |
| commit | d106f86a676ad39fcf76b15ac6b982fca48c9f42 (patch) | |
| tree | 41bf25c2a3692464b0c331b89704d9582d22adda | |
| parent | Updated TODO. (diff) | |
| download | snac2-d106f86a676ad39fcf76b15ac6b982fca48c9f42.tar.gz snac2-d106f86a676ad39fcf76b15ac6b982fca48c9f42.tar.xz snac2-d106f86a676ad39fcf76b15ac6b982fca48c9f42.zip | |
Show validation checks and rel=me in links in the public page.
| -rw-r--r-- | html.c | 26 |
1 files changed, 22 insertions, 4 deletions
| @@ -767,16 +767,34 @@ static xs_html *html_user_body(snac *user, int local) | |||
| 767 | xs_str *k; | 767 | xs_str *k; |
| 768 | xs_str *v; | 768 | xs_str *v; |
| 769 | 769 | ||
| 770 | xs_dict *val_metadata = xs_dict_get(user->config, "validated_metadata"); | ||
| 771 | if (xs_is_null(val_metadata)) | ||
| 772 | val_metadata = xs_stock_dict; | ||
| 773 | |||
| 770 | xs_html *snac_metadata = xs_html_tag("div", | 774 | xs_html *snac_metadata = xs_html_tag("div", |
| 771 | xs_html_attr("class", "snac-metadata")); | 775 | xs_html_attr("class", "snac-metadata")); |
| 772 | 776 | ||
| 773 | while (xs_dict_iter(&metadata, &k, &v)) { | 777 | while (xs_dict_iter(&metadata, &k, &v)) { |
| 774 | xs_html *value; | 778 | xs_html *value; |
| 775 | 779 | ||
| 776 | if (xs_startswith(v, "https:/" "/")) | 780 | if (xs_startswith(v, "https:/" "/")) { |
| 777 | value = xs_html_tag("a", | 781 | /* is this link validated? */ |
| 778 | xs_html_attr("href", v), | 782 | char *val_date = xs_dict_get(val_metadata, v); |
| 779 | xs_html_text(v)); | 783 | |
| 784 | if (!xs_is_null(val_date) && *val_date) { | ||
| 785 | value = xs_html_container( | ||
| 786 | xs_html_raw("✔ "), | ||
| 787 | xs_html_tag("a", | ||
| 788 | xs_html_attr("href", v), | ||
| 789 | xs_html_attr("rel", "me"), | ||
| 790 | xs_html_text(v))); | ||
| 791 | } | ||
| 792 | else { | ||
| 793 | value = xs_html_tag("a", | ||
| 794 | xs_html_attr("href", v), | ||
| 795 | xs_html_text(v)); | ||
| 796 | } | ||
| 797 | } | ||
| 780 | else | 798 | else |
| 781 | value = xs_html_text(v); | 799 | value = xs_html_text(v); |
| 782 | 800 | ||