Skip to content

Commit

Permalink
bug: fix displaying JSON in grant detail
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed Jan 10, 2020
1 parent 98c024d commit 18e67bf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion app/grants/templates/grants/detail/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<script src="{% static "v2/js/lib/ipfs-api.js" %}"></script>
<script src="{% static "v2/js/ipfs.js" %}"></script>
<script>
$('[data-toggle="tooltip"]').bootstrapTooltip();
$('[data-toggle="tooltip"]').bootstrapTooltip();
</script>
<script src="{% static "v2/js/user-search.js" %}"></script>
<script src="{% static "v2/js/grants/shared.js" %}"></script>
Expand Down
40 changes: 19 additions & 21 deletions app/grants/templates/grants/detail/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,24 @@ <h4 class="m-auto text-center font-weight-semibold">{% trans "No Activity for th
</div>

<script>
{% with description_tab_url=grant.url|addstr:'?tab=description' %}
let grant_description;

{% if request.get_full_path == description_tab_url or request.get_full_path == grant.url %}
grant_description = new Quill('#editor', {
theme: 'bubble',
readOnly: true,
});

{% if is_team_member and not grant_is_inactive %}
grant_description = new Quill('#editor', {
theme: 'snow',
});
grant_description.enable(false);
{% endif %}
if (document.getElementById("editor")) {
let grant_description;

grant_description = new Quill('#editor', {
theme: 'bubble',
readOnly: true,
});

{% if is_team_member and not grant_is_inactive %}
grant_description = new Quill('#editor', {
theme: 'snow',
});
grant_description.enable(false);
{% endif %}

let desc = JSON.parse(grant_description.getContents().ops[0].insert);
if (desc.ops) {
grant_description.setContents(desc);
}
{% endif %}
{% endwith %}
let desc = JSON.parse(grant_description.getContents().ops[0].insert);
if (desc.ops) {
grant_description.setContents(desc);
}
}
</script>

0 comments on commit 18e67bf

Please sign in to comment.