collect.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <div class="panel panel-default">
  2. <div class="panel-heading clearfix">
  3. <div class="col-md-8">
  4. 收藏夹名
  5. </div>
  6. <div class="col-md-4">
  7. 收藏数
  8. </div>
  9. </div>
  10. {% if collects.items %}
  11. {% if setting.collect_list == 1 or (setting.collect_list == 2 and g.user.is_authenticated) or (g.user.is_authenticated and g.user.username == g.user_url) %}
  12. {% for collect in collects.items %}
  13. <div class="panel-body" style="border-bottom:1px solid #eee">
  14. <div class="row" style="margin:0">
  15. <div class="col-md-8">
  16. <a href="{{ url_for('user.collect_detail',collectId =collect.id)}}">{{ collect.name }}</a>
  17. </div>
  18. <div class="col-md-4">
  19. {% if g.user.is_authenticated -%}
  20. <span class="pull-right">
  21. {% if collect in current_user.following_collects -%}
  22. <button class="btn btn-sm btn-default collectfollow active" id="{{ collect.id}}" style="padding:0 5px">取消关注</button>
  23. {%- else %}
  24. <button class="btn btn-sm btn-default collectfollow" id="{{ collect.id}}" style="padding:0 5px">关注</button>
  25. {%- endif %}
  26. </span>
  27. {%- endif %}
  28. <span style="margin-left:20px">
  29. {{ collect.topics.count() }}
  30. </span>
  31. </div>
  32. </div>
  33. </div>
  34. {% endfor %}
  35. {{ p_footer(collects,'user.collect')}}
  36. {% else %}
  37. <div class="panel-body" style="border:1px dashed #337ab7;margin:5px;">
  38. <span class="text-center" style="display:block;width:100%;color:#999">
  39. <span class="glyphicon glyphicon-lock" aria-hidden="true" style="font-size:16px;"></span>
  40. 根据用户设置,列表被隐藏
  41. </span>
  42. </div>
  43. {% endif %}
  44. {% else %}
  45. <div class="panel-body text-center">
  46. 没有收藏
  47. </div>
  48. {% endif %}
  49. </div>