info.html 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. {% macro other(user) -%}
  2. {% if current_user.is_authenticated and current_user.id != user.id %}
  3. <div class="list-group-item">
  4. <span class="text-right" style="display:block">
  5. {% if user.id | user_is_followed %}
  6. <button class="btn btn-sm btn-default user-following active" data-id="{{ user.id}}">取消关注</button>
  7. {% else %}
  8. <button class="btn btn-sm btn-default user-following" data-id="{{ user.id}}">关注他</button>
  9. {% endif %}
  10. <button class="btn btn-sm btn-default" id="{{ user.id}}" title="私信" data-toggle="modal" data-target="#send-message"><i class="fa fa-comments" style="font-size:16px;"></i></button>
  11. </span>
  12. </div>
  13. {% endif %}
  14. {%- endmacro %}
  15. {% macro mine(user) -%}
  16. {% if g.user.is_authenticated and current_user.id == user.id and not user.is_confirmed %}
  17. <div class="alert alert-info" style="padding:6px;font-size:12px;margin-top:10px;">
  18. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  19. <span aria-hidden="true">&times;</span>
  20. </button>
  21. {{ _("You haven't confirm your account,Please confirmed") }}
  22. <span id="email-confirm" class="btn btn-info btn-sm" style="padding:2px 5px;">{{ _('Activate Account')}}</span>
  23. </div>
  24. {% endif %}
  25. {%- endmacro %}
  26. {% macro online(user) -%}
  27. {% set setting = user.setting %}
  28. {%- set _a = (setting.online_status == 1 and user.username | is_online) %}
  29. {%- set _b = (setting.online_status == 2 and current_user.is_authenticated and user.username | is_online) %}
  30. {%- if _a or _b %}
  31. <span class="online">{{ _('ONLINE') }} </span>
  32. {%- else %}
  33. <span class="online">{{ _('OUTLINE') }}</span>
  34. {% endif -%}
  35. {%- endmacro %}
  36. <div class="list-group">
  37. <div class="media list-group-item">
  38. <div class="media-left">
  39. <img class="media-object img-circle" src="{{ url_for('avatar',text=user.username) }}" alt="avatar" style="width:64px;height:64px"/>
  40. </div>
  41. <div class="media-body">
  42. <h4 class="media-heading">
  43. {{ user.username}}
  44. {{ online(user) }}
  45. </h4>
  46. <small style="color:#999">
  47. <span>第{{ user.id }}号会员</span>/
  48. <span>{{user.register_time | timesince }}</span>
  49. <br/>
  50. <span>{{ user.topics.count() }}篇主题</span> |
  51. <span>{{ user.replies.count() }}条回复</span>
  52. </small>
  53. </div>
  54. <blockquote style="font-size:14px;">
  55. <p>{{ user.info.word }}</p>
  56. <footer>Someone famous in <cite title="Source Title">{{ user.info.school }}</cite></footer>
  57. </blockquote>
  58. <table style="font-size:12px;width:100%" align="center">
  59. <tr>
  60. <td align="center" style="border-right:1px solid #AACCEE;"><p>1</p>积分</td>
  61. <td align="center" style="border-right:1px solid #AACCEE;"><p>{{ user.followers.count()}}</p>粉丝</td>
  62. <td align="center"><p>{{ user.following_users.count() }}</p>关注</td>
  63. </tr>
  64. </table>
  65. </div>
  66. {{ other(user) }}
  67. {{ mine(user) }}
  68. </div>