5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 21:41:41 +00:00

botón de estadísticas más arriba

This commit is contained in:
f 2022-07-15 14:17:46 -03:00
parent 03d2914ec6
commit 091ceac788
2 changed files with 5 additions and 3 deletions

View file

@ -35,6 +35,8 @@ class PostsController < ApplicationController
# Filtrar los posts que les invitades no pueden ver # Filtrar los posts que les invitades no pueden ver
@usuarie = site.usuarie? current_usuarie @usuarie = site.usuarie? current_usuarie
@site_stat = SiteStat.new(site)
end end
def show def show

View file

@ -15,15 +15,15 @@
- else - else
%td= link_to t('posts.filter'), site_posts_path(@site, **@filter_params.merge(layout: layout.value)), class: 'btn btn-secondary btn-sm' %td= link_to t('posts.filter'), site_posts_path(@site, **@filter_params.merge(layout: layout.value)), class: 'btn btn-secondary btn-sm'
- if policy(@site_stat).index?
= link_to t('stats.index.title'), site_stats_path(@site), class: 'btn'
- if policy(@site).edit? - if policy(@site).edit?
= link_to t('sites.edit.btn', site: @site.title), edit_site_path(@site), class: 'btn' = link_to t('sites.edit.btn', site: @site.title), edit_site_path(@site), class: 'btn'
- if policy(@site).private? - if policy(@site).private?
= link_to t('sites.private'), '../private/' + @site.name, class: 'btn', target: '_blank', rel: 'noopener' = link_to t('sites.private'), '../private/' + @site.name, class: 'btn', target: '_blank', rel: 'noopener'
- if policy(SiteStat.new(@site)).index?
= link_to t('stats.index.title'), site_stats_path(@site), class: 'btn'
- if policy(SiteUsuarie.new(@site, current_usuarie)).index? - if policy(SiteUsuarie.new(@site, current_usuarie)).index?
= render 'layouts/btn_with_tooltip', = render 'layouts/btn_with_tooltip',
tooltip: t('usuaries.index.help.self'), tooltip: t('usuaries.index.help.self'),