stayind-order 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +38 -0
  4. data/app/controllers/order/Order.iml +12 -0
  5. data/app/controllers/order/orders_controller.rb +28 -0
  6. data/app/views/order/orders/_footer.html.erb +16 -0
  7. data/app/views/order/orders/category.html.erb +8 -0
  8. data/app/views/order/orders/category.html.erb~ +8 -0
  9. data/app/views/order/orders/index.html.erb +11 -0
  10. data/app/views/order/orders/one_order.html.erb +9 -0
  11. data/app/views/order/orders/order.html.erb +24 -0
  12. data/app/views/order/orders/orders.html.erb +18 -0
  13. data/app/views/order/orders/place.html.erb +29 -0
  14. data/app/views/order/orders/place.html.erb~ +29 -0
  15. data/app/views/order/orders/product.html.erb +5 -0
  16. data/app/views/order/orders/product_order.html.erb +17 -0
  17. data/app/views/order/orders/product_order.html.erb~ +17 -0
  18. data/config/Config.iml +12 -0
  19. data/config/locales/en.yml +15 -0
  20. data/config/locales/pl.yml +15 -0
  21. data/config/routes.rb +17 -0
  22. data/config/routes.rb~ +10 -0
  23. data/lib/Lib.iml +12 -0
  24. data/lib/order/engine.rb +7 -0
  25. data/lib/order/engine.rb~ +7 -0
  26. data/lib/order/version.rb +3 -0
  27. data/lib/order.rb +29 -0
  28. data/lib/order.rb~ +16 -0
  29. data/lib/tasks/order_tasks.rake +4 -0
  30. data/test/Test.iml +22 -0
  31. data/test/dummy/README.rdoc +261 -0
  32. data/test/dummy/Rakefile +7 -0
  33. data/test/dummy/app/assets/javascripts/application.js +15 -0
  34. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  35. data/test/dummy/app/controllers/application_controller.rb +3 -0
  36. data/test/dummy/app/helpers/application_helper.rb +2 -0
  37. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  38. data/test/dummy/config/application.rb +59 -0
  39. data/test/dummy/config/boot.rb +10 -0
  40. data/test/dummy/config/database.yml +25 -0
  41. data/test/dummy/config/environment.rb +5 -0
  42. data/test/dummy/config/environments/development.rb +37 -0
  43. data/test/dummy/config/environments/production.rb +67 -0
  44. data/test/dummy/config/environments/test.rb +37 -0
  45. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  46. data/test/dummy/config/initializers/inflections.rb +15 -0
  47. data/test/dummy/config/initializers/mime_types.rb +5 -0
  48. data/test/dummy/config/initializers/secret_token.rb +7 -0
  49. data/test/dummy/config/initializers/session_store.rb +8 -0
  50. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  51. data/test/dummy/config/locales/en.yml +5 -0
  52. data/test/dummy/config/routes.rb +58 -0
  53. data/test/dummy/config.ru +4 -0
  54. data/test/dummy/db/development.sqlite3 +0 -0
  55. data/test/dummy/db/test.sqlite3 +0 -0
  56. data/test/dummy/log/development.log +27 -0
  57. data/test/dummy/log/test.log +3 -0
  58. data/test/dummy/public/404.html +26 -0
  59. data/test/dummy/public/422.html +26 -0
  60. data/test/dummy/public/500.html +25 -0
  61. data/test/dummy/public/favicon.ico +0 -0
  62. data/test/dummy/script/rails +6 -0
  63. data/test/order_test.rb +7 -0
  64. data/test/test_helper.rb +16 -0
  65. data/vendor/assets/javascripts/si.order.js +214 -0
  66. metadata +177 -0
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2012 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = Order
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'Order'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+
24
+
25
+
26
+ Bundler::GemHelper.install_tasks
27
+
28
+ require 'rake/testtask'
29
+
30
+ Rake::TestTask.new(:test) do |t|
31
+ t.libs << 'lib'
32
+ t.libs << 'test'
33
+ t.pattern = 'test/**/*_test.rb'
34
+ t.verbose = false
35
+ end
36
+
37
+
38
+ task :default => :test
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$">
6
+ <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
7
+ </content>
8
+ <orderEntry type="inheritedJdk" />
9
+ <orderEntry type="sourceFolder" forTests="false" />
10
+ </component>
11
+ </module>
12
+
@@ -0,0 +1,28 @@
1
+ module Order
2
+ class OrdersController < ::ApplicationController
3
+ layout false
4
+ def index
5
+ end
6
+
7
+ def category
8
+ end
9
+
10
+ def product
11
+ end
12
+
13
+ def place
14
+ end
15
+
16
+ def product_order
17
+ end
18
+
19
+ def orders
20
+ end
21
+
22
+ def orderw
23
+ end
24
+
25
+ def one_order
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,16 @@
1
+ <div data-role="footer" data-position="fixed">
2
+ <div data-role="navbar" id="order-navbar">
3
+ <ul>
4
+ <li>
5
+ <a href="<%= url_for :order_page %>" data-icon="" class="ui-btn-active" class="new-order-link">
6
+ <%= tr('order.new_order') %>
7
+ </a>
8
+ </li>
9
+ <li>
10
+ <a href="<%= url_for :order_orders_page %>" data-theme="" data-icon="" class="your-orders-link">
11
+ <%= tr('order.your_orders') %>
12
+ </a>
13
+ </li>
14
+ </ul>
15
+ </div>
16
+ </div>
@@ -0,0 +1,8 @@
1
+ <div data-role="collapsible">
2
+ <h2>{{= Si.I18n.tr(id, 'name') }}</h2>
3
+
4
+ <ul data-role="listview" data-filter="true" data-filter-theme="c" data-divider-theme="d">
5
+ {{= products }}
6
+ </ul>
7
+
8
+ </div>
@@ -0,0 +1,8 @@
1
+ <div data-role="collapsible">
2
+ <h2>{{= Si.I18n.tr(_id, 'name') }}</h2>
3
+
4
+ <ul data-role="listview" data-filter="true" data-filter-theme="c" data-divider-theme="d">
5
+
6
+ </ul>
7
+
8
+ </div>
@@ -0,0 +1,11 @@
1
+ <div data-role="page" id="orders-page">
2
+ <%= render :partial => "layouts/header", :locals => { :back => true, :title => tr('orders_and_services') } %>
3
+
4
+ <div data-role="content">
5
+ <div data-role="collapsible-set" data-theme="b" data-content-theme="d">
6
+ {{= categories }}
7
+ </div>
8
+ </div>
9
+
10
+ <%= render "footer" %>
11
+ </div>
@@ -0,0 +1,9 @@
1
+ <li>
2
+ <a href="<%= url_for :order_order_page %>?order={{= id }}">
3
+ <div class="ui-grid-b">
4
+ <div class="ui-block-a">{{= date }}</div>
5
+ <div class="ui-block-b">{{= value.toFixed(2) }}</div>
6
+ <div class="ui-block-c">{{= Si.I18n.tr('order.statuses', status) }}</div>
7
+ </div>
8
+ </a>
9
+ </li>
@@ -0,0 +1,24 @@
1
+ <div data-role="page" id="orders-page">
2
+ <%= render :partial => "layouts/header", :locals => { :back => true, :title => "{{= date }}" } %>
3
+
4
+ <div data-role="content">
5
+
6
+ <ul data-role="listview" data-inset="true">
7
+
8
+ {{= productOrders }}
9
+
10
+ <li data-role="fieldcontain">
11
+ <div class="ui-grid-a">
12
+ <div class="ui-block-a">
13
+ <%= tr('total') %>
14
+ </div>
15
+ <div class="ui-block-b">
16
+ {{= total.toFixed(2) }}
17
+ </div>
18
+ </div>
19
+ </li>
20
+ </ul>
21
+ </div>
22
+
23
+ <%= render "footer" %>
24
+ </div>
@@ -0,0 +1,18 @@
1
+ <div data-role="page" id="your-orders-page">
2
+ <%= render :partial => "layouts/header", :locals => {:back => true, :title => tr('order.your_orders')} %>
3
+
4
+ <div data-role="content">
5
+ <ul data-role="listview">
6
+ <li data-role="list-divider">
7
+ <div class="ui-grid-b">
8
+ <div class="ui-block-a"><%= tr('order.date') %></div>
9
+ <div class="ui-block-b"><%= tr('order.value') %></div>
10
+ <div class="ui-block-c"><%= tr('order.status') %></div>
11
+ </div>
12
+ </li>
13
+ {{= orders }}
14
+ </ul>
15
+ </div>
16
+
17
+ <%= render "footer" %>
18
+ </div>
@@ -0,0 +1,29 @@
1
+ <div data-role="page" id="orders-page">
2
+ <%= render :partial => "layouts/header", :locals => { :back => true, :title => tr('order.new_order') } %>
3
+
4
+ <div data-role="content">
5
+
6
+ <ul data-role="listview" data-inset="true" class="products-list">
7
+
8
+ {{= productOrders }}
9
+
10
+ <li data-role="fieldcontain">
11
+ <div class="ui-grid-a">
12
+ <div class="ui-block-a" >
13
+ <%= tr('total') %>
14
+ </div>
15
+ <div class="ui-block-b" id="totalPrice">
16
+ {{= total.toFixed(2) }}
17
+ </div>
18
+ </div>
19
+ </li>
20
+ </ul>
21
+
22
+ <a data-role="button" data-theme="b" id="order-button" href="#">
23
+ <%= tr('order.order') %>
24
+ </a>
25
+
26
+ </div>
27
+
28
+ <%= render "footer" %>
29
+ </div>
@@ -0,0 +1,29 @@
1
+ <div data-role="page" id="orders-page">
2
+ <%= render :partial => "layouts/header", :locals => { :back => true, :title => tr('order.new_order') } %>
3
+
4
+ <div data-role="content">
5
+
6
+ <ul data-role="listview" data-inset="true" class="products-list">
7
+
8
+ {{= productOrders }}
9
+
10
+ <li data-role="fieldcontain">
11
+ <div class="ui-grid-a">
12
+ <div class="ui-block-a" >
13
+ Total
14
+ </div>
15
+ <div class="ui-block-b">
16
+ {{= total.toFixed(2) }}
17
+ </div>
18
+ </div>
19
+ </li>
20
+ </ul>
21
+
22
+ <a data-role="button" data-theme="b" id="order-button" href="#">
23
+ Order
24
+ </a>
25
+
26
+ </div>
27
+
28
+ <%= render "footer" %>
29
+ </div>
@@ -0,0 +1,5 @@
1
+ <li><a href="<%= url_for :order_place_page %>?product={{= id }}">
2
+ <h3>{{= Si.I18n.tr(id, 'name') }}</h3>
3
+ <p class="ui-li-aside">{{= price.toFixed(2) }} PLN</p>
4
+ <p>{{= Si.I18n.tr(id, 'description') }}</p>
5
+ </a></li>
@@ -0,0 +1,17 @@
1
+ <li data-role="list-divider" id="{{= id }}-name">
2
+ {{= Si.I18n.tr(id, 'name') }}
3
+ </li>
4
+ <li data-role="fieldcontain" id="{{= id }}">
5
+ <div class="ui-grid-a">
6
+ <div class="ui-block-a">
7
+ {{ if(editable) { }}
8
+ <input type="range" id="" class="product-qunatity" data-product-id="{{= id }}" name="slider" value="{{= quantity }}" min="1" max="10" data-highlight="true">
9
+ {{ } else { }}
10
+ {{= quantity }}
11
+ {{ } }}
12
+ </div>
13
+ <div class="ui-block-b value">
14
+ {{= value.toFixed(2) }}
15
+ </div>
16
+ </div>
17
+ </li>
@@ -0,0 +1,17 @@
1
+ <li data-role="list-divider" id="{{= id }}-name">
2
+ {{= Si.I18n.tr(id, 'name') }}
3
+ </li>
4
+ <li data-role="fieldcontain" id="{{= id }}">
5
+ <div class="ui-grid-a">
6
+ <div class="ui-block-a">
7
+ {{ if(editable) { }}
8
+ <input type="range" id="" class="product-qunatity" data-product-id="{{= id }}" name="slider" value="{{= quantity }}" min="1" max="10" data-highlight="true">
9
+ {{ } else { }}
10
+ {{= quantity }}
11
+ {{ } }}
12
+ </div>
13
+ <div class="ui-block-b value">
14
+ {{= value.toFixed(2) }}
15
+ </div>
16
+ </div>
17
+ </li>
data/config/Config.iml ADDED
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$">
6
+ <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
7
+ </content>
8
+ <orderEntry type="inheritedJdk" />
9
+ <orderEntry type="sourceFolder" forTests="false" />
10
+ </component>
11
+ </module>
12
+
@@ -0,0 +1,15 @@
1
+ en:
2
+ orders_and_services: "Orders & services"
3
+
4
+ order:
5
+ new_order: 'New order'
6
+ products: 'Products'
7
+ your_orders: 'Your orders'
8
+ order: 'Order'
9
+ date: 'Date'
10
+ value: 'Value'
11
+ status: 'Status'
12
+ statuses:
13
+ building: 'building'
14
+ pending: 'pending'
15
+ completed: 'completed'
@@ -0,0 +1,15 @@
1
+ pl:
2
+ orders_and_services: "Zamówienia i usługi"
3
+
4
+ order:
5
+ new_order: 'Nowe zamówienie'
6
+ products: 'Produkty'
7
+ your_orders: 'Twoje zamówienia'
8
+ order: 'Zamów'
9
+ date: 'Data'
10
+ value: 'Wartość'
11
+ status: 'Status'
12
+ statuses:
13
+ building: 'tworzenie'
14
+ pending: 'realizacja'
15
+ completed: 'zrealizowane'
data/config/routes.rb ADDED
@@ -0,0 +1,17 @@
1
+ Rails.application.routes.draw do
2
+ get "#order_index" => "order/orders#index" , :as => :order_page
3
+ get "#place" => "order/orders#place" , :as => :order_place_page
4
+ get "#product_order" => "order/orders#product_order" , :as => :order_product_order_page
5
+ get "#orders" => "order/orders#orders" , :as => :order_orders_page
6
+ get "#order" => "order/orders#order" , :as => :order_order_page
7
+
8
+ get "order_index.html" => "order/orders#index" , :as => :order_tpl
9
+ get "category.html" => "order/orders#category" , :as => :order_category_tpl
10
+ get "product.html" => "order/orders#product" , :as => :order_product_tpl
11
+ get "place.html" => "order/orders#place" , :as => :order_place_tpl
12
+ get "product_order.html" => "order/orders#product_order" , :as => :order_product_order_tpl
13
+ get "orders.html" => "order/orders#orders" , :as => :order_orders_tpl
14
+ get "order.html" => "order/orders#order" , :as => :order_order_tpl
15
+ get "one_order.html" => "order/orders#one_order" , :as => :order_one_order_tpl
16
+ end
17
+
data/config/routes.rb~ ADDED
@@ -0,0 +1,10 @@
1
+ Rails.application.routes.draw do
2
+ get "#order" => "order/orders#index" , :as => :order_page
3
+
4
+ get "order.html" => "order/orders#index" , :as => :order_tpl
5
+
6
+
7
+ get "category.html" => "order/orders#category" , :as => :order_category_tpl
8
+
9
+ get "product.html" => "order/orders#product" , :as => :order_product_tpl
10
+ end
data/lib/Lib.iml ADDED
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$">
6
+ <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
7
+ </content>
8
+ <orderEntry type="inheritedJdk" />
9
+ <orderEntry type="sourceFolder" forTests="false" />
10
+ </component>
11
+ </module>
12
+
@@ -0,0 +1,7 @@
1
+ module Order
2
+
3
+ class Engine < Rails::Engine
4
+
5
+ end
6
+
7
+ end
@@ -0,0 +1,7 @@
1
+ module Order
2
+
3
+ class Engine < Rails::Engine
4
+
5
+ end
6
+
7
+ end
@@ -0,0 +1,3 @@
1
+ module Order
2
+ VERSION = "0.0.1"
3
+ end
data/lib/order.rb ADDED
@@ -0,0 +1,29 @@
1
+ # Requires
2
+ require "active_support/dependencies"
3
+
4
+ module Order
5
+ # Our host application root path
6
+ # We set this when the engine is initialized
7
+ mattr_accessor :app_root
8
+
9
+ # Yield self on setup for nice config blocks
10
+ def self.setup
11
+ yield self
12
+ end
13
+
14
+ end
15
+
16
+
17
+ def export_dir
18
+ if has_asset_pipeline?
19
+ "app/assets/javascripts/order"
20
+ else
21
+ "public/javascripts"
22
+ end
23
+ end
24
+
25
+ def javascript_file
26
+ Rails.root.join(export_dir, "si.order.js")
27
+ end
28
+
29
+ require "order/engine"
data/lib/order.rb~ ADDED
@@ -0,0 +1,16 @@
1
+ # Requires
2
+ require "active_support/dependencies"
3
+
4
+ module Order
5
+ # Our host application root path
6
+ # We set this when the engine is initialized
7
+ mattr_accessor :app_root
8
+
9
+ # Yield self on setup for nice config blocks
10
+ def self.setup
11
+ yield self
12
+ end
13
+
14
+ end
15
+
16
+ require "order/engine"
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :order do
3
+ # # Task goes here
4
+ # end
data/test/Test.iml ADDED
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="FacetManager">
4
+ <facet type="RailsFacetType" name="Ruby on Rails">
5
+ <configuration>
6
+ <RAILS_FACET_CONFIG_ID NAME="RAILS_FACET_SUPPORT_REMOVED" VALUE="false" />
7
+ <RAILS_FACET_CONFIG_ID NAME="RAILS_TESTS_SOURCES_PATCHED" VALUE="true" />
8
+ <RAILS_FACET_CONFIG_ID NAME="RAILS_FACET_APPLICATION_ROOT" VALUE="$MODULE_DIR$/dummy" />
9
+ </configuration>
10
+ </facet>
11
+ </component>
12
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
13
+ <exclude-output />
14
+ <content url="file://$MODULE_DIR$">
15
+ <sourceFolder url="file://$MODULE_DIR$" isTestSource="true" />
16
+ <excludeFolder url="file://$MODULE_DIR$/dummy/tmp" />
17
+ </content>
18
+ <orderEntry type="inheritedJdk" />
19
+ <orderEntry type="sourceFolder" forTests="false" />
20
+ </component>
21
+ </module>
22
+