From 8aa26b6bea3e687dd3e0c214780be52424f0caee Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 18 Mar 2014 21:48:24 -0600 Subject: [PATCH] agregar indice de acciones --- app/controllers/actions_controller.rb | 4 ++++ app/views/actions/index.html.haml | 26 +++++++++++++++++++++++++ app/views/users/home.html.haml | 2 +- config/routes.rb | 1 + vendor/assets/stylesheets/dashboard.css | 2 +- 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 app/views/actions/index.html.haml diff --git a/app/controllers/actions_controller.rb b/app/controllers/actions_controller.rb index 2cc0c45..ce5e3b1 100644 --- a/app/controllers/actions_controller.rb +++ b/app/controllers/actions_controller.rb @@ -4,6 +4,10 @@ def show end + def index + @actions = Action.all + end + def agregar @action = Action.find(params[:id]) if !current_user.nil? diff --git a/app/views/actions/index.html.haml b/app/views/actions/index.html.haml new file mode 100644 index 0000000..0cd3562 --- /dev/null +++ b/app/views/actions/index.html.haml @@ -0,0 +1,26 @@ +-if user_signed_in? + = render 'shared/sidebar' + +#page-wrapper + .page-content + .row + .col-lg-6 + .tile.green.checklist-tile + %h3 + %i.fa.fa-check-square-o + Acciones Saludables + .checklist + - @actions.each do |a| + - if !current_user.doing_action?(Action.find_by(id: a.id)).nil? + - selected = "selected" + %label{class: selected} + %a{href: accion_path(a)} + - if !current_user.doing_action?(Action.find_by(id: a.id)).nil? + %input{type: "checkbox", :checked => true} + %i.fa.fa-wrench.fa-fw.text-faded + -else + %input{type: "checkbox", :checked => false} + %i.fa.fa-wrench.fa-fw.text-faded + = a.name + %span.task-time.text-faded.pull-right + = a.points diff --git a/app/views/users/home.html.haml b/app/views/users/home.html.haml index 9622aaf..dac07ae 100644 --- a/app/views/users/home.html.haml +++ b/app/views/users/home.html.haml @@ -83,7 +83,7 @@ Acciones realizadas .circle-tile-number.text-faded = current_user.completed_actions.count - puntos + acciones %span#sparklineA %a.circle-tile-footer{href: done_user_actions_path} Historial diff --git a/config/routes.rb b/config/routes.rb index f5d18a1..59d2ae1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,6 +8,7 @@ resources :friend_relationships, only: [:create, :destroy] post "acciones/users", to: 'actions#agregar', as: 'add_accion_user' + get "acciones", to: 'actions#index', as: 'acciones' get "acciones/users", to: 'actions#user', as: 'accion_user' get "acciones/:id", to: 'actions#show', as: 'accion' get "/perfil/:id", to: 'users#show', as: 'user_show' diff --git a/vendor/assets/stylesheets/dashboard.css b/vendor/assets/stylesheets/dashboard.css index b0aa8bd..74fab1a 100644 --- a/vendor/assets/stylesheets/dashboard.css +++ b/vendor/assets/stylesheets/dashboard.css @@ -1970,7 +1970,7 @@ input[type="checkbox"]:hover, input[type="checkbox"]:checked::after, .checkbox input[type="checkbox"]:checked::after, .checkbox-inline input[type="checkbox"]:checked::after { - content: url(../img/checkmark.png); + content: url("http://themes.startbootstrap.com/flex-admin-v1.2/img/checkmark.png"); display: block; position: absolute; top: -6px;