Permalink
Browse files

haml glory!

  • Loading branch information...
1 parent cc6a221 commit d97ef84ef78ede140494309b53bdcbbbbb920e7a @nofxx committed Jul 13, 2008
@@ -1,6 +1,8 @@
class HomeController < ApplicationController
def index
- @mensagem = "Bem-vindo"
+ @mensagem = "Bem-vindo"
+ @aps = current_user.aps.count
+ @clients = current_user.clients.count
end
end
@@ -72,7 +72,7 @@ def flexigrid_button_click(class_name, redirect_to_url, options = {})
output << " if (confirm('#{options[:confirm]}'))" if options[:confirm]
output << " window.location = '" << url_for(redirect_to_url) << "/'+$('td', '.trSelected', '.flexigrid')[0].textContent;"
output << " } else { "
- output << " alert('You dont selected a item.'); } "
+ output << " alert('Select one item.'); } "
else
output << "window.location = '" << url_for(redirect_to_url) << "'"
end
@@ -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
+
+
@@ -1,56 +0,0 @@
-<h1>Editando <%= @ap.essid %></h1>
-
-<% form_for(@ap) do |f| %>
- <%= f.error_messages %>
-
- <p>
- <%= f.label :essid %><br />
- <%= f.text_field :essid %>
- </p>
- <p>
- <%= f.label :mac %><br />
- <%= f.text_field :mac %>
- </p>
- <p>
- <%= f.label :enc %><br />
- <%= f.text_field :enc %>
- </p>
- <p>
- <%= f.label :key %><br />
- <%= f.text_field :key %>
- </p>
- <p>
- <%= f.label :ip %><br />
- <%= f.text_field :ip %>
- </p>
- <p>
- <%= f.label :mask %><br />
- <%= f.text_field :mask %>
- </p>
- <p>
- <%= f.label :dhcp %><br />
- <%= f.check_box :dhcp %>
- </p>
- <p>
- <%= f.label :canal %><br />
- <%= f.text_field :channel %>
- </p>
- <p>
- <%= f.label :Pais %><br />
- <%= f.text_field :country %>
- </p>
- <p>
- <%= f.label :Cidade %><br />
- <%= f.text_field :city %>
- </p>
- <p>
- <%= f.label :Estado %><br />
- <%= f.text_field :region %>
- </p>
- <p>
- <%= f.submit "Atualizar" %>
- </p>
-<% end %>
-
-<%= link_to 'Ver', @ap %> |
-<%= link_to 'Voltar', aps_path %>
@@ -0,0 +1,7 @@
+%h1= "Editando #{@ap.essid}"
+
+= partial 'aps/ap', :metodo => "put"
+
+= link_to 'Ver', @ap
+|
+= link_to 'Voltar', aps_path
@@ -1,2 +0,0 @@
-<h1>Listando Pontos de acesso</h1>
-<%= content_tag('div', '', :id => 'flexigrid') %>
@@ -0,0 +1,3 @@
+%h1 Listando Pontos de acesso
+
+= content_tag('div', '', :id => 'flexigrid')
@@ -12,6 +12,8 @@ $(document).ready(function(){
s << {:display => 'Mac', :name => 'mac'}
s << {:display => 'IP', :name => 'ip'}
+ b << {:name => 'Ver', :bclass => 'show'}
+ b << {:separator => true}
b << {:name => 'Adicionar', :bclass => 'add'}
b << {:separator => true}
b << {:name => 'Editar', :bclass => 'edit'}
@@ -20,7 +22,8 @@ $(document).ready(function(){
end
%>
-
+
+ <%= flexigrid_button_click '.show', '/aps/show', :include_id => true %>
<%= flexigrid_button_click '.add', new_ap_path %>
<%= flexigrid_button_click '.edit', '/aps/edit', :include_id => true %>
<%= flexigrid_button_click '.destroy', '/aps/destroy', :include_id => true, :confirm => 'Tem certeza?' %>
View
@@ -1,55 +0,0 @@
-<h1>Novo Ponto de acesso</h1>
-
-<% form_for(@ap) do |f| %>
- <%= f.error_messages %>
-
- <p>
- <%= f.label :essid %><br />
- <%= f.text_field :essid %>
- </p>
- <p>
- <%= f.label :mac %><br />
- <%= f.text_field :mac %>
- </p>
- <p>
- <%= f.label :enc %><br />
- <%= f.text_field :enc %>
- </p>
- <p>
- <%= f.label :key %><br />
- <%= f.text_field :key %>
- </p>
- <p>
- <%= f.label :ip %><br />
- <%= f.text_field :ip %>
- </p>
- <p>
- <%= f.label :mask %><br />
- <%= f.text_field :mask %>
- </p>
- <p>
- <%= f.label :dhcp %><br />
- <%= f.check_box :dhcp %>
- </p>
- <p>
- <%= f.label :channel %><br />
- <%= f.text_field :channel %>
- </p>
- <p>
- <%= f.label :pais %><br />
- <%= f.text_field :country %>
- </p>
- <p>
- <%= f.label :cidade %><br />
- <%= f.text_field :city %>
- </p>
- <p>
- <%= f.label :estado %><br />
- <%= f.text_field :region %>
- </p>
- <p>
- <%= f.submit "Criar" %>
- </p>
-<% end %>
-
-<%= link_to 'Voltar', aps_path %>
@@ -0,0 +1,5 @@
+%h1 Novo Ponto de acesso
+
+= partial 'aps/ap', :metodo => "post"
+
+= link_to 'Voltar', aps_path
@@ -1,63 +0,0 @@
-<h1><%= @ap.essid %></h1>
-<p>
- <b>Essid:</b>
- <%=h @ap.essid %>
-</p>
-
-<p>
- <b>Mac:</b>
- <%=h @ap.mac %>
-</p>
-
-<p>
- <b>Enc:</b>
- <%=h @ap.enc %>
-</p>
-
-<p>
- <b>Key:</b>
- <%=h @ap.key %>
-</p>
-
-<p>
- <b>Ip:</b>
- <%=h @ap.ip %>
-</p>
-
-<p>
- <b>Mask:</b>
- <%=h @ap.mask %>
-</p>
-
-<p>
- <b>Dhcp:</b>
- <%=h @ap.dhcp %>
-</p>
-
-<p>
- <b>Canal:</b>
- <%=h @ap.channel %>
-</p>
-
-<p>
- <b>Pais:</b>
- <%=h @ap.country %>
-</p>
-
-<p>
- <b>Cidade:</b>
- <%=h @ap.city %>
-</p>
-
-<p>
- <b>Estado:</b>
- <%=h @ap.region %>
-</p>
-<p>Clientes:
-<% for client in @ap.clients %>
- <p><%= link_to client.mac, client %></p>
-<% end %>
-</p>
-<br>
-<%= link_to 'Editar', edit_ap_path(@ap) %> |
-<%= link_to 'Voltar', aps_path %>
@@ -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
@@ -1,3 +0,0 @@
-<p><%= @mensagem %></p>
-
-
@@ -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
+
@@ -1,3 +1,5 @@
-<div id="header">
- <div id="logo"></div>
-</div>
+<a href='/'>
+ <div id="header">
+ <div id="logo"></div>
+ </div>
+</a>
Oops, something went wrong.

0 comments on commit d97ef84

Please sign in to comment.