_macro.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. {% import 'base/link.html' as link %}
  2. {% macro nav_list(type,name) -%}
  3. <ul class="nav nav-pills nav-stacked" >
  4. <li role="presentation" {% if type =='topic' %}class="active"{% endif %}>
  5. <a href="{{ url_for('mine.topiclist',username=name)}}">{{ _("topics of %(n)s",n = name) }}</a>
  6. </li>
  7. <li role="presentation" {% if type =='reply' %}class="active"{% endif %}>
  8. <a href="{{ url_for('mine.replylist',username=name)}}">{{ _("replies of %(n)s",n = name) }}</a>
  9. </li>
  10. <li role="presentation" {% if type =='collect' %}class="active"{% endif %}>
  11. <a href="{{ url_for('mine.collectlist',username=name)}}">{{ _("collects of %(n)s",n = name) }}</a>
  12. </li>
  13. <li role="presentation" {% if type =='follower' %}class="active"{% endif %}>
  14. <a href="{{ url_for('mine.followerlist',username=name)}}">{{ _("followers of %(n)s",n = name) }}</a>
  15. </li>
  16. <li role="presentation" {% if type =='follower' %}class="active"{% endif %}>
  17. <a href="{{ url_for('mine.followinglist',username=name)}}">{{ _("following of %(n)s",n = name) }}</a>
  18. </li>
  19. </ul>
  20. {%- endmacro %}
  21. {% macro other(user) -%}
  22. {% if g.user.is_authenticated and g.user.username != user.username %}
  23. <div class="list-group-item">
  24. <span class="text-right" style="display:block">
  25. {% if user in g.user.following_users %}
  26. <button class="btn btn-sm btn-default userfollow active" id="{{ user.id}}">取消关注</button>
  27. {% else %}
  28. <button class="btn btn-sm btn-default userfollow" id="{{ user.id}}">关注他</button>
  29. {% endif %}
  30. <button class="btn btn-sm btn-default" id="{{ user.id}}" title="私信" data-toggle="modal" data-target="#send-message"><i class="icon-comments-alt" style="font-size:16px;"></i></button>
  31. </span>
  32. </div>
  33. {% endif %}
  34. {%- endmacro %}
  35. {% macro mine(user) -%}
  36. {% if g.user.is_authenticated and g.user.username == user.username and not user.is_confirmed %}
  37. <div class="alert alert-info" style="padding:6px;font-size:12px;margin-top:10px;">
  38. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  39. <span aria-hidden="true">&times;</span>
  40. </button>
  41. {{ _("You haven't confirm your account,Please confirmed") }}
  42. <span id="email-confirm" class="btn btn-info btn-sm" style="padding:2px 5px;">{{ _('Activate Account')}}</span>
  43. </div>
  44. {% endif %}
  45. {%- endmacro %}
  46. {% macro user_title(user) -%}
  47. {% set setting = user.setting %}
  48. {% set info = user.info %}
  49. <div class="list-group">
  50. <div class="media list-group-item">
  51. <div class="media-left">
  52. {{ link.user_avatar(user)}}
  53. </div>
  54. <div class="media-body">
  55. <h4 class="media-heading">
  56. {{ user.username}}
  57. {%- set _a = (setting.online_status == 1 and user.username | is_online) %}
  58. {%- set _b = (setting.online_status == 2 and g.user.is_authenticated and user.username | is_online) %}
  59. {%- if _a or _b %}
  60. <span class="online">{{ _('ONLINE') }} </span>
  61. {%- else %}
  62. <span class="online">{{ _('OUTLINE') }}</span>
  63. {% endif -%}
  64. </h4>
  65. <small style="color:#999">
  66. <span>第{{ user.id }}号会员</span>/
  67. <span>{{user.register_time | timesince }}</span>
  68. <br/>
  69. <span>{{ user.topics.count() }}篇主题</span> |
  70. <span>{{ user.replies.count() }}条回复</span>
  71. </small>
  72. </div>
  73. <blockquote style="font-size:14px;">
  74. <p>{{ info.word }}</p>
  75. <footer>Someone famous in <cite title="Source Title">{{ info.school }}</cite></footer>
  76. </blockquote>
  77. <table style="font-size:12px;width:100%" align="center">
  78. <tr>
  79. <td align="center" style="border-right:1px solid #AACCEE;"><p>1</p>积分</td>
  80. <td align="center" style="border-right:1px solid #AACCEE;"><p>{{ user.followers.count()}}</p>粉丝</td>
  81. <td align="center"><p>{{ user.following_users.count() }}</p>关注</td>
  82. </tr>
  83. </table>
  84. </div>
  85. {{ other(user) }}
  86. {{ mine(user) }}
  87. </div>
  88. {%- endmacro %}