1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- {% if g.user.is_authenticated %}
- <ul class="list-group">
- {% if topic in current_user.following_topics %}
- <button type="button" class="btn btn-info btn-block topicfollow active" id="{{ topic.id }}">取消关注</button>
- {% else %}
- <button type="button" class="btn btn-info btn-block topicfollow" id="{{ topic.id }}">关注问题</button>
- {% endif %}
- {% if current_user.is_authenticated and current_user == topic.author %}
- <a class="btn btn-success btn-block" href="{{ url_for('topic.edit',topicId=topic.uid)}}">
- 编辑问题
- </a>
- {%- endif %}
- {% if topic.id | is_collected %}
- <span class="btn btn-default btn-block">已收藏</span>
- {% else %}
- <span class="btn btn-default btn-block" data-toggle="modal" data-target="#sidecollect">收藏问题</span>
- <div class="modal fade" id="sidecollect" tabindex="-1" role="dialog" aria-labelledby="sidecollectLabel">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
- <h4 class="modal-title" id="sidecollectLabel">收藏夹</h4>
- </div>
- {% if not current_user.collects.all() %}
- <div class="modal-body">
- <a href="{{ url_for('mine.collect') }}" style="text-decoration:none">
- <i class="icon icon-plus"></i> 创建
- </a>
- </div>
- {% else %}
- <form action="{{ url_for('mine.collect_detail',topicId=topic.uid)}}" method="POST">
- {{ form.hidden_tag() }}
- <div class="modal-body">
- <p> 添加到收藏夹 </p>
- {% for collect in current_user.collects %}
- <label data-id="{{ collect.id }}"><input name="add-to-collect" type="checkbox" value="{{ collect.id}}" />{{ collect.name }}</label>
- {% if collect.is_privacy %}
- <span class="label label-default">私密</span>
- {% else %}
- <span class="label label-default">公开</span>
- {% endif %}
- <br/>
- {% endfor %}
- </div>
- <div class="modal-footer" style="padding-top:5px;padding-bottom:5px;">
- <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
- <button type="submit" class="btn btn-primary">提交</button>
- </div>
- </form>
- {% endif %}
- </div>
- </div>
- </div>
- {% endif %}
- </ul>
- {% endif %}
|