link.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. <img class="media-object img-circle" src="{{ url_for('avatar',text=user.username) }}" style="width:{{ width }}px;height:{{ width }}px">
  32. {% else %}
  33. <img class="media-object img-circle" src="{{ url_for('upload.avatar_file',filename=info.avatar) }}" style="width:{{ width }}px;height:{{ width }}px">
  34. {%- endif %}
  35. {%- endmacro %}
  36. {% macro following_tag() -%}
  37. <a href="{{ url_for('follow.tag')}}">{{ _('Following Tags') }}</a>
  38. {%- endmacro %}
  39. {% macro following_topic() -%}
  40. <a href="{{ url_for('follow.topic')}}">{{ _('Following Topics')}}</a>
  41. {%- endmacro %}
  42. {% macro following_user() -%}
  43. <a href="{{ url_for('follow.user')}}">{{ _('Following Users')}}</a>
  44. {%- endmacro %}
  45. {% macro following_collect() -%}
  46. <a href="{{ url_for('follow.collect')}}">{{ _('Following Collects')}}</a>
  47. {%- endmacro %}
  48. {% macro collectlist() -%}
  49. <a href="{{ url_for('topic.collectlist')}}">{{ _('CollectList')}}</a>
  50. {%- endmacro %}
  51. {% macro collect(c) -%}
  52. <a href="{{ url_for('topic.collect',collectId=c.id)}}">{{ c.name }}</a>
  53. {%- endmacro %}