initial commit

This commit is contained in:
2012-08-22 18:15:37 +02:00
commit 0856528f5e
120 changed files with 3048 additions and 0 deletions
@@ -0,0 +1,7 @@
-if target.errors.any?
#error_explanation
.errors-content
%h2= t('helpers.forms.errors.title', :count => target.errors.count)
%ul
- for message in target.errors.full_messages
%li= message
+15
View File
@@ -0,0 +1,15 @@
.page-header= title 'Home'
ul.nav.nav-tabs.nav-stacked
- if list_open?
li.active= link_to '€ 23,45'.html_safe, '#'
li= link_to 'Place order', '/show_products?supplier_id=' + active_list.supplier.id
li= link_to 'Active list', '#'
li= link_to 'Request bill', '#'
li= link_to 'I have a question', '#'
- else
li= link_to 'Place order', '/select_qrcode'
li= link_to 'Subscribe to list', '#'
ul.nav.nav-tabs.nav-stacked
li= link_to 'View history', '#'
@@ -0,0 +1,4 @@
.page-header= title 'Select Qr code'
ul
- for table in @tables
li= link_to image_tag(url_for(qrcode_table_path(table, format: :png))), {action: :create_list, table_id: table.id}
@@ -0,0 +1,17 @@
table#products-table.table.table-striped.table-hover
tbody
- content_for :footer do
javascript:
jQuery(function(){
$.get('#{product_list_supplier_path(@supplier, format: :json).html_safe}', function(res){
window.products = res
body = $('#products-table tbody')
for(category in window.products){
body.append('<tr><td><h3>'+category+'<h3></td></tr>')
for(iproduct in window.products[category]){
body.append('<tr><td>'+window.products[category][iproduct].name+'</td></tr>')
}
}
})
})
+68
View File
@@ -0,0 +1,68 @@
doctype html
html lang="en"
head
meta charset="utf-8"
meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"
meta name="viewport" content="width=device-width, initial-scale=1.0"
title= content_for?(:title) ? yield(:title) : "Qrammer"
= csrf_meta_tags
/! Le HTML5 shim, for IE6-8 support of HTML elements
/[if lt IE 9]
= javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js"
= stylesheet_link_tag "application", :media => "all"
link href="images/apple-touch-icon-144x144.png" rel="apple-touch-icon-precomposed" sizes="144x144"
link href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon-precomposed" sizes="114x114"
link href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon-precomposed" sizes="72x72"
link href="images/apple-touch-icon.png" rel="apple-touch-icon-precomposed"
link href="images/favicon.ico" rel="shortcut icon"
body
.navbar.navbar-fixed-top
.navbar-inner
.container
a.btn.btn-navbar data-target=".nav-collapse" data-toggle="collapse"
span.icon-bar
span.icon-bar
span.icon-bar
a.brand href=root_path Qrammer
.container.nav-collapse
ul.nav
li= link_to User.model_name.human_plural, users_path
li= link_to Supplier.model_name.human_plural, suppliers_path
li= link_to Table.model_name.human_plural, tables_path
li= link_to Product.model_name.human_plural, products_path
li= link_to List.model_name.human_plural, lists_path
li= link_to ProductCategory.model_name.human_plural, product_categories_path
.container
.content
- if flash[:alert].present?
.alert.alert-error
a.close data-dismiss="alert" &#215;
div= flash[:alert]
- if flash[:notice].present?
.alert.alert-success
a.close data-dismiss="alert" &#215;
div= flash[:notice]
.row
.span9
= yield
.span3
.well.sidebar-nav
h3 Sidebar
ul.nav.nav-list
li.nav-header Sidebar
li= link_to "Link 1", "/path1"
li= link_to "Link 2", "/path2"
li= link_to "Link 3", "/path3"
footer
p &copy; Companytools 2012
/!
Javascripts
\==================================================
/! Placed at the end of the document so the pages load faster
= javascript_include_tag "application"
= yield :footer
+18
View File
@@ -0,0 +1,18 @@
= form_for @list, html: {class: 'form-horizontal' } do |f|
= render 'error_messages', target: @list
.control-group class=(@list.errors[:state].any? ? 'error' : nil)
= f.label :state, class: 'control-label'
.controls
= f.text_field :state, class: 'text_field'
.control-group class=(@list.errors[:closed_at].any? ? 'error' : nil)
= f.label :closed_at, class: 'control-label'
.controls
= f.text_field :closed_at, class: 'text_field'
.control-group class=(@list.errors[:table_id].any? ? 'error' : nil)
= f.label :table_id, Table.model_name.human, class: 'control-label'
.controls
= f.select :table_id, options_for_select(@tables.map{|a| [a.number, a.id]}), include_blank: nil
.form-actions
= f.submit nil, class: 'btn btn-primary'
'
= link_to t("helpers.links.cancel"), lists_path, class: 'btn'
+4
View File
@@ -0,0 +1,4 @@
- model_class = List
.page-header
= title :edit, model_class
= render 'form'
+26
View File
@@ -0,0 +1,26 @@
- model_class = List
div.page-header= title :index, model_class
- if @lists.any?
table.table.table-striped
thead
tr
th= model_class.human_attribute_name(:state)
th= model_class.human_attribute_name(:closed_at)
th= Table.model_name.human
th= model_class.human_attribute_name(:created_at)
th=t 'helpers.actions'
tbody
- @lists.each do |list|
tr
td= link_to list.state, list
td= list.closed_at
td= link_to list.table.number, list.table
td=l list.created_at, format: :short
td
= link_to t('helpers.links.edit'), [:edit, list], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), list, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
- else
= no_content_given model_class
= link_to t("helpers.links.new"), new_list_path, class: 'btn btn-primary'
+4
View File
@@ -0,0 +1,4 @@
- model_class = List
.page-header
= title :new, model_class
= render 'form'
+18
View File
@@ -0,0 +1,18 @@
- model_class = List
.page-header= title :show, @list
dl.dl-horizontal.show-list
dt= model_class.human_attribute_name(:state)
dd= @list.state
dt= model_class.human_attribute_name(:closed_at)
dd= @list.closed_at
- if @list.table.present?
dt= Table.model_name.human
dd= link_to @list.table.number, @list.table
.form-actions
= link_to t("helpers.links.back"), lists_path, class: 'btn'
'
= link_to t('helpers.links.edit'), [:edit, @list], class: 'btn'
'
= link_to t("helpers.links.destroy"), @list, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
@@ -0,0 +1,14 @@
= form_for @product_category, html: {class: 'form-horizontal' } do |f|
= render 'error_messages', target: @product_category
.control-group class=(@product_category.errors[:name].any? ? 'error' : nil)
= f.label :name, class: 'control-label'
.controls
= f.text_field :name, class: 'text_field'
.control-group class=(@product_category.errors[:supplier_id].any? ? 'error' : nil)
= f.label :supplier_id, Supplier.model_name.human, class: 'control-label'
.controls
= f.select :supplier_id, options_for_select(@suppliers.map{|a| [a.name, a.id]}), include_blank: nil
.form-actions
= f.submit nil, class: 'btn btn-primary'
'
= link_to t("helpers.links.cancel"), product_categories_path, class: 'btn'
@@ -0,0 +1,4 @@
- model_class = ProductCategory
.page-header
= title :edit, model_class
= render 'form'
@@ -0,0 +1,24 @@
- model_class = ProductCategory
div.page-header= title :index, model_class
- if @product_categories.any?
table.table.table-striped
thead
tr
th= model_class.human_attribute_name(:name)
th= Supplier.model_name.human
th= model_class.human_attribute_name(:created_at)
th=t 'helpers.actions'
tbody
- @product_categories.each do |product_category|
tr
td= link_to product_category.name, product_category
td= link_to product_category.supplier.name, product_category.supplier
td=l product_category.created_at, format: :short
td
= link_to t('helpers.links.edit'), [:edit, product_category], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), product_category, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
- else
= no_content_given model_class
= link_to t("helpers.links.new"), new_product_category_path, class: 'btn btn-primary'
@@ -0,0 +1,4 @@
- model_class = ProductCategory
.page-header
= title :new, model_class
= render 'form'
@@ -0,0 +1,15 @@
- model_class = ProductCategory
.page-header= title :show, @product_category
dl.dl-horizontal.show-list
dt= model_class.human_attribute_name(:name)
dd= @product_category.name
dt= Supplier.model_name.human
dd= link_to @product_category.supplier.name, @product_category.supplier
.form-actions
= link_to t("helpers.links.back"), product_categories_path, class: 'btn'
'
= link_to t('helpers.links.edit'), [:edit, @product_category], class: 'btn'
'
= link_to t("helpers.links.destroy"), @product_category, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
+26
View File
@@ -0,0 +1,26 @@
= form_for @product, html: {class: 'form-horizontal' } do |f|
= render 'error_messages', target: @product
.control-group class=(@product.errors[:name].any? ? 'error' : nil)
= f.label :name, class: 'control-label'
.controls
= f.text_field :name, class: 'text_field'
.control-group class=(@product.errors[:code].any? ? 'error' : nil)
= f.label :code, class: 'control-label'
.controls
= f.text_field :code, class: 'text_field'
.control-group class=(@product.errors[:price].any? ? 'error' : nil)
= f.label :price, class: 'control-label'
.controls
= f.text_field :price, class: 'text_field'
.control-group class=(@product.errors[:product_category_id].any? ? 'error' : nil)
= f.label :product_category_id, ProductCategory.model_name.human, class: 'control-label'
.controls
= f.select :product_category_id, options_for_select(@product_categories.map{|a| [a.name, a.id]}), include_blank: ''
.control-group class=(@product.errors[:supplier_id].any? ? 'error' : nil)
= f.label :supplier_id, Supplier.model_name.human, class: 'control-label'
.controls
= f.select :supplier_id, options_for_select(@suppliers.map{|a| [a.name, a.id]}), include_blank: nil
.form-actions
= f.submit nil, class: 'btn btn-primary'
'
= link_to t("helpers.links.cancel"), products_path, class: 'btn'
+4
View File
@@ -0,0 +1,4 @@
- model_class = Product
.page-header
= title :edit, model_class
= render 'form'
+30
View File
@@ -0,0 +1,30 @@
- model_class = Product
div.page-header= title :index, model_class
- if @products.any?
table.table.table-striped
thead
tr
th= model_class.human_attribute_name(:name)
th= model_class.human_attribute_name(:code)
th= model_class.human_attribute_name(:price)
th= ProductCategory.model_name.human
th= Supplier.model_name.human
th= model_class.human_attribute_name(:created_at)
th=t 'helpers.actions'
tbody
- @products.each do |product|
tr
td= link_to product.name, product
td= product.code
td= product.price
td= link_to product.product_category.name, product.product_category
td= link_to product.supplier.name, product.supplier
td=l product.created_at, format: :short
td
= link_to t('helpers.links.edit'), [:edit, product], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), product, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
- else
= no_content_given model_class
= link_to t("helpers.links.new"), new_product_path, class: 'btn btn-primary'
+4
View File
@@ -0,0 +1,4 @@
- model_class = Product
.page-header
= title :new, model_class
= render 'form'
+23
View File
@@ -0,0 +1,23 @@
- model_class = Product
.page-header= title :show, @product
dl.dl-horizontal.show-list
dt= model_class.human_attribute_name(:name)
dd= @product.name
dt= model_class.human_attribute_name(:code)
dd= @product.code
dt= model_class.human_attribute_name(:price)
dd= @product.price
- if @product.product_category.present?
dt= ProductCategory.model_name.human
dd= link_to @product.product_category.name, @product.product_category
- if @product.supplier.present?
dt= Supplier.model_name.human
dd= link_to @product.supplier.name, @product.supplier
.form-actions
= link_to t("helpers.links.back"), products_path, class: 'btn'
'
= link_to t('helpers.links.edit'), [:edit, @product], class: 'btn'
'
= link_to t("helpers.links.destroy"), @product, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
+10
View File
@@ -0,0 +1,10 @@
= form_for @supplier, html: {class: 'form-horizontal' } do |f|
= render 'error_messages', target: @supplier
.control-group class=(@supplier.errors[:name].any? ? 'error' : nil)
= f.label :name, class: 'control-label'
.controls
= f.text_field :name, class: 'text_field'
.form-actions
= f.submit nil, class: 'btn btn-primary'
'
= link_to t("helpers.links.cancel"), suppliers_path, class: 'btn'
+4
View File
@@ -0,0 +1,4 @@
- model_class = Supplier
.page-header
= title :edit, model_class
= render 'form'
+22
View File
@@ -0,0 +1,22 @@
- model_class = Supplier
div.page-header= title :index, model_class
- if @suppliers.any?
table.table.table-striped
thead
tr
th= model_class.human_attribute_name(:name)
th= model_class.human_attribute_name(:created_at)
th=t 'helpers.actions'
tbody
- @suppliers.each do |supplier|
tr
td= link_to supplier.name, supplier
td=l supplier.created_at, format: :short
td
= link_to t('helpers.links.edit'), [:edit, supplier], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), supplier, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
- else
= no_content_given model_class
= link_to t("helpers.links.new"), new_supplier_path, class: 'btn btn-primary'
+4
View File
@@ -0,0 +1,4 @@
- model_class = Supplier
.page-header
= title :new, model_class
= render 'form'
+14
View File
@@ -0,0 +1,14 @@
- model_class = Supplier
.page-header
= title :show, @supplier
dl.dl-horizontal.show-list
dt= model_class.human_attribute_name(:name) + ':'
dd= @supplier.name
.form-actions
= link_to t("helpers.links.back"), suppliers_path, class: 'btn'
'
= link_to t('helpers.links.edit'), [:edit, @supplier], class: 'btn'
'
= link_to t("helpers.links.destroy"), @supplier, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
+14
View File
@@ -0,0 +1,14 @@
= form_for @table, html: {class: 'form-horizontal' } do |f|
= render 'error_messages', target: @table
.control-group class=(@table.errors[:number].any? ? 'error' : nil)
= f.label :number, class: 'control-label'
.controls
= f.text_field :number, class: 'text_field'
.control-group class=(@table.errors[:supplier_id].any? ? 'error' : nil)
= f.label :supplier_id, Supplier.model_name.human, class: 'control-label'
.controls
= f.select :supplier_id, options_for_select(@suppliers.map{|a| [a.name, a.id]}), include_blank: nil
.form-actions
= f.submit nil, class: 'btn btn-primary'
'
= link_to t("helpers.links.cancel"), tables_path, class: 'btn'
+4
View File
@@ -0,0 +1,4 @@
- model_class = Table
.page-header
= title :edit, model_class
= render 'form'
+24
View File
@@ -0,0 +1,24 @@
- model_class = Table
div.page-header= title :index, model_class
- if @tables.any?
table.table.table-striped
thead
tr
th= model_class.human_attribute_name(:number)
th= Supplier.model_name.human
th= model_class.human_attribute_name(:created_at)
th=t 'helpers.actions'
tbody
- @tables.each do |table|
tr
td= link_to table.number, table
td= link_to table.supplier.name, table.supplier
td=l table.created_at, format: :short
td
= link_to t('helpers.links.edit'), [:edit, table], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), table, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
- else
= no_content_given model_class
= link_to t("helpers.links.new"), new_table_path, class: 'btn btn-primary'
+4
View File
@@ -0,0 +1,4 @@
- model_class = Table
.page-header
= title :new, model_class
= render 'form'
+16
View File
@@ -0,0 +1,16 @@
- model_class = Table
.page-header= title :show, @table
dl.dl-horizontal.show-list
dt= model_class.human_attribute_name(:number)
dd= @table.number
- if @table.supplier.present?
dt= Supplier.model_name.human
dd= link_to @table.supplier.name, @table.supplier
.form-actions
= link_to t("helpers.links.back"), tables_path, class: 'btn'
'
= link_to t('helpers.links.edit'), [:edit, @table], class: 'btn'
'
= link_to t("helpers.links.destroy"), @table, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
+45
View File
@@ -0,0 +1,45 @@
= form_for @user, html: {class: 'form-horizontal' } do |f|
.control-group
= f.label :email, class: 'control-label'
.controls
= f.text_field :email, class: 'text_field'
.control-group
= f.label :encrypted_password, class: 'control-label'
.controls
= f.text_field :encrypted_password, class: 'text_field'
.control-group
= f.label :remember_token, class: 'control-label'
.controls
= f.text_field :remember_token, class: 'text_field'
.control-group
= f.label :remember_created_at, class: 'control-label'
.controls
= f.text_field :remember_created_at, class: 'text_field'
.control-group
= f.label :reset_password_token, class: 'control-label'
.controls
= f.text_field :reset_password_token, class: 'text_field'
.control-group
= f.label :sign_in_count, class: 'control-label'
.controls
= f.text_field :sign_in_count, class: 'text_field'
.control-group
= f.label :current_sign_in_at, class: 'control-label'
.controls
= f.text_field :current_sign_in_at, class: 'text_field'
.control-group
= f.label :last_sign_in_at, class: 'control-label'
.controls
= f.text_field :last_sign_in_at, class: 'text_field'
.control-group
= f.label :current_sign_in_ip, class: 'control-label'
.controls
= f.text_field :current_sign_in_ip, class: 'text_field'
.control-group
= f.label :last_sign_in_ip, class: 'control-label'
.controls
= f.text_field :last_sign_in_ip, class: 'text_field'
.form-actions
= f.submit nil, class: 'btn btn-primary'
'
= link_to t("helpers.links.cancel"), users_path, class: 'btn'
+4
View File
@@ -0,0 +1,4 @@
- model_class = User
.page-header
= title :edit, model_class
= render 'form'
+38
View File
@@ -0,0 +1,38 @@
- model_class = User
div class="page-header"= title :index, model_class
table class="table table-striped"
thead
tr
th= model_class.human_attribute_name(:email)
th= model_class.human_attribute_name(:encrypted_password)
th= model_class.human_attribute_name(:remember_token)
th= model_class.human_attribute_name(:remember_created_at)
th= model_class.human_attribute_name(:reset_password_token)
th= model_class.human_attribute_name(:sign_in_count)
th= model_class.human_attribute_name(:current_sign_in_at)
th= model_class.human_attribute_name(:last_sign_in_at)
th= model_class.human_attribute_name(:current_sign_in_ip)
th= model_class.human_attribute_name(:last_sign_in_ip)
th= model_class.human_attribute_name(:created_at)
th=t 'helpers.actions'
tbody
- @users.each do |user|
tr
td= link_to user.email, user
td= user.encrypted_password
td= user.remember_token
td= user.remember_created_at
td= user.reset_password_token
td= user.sign_in_count
td= user.current_sign_in_at
td= user.last_sign_in_at
td= user.current_sign_in_ip
td= user.last_sign_in_ip
td=l user.created_at, format: :short
td
= link_to t('helpers.links.edit'), [:edit, user], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), user, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
= link_to t("helpers.links.new"), new_user_path, class: 'btn btn-primary'
+4
View File
@@ -0,0 +1,4 @@
- model_class = User
.page-header
= title :new, model_class
= render 'form'
+32
View File
@@ -0,0 +1,32 @@
- model_class = User
.page-header
= title :show, @user
dl.dl-horizontal.show-list
dt= model_class.human_attribute_name(:email) + ':'
dd= @user.email
dt= model_class.human_attribute_name(:encrypted_password) + ':'
dd= @user.encrypted_password
dt= model_class.human_attribute_name(:remember_token) + ':'
dd= @user.remember_token
dt= model_class.human_attribute_name(:remember_created_at) + ':'
dd= @user.remember_created_at
dt= model_class.human_attribute_name(:reset_password_token) + ':'
dd= @user.reset_password_token
dt= model_class.human_attribute_name(:sign_in_count) + ':'
dd= @user.sign_in_count
dt= model_class.human_attribute_name(:current_sign_in_at) + ':'
dd= @user.current_sign_in_at
dt= model_class.human_attribute_name(:last_sign_in_at) + ':'
dd= @user.last_sign_in_at
dt= model_class.human_attribute_name(:current_sign_in_ip) + ':'
dd= @user.current_sign_in_ip
dt= model_class.human_attribute_name(:last_sign_in_ip) + ':'
dd= @user.last_sign_in_ip
.form-actions
= link_to t("helpers.links.back"), users_path, class: 'btn'
'
= link_to t('helpers.links.edit'), [:edit, @user], class: 'btn'
'
= link_to t("helpers.links.destroy"), @user, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'