diff --git a/app/views/posts/index.haml b/app/views/posts/index.haml index 714e334..5472fb4 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')