Skip to content

Commit

Permalink
Added hyperlink to the review page
Browse files Browse the repository at this point in the history
  • Loading branch information
KasukabeDefenceForce committed Oct 17, 2020
1 parent d1c1c17 commit d211c8b
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions critiquebrainz/frontend/templates/review/modify/artist.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{% if entity is not defined %}
{% set entity = review.entity_id | entity_details(type=entity_type) %}
{% set entity = entity_id | entity_details(type=entity_type) %}
{% endif %}
<div class="col-md-12">
<dl class="dl-horizontal">
<dt>{{ _('Artist') }}</dt>
<dd>
{{ entity['name'] | default(_('[Unknown artist]')) }}
<a href="{{ url_for('artist.entity', mbid=entity_id) }}" target="_blank">{{entity['name'] | default(_('[Unknown artist]')) }}</a>
</dd>
<dt>{{ _('Type') }}</dt>
<dd>{{ entity['type'] or '-' }}</dd>
Expand Down
1 change: 1 addition & 0 deletions critiquebrainz/frontend/templates/review/modify/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<dt>{{ _('Event') }}</dt>
<dd>
{{ entity['name'] | default(_('[Unknown event]')) }}
<a href="{{ url_for('event.entity', id=entity_id) }}" target="_blank">{{ entity['name'] | default(_('[Unknown event]')) }}</a>
{% if entity['life-span'] %}
<span class="text-muted">({{ entity['life-span']['begin'] }} - {{ entity['life-span']['end'] }})</span>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion critiquebrainz/frontend/templates/review/modify/label.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<dl class="dl-horizontal">
<dt>{{ _('Label') }}</dt>
<dd>
{{ entity['name'] | default(_('[Unknown label]')) }}
<a href="{{ url_for('label.entity', id=entity_id) }}" target="_blank">{{ entity['name'] | default(_('[Unknown label]')) }}</a>
{% if entity['life-span'] %}
<span class="text-muted">({{ entity['life-span']['begin'] }} - {{ entity['life-span']['end'] }})</span>
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions critiquebrainz/frontend/templates/review/modify/place.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<dt>{{ _('Place') }}</dt>
<dd>
{{ entity['name'] | default(_('[Unknown place]')) }}
<a href="{{ url_for('place.entity', id=entity_id) }}" target="_blank">{{ entity['name'] | default(_('[Unknown place]')) }}</a>
{% if entity['life-span'] %}
<span class="text-muted">({{ entity['life-span']['begin'] }} - {{ entity['life-span']['end'] }})</span>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<dt>{{ _('Artist') }}</dt><dd>{{ entity['artist-credit-phrase'] | default(_('[Unknown artist]')) }}</dd>
<dt>{{ _('Release group') }}</dt>
<dd>
{{ entity['title'] | default(_('[Unknown release group]')) }}
<a href="{{ url_for('release_group.entity', id=entity_id) }}" target="_blank">{{ entity['title'] | default(_('[Unknown release group]')) }}</a>
{% if entity['first-release-date'] %}
<span class="text-muted">({{ entity['first-release-date'][:4] }})</span>
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions critiquebrainz/frontend/templates/review/modify/work.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<dt>{{ _('Work') }}</dt>
<dd>
{{ entity['name'] | default(_('[Unknown work]')) }}
<a href="{{ url_for('work.entity', id=entity_id) }}" target="_blank">{{entity['name'] | default(_('[Unknown work]')) }}</a>
</dd>
<dt>{{ _('Type') }}</dt>
<dd>{{ entity['type'] or '-' }}</dd>
Expand Down
4 changes: 2 additions & 2 deletions critiquebrainz/frontend/views/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def create(entity_type=None, entity_id=None):
if not form.errors:
flash.info(gettext("Please provide some text or a rating for this review."))
return render_template('review/modify/write.html', form=form, entity_type=entity_type, entity=entity,
spotify_mappings=spotify_mappings, soundcloud_url=soundcloud_url)
entity_id=entity_id, spotify_mappings=spotify_mappings, soundcloud_url=soundcloud_url)

entity_title = None
if 'title' in entity:
Expand All @@ -289,7 +289,7 @@ def create(entity_type=None, entity_id=None):
if not form.errors:
flash.info(gettext("Please provide some text or a rating for this review."))
return render_template('review/modify/write.html', form=form, entity_type=entity_type,
entity_title=entity_title, entity=entity)
entity_title=entity_title, entity=entity, entity_id=entity_id)


@review_bp.route('/<uuid:id>/edit', methods=('GET', 'POST'))
Expand Down

0 comments on commit d211c8b

Please sign in to comment.