-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Se movió la gestión de Posts al administrador
- Loading branch information
1 parent
bc92e17
commit e33b434
Showing
12 changed files
with
82 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module Admin | ||
class PostsController < BaseController | ||
has_scope :has_status | ||
has_scope :lifo, :type => :boolean, :default => true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
= alert_message_for(post) | ||
|
||
= form_for [:admin, post], :html => { :class => 'form-stacked' } do |f| | ||
%fieldset | ||
|
||
- if post.persisted? | ||
%legend | ||
Editando Post ##{post.id} | ||
- if post.persisted? | ||
%small= link_to "Ver original", post, :target => '_blank' | ||
|
||
.clearfix | ||
= f.label :title | ||
.input | ||
= f.text_field :title, :class => 'xxlarge' | ||
.clearfix | ||
= f.label :content | ||
.input | ||
= f.text_area :content, :class => 'xxlarge' | ||
|
||
.actions | ||
= f.submit ( post.new_record? ? 'Publicar' : 'Guardar' ), :class => 'btn primary' | ||
= link_to 'Cancelar', admin_posts_path, :class => 'btn' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
%ul.pills | ||
%li{:class=>active_if_current(:action => :index)}= link_to "Listar Todos", admin_posts_path | ||
%li{:class=>active_if_current(:action => :new)}= link_to "Crear Nuevo", new_admin_post_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- page_title("Editando Post") | ||
|
||
%h2.fancy-title Administración de Posts | ||
|
||
= render 'pills' | ||
|
||
= render 'form', :post => @post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
- page_title("Administración de Posts") | ||
|
||
%h2.fancy-title= html_page_title | ||
|
||
= render 'pills' | ||
|
||
- if @posts.empty? | ||
%p No se han encontrado posts | ||
-else | ||
%table | ||
%thead | ||
%tr | ||
%th # | ||
%th Título | ||
%th | ||
%tbody | ||
- @posts.each do |post| | ||
%tr | ||
%td= post.id | ||
%td= post.title | ||
%td | ||
=link_to "Permalink", post, :target => '_blank' | ||
=link_to "Editar", edit_admin_post_path(post) | ||
=link_to "Eliminar", admin_post_path(post), :method => :delete, :confirm => "¿Estás seguro?" | ||
|
||
= paginate @posts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- page_title("Crear nuevo Post") | ||
|
||
%h2.fancy-title Administración de Posts | ||
|
||
= render 'pills' | ||
|
||
= render 'form', :post => @post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters