From a95bb4be97cac09b625626cae9da39c8608bbebf Mon Sep 17 00:00:00 2001 From: f Date: Mon, 5 Feb 2018 14:27:12 -0300 Subject: [PATCH] migas de pan --- app/views/layouts/_breadcrumb.haml | 7 +++++++ app/views/posts/edit.haml | 10 ++++++++++ app/views/posts/index.haml | 3 +++ app/views/posts/new.haml | 3 +++ app/views/posts/show.haml | 9 +++++++++ app/views/sites/index.haml | 18 ++++++++++++------ config/locales/en.yml | 2 ++ config/locales/es.yml | 2 ++ 8 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 app/views/layouts/_breadcrumb.haml diff --git a/app/views/layouts/_breadcrumb.haml b/app/views/layouts/_breadcrumb.haml new file mode 100644 index 00000000..2eed3d4a --- /dev/null +++ b/app/views/layouts/_breadcrumb.haml @@ -0,0 +1,7 @@ +%nav{'aria-label': 'breadcrumb', role: 'navigation'} + %ol.breadcrumb + - crumbs.each do |crumb| + - if crumb == crumbs.last + %li.breadcrumb-item.active{'aria-current': 'page'}= crumb + - else + %li.breadcrumb-item= crumb diff --git a/app/views/posts/edit.haml b/app/views/posts/edit.haml index f327f1b8..d9e13dc1 100644 --- a/app/views/posts/edit.haml +++ b/app/views/posts/edit.haml @@ -1,3 +1,13 @@ +.row + .col + = render 'layouts/breadcrumb', + crumbs: [ link_to(t('sites.index'), sites_path), + @site.name, + link_to(t('posts.index'), + site_posts_path(@site)), + link_to(@post.title, site_post_path(@site, @post)), + t('posts.edit')] + .row .col = render 'posts/form' diff --git a/app/views/posts/index.haml b/app/views/posts/index.haml index 98a2d9ba..c0896987 100644 --- a/app/views/posts/index.haml +++ b/app/views/posts/index.haml @@ -1,3 +1,6 @@ +.row + .col + = render 'layouts/breadcrumb', crumbs: [ link_to(t('sites.index'), sites_path), @site.name, t('posts.index') ] .row .col %h1= @site.name diff --git a/app/views/posts/new.haml b/app/views/posts/new.haml index f327f1b8..41c2722d 100644 --- a/app/views/posts/new.haml +++ b/app/views/posts/new.haml @@ -1,3 +1,6 @@ +.row + .col + = render 'layouts/breadcrumb', crumbs: [ link_to(t('sites.index'), sites_path), @site.name, link_to(t('posts.index'), site_posts_path(@site)), t('posts.new') ] .row .col = render 'posts/form' diff --git a/app/views/posts/show.haml b/app/views/posts/show.haml index 174cbee4..15aa853b 100644 --- a/app/views/posts/show.haml +++ b/app/views/posts/show.haml @@ -1,3 +1,12 @@ +.row + .col + = render 'layouts/breadcrumb', + crumbs: [ link_to(t('sites.index'), sites_path), + @site.name, + link_to(t('posts.index'), + site_posts_path(@site)), + @post.title ] + .row .col %h1= @post.title diff --git a/app/views/sites/index.haml b/app/views/sites/index.haml index 95587891..6e175b77 100644 --- a/app/views/sites/index.haml +++ b/app/views/sites/index.haml @@ -1,7 +1,13 @@ -%h1= t('sites.title') -%table.table.table-striped.table-condensed - %tbody - - @sites.each do |site| - %tr - %td= link_to site.name, site_path(site) +.row + .col + = render 'layouts/breadcrumb', crumbs: [ t('sites.index') ] +.row + .col + %h1= t('sites.title') + + %table.table.table-striped.table-condensed + %tbody + - @sites.each do |site| + %tr + %td= link_to site.name, site_path(site) diff --git a/config/locales/en.yml b/config/locales/en.yml index 1de8119a..8bed5c12 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -7,9 +7,11 @@ en: submit: 'Log in' sites: title: 'Sites' + index: 'Sites' footer: powered_by: 'is developed by' posts: + index: 'Posts' edit: 'Edit' save: 'Save' date: 'Publication date' diff --git a/config/locales/es.yml b/config/locales/es.yml index 7f19b026..21914f5d 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -7,9 +7,11 @@ es: submit: 'Ingresar' sites: title: 'Sitios' + index: 'Sitios' footer: powered_by: 'es desarrollada por' posts: + index: 'Artículos' edit: 'Editar' save: 'Guardar' date: 'Fecha de publicación'