Permalink
Browse files

Fix bugs involving rack offline gem

  • Loading branch information...
iwano committed May 23, 2012
1 parent 7943193 commit b079c9dff9a2ba94f8bf7bad3e09abbfec76ba01
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html manifest="/application.manifest">
+<html>
<head>
<title><%= full_title(yield(:title)) %></title>
<link rel="shortcut icon" href="/favicon.ico" />
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html manifest="/application.manifest">
+<html>
<head>
<title><%= full_title(yield(:title)) %></title>
<%= stylesheet_link_tag "http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" %>
@@ -32,16 +32,19 @@
$('li.swipe').live('swipeleft', function(event){
var $li = $(this);
$('.aDeleteBtn').remove();
+ var $url = '/route_details/deliver?' + $(this).attr('id');
var $deleteBtn = $('<a>Delivered</a>').attr({
'class': 'aDeleteBtn ui-btn-up-r',
- 'href': '/'});
+ 'href': $url});
$li.prepend($deleteBtn);
});
$('li.swipe').live('swiperight', function(event){
$('.aDeleteBtn').remove();
});
+
});
+
</script>
<%= yield(:head) %>
</head>
@@ -4,13 +4,13 @@
<li data-role="list-divider"></li>
<h2>Stops (<%= @route.route_details.count %>)</h2>
<% @route_details.each do |route_detail| %>
- <li class="swipe">
+ <li class="swipe" id="order_id=<%= route_detail.order.id%>">
<%= link_to(route_detail.order, :data => { :transition => 'slide' }) do %>
<%= route_detail.order.user.name %><br />
<%= "#{route_detail.order.user.state.name} - #{route_detail.order.user.city.name}"%><br />
<%= route_detail.order.user.address %><br />
<%= "#{route_detail.order.number_products} - #{number_to_currency (route_detail.order.total)}" %><br />
- <%= route_detail.order.status%>
+ <%= route_detail.order.status%> <%=hidden_field 'id', route_detail.order.id, class: "route_id", value: route_detail.route.id%>
<% end %>
</li>
<% end %>
@@ -1,4 +1,6 @@
- <h4 class="center"><%=current_user.email%></h4>
+ <% if signed_in?%>
+ <h4 class="center"><%=current_user.email%></h4>
+ <%end%>
<%= link_to "Full Site", root_url(:mobile => 0), :rel => "external", :data => { :role => "button", :theme=>"b", :transition=>"flip" } %>
<% if signed_in?%>
<%= button_to "Log out", signout_path, method: "delete", :data => { :role => "button", :theme=>"e"} %>
View
@@ -1,6 +1,5 @@
require File.expand_path('../boot', __FILE__)
-ENV["RAILS_ASSET_ID"] = "" # disable timestamps at end of asset files for offline browsing
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
View
@@ -1,25 +1,4 @@
Xbotana::Application.routes.draw do
- offline = Rack::Offline.configure do
- cache "assets/application.js"
- cache "assets/application.css"
- cache "assets/custom.css.scss"
- cache "assets/xsoftware_logo.png"
- files = Dir[
- "#{root}/**/*.html"]
- files.each do |file|
- public_dir = Pathname.new("#{root}/public")
- cache Pathname.new(file).relative_path_from(public_dir)
- end
- files = Dir[
- "#{root}/assets/**/*.{js,css,jpg,png,gif}"]
- files.each do |file|
- cache Pathname.new(file).relative_path_from(root)
- end
-
- network "/"
- end
- match "/application.manifest" => offline
-
match 'users/update_city_select/:id', :controller=>'users', :action => 'update_city_select'
get 'static_pages/search'
get 'orders/emptycart'

0 comments on commit b079c9d

Please sign in to comment.