user.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {% extends 'user/base.html' %}
  2. {% from 'user/_macro.html' import not_allowed %}
  3. {% block mmm -%}
  4. {% set orderby = request.args.get('orderby') %}
  5. {% set username = user.username %}
  6. {% set setting = user.setting %}
  7. <div class="panel panel-default">
  8. <div class="panel-heading clearfix">
  9. <span style="float:right">
  10. {{_('Sort:')}}
  11. <div class="btn-group btn-group-xs" role="group">
  12. <a href="{{ url_for('user.topic',username=username,orderby='publish')}}" class="btn btn-default">{{_('time')}}</a>
  13. <a href="{{ url_for('user.topic',username=username,orderby='vote')}}" class="btn btn-default active">{{_('vote')}}</a>
  14. </div>
  15. </span>
  16. </div>
  17. {% if topic_is_allowed %}
  18. {{ itemlist(topics,user) }}
  19. {% else %}
  20. {{ not_allowed() }}
  21. {% endif %}
  22. </div>
  23. {%- endblock mmm %}
  24. {% macro itemlist(topics,user) -%}
  25. {% for topic in topics.items %}
  26. <div class="panel-body" style="border-bottom:1px solid #eee;font-size:16px;">
  27. <span style="color:#666">{{ topic.board.board }}</span>
  28. {{ link.topic(topic) }}
  29. <div style="font-size:12px;color:#999;">
  30. {{_('create time:')}}{{ topic.created_at | timesince }}
  31. · {{ _('the last reply published by %(author)s',author=link.user(topic.author))}}
  32. </div>
  33. </div>
  34. {% else %}
  35. <div class="panel-body text-center">
  36. {{_('No Topic')}}
  37. </div>
  38. {% endfor %}
  39. {{ p_footer(topics,'user.topic',dict(username=user.username))}}
  40. {%- endmacro %}