Skip to content

Commit

Permalink
haml glory!
Browse files Browse the repository at this point in the history
  • Loading branch information
nofxx committed Jul 13, 2008
1 parent cc6a221 commit d97ef84
Show file tree
Hide file tree
Showing 18 changed files with 206 additions and 261 deletions.
4 changes: 3 additions & 1 deletion app/controllers/home_controller.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,8 @@
class HomeController < ApplicationController class HomeController < ApplicationController
def index def index
@mensagem = "Bem-vindo" @mensagem = "Bem-vindo"
@aps = current_user.aps.count
@clients = current_user.clients.count
end end


end end
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def flexigrid_button_click(class_name, redirect_to_url, options = {})
output << " if (confirm('#{options[:confirm]}'))" if options[:confirm] output << " if (confirm('#{options[:confirm]}'))" if options[:confirm]
output << " window.location = '" << url_for(redirect_to_url) << "/'+$('td', '.trSelected', '.flexigrid')[0].textContent;" output << " window.location = '" << url_for(redirect_to_url) << "/'+$('td', '.trSelected', '.flexigrid')[0].textContent;"
output << " } else { " output << " } else { "
output << " alert('You dont selected a item.'); } " output << " alert('Select one item.'); } "
else else
output << "window.location = '" << url_for(redirect_to_url) << "'" output << "window.location = '" << url_for(redirect_to_url) << "'"
end end
Expand Down
40 changes: 40 additions & 0 deletions app/views/aps/_ap.html.haml
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,40 @@
- form_for(@ap) do |f|
= f.error_messages
%p
= f.label :essid
= f.text_field :essid
%p
= f.label :mac
= f.text_field :mac
%p
= f.label :enc
= f.text_field :enc
%p
= f.label :key
= f.text_field :key
%p
= f.label :ip
= f.text_field :ip
%p
= f.label :mask
= f.text_field :mask
%p
= f.label :dhcp
= f.check_box :dhcp
%p
= f.label :canal
= f.text_field :channel
%p
= f.label :Pais
= f.text_field :country
%p
= f.label :Cidade
= f.text_field :city
%p
= f.label :Estado
= f.text_field :region

%p= f.submit(metodo == "post" ? "Gravar" : "Atualizar")
- end


56 changes: 0 additions & 56 deletions app/views/aps/edit.html.erb

This file was deleted.

7 changes: 7 additions & 0 deletions app/views/aps/edit.html.haml
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,7 @@
%h1= "Editando #{@ap.essid}"

= partial 'aps/ap', :metodo => "put"

= link_to 'Ver', @ap
|
= link_to 'Voltar', aps_path
2 changes: 0 additions & 2 deletions app/views/aps/index.html.erb

This file was deleted.

3 changes: 3 additions & 0 deletions app/views/aps/index.html.haml
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,3 @@
%h1 Listando Pontos de acesso

= content_tag('div', '', :id => 'flexigrid')
5 changes: 4 additions & 1 deletion app/views/aps/index.js.erb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ $(document).ready(function(){
s << {:display => 'Mac', :name => 'mac'} s << {:display => 'Mac', :name => 'mac'}
s << {:display => 'IP', :name => 'ip'} s << {:display => 'IP', :name => 'ip'}


b << {:name => 'Ver', :bclass => 'show'}
b << {:separator => true}
b << {:name => 'Adicionar', :bclass => 'add'} b << {:name => 'Adicionar', :bclass => 'add'}
b << {:separator => true} b << {:separator => true}
b << {:name => 'Editar', :bclass => 'edit'} b << {:name => 'Editar', :bclass => 'edit'}
Expand All @@ -20,7 +22,8 @@ $(document).ready(function(){


end end
%> %>


<%= flexigrid_button_click '.show', '/aps/show', :include_id => true %>
<%= flexigrid_button_click '.add', new_ap_path %> <%= flexigrid_button_click '.add', new_ap_path %>
<%= flexigrid_button_click '.edit', '/aps/edit', :include_id => true %> <%= flexigrid_button_click '.edit', '/aps/edit', :include_id => true %>
<%= flexigrid_button_click '.destroy', '/aps/destroy', :include_id => true, :confirm => 'Tem certeza?' %> <%= flexigrid_button_click '.destroy', '/aps/destroy', :include_id => true, :confirm => 'Tem certeza?' %>
Expand Down
55 changes: 0 additions & 55 deletions app/views/aps/new.html.erb

This file was deleted.

5 changes: 5 additions & 0 deletions app/views/aps/new.html.haml
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,5 @@
%h1 Novo Ponto de acesso

= partial 'aps/ap', :metodo => "post"

= link_to 'Voltar', aps_path
63 changes: 0 additions & 63 deletions app/views/aps/show.html.erb

This file was deleted.

44 changes: 44 additions & 0 deletions app/views/aps/show.html.haml
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,44 @@
%h1= @ap.essid
%p
%b Essid:
=h @ap.essid
%p
%b Mac:
=h @ap.mac
%p
%b Enc:
=h @ap.enc
%p
%b Key:
=h @ap.key
%p
%b Ip:
=h @ap.ip
%p
%b Mask:
=h @ap.mask
%p
%b DHCP:
=h @ap.dhcp
%p
%b Canal:
=h @ap.channel
%p
%b Pais:
=h @ap.country
%p
%b Cidade:
=h @ap.city
%p
%b Estado:
=h @ap.region
%p
%b Clientes:
- for client in @ap.clients
%p
= link_to client.mac, client
- end
%br/
= link_to 'Editar', edit_ap_path(@ap)
|
= link_to 'Voltar', aps_path
3 changes: 0 additions & 3 deletions app/views/home/index.html.erb

This file was deleted.

18 changes: 18 additions & 0 deletions app/views/home/index.html.haml
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,18 @@
%h1= @mensagem

%p
You may want to start up
= link_to "uploading a logfile?", new_logfile_path


%h2 News on your area



%h2= current_user.login.upcase
%p
You have
= link_to "#{@aps} Access Points", aps_path
and
= link_to "#{@clients} Clients.", clients_path

8 changes: 5 additions & 3 deletions app/views/layouts/header.html.erb
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,5 @@
<div id="header"> <a href='/'>
<div id="logo"></div> <div id="header">
</div> <div id="logo"></div>
</div>
</a>
Loading

0 comments on commit d97ef84

Please sign in to comment.