Skip to content

Commit

Permalink
agregar indice de acciones
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjcsr committed Mar 19, 2014
1 parent 7629389 commit 8aa26b6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/controllers/actions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ def show

end

def index
@actions = Action.all
end

def agregar
@action = Action.find(params[:id])
if !current_user.nil?
Expand Down
26 changes: 26 additions & 0 deletions app/views/actions/index.html.haml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion app/views/users/home.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/stylesheets/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8aa26b6

Please sign in to comment.