Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit

Permalink
Adding menu and cool buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
tscolari committed Sep 15, 2011
1 parent 4c8af70 commit 0fb95be
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 25 deletions.
6 changes: 0 additions & 6 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@ class ApplicationController < ActionController::Base
protect_from_forgery
respond_to_mobile_requests :skip_xhr_requests => false

private

def is_mobile_request?
true
end

end
16 changes: 16 additions & 0 deletions app/views/layouts/application.mobile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@
<body>
<div data-role="page">
<%= yield %>
<div data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li>
<%= link_to notes_path, :class => ("ui-btn-active" if action_name == 'index'), :"data-icon" => "home", :"data-iconpos" => "top" do %>
Home
<% end %>
</li>
<li>
<%= link_to new_note_path, :class => ("ui-btn-active" if action_name == 'new'), :"data-icon" => "plus", :"data-iconpos" => "top" do %>
New Note
<% end %>
</li>
</ul>
</div>
</div>
</div>
</body>
</html>
6 changes: 1 addition & 5 deletions app/views/notes/edit.mobile.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<div data-role="header">
<h1>Editing note</h1>
<%= link_to "Cancel", note_path(@note), :"data-icon" => "delete", :class => "ui-btn-right" %>
</div>

<%= render 'form' %>

<div data-role="footer">
<%= link_to 'Show', @note %>
<%= link_to 'Back', notes_path %>
</div>
4 changes: 0 additions & 4 deletions app/views/notes/index.mobile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@
<% end %>
</ul>
</div>

<div data-role="footer">
<%= link_to 'New Note', new_note_path %>
</div>
5 changes: 1 addition & 4 deletions app/views/notes/new.mobile.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<div data-role="header">
<h1>New note</h1>
<%= link_to "Cancel", notes_path, :"data-icon" => "delete", :class => "ui-btn-right" %>
</div>

<%= render 'form' %>

<div data-role="footer">
<%= link_to 'Back', notes_path %>
</div>
19 changes: 13 additions & 6 deletions app/views/notes/show.mobile.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
<div data-role="header">
<%= link_to "Back", notes_path, :"data-icon" => "arrow-l", :class => "ui-btn-left" %>
<h1><%= @note.title %></h1>
<%= link_to "Edit", edit_note_path(@note), :"data-icon" => "gear", :class => "ui-btn-right" %>

<div data-role="navbar">
<ul>
<li>
<%= link_to @note, :confirm => 'Are you sure?', :method => :delete, :"data-icon" => "delete", :"data-iconpos" => "top" do %>
Delete
<% end %>
</li>
</ul>
</div>
</div>


<div data-role="content">
<p id="notice"><%= notice %></p>
<p>
<%= @note.body %>
</p>
</div>

<div data-role="footer">
<%= link_to 'Edit', edit_note_path(@note) %>
<%= link_to 'Destroy', @note, confirm: 'Are you sure?', method: :delete %>
<%= link_to 'Back', notes_path %>
</div>

0 comments on commit 0fb95be

Please sign in to comment.