<% block = cell(:elements, :block).new(class: 'xs-12 sm-12 md-12') %> <%=raw block.open %> <%=raw cell(:elements, :title).new(label: LANGUAGES[:lato_blog][:mixed][:switch_status], size: 6) %> <% published_button = cell(:elements, :button).new(label: LANGUAGES[:lato_blog][:mixed][:published_posts], icon: 'thumbs-o-up', url: lato_blog.posts_path(status: 'published')) drafted_button = cell(:elements, :button).new(label: LANGUAGES[:lato_blog][:mixed][:drafted_posts], icon: 'user-secret', url: lato_blog.posts_path(status: 'drafted')) deleted_button = cell(:elements, :button).new(label: LANGUAGES[:lato_blog][:mixed][:deleted_posts], icon: 'trash', url: lato_blog.posts_path(status: 'deleted')) buttons = [] buttons = [drafted_button, deleted_button] if status && status === 'published' buttons = [published_button, deleted_button] if status && status === 'drafted' buttons = [published_button, drafted_button] if status && status === 'deleted' %>
<% buttons.each do |button| %> <%=raw button.show %> <% end %>
<%=raw block.close %>