changes unfinished

This commit is contained in:
2013-01-17 10:28:05 +01:00
parent 730768cb59
commit db1a6ac96b
13 changed files with 88 additions and 13 deletions
+3
View File
@@ -0,0 +1,3 @@
module MailHelper
end
+12
View File
@@ -15,10 +15,22 @@ class Table
#validates :list_id, presence: true
validates :number, numericality: {greater_than: 0}
view :by_supplier_id_and_id, key: [:supplier_id, :_id]
view :by_supplier_id_and_number, key: [:supplier_id, :number]
#validates_uniqueness_of :number
view :by_number, key: :number
def self.for_supplier(supplier, options = {})
startkey = options[:from_number].present? ? [supplier.id, options.delete(:from_number).to_i] : [supplier.id]
endkey = options[:to_number].present? ? [supplier.id, options.delete(:to_number).to_i]: [supplier.id, {}]
total_entries = database.view(by_supplier_id_and_number({startkey: startkey, endkey: endkey, include_docs: false, reduce: true}))
options[:total_entries] = total_entries
with_pagination_options(options) do |options|
database.view(by_supplier_id_and_number({startkey: startkey, endkey: endkey, include_docs: true, reduce: false}.merge(options)))
end
end
def occupied?
return @is_occupied if instance_variable_defined?(:'@is_occupied')
@is_occupied = !self.class.database.view(List.active_by_table_id_view(key: id, reduce: true)).zero?
@@ -1,5 +0,0 @@
<p>Welcome <%= @resource.email %>!</p>
<p>You can confirm your account email through the link below:</p>
<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
@@ -0,0 +1,7 @@
h3 "Welkom bij Qwaiter #{@resource.email}!"
p
|
Je hebt een account aangevraag bij Qwaiter. Als dit niet de bedoeling is kan je deze email negeren.
Om je account te activeren moet je op de bevestigingslink hieronder klikken:
p= link_to 'Bevestig mijn Qwaiter account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token)
+4 -4
View File
@@ -5,10 +5,10 @@ div.page-header= title :index, model_class
table.table
thead
tr
th.link= model_class.human_attribute_name(:number)
th.link= Section.model_name.human
th.timestamp= model_class.human_attribute_name(:created_at)
th.actions=t 'helpers.actions'
th.link data-t="attributes.table.number"= model_class.human_attribute_name(:number)
th.link data-t="models.section"= Section.model_name.human
th.timestamp data-t="attributes.table.created_at"= model_class.human_attribute_name(:created_at)
th.actions data-t="helpers.actions"=t 'helpers.actions'
tbody
- @tables.each do |table|
tr