Skip to content

Commit

Permalink
Remove route for down votes and make it a span (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
BentiGorlich committed Feb 21, 2024
1 parent 48c89bc commit 355f587
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions config/kbin_routes/entry.yaml
Expand Up @@ -49,7 +49,7 @@ entry_comment_image_delete:
entry_comment_voters:
controller: App\Controller\Entry\Comment\EntryCommentVotersController
defaults: { slug: -, }
requirements: { type: 'up|down' }
requirements: { type: 'up' }
path: /m/{magazine_name}/t/{entry_id}/{slug}/comment/{comment_id}/votes/{type}
methods: [ GET ]

Expand Down Expand Up @@ -200,7 +200,7 @@ entry_pin:
entry_voters:
controller: App\Controller\Entry\EntryVotersController
defaults: { slug: -, sortBy: hot }
requirements: { type: 'up|down' }
requirements: { type: 'up' }
path: /m/{magazine_name}/t/{entry_id}/{slug}/votes/{type}
methods: [ GET ]

Expand Down
9 changes: 3 additions & 6 deletions templates/entry/_options_activity.html.twig
Expand Up @@ -9,17 +9,14 @@
{{ 'up_votes'|trans }} ({{ entry.countUpVotes }})
</a>
</li>
<li>
<a href="{{ entry_voters_url(entry, 'down') }}"
class="{{ html_classes({'active': is_route_name('entry_voters') and route_has_param('type', 'down')}) }}">
{{ 'down_votes'|trans }} ({{ entry.countDownVotes }})
</a>
</li>
<li>
<a href="{{ entry_favourites_url(entry) }}"
class="{{ html_classes({'active': is_route_name('entry_fav')}) }}">
{{ 'favourites'|trans }} ({{ entry.favouriteCount }})
</a>
</li>
<li>
<span>{{ 'down_votes'|trans }} ({{ entry.countDownVotes }})</span>
</li>
</menu>
</aside>
9 changes: 3 additions & 6 deletions templates/entry/comment/_options_activity.html.twig
Expand Up @@ -9,17 +9,14 @@
{{ 'up_votes'|trans }} ({{ comment.countUpVotes }})
</a>
</li>
<li>
<a href="{{ entry_comment_voters_url(comment, 'down') }}"
class="{{ html_classes({'active': is_route_name('entry_comment_voters') and route_has_param('type', 'down')}) }}">
{{ 'down_votes'|trans }} ({{ comment.countDownVotes }})
</a>
</li>
<li>
<a href="{{ entry_comment_favourites_url(comment) }}"
class="{{ html_classes({'active': is_route_name('entry_comment_favourites')}) }}">
{{ 'favourites'|trans }} ({{ comment.favouriteCount }})
</a>
</li>
<li>
<span>{{ 'down_votes'|trans }} ({{ comment.countDownVotes }})</span>
</li>
</menu>
</aside>

0 comments on commit 355f587

Please sign in to comment.