123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- {% extends 'base/base.html' %}
- {% block script -%}
- {{ super() }}
- <script type="text/javascript">
- var voteData = {
- 'vote_up': "{{ url_for('topic.vote_up',topicId=topic.uid)}}",
- 'vote_down': "{{ url_for('topic.vote_down',topicId=topic.uid)}}"
- };
- DoVote(voteData);
- </script>
- {%- endblock script %}
- {% block content %}
- {% set board = topic.board %}
- <ol class="breadcrumb" style="margin:0">
- <li><a href="{{ url_for('forums.forums') }}"><span class="glyphicon glyphicon-home" aria-hidden="true"></span>{{ _('Index') }}</a></li>
- <li><a href="{{ url_for('board.board',parent_b=board.parent_board) }}">{{ board.parent_board }}</a></li>
- <li><a href="{{ url_for('board.board',parent_b=board.parent_board,child_b=board.board)}}">{{ board.board }}</a></li>
- <li class="active">{{ topic.title }}</li>
- </ol>
- {% from 'base/paginate.html' import footer as p_footer %}
- <div class="row">
- <div class="col-md-9">
- <div class="panel panel-default">
- <div class="panel-heading media ">
- <div class="media-body">
- <h3 class="media-heading" style="font-size:20px;"><b>{{ topic.title}}</b></h3>
- <small style="color:#999">
- {{ votes(topic) }}
- {% for tag in topic.tags %}
- {{ link_base.tag(tag) }}
- {% endfor %}
- <span style="margin-left:10px;">
- {% set last_reply = topic.replies.first() %}
- {{ link_base.user(topic.author.username )}}
- {{ _('published at %(time)s',time = topic.publish | timesince ) }}
- {% if last_reply %}
- · {{ _('The last reply published by %(author)s at %(time)s',author=link_base.user(last_reply.author.username),time=last_reply.publish | timesince)}}
- {% endif %}
- </span>
- </small>
- </div>
- <div class="media-right">
- <a href="{{ url_for('user.user',user_url=topic.author.username)}}">
- <img class="media-object img-circle" src="{{ link_base.avatar(topic.author) }}" alt="avatar" style="width:64px;height:64px">
- </a>
- </div>
- </div>
- <div class="panel-body topic-content">
- {% if topic.is_markdown %}
- {{ topic.content | markdown }}
- {% else %}
- {{ topic.content | safe_clean }}
- {% endif %}
- </div>
- </div>
- {% include 'topic/replies.html' %}
- </div>
- <div class="col-md-3" style="padding-left:0">
- {% set ask_url = url_for('topic.ask',boardId=topic.board.id) %}
- {% include 'topic/panel.html' %}
- {{ panel_base.board() }}
- </div>
- </div>
- {% endblock %}
- {% macro votes(topic) -%}
- <div class="votes">
- {% if topic.vote and topic.vote > 0 -%}
- {{ vote_a('up',topic.vote) }}
- {% else %}
- {{ vote_a('up') }}
- {%- endif %}
- {% if topic.vote and topic.vote < 0 %}
- {{ vote_a('down',topic.vote) }}
- {% else %}
- {{ vote_a('down') }}
- {%- endif %}
- </div>
- {%- endmacro %}
- {% macro vote_a(vo,count=None) -%}
- {% if count -%}
- <a id="topic-{{ vo }}-vote" class="vote" href="javascript:void(0)" style="text-decoration:none;">
- <i class="icon-chevron-{{ vo }}">{{ count }}</i>
- </a>
- {% else %}
- <a id="topic-{{ vo }}-vote" class="vote" href="javascript:void(0)" style="text-decoration:none;">
- <i class="icon-chevron-{{ vo }}"></i>
- </a>
- {%- endif %}
- {%- endmacro %}
|