Skip to content

Commit

Permalink
Gdrive links (#40)
Browse files Browse the repository at this point in the history
* Add link to the parent of the document
* Open drive links in new tab/window
* Use target on correct anchor
  • Loading branch information
dumyan authored and pwalsh committed Sep 20, 2016
1 parent f4249d5 commit ee21dd1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions views/index_embed.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,24 @@
{% endif %}
{% endfor %}
{% if cell %}
{% set parentId = "" %}
{% if cell.uploads %}
{% for upload in cell.uploads %}
{% if upload.parentId %}
{% set parentId = upload.parentId %}
{% endif %}
{% endfor %}
{% endif %}
<td class="text-center" data-toggle="popover" data-content="{{ h.tooltip(country, cell) }}">
{% if parentId %}
<a target="_blank" href="https://drive.google.com/drive/folders/{{ parentId }}">
{% endif %}
<span class="badge state state-{{ cell.state|replace(' ', '-') }}">
<span>{{ h.state(cell.state) }}</span>
</span>
{% if parentId %}
</a>
{% endif %}
</td>
{% else %}
<td class="text-center" data-toggle="popover" data-content="{{ h.tooltip(country, doc) }}">
Expand Down
14 changes: 14 additions & 0 deletions views/status_embed.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,24 @@ <h2>{{ gettext("Current Status") }}</h2>
<td class="text-center">{{ date_format({'year':fiscal_year}, 'YYYY') }}</td>
<td>
{% if cell %}
{% set parentId = "" %}
{% if cell.uploads %}
{% for upload in cell.uploads %}
{% if upload.parentId %}
{% set parentId = upload.parentId %}
{% endif %}
{% endfor %}
{% endif %}
{% if parentId %}
<a target="_blank" href="https://drive.google.com/drive/folders/{{ parentId }}">
{% endif %}
<span class="badge state state-{{ cell.state|replace(' ', '-') }}">
<span>{{ h.state(cell.state) }}</span>
</span>
{{ h.state(cell.state) }}
{% if parentId %}
</a>
{% endif %}
{% else %}
<span class="badge state state-not-produced">
<span>{{ h.state("not produced") }}</span>
Expand Down

0 comments on commit ee21dd1

Please sign in to comment.