agregar un menu para poder filtrar por categoria

This commit is contained in:
f 2018-09-06 16:49:37 -03:00
parent 3d57b94fe3
commit 5e02d061d1
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
5 changed files with 23 additions and 11 deletions

View file

@ -34,7 +34,7 @@ gem 'commonmarker'
gem 'email_address'
gem 'rails_warden'
gem 'haml-rails'
gem 'bootstrap', '~> 4.0.0.beta3'
gem 'bootstrap', '~> 4.0.0'
gem 'jekyll'
gem 'jquery-rails'
gem 'font-awesome-rails'

View file

@ -43,7 +43,7 @@ GEM
airbrussh (1.3.0)
sshkit (>= 1.6.1, != 1.7.0)
arel (8.0.0)
autoprefixer-rails (8.3.0)
autoprefixer-rails (9.1.4)
execjs
bcrypt_pbkdf (1.0.0)
bindex (0.5.0)
@ -111,7 +111,7 @@ GEM
activesupport (>= 4.0, < 6)
execjs (2.7.0)
fastimage (2.1.3)
ffi (1.9.23)
ffi (1.9.25)
font-awesome-rails (4.7.0.4)
railties (>= 3.2, < 6.0)
forwardable-extended (2.6.0)
@ -188,7 +188,7 @@ GEM
mini_portile2 (~> 2.3.0)
pathutil (0.16.1)
forwardable-extended (~> 2.6)
popper_js (1.12.9)
popper_js (1.14.3)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
@ -236,7 +236,7 @@ GEM
sexp_processor (~> 4.9)
rubyzip (1.2.1)
safe_yaml (1.0.4)
sass (3.5.6)
sass (3.5.7)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
@ -303,7 +303,7 @@ PLATFORMS
DEPENDENCIES
bcrypt_pbkdf
bootstrap (~> 4.0.0.beta3)
bootstrap (~> 4.0.0)
capistrano
capistrano-bundler
capistrano-passenger
@ -340,4 +340,4 @@ DEPENDENCIES
whenever
BUNDLED WITH
1.16.1
1.16.3

View file

@ -21,9 +21,19 @@
= link_to template.id.camelize,
new_site_post_path(@site, lang: @lang, template: template.id),
class: 'dropdown-item'
- @site.translations.each do |l|
= link_to t("i18n.#{l}"), site_posts_path(@site, category: @category, lang: l),
class: 'btn btn-info'
- @site.translations.each do |l|
= link_to t("i18n.#{l}"), site_posts_path(@site, category: @category, lang: l),
class: 'btn btn-info'
.btn-group.pull-right
= link_to t('posts.categories'), site_posts_path(@site, lang: @lang), class: 'btn btn-secondary'
%button.btn.btn-secondary.dropdown-toggle.dropdown-toggle-split{data: { toggle: 'split' },
aria: { haspopup: 'true', expanded: 'false' }}
%span.sr-only= t('posts.dropdown')
.dropdown-menu
- @site.categories.each do |c|
= link_to c.split(':').first,
site_posts_path(@site, lang: @lang, category: c),
class: (params[:category] == c) ? 'dropdown-item active' : 'dropdown-item'
.row
.col

View file

@ -150,6 +150,7 @@ en:
order: 'Order'
new: 'New post'
dropdown: 'Toggle dropdown'
categories: 'Everything'
index: 'Posts'
edit: 'Edit'
save: 'Save'
@ -158,7 +159,6 @@ en:
title: 'Title'
tags: 'Tags'
tags_help: 'Comma separated!'
categories: 'Categories'
tags: 'Tags'
slug: 'Slug'
slug_help: 'This is the name of the article on the URL, ie. /title/.

View file

@ -146,6 +146,8 @@ es:
order: 'posición'
date: 'fecha'
order: 'Posición'
categories: 'Todos'
dropdown: 'Desplegar el menú'
new: 'Empezar un artículo nuevo'
index: 'Artículos'
edit: 'Editar'