link.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {% macro userlist() -%}
  2. <a href="{{ url_for('user.list') }}">{{ _('UserList') }}</a>
  3. {%- endmacro %}
  4. {% macro user(user) -%}
  5. <a href="{{ url_for('user.user',username=user.username) }}">{{ user.username }}</a>
  6. {%- endmacro %}
  7. {% macro taglist() -%}
  8. <a href="{{ url_for('tag.list') }}">{{ _('TagList') }}</a>
  9. {%- endmacro %}
  10. {% macro tag(tag) -%}
  11. <a class="tag" href="{{ url_for('tag.tag',name=tag.name) }}">{{ tag.name }}</a>
  12. {%- endmacro %}
  13. {% macro topiclist() -%}
  14. <a href="{{ url_for('topic.list') }}">{{ _('TopicList') }}</a>
  15. {%- endmacro %}
  16. {% macro topic(topic) -%}
  17. <a href="{{ url_for('topic.topic',topicId=topic.id)}}">{{ topic.title }}</a>
  18. {%- endmacro %}
  19. {% macro boardlist() -%}
  20. <a href="{{ url_for('board.list') }}">{{ _('BoardList') }}</a>
  21. {%- endmacro %}
  22. {% macro board(board) -%}
  23. <a href="{{ url_for('forums.board',boardId=board.id) }}">{{ board.name }}</a>
  24. {%- endmacro %}
  25. {% macro avatar(text,width=64) -%}
  26. <img class="media-object img-circle" src="{{ url_for('avatar',text=text) }}" style="width:{{ width }}px;height:{{ width }}px">
  27. {%- endmacro %}
  28. {% macro user_avatar(user,width=64) -%}
  29. {% set info = user.info %}
  30. {% if not info.avatar -%}
  31. <a href="{{ url_for('user.user',username=user.username) }}">
  32. <img class="img-circle" src="{{ url_for('avatar',text=user.username) }}" style="width:{{ width }}px;height:{{ width }}px">
  33. </a>
  34. {% else %}
  35. <a href="{{ url_for('user.user',username=user.username) }}">
  36. <img class="img-circle" src="{{ url_for('upload.avatar_file',filename=info.avatar) }}" style="width:{{ width }}px;height:{{ width }}px">
  37. </a>
  38. {%- endif %}
  39. {%- endmacro %}
  40. {% macro following_tag() -%}
  41. <a href="{{ url_for('follow.tag')}}">{{ _('Following Tags') }}</a>
  42. {%- endmacro %}
  43. {% macro following_topic() -%}
  44. <a href="{{ url_for('follow.topic')}}">{{ _('Following Topics')}}</a>
  45. {%- endmacro %}
  46. {% macro following_user() -%}
  47. <a href="{{ url_for('follow.user')}}">{{ _('Following Users')}}</a>
  48. {%- endmacro %}
  49. {% macro following_collect() -%}
  50. <a href="{{ url_for('follow.collect')}}">{{ _('Following Collects')}}</a>
  51. {%- endmacro %}
  52. {% macro collectlist() -%}
  53. <a href="{{ url_for('collect.list')}}">{{ _('CollectList')}}</a>
  54. {%- endmacro %}
  55. {% macro collect(c) -%}
  56. <a href="{{ url_for('collect.collect',pk=c.id)}}">{{ c.name }}</a>
  57. {%- endmacro %}