user-card.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <div class="user w-100" style="border: 1px solid black; background-color: white; margin: 6px 0; padding: 4px;">
  2. <div style="float: right; margin-top: 0; text-align: right">
  3. {% if user.profile_image_url %}
  4. <img style="float: right; margin-left: 4px;" src="{{ user.profile_image_url }}">
  5. {% endif %}
  6. {% if user.username %}
  7. <pre style="display: inline; color: #0f0f0f; font-weight: bold; ">@{{ user.username }}</pre>
  8. <br>
  9. {% endif %}
  10. <span><pre style="display: inline; color: #0f0f0f;">{{ user.id }}</pre></span>
  11. </div>
  12. <p style="margin-top: 0">
  13. {% if user.actions and user.actions.view_profile %}
  14. {% with view_profile=user.actions.view_profile %}
  15. <a href="{{ url_for( view_profile.route, **view_profile.route_params ) }}">
  16. {% endwith %}
  17. {% elif user.url %}
  18. <a href="{{ user.url }}">
  19. {% else %}
  20. <a href="{{ url_for('twitter_v2_facade.get_profile_html', user_id=user.id) }}">
  21. {% endif %}
  22. <strong>{{ user.name }}</strong></a>
  23. {% if user.verified %}
  24. <small>[verified]</small>
  25. {% endif %}
  26. {% if user.protected %}
  27. <small>[protected]</small>
  28. {% endif %}
  29. </p>
  30. {% if user.description %}
  31. <div>
  32. {{ user.description }}
  33. </div>
  34. {% endif %}
  35. {% if user.total_count %}
  36. {# this is getting into the new Collection territory, which mirrored User #}
  37. <p>
  38. {{ user.total_count }} items.
  39. </p>
  40. {% endif %}
  41. {% if user.pinned_tweet_id %}
  42. <div>
  43. <p>Pinned tweet:</p>
  44. <div style="border: 1px solid black">{{ user.pinned_tweet_id }}</div>
  45. </div>
  46. {% endif %}
  47. <dl>
  48. {% if user.created_at %}
  49. <dt>Member since</dt>
  50. <dd>{{ user.created_at }}</dd>
  51. {% endif %}
  52. {% if user.website %}
  53. <dt>Website</dt>
  54. <dd><a href="{{ user.website }}">{{ user.website }}</a></dd>
  55. {% endif %}
  56. {% if user.location %}
  57. <dt>Location</dt>
  58. <dd>{{ user.location }}</dd>
  59. {% endif %}
  60. {% if user.public_metrics %}
  61. {% if user.public_metrics.tweet_count %}
  62. <dt>Tweets</dt>
  63. <dd>{{ user.public_metrics.tweet_count }}</dd>
  64. {% endif %}
  65. {% if user.public_metrics.followers_count %}
  66. <dt>Followers</dt>
  67. <dd>{{ user.public_metrics.followers_count }}</dd>
  68. {% endif %}
  69. {% if user.public_metrics.following_count %}
  70. <dt>Following</dt>
  71. <dd>{{ user.public_metrics.following_count }}</dd>
  72. {% endif %}
  73. {% if user.public_metrics.listed_count %}
  74. <dt>Listed</dt>
  75. <dd>{{ user.public_metrics.listed_count }}</dd>
  76. {% endif %}
  77. {% endif %}
  78. </dl>
  79. </div>