Migrate pagevote and bookmark to use content_type
This commit is contained in:
parent
64495be799
commit
36e27321f7
19 changed files with 285 additions and 87 deletions
|
@ -46,8 +46,8 @@
|
|||
<div class="show-more"> {{_("...More")}} </div>
|
||||
</div>
|
||||
<div class="actionbar-box">
|
||||
{% set pagevote = post.pagevote %}
|
||||
{% set bookmark = post.bookmark %}
|
||||
{% set pagevote = post.get_or_create_pagevote() %}
|
||||
{% set bookmark = post.get_or_create_bookmark() %}
|
||||
{% set hide_actionbar_comment = True %}
|
||||
{% set include_hr = False %}
|
||||
{% set share_url = request.build_absolute_uri(post.get_absolute_url()) %}
|
||||
|
|
|
@ -109,8 +109,8 @@
|
|||
<div class="show-more"> {{_("...More")}} </div>
|
||||
</div>
|
||||
<div class="actionbar-box">
|
||||
{% set pagevote = problem.pagevote %}
|
||||
{% set bookmark = problem.bookmark %}
|
||||
{% set pagevote = problem.get_or_create_pagevote() %}
|
||||
{% set bookmark = problem.get_or_create_bookmark() %}
|
||||
{% set hide_actionbar_comment = True %}
|
||||
{% set include_hr = False %}
|
||||
{% set share_url = request.build_absolute_uri(problem.get_absolute_url()) %}
|
||||
|
|
|
@ -16,10 +16,11 @@
|
|||
<table style="display: none" class="table toggled">
|
||||
<tbody>
|
||||
{% for post in blogs %}
|
||||
{% if post.bookmark.page_object() %}
|
||||
{% set object = post.bookmark.linked_object %}
|
||||
{% if object %}
|
||||
<tr>
|
||||
<td class="bookmark-name">
|
||||
<a href="{{ url('blog_post', post.bookmark.page_object().id, post.bookmark.page_object().slug) }}">{{ post.bookmark.page_object().title}} </a>
|
||||
<a href="{{ url('blog_post', object.id, object.slug) }}">{{ object.title}} </a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
@ -36,10 +37,11 @@
|
|||
<table style="display: none" class="table toggled">
|
||||
<tbody>
|
||||
{% for problem in problems %}
|
||||
{% if problem.bookmark.page_object() %}
|
||||
{% set object = problem.bookmark.linked_object %}
|
||||
{% if object %}
|
||||
<tr>
|
||||
<td class="bookmark-name">
|
||||
<a href="{{ url('problem_detail', problem.bookmark.page_object().code) }}">{{ problem.bookmark.page_object().name}} </a>
|
||||
<a href="{{ url('problem_detail', object.code) }}">{{ object.name}} </a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
@ -57,10 +59,11 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
{% for contest in contests %}
|
||||
{% if contest.bookmark.page_object() %}
|
||||
{% set object = contest.bookmark.linked_object %}
|
||||
{% if object %}
|
||||
<tr>
|
||||
<td class="bookmark-name">
|
||||
<a href="{{ url('contest_view', contest.bookmark.page_object().key) }}">{{ contest.bookmark.page_object().name}} </a>
|
||||
<a href="{{ url('contest_view', object.key) }}">{{ object.name}} </a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
@ -78,10 +81,11 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
{% for solution in solutions %}
|
||||
{% if solution.bookmark.page_object() %}
|
||||
{% set object = solution.bookmark.linked_object %}
|
||||
{% if object %}
|
||||
<tr>
|
||||
<td class="bookmark-name">
|
||||
<a href="{{ url('problem_editorial', solution.bookmark.page_object().problem.code) }}">{{ solution.bookmark.page_object().problem.name}} </a>
|
||||
<a href="{{ url('problem_editorial', object.problem.code) }}">{{ object.problem.name}} </a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue