From 4235a373fb97e852ed9c7e37027ea9196b6ff726 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 2 Oct 2018 17:13:31 -0300 Subject: [PATCH] ir a la plantilla por defecto --- app/views/posts/index.haml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/posts/index.haml b/app/views/posts/index.haml index 714e3340..5472fb45 100644 --- a/app/views/posts/index.haml +++ b/app/views/posts/index.haml @@ -10,9 +10,12 @@ .row .col .btn-group - = link_to t('posts.new'), new_site_post_path(@site, lang: @lang), - class: 'btn btn-success' - - unless @site.templates.empty? + - if @site.templates.empty? + = link_to t('posts.new'), new_site_post_path(@site, lang: @lang), + class: 'btn btn-success' + - else + = link_to t('posts.new'), new_site_post_path(@site, lang: @lang, template: @site.templates.first.id), + class: 'btn btn-success' %button.btn.btn-success.dropdown-toggle.dropdown-toggle-split{data: { toggle: 'split' }, aria: { haspopup: 'true', expanded: 'false' }} %span.sr-only= t('posts.dropdown')