Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

scaffolded model

  • Loading branch information...
commit bc79ac0882e83e04750e05dacfc32dc86efc2e4f 1 parent b122dfe
@mkristian authored
Showing with 5,764 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +90 −0 app/controllers/board_configs_controller.rb
  3. +90 −0 app/controllers/boards_controller.rb
  4. +90 −0 app/controllers/listings_controller.rb
  5. +90 −0 app/controllers/venue_configs_controller.rb
  6. +90 −0 app/controllers/venues_controller.rb
  7. +8 −0 app/guards/board_configs_guard.rb
  8. +8 −0 app/guards/boards_guard.rb
  9. +8 −0 app/guards/listings_guard.rb
  10. +8 −0 app/guards/venue_configs_guard.rb
  11. +8 −0 app/guards/venues_guard.rb
  12. +2 −0  app/helpers/board_configs_helper.rb
  13. +2 −0  app/helpers/boards_helper.rb
  14. +2 −0  app/helpers/listings_helper.rb
  15. +2 −0  app/helpers/venue_configs_helper.rb
  16. +2 −0  app/helpers/venues_helper.rb
  17. +22 −0 app/models/board.rb
  18. +22 −0 app/models/board_config.rb
  19. +24 −0 app/models/listing.rb
  20. +23 −0 app/models/venue.rb
  21. +25 −0 app/models/venue_config.rb
  22. +28 −0 app/views/board_configs/edit.html.erb
  23. +26 −0 app/views/board_configs/index.html.erb
  24. +27 −0 app/views/board_configs/new.html.erb
  25. +23 −0 app/views/board_configs/show.html.erb
  26. +28 −0 app/views/boards/edit.html.erb
  27. +26 −0 app/views/boards/index.html.erb
  28. +27 −0 app/views/boards/new.html.erb
  29. +23 −0 app/views/boards/show.html.erb
  30. +20 −0 app/views/layouts/board_configs.html.erb
  31. +20 −0 app/views/layouts/boards.html.erb
  32. +20 −0 app/views/layouts/listings.html.erb
  33. +20 −0 app/views/layouts/venue_configs.html.erb
  34. +20 −0 app/views/layouts/venues.html.erb
  35. +36 −0 app/views/listings/edit.html.erb
  36. +30 −0 app/views/listings/index.html.erb
  37. +35 −0 app/views/listings/new.html.erb
  38. +33 −0 app/views/listings/show.html.erb
  39. +40 −0 app/views/venue_configs/edit.html.erb
  40. +32 −0 app/views/venue_configs/index.html.erb
  41. +39 −0 app/views/venue_configs/new.html.erb
  42. +38 −0 app/views/venue_configs/show.html.erb
  43. +32 −0 app/views/venues/edit.html.erb
  44. +28 −0 app/views/venues/index.html.erb
  45. +31 −0 app/views/venues/new.html.erb
  46. +28 −0 app/views/venues/show.html.erb
  47. +10 −0 config/routes.rb
  48. +20 −0 db/migrate/20100704220152_create_venues.rb
  49. +22 −0 db/migrate/20100704220226_create_venue_configs.rb
  50. +19 −0 db/migrate/20100704220301_create_board_configs.rb
  51. +19 −0 db/migrate/20100704220328_create_boards.rb
  52. +21 −0 db/migrate/20100704220402_create_listings.rb
  53. +204 −0 spec/controllers/board_configs_controller_spec.rb
  54. +204 −0 spec/controllers/boards_controller_spec.rb
  55. +204 −0 spec/controllers/listings_controller_spec.rb
  56. +204 −0 spec/controllers/venue_configs_controller_spec.rb
  57. +204 −0 spec/controllers/venues_controller_spec.rb
  58. +13 −0 spec/fixtures/board_configs.yml
  59. +13 −0 spec/fixtures/boards.yml
  60. +17 −0 spec/fixtures/listings.yml
  61. +19 −0 spec/fixtures/venue_configs.yml
  62. +15 −0 spec/fixtures/venues.yml
  63. +11 −0 spec/helpers/board_configs_helper_spec.rb
  64. +11 −0 spec/helpers/boards_helper_spec.rb
  65. +11 −0 spec/helpers/listings_helper_spec.rb
  66. +11 −0 spec/helpers/venue_configs_helper_spec.rb
  67. +11 −0 spec/helpers/venues_helper_spec.rb
  68. +4 −0 spec/integration/board_configs_spec.rb
  69. +4 −0 spec/integration/boards_spec.rb
  70. +4 −0 spec/integration/listings_spec.rb
  71. +4 −0 spec/integration/venue_configs_spec.rb
  72. +4 −0 spec/integration/venues_spec.rb
  73. +87 −0 spec/models/board_config_spec.rb
  74. +80 −0 spec/models/board_spec.rb
  75. +111 −0 spec/models/listing_spec.rb
  76. +144 −0 spec/models/venue_config_spec.rb
  77. +92 −0 spec/models/venue_spec.rb
  78. +33 −0 spec/routing/board_configs_routing_spec.rb
  79. +33 −0 spec/routing/boards_routing_spec.rb
  80. +33 −0 spec/routing/listings_routing_spec.rb
  81. +33 −0 spec/routing/venue_configs_routing_spec.rb
  82. +33 −0 spec/routing/venues_routing_spec.rb
  83. +26 −0 spec/views/board_configs/edit.html.erb_spec.rb
  84. +30 −0 spec/views/board_configs/index.html.erb_spec.rb
  85. +26 −0 spec/views/board_configs/new.html.erb_spec.rb
  86. +21 −0 spec/views/board_configs/show.html.erb_spec.rb
  87. +26 −0 spec/views/boards/edit.html.erb_spec.rb
  88. +30 −0 spec/views/boards/index.html.erb_spec.rb
  89. +26 −0 spec/views/boards/new.html.erb_spec.rb
  90. +21 −0 spec/views/boards/show.html.erb_spec.rb
  91. +28 −0 spec/views/listings/edit.html.erb_spec.rb
  92. +33 −0 spec/views/listings/index.html.erb_spec.rb
  93. +28 −0 spec/views/listings/new.html.erb_spec.rb
  94. +23 −0 spec/views/listings/show.html.erb_spec.rb
  95. +32 −0 spec/views/venue_configs/edit.html.erb_spec.rb
  96. +39 −0 spec/views/venue_configs/index.html.erb_spec.rb
  97. +32 −0 spec/views/venue_configs/new.html.erb_spec.rb
  98. +27 −0 spec/views/venue_configs/show.html.erb_spec.rb
  99. +28 −0 spec/views/venues/edit.html.erb_spec.rb
  100. +33 −0 spec/views/venues/index.html.erb_spec.rb
  101. +28 −0 spec/views/venues/new.html.erb_spec.rb
  102. +23 −0 spec/views/venues/show.html.erb_spec.rb
  103. +66 −0 src/main/java/com/example/client/Application.java
  104. +77 −0 src/main/java/com/example/client/models/Board.java
  105. +77 −0 src/main/java/com/example/client/models/BoardConfig.java
  106. +39 −0 src/main/java/com/example/client/models/BoardConfigFactory.java
  107. +39 −0 src/main/java/com/example/client/models/BoardFactory.java
  108. +86 −0 src/main/java/com/example/client/models/Listing.java
  109. +39 −0 src/main/java/com/example/client/models/ListingFactory.java
  110. +81 −0 src/main/java/com/example/client/models/Venue.java
  111. +89 −0 src/main/java/com/example/client/models/VenueConfig.java
  112. +39 −0 src/main/java/com/example/client/models/VenueConfigFactory.java
  113. +39 −0 src/main/java/com/example/client/models/VenueFactory.java
  114. +68 −0 src/main/java/com/example/client/views/board_configs/BoardConfigFields.java
  115. +67 −0 src/main/java/com/example/client/views/board_configs/BoardConfigScreen.java
  116. +70 −0 src/main/java/com/example/client/views/boards/BoardFields.java
  117. +67 −0 src/main/java/com/example/client/views/boards/BoardScreen.java
  118. +93 −0 src/main/java/com/example/client/views/listings/ListingFields.java
  119. +67 −0 src/main/java/com/example/client/views/listings/ListingScreen.java
  120. +104 −0 src/main/java/com/example/client/views/venue_configs/VenueConfigFields.java
  121. +67 −0 src/main/java/com/example/client/views/venue_configs/VenueConfigScreen.java
  122. +81 −0 src/main/java/com/example/client/views/venues/VenueFields.java
  123. +67 −0 src/main/java/com/example/client/views/venues/VenueScreen.java
  124. +26 −0 src/test/java/com/example/client/GwtTestSuite.java
  125. +13 −0 src/test/java/com/example/client/models/AbstractApplicationResourceTestGwt.java
  126. +110 −0 src/test/java/com/example/client/models/BoardConfigTestGwt.java
  127. +110 −0 src/test/java/com/example/client/models/BoardTestGwt.java
  128. 0  src/test/java/com/example/client/models/ListingTestGwt.java
  129. +119 −0 src/test/java/com/example/client/models/VenueConfigTestGwt.java
  130. +113 −0 src/test/java/com/example/client/models/VenueTestGwt.java
  131. +2 −0  war/WEB-INF/.gitignore
View
1  .gitignore
@@ -1,2 +1,3 @@
target
root_*
+tomcat
View
90 app/controllers/board_configs_controller.rb
@@ -0,0 +1,90 @@
+class BoardConfigsController < ApplicationController
+
+ # GET /board_configs
+ # GET /board_configs.xml
+ def index
+ @board_configs = BoardConfig.all()
+
+ respond_to do |format|
+ format.html
+ format.xml { render :xml => @board_configs }
+ end
+ end
+
+ # GET /board_configs/1
+ # GET /board_configs/1.xml
+ def show
+ @board_config = BoardConfig.get!(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @board_config }
+ end
+ end
+
+ # GET /board_configs/new
+ # GET /board_configs/new.xml
+ def new
+ @board_config = BoardConfig.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @board_config }
+ end
+ end
+
+ # GET /board_configs/1/edit
+ def edit
+ @board_config = BoardConfig.get!(params[:id])
+ end
+
+ # POST /board_configs
+ # POST /board_configs.xml
+ def create
+ @board_config = BoardConfig.new(params[:board_config])
+ @board_config.current_user = current_user
+
+ respond_to do |format|
+ if @board_config.save
+ flash[:notice] = 'BoardConfig was successfully created.'
+ format.html { redirect_to(board_config_url(@board_config.id)) }
+ format.xml { render :xml => @board_config, :status => :created, :location => board_config_url(@board_config.id) + ".xml" }
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @board_config.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /board_configs/1
+ # PUT /board_configs/1.xml
+ def update
+ @board_config = BoardConfig.get!(params[:id])
+ @board_config.current_user = current_user
+
+ respond_to do |format|
+ if @board_config.update(params[:board_config]) or not @board_config.dirty?
+ flash[:notice] = 'BoardConfig was successfully updated.'
+ format.html { redirect_to(board_config_url(@board_config.id)) }
+ format.xml { render :xml => @board_config }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @board_config.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /board_configs/1
+ # DELETE /board_configs/1.xml
+ def destroy
+ @board_config = BoardConfig.get(params[:id])
+ @board_config.current_user = current_user
+ @board_config.destroy if @board_config
+
+ respond_to do |format|
+ flash[:notice] = 'BoardConfig was successfully deleted.'
+ format.html { redirect_to(board_configs_url) }
+ format.xml { head :ok }
+ end
+ end
+end
View
90 app/controllers/boards_controller.rb
@@ -0,0 +1,90 @@
+class BoardsController < ApplicationController
+
+ # GET /boards
+ # GET /boards.xml
+ def index
+ @boards = Board.all()
+
+ respond_to do |format|
+ format.html
+ format.xml { render :xml => @boards }
+ end
+ end
+
+ # GET /boards/1
+ # GET /boards/1.xml
+ def show
+ @board = Board.get!(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @board }
+ end
+ end
+
+ # GET /boards/new
+ # GET /boards/new.xml
+ def new
+ @board = Board.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @board }
+ end
+ end
+
+ # GET /boards/1/edit
+ def edit
+ @board = Board.get!(params[:id])
+ end
+
+ # POST /boards
+ # POST /boards.xml
+ def create
+ @board = Board.new(params[:board])
+ @board.current_user = current_user
+
+ respond_to do |format|
+ if @board.save
+ flash[:notice] = 'Board was successfully created.'
+ format.html { redirect_to(board_url(@board.id)) }
+ format.xml { render :xml => @board, :status => :created, :location => board_url(@board.id) + ".xml" }
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @board.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /boards/1
+ # PUT /boards/1.xml
+ def update
+ @board = Board.get!(params[:id])
+ @board.current_user = current_user
+
+ respond_to do |format|
+ if @board.update(params[:board]) or not @board.dirty?
+ flash[:notice] = 'Board was successfully updated.'
+ format.html { redirect_to(board_url(@board.id)) }
+ format.xml { render :xml => @board }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @board.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /boards/1
+ # DELETE /boards/1.xml
+ def destroy
+ @board = Board.get(params[:id])
+ @board.current_user = current_user
+ @board.destroy if @board
+
+ respond_to do |format|
+ flash[:notice] = 'Board was successfully deleted.'
+ format.html { redirect_to(boards_url) }
+ format.xml { head :ok }
+ end
+ end
+end
View
90 app/controllers/listings_controller.rb
@@ -0,0 +1,90 @@
+class ListingsController < ApplicationController
+
+ # GET /listings
+ # GET /listings.xml
+ def index
+ @listings = Listing.all()
+
+ respond_to do |format|
+ format.html
+ format.xml { render :xml => @listings }
+ end
+ end
+
+ # GET /listings/1
+ # GET /listings/1.xml
+ def show
+ @listing = Listing.get!(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @listing }
+ end
+ end
+
+ # GET /listings/new
+ # GET /listings/new.xml
+ def new
+ @listing = Listing.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @listing }
+ end
+ end
+
+ # GET /listings/1/edit
+ def edit
+ @listing = Listing.get!(params[:id])
+ end
+
+ # POST /listings
+ # POST /listings.xml
+ def create
+ @listing = Listing.new(params[:listing])
+ @listing.current_user = current_user
+
+ respond_to do |format|
+ if @listing.save
+ flash[:notice] = 'Listing was successfully created.'
+ format.html { redirect_to(listing_url(@listing.id)) }
+ format.xml { render :xml => @listing, :status => :created, :location => listing_url(@listing.id) + ".xml" }
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @listing.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /listings/1
+ # PUT /listings/1.xml
+ def update
+ @listing = Listing.get!(params[:id])
+ @listing.current_user = current_user
+
+ respond_to do |format|
+ if @listing.update(params[:listing]) or not @listing.dirty?
+ flash[:notice] = 'Listing was successfully updated.'
+ format.html { redirect_to(listing_url(@listing.id)) }
+ format.xml { render :xml => @listing }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @listing.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /listings/1
+ # DELETE /listings/1.xml
+ def destroy
+ @listing = Listing.get(params[:id])
+ @listing.current_user = current_user
+ @listing.destroy if @listing
+
+ respond_to do |format|
+ flash[:notice] = 'Listing was successfully deleted.'
+ format.html { redirect_to(listings_url) }
+ format.xml { head :ok }
+ end
+ end
+end
View
90 app/controllers/venue_configs_controller.rb
@@ -0,0 +1,90 @@
+class VenueConfigsController < ApplicationController
+
+ # GET /venue_configs
+ # GET /venue_configs.xml
+ def index
+ @venue_configs = VenueConfig.all()
+
+ respond_to do |format|
+ format.html
+ format.xml { render :xml => @venue_configs }
+ end
+ end
+
+ # GET /venue_configs/1
+ # GET /venue_configs/1.xml
+ def show
+ @venue_config = VenueConfig.get!(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @venue_config }
+ end
+ end
+
+ # GET /venue_configs/new
+ # GET /venue_configs/new.xml
+ def new
+ @venue_config = VenueConfig.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @venue_config }
+ end
+ end
+
+ # GET /venue_configs/1/edit
+ def edit
+ @venue_config = VenueConfig.get!(params[:id])
+ end
+
+ # POST /venue_configs
+ # POST /venue_configs.xml
+ def create
+ @venue_config = VenueConfig.new(params[:venue_config])
+ @venue_config.current_user = current_user
+
+ respond_to do |format|
+ if @venue_config.save
+ flash[:notice] = 'VenueConfig was successfully created.'
+ format.html { redirect_to(venue_config_url(@venue_config.id)) }
+ format.xml { render :xml => @venue_config, :status => :created, :location => venue_config_url(@venue_config.id) + ".xml" }
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @venue_config.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /venue_configs/1
+ # PUT /venue_configs/1.xml
+ def update
+ @venue_config = VenueConfig.get!(params[:id])
+ @venue_config.current_user = current_user
+
+ respond_to do |format|
+ if @venue_config.update(params[:venue_config]) or not @venue_config.dirty?
+ flash[:notice] = 'VenueConfig was successfully updated.'
+ format.html { redirect_to(venue_config_url(@venue_config.id)) }
+ format.xml { render :xml => @venue_config }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @venue_config.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /venue_configs/1
+ # DELETE /venue_configs/1.xml
+ def destroy
+ @venue_config = VenueConfig.get(params[:id])
+ @venue_config.current_user = current_user
+ @venue_config.destroy if @venue_config
+
+ respond_to do |format|
+ flash[:notice] = 'VenueConfig was successfully deleted.'
+ format.html { redirect_to(venue_configs_url) }
+ format.xml { head :ok }
+ end
+ end
+end
View
90 app/controllers/venues_controller.rb
@@ -0,0 +1,90 @@
+class VenuesController < ApplicationController
+
+ # GET /venues
+ # GET /venues.xml
+ def index
+ @venues = Venue.all()
+
+ respond_to do |format|
+ format.html
+ format.xml { render :xml => @venues }
+ end
+ end
+
+ # GET /venues/1
+ # GET /venues/1.xml
+ def show
+ @venue = Venue.get!(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @venue }
+ end
+ end
+
+ # GET /venues/new
+ # GET /venues/new.xml
+ def new
+ @venue = Venue.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @venue }
+ end
+ end
+
+ # GET /venues/1/edit
+ def edit
+ @venue = Venue.get!(params[:id])
+ end
+
+ # POST /venues
+ # POST /venues.xml
+ def create
+ @venue = Venue.new(params[:venue])
+ @venue.current_user = current_user
+
+ respond_to do |format|
+ if @venue.save
+ flash[:notice] = 'Venue was successfully created.'
+ format.html { redirect_to(venue_url(@venue.id)) }
+ format.xml { render :xml => @venue, :status => :created, :location => venue_url(@venue.id) + ".xml" }
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @venue.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /venues/1
+ # PUT /venues/1.xml
+ def update
+ @venue = Venue.get!(params[:id])
+ @venue.current_user = current_user
+
+ respond_to do |format|
+ if @venue.update(params[:venue]) or not @venue.dirty?
+ flash[:notice] = 'Venue was successfully updated.'
+ format.html { redirect_to(venue_url(@venue.id)) }
+ format.xml { render :xml => @venue }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @venue.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /venues/1
+ # DELETE /venues/1.xml
+ def destroy
+ @venue = Venue.get(params[:id])
+ @venue.current_user = current_user
+ @venue.destroy if @venue
+
+ respond_to do |format|
+ flash[:notice] = 'Venue was successfully deleted.'
+ format.html { redirect_to(venues_url) }
+ format.xml { head :ok }
+ end
+ end
+end
View
8 app/guards/board_configs_guard.rb
@@ -0,0 +1,8 @@
+Ixtlan::Guard.initialize(:board_configs,
+ { :index => [],
+ :show => [],
+ :edit => [],
+ :update => [],
+ :new => [],
+ :create => [],
+ :destroy => [] })
View
8 app/guards/boards_guard.rb
@@ -0,0 +1,8 @@
+Ixtlan::Guard.initialize(:boards,
+ { :index => [],
+ :show => [],
+ :edit => [],
+ :update => [],
+ :new => [],
+ :create => [],
+ :destroy => [] })
View
8 app/guards/listings_guard.rb
@@ -0,0 +1,8 @@
+Ixtlan::Guard.initialize(:listings,
+ { :index => [],
+ :show => [],
+ :edit => [],
+ :update => [],
+ :new => [],
+ :create => [],
+ :destroy => [] })
View
8 app/guards/venue_configs_guard.rb
@@ -0,0 +1,8 @@
+Ixtlan::Guard.initialize(:venue_configs,
+ { :index => [],
+ :show => [],
+ :edit => [],
+ :update => [],
+ :new => [],
+ :create => [],
+ :destroy => [] })
View
8 app/guards/venues_guard.rb
@@ -0,0 +1,8 @@
+Ixtlan::Guard.initialize(:venues,
+ { :index => [],
+ :show => [],
+ :edit => [],
+ :update => [],
+ :new => [],
+ :create => [],
+ :destroy => [] })
View
2  app/helpers/board_configs_helper.rb
@@ -0,0 +1,2 @@
+module BoardConfigsHelper
+end
View
2  app/helpers/boards_helper.rb
@@ -0,0 +1,2 @@
+module BoardsHelper
+end
View
2  app/helpers/listings_helper.rb
@@ -0,0 +1,2 @@
+module ListingsHelper
+end
View
2  app/helpers/venue_configs_helper.rb
@@ -0,0 +1,2 @@
+module VenueConfigsHelper
+end
View
2  app/helpers/venues_helper.rb
@@ -0,0 +1,2 @@
+module VenuesHelper
+end
View
22 app/models/board.rb
@@ -0,0 +1,22 @@
+class Board
+ include DataMapper::Resource
+
+ property :id, Serial
+ property :name, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ property :fullname, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ property :position, Integer, :required => true
+ property :enabled, ::DataMapper::Types::Boolean, :required => true
+ timestamps :at
+
+ modified_by Ixtlan::Models::USER
+
+ require 'dm-serializer'
+ alias :to_x :to_xml_document
+ def to_xml_document(opts = {}, doc = nil)
+ unless(opts[:methods])
+ opts.merge!({:methods => [:updated_by], :updated_by => {:methods => [], :exclude => [:created_at, :updated_at]}})
+ end
+ to_x(opts, doc)
+ end
+
+end
View
22 app/models/board_config.rb
@@ -0,0 +1,22 @@
+class BoardConfig
+ include DataMapper::Resource
+
+ property :id, Serial
+ property :board_id, Integer, :required => true
+ property :locale_id, Integer, :required => true
+ property :map_url, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ property :directions_url, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ timestamps :at
+
+ modified_by Ixtlan::Models::USER
+
+ require 'dm-serializer'
+ alias :to_x :to_xml_document
+ def to_xml_document(opts = {}, doc = nil)
+ unless(opts[:methods])
+ opts.merge!({:methods => [:updated_by], :updated_by => {:methods => [], :exclude => [:created_at, :updated_at]}})
+ end
+ to_x(opts, doc)
+ end
+
+end
View
24 app/models/listing.rb
@@ -0,0 +1,24 @@
+class Listing
+ include DataMapper::Resource
+
+ property :id, Serial
+ property :location, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ property :email, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ property :name, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ property :ridedate, Date, :required => true
+ property :driver, ::DataMapper::Types::Boolean, :required => true
+ property :password, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ timestamps :at
+
+ modified_by Ixtlan::Models::USER
+
+ require 'dm-serializer'
+ alias :to_x :to_xml_document
+ def to_xml_document(opts = {}, doc = nil)
+ unless(opts[:methods])
+ opts.merge!({:methods => [:updated_by], :updated_by => {:methods => [], :exclude => [:created_at, :updated_at]}})
+ end
+ to_x(opts, doc)
+ end
+
+end
View
23 app/models/venue.rb
@@ -0,0 +1,23 @@
+class Venue
+ include DataMapper::Resource
+
+ property :id, Serial
+ property :fullname, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ property :email, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ property :password, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ property :bcc, ::DataMapper::Types::Boolean, :required => true
+ property :enabled, ::DataMapper::Types::Boolean, :required => true
+ timestamps :at
+
+ modified_by Ixtlan::Models::USER
+
+ require 'dm-serializer'
+ alias :to_x :to_xml_document
+ def to_xml_document(opts = {}, doc = nil)
+ unless(opts[:methods])
+ opts.merge!({:methods => [:updated_by], :updated_by => {:methods => [], :exclude => [:created_at, :updated_at]}})
+ end
+ to_x(opts, doc)
+ end
+
+end
View
25 app/models/venue_config.rb
@@ -0,0 +1,25 @@
+class VenueConfig
+ include DataMapper::Resource
+
+ property :id, Serial
+ property :locale_id, Integer, :required => true
+ property :venue_id, Integer, :required => true
+ property :date_format, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ property :home_url, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ property :schedule_url, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ property :checklist_url, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ property :iframe_url, String, :required => true, :format => /^[^<'&">]*$/, :length => 255
+ timestamps :at
+
+ modified_by Ixtlan::Models::USER
+
+ require 'dm-serializer'
+ alias :to_x :to_xml_document
+ def to_xml_document(opts = {}, doc = nil)
+ unless(opts[:methods])
+ opts.merge!({:methods => [:updated_by], :updated_by => {:methods => [], :exclude => [:created_at, :updated_at]}})
+ end
+ to_x(opts, doc)
+ end
+
+end
View
28 app/views/board_configs/edit.html.erb
@@ -0,0 +1,28 @@
+<h1>Editing board_config</h1>
+
+<% form_for(:board_config, :url => board_config_path(@board_config.key), :html => {:method => :put}) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :board_id %><br />
+ <%= f.text_field :board_id %>
+ </p>
+ <p>
+ <%= f.label :locale_id %><br />
+ <%= f.text_field :locale_id %>
+ </p>
+ <p>
+ <%= f.label :map_url %><br />
+ <%= f.text_field :map_url %>
+ </p>
+ <p>
+ <%= f.label :directions_url %><br />
+ <%= f.text_field :directions_url %>
+ </p>
+ <p>
+ <%= f.submit 'Update' %>
+ </p>
+<% end %>
+
+<%= link_to 'Show', board_config_path(@board_config.key) %> |
+<%= link_to 'Back', board_configs_path %>
View
26 app/views/board_configs/index.html.erb
@@ -0,0 +1,26 @@
+<h1>Listing board_configs</h1>
+
+<table>
+ <tr>
+ <th>Board</th>
+ <th>Locale</th>
+ <th>Map url</th>
+ <th>Directions url</th>
+ </tr>
+
+<% @board_configs.each do |board_config| %>
+ <tr>
+ <td><%=h board_config.board_id %></td>
+ <td><%=h board_config.locale_id %></td>
+ <td><%=h board_config.map_url %></td>
+ <td><%=h board_config.directions_url %></td>
+ <td><%= link_to 'Show', board_config_path(board_config.key) %></td>
+ <td><%= link_to 'Edit', edit_board_config_path(board_config.key) %></td>
+ <td><%= link_to 'Destroy', board_config_path(board_config.key), :confirm => 'Are you sure?', :method => :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New board_config', new_board_config_path %>
View
27 app/views/board_configs/new.html.erb
@@ -0,0 +1,27 @@
+<h1>New board_config</h1>
+
+<% form_for(@board_config) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :board_id %><br />
+ <%= f.text_field :board_id %>
+ </p>
+ <p>
+ <%= f.label :locale_id %><br />
+ <%= f.text_field :locale_id %>
+ </p>
+ <p>
+ <%= f.label :map_url %><br />
+ <%= f.text_field :map_url %>
+ </p>
+ <p>
+ <%= f.label :directions_url %><br />
+ <%= f.text_field :directions_url %>
+ </p>
+ <p>
+ <%= f.submit 'Create' %>
+ </p>
+<% end %>
+
+<%= link_to 'Back', board_configs_path %>
View
23 app/views/board_configs/show.html.erb
@@ -0,0 +1,23 @@
+<p>
+ <b>Board:</b>
+ <%=h @board_config.board_id %>
+</p>
+
+<p>
+ <b>Locale:</b>
+ <%=h @board_config.locale_id %>
+</p>
+
+<p>
+ <b>Map url:</b>
+ <%=h @board_config.map_url %>
+</p>
+
+<p>
+ <b>Directions url:</b>
+ <%=h @board_config.directions_url %>
+</p>
+
+
+<%= link_to 'Edit', edit_board_config_path(@board_config.key) %> |
+<%= link_to 'Back', board_configs_path %>
View
28 app/views/boards/edit.html.erb
@@ -0,0 +1,28 @@
+<h1>Editing board</h1>
+
+<% form_for(:board, :url => board_path(@board.key), :html => {:method => :put}) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :name %><br />
+ <%= f.text_field :name %>
+ </p>
+ <p>
+ <%= f.label :fullname %><br />
+ <%= f.text_field :fullname %>
+ </p>
+ <p>
+ <%= f.label :position %><br />
+ <%= f.text_field :position %>
+ </p>
+ <p>
+ <%= f.label :enabled %><br />
+ <%= f.check_box :enabled %>
+ </p>
+ <p>
+ <%= f.submit 'Update' %>
+ </p>
+<% end %>
+
+<%= link_to 'Show', board_path(@board.key) %> |
+<%= link_to 'Back', boards_path %>
View
26 app/views/boards/index.html.erb
@@ -0,0 +1,26 @@
+<h1>Listing boards</h1>
+
+<table>
+ <tr>
+ <th>Name</th>
+ <th>Fullname</th>
+ <th>Position</th>
+ <th>Enabled</th>
+ </tr>
+
+<% @boards.each do |board| %>
+ <tr>
+ <td><%=h board.name %></td>
+ <td><%=h board.fullname %></td>
+ <td><%=h board.position %></td>
+ <td><%=h board.enabled %></td>
+ <td><%= link_to 'Show', board_path(board.key) %></td>
+ <td><%= link_to 'Edit', edit_board_path(board.key) %></td>
+ <td><%= link_to 'Destroy', board_path(board.key), :confirm => 'Are you sure?', :method => :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New board', new_board_path %>
View
27 app/views/boards/new.html.erb
@@ -0,0 +1,27 @@
+<h1>New board</h1>
+
+<% form_for(@board) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :name %><br />
+ <%= f.text_field :name %>
+ </p>
+ <p>
+ <%= f.label :fullname %><br />
+ <%= f.text_field :fullname %>
+ </p>
+ <p>
+ <%= f.label :position %><br />
+ <%= f.text_field :position %>
+ </p>
+ <p>
+ <%= f.label :enabled %><br />
+ <%= f.check_box :enabled %>
+ </p>
+ <p>
+ <%= f.submit 'Create' %>
+ </p>
+<% end %>
+
+<%= link_to 'Back', boards_path %>
View
23 app/views/boards/show.html.erb
@@ -0,0 +1,23 @@
+<p>
+ <b>Name:</b>
+ <%=h @board.name %>
+</p>
+
+<p>
+ <b>Fullname:</b>
+ <%=h @board.fullname %>
+</p>
+
+<p>
+ <b>Position:</b>
+ <%=h @board.position %>
+</p>
+
+<p>
+ <b>Enabled:</b>
+ <%=h @board.enabled %>
+</p>
+
+
+<%= link_to 'Edit', edit_board_path(@board.key) %> |
+<%= link_to 'Back', boards_path %>
View
20 app/views/layouts/board_configs.html.erb
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
+ <% if controller.send :current_user %>
+ <meta http-equiv="refresh" content="<%= controller.send(:session_timeout) * 60 %>" />
+ <% end -%>
+ <title>BoardConfigs: <%= controller.action_name %></title>
+ <%= stylesheet_link_tag 'scaffold' %>
+</head>
+<body>
+
+<p style="color: green"><%= flash[:notice] %></p>
+
+<%= yield %>
+
+</body>
+</html>
View
20 app/views/layouts/boards.html.erb
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
+ <% if controller.send :current_user %>
+ <meta http-equiv="refresh" content="<%= controller.send(:session_timeout) * 60 %>" />
+ <% end -%>
+ <title>Boards: <%= controller.action_name %></title>
+ <%= stylesheet_link_tag 'scaffold' %>
+</head>
+<body>
+
+<p style="color: green"><%= flash[:notice] %></p>
+
+<%= yield %>
+
+</body>
+</html>
View
20 app/views/layouts/listings.html.erb
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
+ <% if controller.send :current_user %>
+ <meta http-equiv="refresh" content="<%= controller.send(:session_timeout) * 60 %>" />
+ <% end -%>
+ <title>Listings: <%= controller.action_name %></title>
+ <%= stylesheet_link_tag 'scaffold' %>
+</head>
+<body>
+
+<p style="color: green"><%= flash[:notice] %></p>
+
+<%= yield %>
+
+</body>
+</html>
View
20 app/views/layouts/venue_configs.html.erb
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
+ <% if controller.send :current_user %>
+ <meta http-equiv="refresh" content="<%= controller.send(:session_timeout) * 60 %>" />
+ <% end -%>
+ <title>VenueConfigs: <%= controller.action_name %></title>
+ <%= stylesheet_link_tag 'scaffold' %>
+</head>
+<body>
+
+<p style="color: green"><%= flash[:notice] %></p>
+
+<%= yield %>
+
+</body>
+</html>
View
20 app/views/layouts/venues.html.erb
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
+ <% if controller.send :current_user %>
+ <meta http-equiv="refresh" content="<%= controller.send(:session_timeout) * 60 %>" />
+ <% end -%>
+ <title>Venues: <%= controller.action_name %></title>
+ <%= stylesheet_link_tag 'scaffold' %>
+</head>
+<body>
+
+<p style="color: green"><%= flash[:notice] %></p>
+
+<%= yield %>
+
+</body>
+</html>
View
36 app/views/listings/edit.html.erb
@@ -0,0 +1,36 @@
+<h1>Editing listing</h1>
+
+<% form_for(:listing, :url => listing_path(@listing.key), :html => {:method => :put}) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :location %><br />
+ <%= f.text_field :location %>
+ </p>
+ <p>
+ <%= f.label :email %><br />
+ <%= f.text_field :email %>
+ </p>
+ <p>
+ <%= f.label :name %><br />
+ <%= f.text_field :name %>
+ </p>
+ <p>
+ <%= f.label :ridedate %><br />
+ <%= f.date_select :ridedate %>
+ </p>
+ <p>
+ <%= f.label :driver %><br />
+ <%= f.check_box :driver %>
+ </p>
+ <p>
+ <%= f.label :password %><br />
+ <%= f.text_field :password %>
+ </p>
+ <p>
+ <%= f.submit 'Update' %>
+ </p>
+<% end %>
+
+<%= link_to 'Show', listing_path(@listing.key) %> |
+<%= link_to 'Back', listings_path %>
View
30 app/views/listings/index.html.erb
@@ -0,0 +1,30 @@
+<h1>Listing listings</h1>
+
+<table>
+ <tr>
+ <th>Location</th>
+ <th>Email</th>
+ <th>Name</th>
+ <th>Ridedate</th>
+ <th>Driver</th>
+ <th>Password</th>
+ </tr>
+
+<% @listings.each do |listing| %>
+ <tr>
+ <td><%=h listing.location %></td>
+ <td><%=h listing.email %></td>
+ <td><%=h listing.name %></td>
+ <td><%=h listing.ridedate %></td>
+ <td><%=h listing.driver %></td>
+ <td><%=h listing.password %></td>
+ <td><%= link_to 'Show', listing_path(listing.key) %></td>
+ <td><%= link_to 'Edit', edit_listing_path(listing.key) %></td>
+ <td><%= link_to 'Destroy', listing_path(listing.key), :confirm => 'Are you sure?', :method => :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New listing', new_listing_path %>
View
35 app/views/listings/new.html.erb
@@ -0,0 +1,35 @@
+<h1>New listing</h1>
+
+<% form_for(@listing) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :location %><br />
+ <%= f.text_field :location %>
+ </p>
+ <p>
+ <%= f.label :email %><br />
+ <%= f.text_field :email %>
+ </p>
+ <p>
+ <%= f.label :name %><br />
+ <%= f.text_field :name %>
+ </p>
+ <p>
+ <%= f.label :ridedate %><br />
+ <%= f.date_select :ridedate %>
+ </p>
+ <p>
+ <%= f.label :driver %><br />
+ <%= f.check_box :driver %>
+ </p>
+ <p>
+ <%= f.label :password %><br />
+ <%= f.text_field :password %>
+ </p>
+ <p>
+ <%= f.submit 'Create' %>
+ </p>
+<% end %>
+
+<%= link_to 'Back', listings_path %>
View
33 app/views/listings/show.html.erb
@@ -0,0 +1,33 @@
+<p>
+ <b>Location:</b>
+ <%=h @listing.location %>
+</p>
+
+<p>
+ <b>Email:</b>
+ <%=h @listing.email %>
+</p>
+
+<p>
+ <b>Name:</b>
+ <%=h @listing.name %>
+</p>
+
+<p>
+ <b>Ridedate:</b>
+ <%=h @listing.ridedate %>
+</p>
+
+<p>
+ <b>Driver:</b>
+ <%=h @listing.driver %>
+</p>
+
+<p>
+ <b>Password:</b>
+ <%=h @listing.password %>
+</p>
+
+
+<%= link_to 'Edit', edit_listing_path(@listing.key) %> |
+<%= link_to 'Back', listings_path %>
View
40 app/views/venue_configs/edit.html.erb
@@ -0,0 +1,40 @@
+<h1>Editing venue_config</h1>
+
+<% form_for(:venue_config, :url => venue_config_path(@venue_config.key), :html => {:method => :put}) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :locale_id %><br />
+ <%= f.text_field :locale_id %>
+ </p>
+ <p>
+ <%= f.label :venue_id %><br />
+ <%= f.text_field :venue_id %>
+ </p>
+ <p>
+ <%= f.label :date_format %><br />
+ <%= f.text_field :date_format %>
+ </p>
+ <p>
+ <%= f.label :home_url %><br />
+ <%= f.text_field :home_url %>
+ </p>
+ <p>
+ <%= f.label :schedule_url %><br />
+ <%= f.text_field :schedule_url %>
+ </p>
+ <p>
+ <%= f.label :checklist_url %><br />
+ <%= f.text_field :checklist_url %>
+ </p>
+ <p>
+ <%= f.label :iframe_url %><br />
+ <%= f.text_field :iframe_url %>
+ </p>
+ <p>
+ <%= f.submit 'Update' %>
+ </p>
+<% end %>
+
+<%= link_to 'Show', venue_config_path(@venue_config.key) %> |
+<%= link_to 'Back', venue_configs_path %>
View
32 app/views/venue_configs/index.html.erb
@@ -0,0 +1,32 @@
+<h1>Listing venue_configs</h1>
+
+<table>
+ <tr>
+ <th>Locale</th>
+ <th>Venue</th>
+ <th>Date format</th>
+ <th>Home url</th>
+ <th>Schedule url</th>
+ <th>Checklist url</th>
+ <th>Iframe url</th>
+ </tr>
+
+<% @venue_configs.each do |venue_config| %>
+ <tr>
+ <td><%=h venue_config.locale_id %></td>
+ <td><%=h venue_config.venue_id %></td>
+ <td><%=h venue_config.date_format %></td>
+ <td><%=h venue_config.home_url %></td>
+ <td><%=h venue_config.schedule_url %></td>
+ <td><%=h venue_config.checklist_url %></td>
+ <td><%=h venue_config.iframe_url %></td>
+ <td><%= link_to 'Show', venue_config_path(venue_config.key) %></td>
+ <td><%= link_to 'Edit', edit_venue_config_path(venue_config.key) %></td>
+ <td><%= link_to 'Destroy', venue_config_path(venue_config.key), :confirm => 'Are you sure?', :method => :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New venue_config', new_venue_config_path %>
View
39 app/views/venue_configs/new.html.erb
@@ -0,0 +1,39 @@
+<h1>New venue_config</h1>
+
+<% form_for(@venue_config) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :locale_id %><br />
+ <%= f.text_field :locale_id %>
+ </p>
+ <p>
+ <%= f.label :venue_id %><br />
+ <%= f.text_field :venue_id %>
+ </p>
+ <p>
+ <%= f.label :date_format %><br />
+ <%= f.text_field :date_format %>
+ </p>
+ <p>
+ <%= f.label :home_url %><br />
+ <%= f.text_field :home_url %>
+ </p>
+ <p>
+ <%= f.label :schedule_url %><br />
+ <%= f.text_field :schedule_url %>
+ </p>
+ <p>
+ <%= f.label :checklist_url %><br />
+ <%= f.text_field :checklist_url %>
+ </p>
+ <p>
+ <%= f.label :iframe_url %><br />
+ <%= f.text_field :iframe_url %>
+ </p>
+ <p>
+ <%= f.submit 'Create' %>
+ </p>
+<% end %>
+
+<%= link_to 'Back', venue_configs_path %>
View
38 app/views/venue_configs/show.html.erb
@@ -0,0 +1,38 @@
+<p>
+ <b>Locale:</b>
+ <%=h @venue_config.locale_id %>
+</p>
+
+<p>
+ <b>Venue:</b>
+ <%=h @venue_config.venue_id %>
+</p>
+
+<p>
+ <b>Date format:</b>
+ <%=h @venue_config.date_format %>
+</p>
+
+<p>
+ <b>Home url:</b>
+ <%=h @venue_config.home_url %>
+</p>
+
+<p>
+ <b>Schedule url:</b>
+ <%=h @venue_config.schedule_url %>
+</p>
+
+<p>
+ <b>Checklist url:</b>
+ <%=h @venue_config.checklist_url %>
+</p>
+
+<p>
+ <b>Iframe url:</b>
+ <%=h @venue_config.iframe_url %>
+</p>
+
+
+<%= link_to 'Edit', edit_venue_config_path(@venue_config.key) %> |
+<%= link_to 'Back', venue_configs_path %>
View
32 app/views/venues/edit.html.erb
@@ -0,0 +1,32 @@
+<h1>Editing venue</h1>
+
+<% form_for(:venue, :url => venue_path(@venue.key), :html => {:method => :put}) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :fullname %><br />
+ <%= f.text_field :fullname %>
+ </p>
+ <p>
+ <%= f.label :email %><br />
+ <%= f.text_field :email %>
+ </p>
+ <p>
+ <%= f.label :password %><br />
+ <%= f.text_field :password %>
+ </p>
+ <p>
+ <%= f.label :bcc %><br />
+ <%= f.check_box :bcc %>
+ </p>
+ <p>
+ <%= f.label :enabled %><br />
+ <%= f.check_box :enabled %>
+ </p>
+ <p>
+ <%= f.submit 'Update' %>
+ </p>
+<% end %>
+
+<%= link_to 'Show', venue_path(@venue.key) %> |
+<%= link_to 'Back', venues_path %>
View
28 app/views/venues/index.html.erb
@@ -0,0 +1,28 @@
+<h1>Listing venues</h1>
+
+<table>
+ <tr>
+ <th>Fullname</th>
+ <th>Email</th>
+ <th>Password</th>
+ <th>Bcc</th>
+ <th>Enabled</th>
+ </tr>
+
+<% @venues.each do |venue| %>
+ <tr>
+ <td><%=h venue.fullname %></td>
+ <td><%=h venue.email %></td>
+ <td><%=h venue.password %></td>
+ <td><%=h venue.bcc %></td>
+ <td><%=h venue.enabled %></td>
+ <td><%= link_to 'Show', venue_path(venue.key) %></td>
+ <td><%= link_to 'Edit', edit_venue_path(venue.key) %></td>
+ <td><%= link_to 'Destroy', venue_path(venue.key), :confirm => 'Are you sure?', :method => :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New venue', new_venue_path %>
View
31 app/views/venues/new.html.erb
@@ -0,0 +1,31 @@
+<h1>New venue</h1>
+
+<% form_for(@venue) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :fullname %><br />
+ <%= f.text_field :fullname %>
+ </p>
+ <p>
+ <%= f.label :email %><br />
+ <%= f.text_field :email %>
+ </p>
+ <p>
+ <%= f.label :password %><br />
+ <%= f.text_field :password %>
+ </p>
+ <p>
+ <%= f.label :bcc %><br />
+ <%= f.check_box :bcc %>
+ </p>
+ <p>
+ <%= f.label :enabled %><br />
+ <%= f.check_box :enabled %>
+ </p>
+ <p>
+ <%= f.submit 'Create' %>
+ </p>
+<% end %>
+
+<%= link_to 'Back', venues_path %>
View
28 app/views/venues/show.html.erb
@@ -0,0 +1,28 @@
+<p>
+ <b>Fullname:</b>
+ <%=h @venue.fullname %>
+</p>
+
+<p>
+ <b>Email:</b>
+ <%=h @venue.email %>
+</p>
+
+<p>
+ <b>Password:</b>
+ <%=h @venue.password %>
+</p>
+
+<p>
+ <b>Bcc:</b>
+ <%=h @venue.bcc %>
+</p>
+
+<p>
+ <b>Enabled:</b>
+ <%=h @venue.enabled %>
+</p>
+
+
+<%= link_to 'Edit', edit_venue_path(@venue.key) %> |
+<%= link_to 'Back', venues_path %>
View
10 config/routes.rb
@@ -1,4 +1,14 @@
ActionController::Routing::Routes.draw do |map|
+ map.resources :listings
+
+ map.resources :boards
+
+ map.resources :board_configs
+
+ map.resources :venue_configs
+
+ map.resources :venues
+
map.resources :audits
map.resource :authentication
View
20 db/migrate/20100704220152_create_venues.rb
@@ -0,0 +1,20 @@
+migration 20100704220152, :create_venues do
+ up do
+ create_table :venues do
+ column :id, Integer, :serial => true
+ column :fullname, String, :nullable => false, :length => 255
+ column :email, String, :nullable => false, :length => 255
+ column :password, String, :nullable => false, :length => 255
+ column :bcc, ::DataMapper::Types::Boolean, :nullable => false
+ column :enabled, ::DataMapper::Types::Boolean, :nullable => false
+ column :created_at, DateTime, :nullable => false
+ column :updated_at, DateTime, :nullable => false
+ column :created_by_id, Integer, :nullable => false
+ column :updated_by_id, Integer, :nullable => false
+ end
+ end
+
+ down do
+ drop_table :venues
+ end
+end
View
22 db/migrate/20100704220226_create_venue_configs.rb
@@ -0,0 +1,22 @@
+migration 20100704220226, :create_venue_configs do
+ up do
+ create_table :venue_configs do
+ column :id, Integer, :serial => true
+ column :locale_id, Integer, :nullable => false
+ column :venue_id, Integer, :nullable => false
+ column :date_format, String, :nullable => false, :length => 255
+ column :home_url, String, :nullable => false, :length => 255
+ column :schedule_url, String, :nullable => false, :length => 255
+ column :checklist_url, String, :nullable => false, :length => 255
+ column :iframe_url, String, :nullable => false, :length => 255
+ column :created_at, DateTime, :nullable => false
+ column :updated_at, DateTime, :nullable => false
+ column :created_by_id, Integer, :nullable => false
+ column :updated_by_id, Integer, :nullable => false
+ end
+ end
+
+ down do
+ drop_table :venue_configs
+ end
+end
View
19 db/migrate/20100704220301_create_board_configs.rb
@@ -0,0 +1,19 @@
+migration 20100704220301, :create_board_configs do
+ up do
+ create_table :board_configs do
+ column :id, Integer, :serial => true
+ column :board_id, Integer, :nullable => false
+ column :locale_id, Integer, :nullable => false
+ column :map_url, String, :nullable => false, :length => 255
+ column :directions_url, String, :nullable => false, :length => 255
+ column :created_at, DateTime, :nullable => false
+ column :updated_at, DateTime, :nullable => false
+ column :created_by_id, Integer, :nullable => false
+ column :updated_by_id, Integer, :nullable => false
+ end
+ end
+
+ down do
+ drop_table :board_configs
+ end
+end
View
19 db/migrate/20100704220328_create_boards.rb
@@ -0,0 +1,19 @@
+migration 20100704220328, :create_boards do
+ up do
+ create_table :boards do
+ column :id, Integer, :serial => true
+ column :name, String, :nullable => false, :length => 255
+ column :fullname, String, :nullable => false, :length => 255
+ column :position, Integer, :nullable => false
+ column :enabled, ::DataMapper::Types::Boolean, :nullable => false
+ column :created_at, DateTime, :nullable => false
+ column :updated_at, DateTime, :nullable => false
+ column :created_by_id, Integer, :nullable => false
+ column :updated_by_id, Integer, :nullable => false
+ end
+ end
+
+ down do
+ drop_table :boards
+ end
+end
View
21 db/migrate/20100704220402_create_listings.rb
@@ -0,0 +1,21 @@
+migration 20100704220402, :create_listings do
+ up do
+ create_table :listings do
+ column :id, Integer, :serial => true
+ column :location, String, :nullable => false, :length => 255
+ column :email, String, :nullable => false, :length => 255
+ column :name, String, :nullable => false, :length => 255
+ column :ridedate, Date, :nullable => false
+ column :driver, ::DataMapper::Types::Boolean, :nullable => false
+ column :password, String, :nullable => false, :length => 255
+ column :created_at, DateTime, :nullable => false
+ column :updated_at, DateTime, :nullable => false
+ column :created_by_id, Integer, :nullable => false
+ column :updated_by_id, Integer, :nullable => false
+ end
+ end
+
+ down do
+ drop_table :listings
+ end
+end
View
204 spec/controllers/board_configs_controller_spec.rb
@@ -0,0 +1,204 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+CONFIGURATION = Object.full_const_get(Ixtlan::Models::CONFIGURATION) unless Object.const_defined? "CONFIGURATION"
+describe BoardConfigsController do
+
+ def mock_board_config(stubs={})
+ @mock_board_config ||= mock_model(BoardConfig, stubs)
+ end
+
+ def mock_array(*args)
+ a = args
+ def a.model
+ BoardConfig
+ end
+ a
+ end
+
+ def mock_arguments(merge = {})
+ args = merge
+ args.merge!(:current_user= => nil, :errors => {})
+ args.merge!(:model => BoardConfig, :key => 12)
+ args
+ end
+
+ before(:each) do
+ user = Object.new
+ def user.id; 1; end
+ def user.login; "root"; end
+ def user.groups
+ g = Object.new
+ def g.name; "root"; end
+ [g]
+ end
+ controller.send(:current_user=, user)
+ mock_configuration = mock_model(CONFIGURATION,{})
+ CONFIGURATION.should_receive(:instance).any_number_of_times.and_return(mock_configuration)
+ mock_configuration.should_receive(:session_idle_timeout).any_number_of_times.and_return(1)
+ end
+
+ describe "GET index" do
+
+ it "exposes all board_configs as @board_configs" do
+ BoardConfig.should_receive(:all).and_return(mock_array(mock_board_config))
+ get :index
+ assigns[:board_configs].should == mock_array(mock_board_config)
+ end
+
+ describe "with mime type of xml" do
+
+ it "renders all board_configses as xml" do
+ BoardConfig.should_receive(:all).and_return(board_configs = mock_array("Array of BoardConfigs"))
+ board_configs.should_receive(:to_xml).and_return("generated XML")
+ get :index, :format => 'xml'
+ response.body.should == "generated XML"
+ end
+
+ end
+
+ end
+
+ describe "GET show" do
+
+ it "exposes the requested board_config as @board_config" do
+ BoardConfig.should_receive(:get!).with("37").and_return(mock_board_config(mock_arguments))
+ get :show, :id => "37"
+ assigns[:board_config].should equal(mock_board_config)
+ end
+
+ describe "with mime type of xml" do
+
+ it "renders the requested board_config as xml" do
+ BoardConfig.should_receive(:get!).with("37").and_return(mock_board_config(mock_arguments))
+ mock_board_config.should_receive(:to_xml).and_return("generated XML")
+ get :show, :id => "37", :format => 'xml'
+ response.body.should == "generated XML"
+ end
+
+ end
+
+ end
+
+ describe "GET new" do
+
+ it "exposes a new board_config as @board_config" do
+ BoardConfig.should_receive(:new).and_return(mock_board_config(mock_arguments))
+ get :new
+ assigns[:board_config].should equal(mock_board_config)
+ end
+
+ end
+
+ describe "GET edit" do
+
+ it "exposes the requested board_config as @board_config" do
+ BoardConfig.should_receive(:get!).with("37").and_return(mock_board_config(mock_arguments))
+ get :edit, :id => "37"
+ assigns[:board_config].should equal(mock_board_config)
+ end
+
+ end
+
+ describe "POST create" do
+
+ describe "with valid params" do
+
+ it "exposes a newly created board_config as @board_config" do
+ BoardConfig.should_receive(:new).with({'these' => 'params'}).and_return(mock_board_config(mock_arguments(:save => true)))
+ post :create, :board_config => {:these => 'params'}
+ assigns(:board_config).should equal(mock_board_config)
+ end
+
+ it "redirects to the created board_config" do
+ BoardConfig.stub!(:new).and_return(mock_board_config(mock_arguments(:save => true)))
+ post :create, :board_config => {}
+ response.should redirect_to(board_config_url(mock_board_config))
+ end
+
+ end
+
+ describe "with invalid params" do
+
+ it "exposes a newly created but unsaved board_config as @board_config" do
+ BoardConfig.stub!(:new).with({'these' => 'params'}).and_return(mock_board_config(mock_arguments(:save => false)))
+ post :create, :board_config => {:these => 'params'}
+ assigns(:board_config).should equal(mock_board_config)
+ end
+
+ it "re-renders the 'new' template" do
+ BoardConfig.stub!(:new).and_return(mock_board_config(mock_arguments(:save => false)))
+ post :create, :board_config => {}
+ response.should render_template('new')
+ end
+
+ end
+
+ end
+
+ describe "PUT udpate" do
+
+ describe "with valid params" do
+
+ it "updates the requested board_config" do
+ BoardConfig.should_receive(:get!).with("37").and_return(mock_board_config(mock_arguments))
+ mock_board_config.should_receive(:update).with({'these' => 'params'})
+ mock_board_config.should_receive(:dirty?)
+ put :update, :id => "37", :board_config => {:these => 'params'}
+ end
+
+ it "exposes the requested board_config as @board_config" do
+ BoardConfig.stub!(:get!).and_return(mock_board_config(mock_arguments(:update => true)))
+ put :update, :id => "1"
+ assigns(:board_config).should equal(mock_board_config)
+ end
+
+ it "redirects to the board_config" do
+ BoardConfig.stub!(:get!).and_return(mock_board_config(mock_arguments(:update => true)))
+ put :update, :id => "1"
+ response.should redirect_to(board_config_url(mock_board_config))
+ end
+
+ end
+
+ describe "with invalid params" do
+
+ it "updates the requested board_config" do
+ BoardConfig.should_receive(:get!).with("37").and_return(mock_board_config(mock_arguments))
+ mock_board_config.should_receive(:update).with({'these' => 'params'})
+ mock_board_config.should_receive(:dirty?)
+ put :update, :id => "37", :board_config => {:these => 'params'}
+ end
+
+ it "exposes the board_config as @board_config" do
+ BoardConfig.stub!(:get!).and_return(mock_board_config(mock_arguments(:update => false)))
+ mock_board_config.should_receive(:dirty?)
+ put :update, :id => "1"
+ assigns(:board_config).should equal(mock_board_config)
+ end
+
+ it "re-renders the 'edit' template" do
+ BoardConfig.stub!(:get!).and_return(mock_board_config(mock_arguments(:update => false, :dirty? => true)))
+ put :update, :id => "1"
+ response.should render_template('edit')
+ end
+
+ end
+
+ end
+
+ describe "DELETE destroy" do
+
+ it "destroys the requested board_config" do
+ BoardConfig.should_receive(:get).with("37").and_return(mock_board_config(mock_arguments))
+ mock_board_config.should_receive(:destroy)
+ delete :destroy, :id => "37"
+ end
+
+ it "redirects to the board_configs list" do
+ BoardConfig.should_receive(:get).with("1").and_return(mock_board_config(mock_arguments(:destroy => true)))
+ delete :destroy, :id => "1"
+ response.should redirect_to(board_configs_url)
+ end
+
+ end
+
+end
View
204 spec/controllers/boards_controller_spec.rb
@@ -0,0 +1,204 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+CONFIGURATION = Object.full_const_get(Ixtlan::Models::CONFIGURATION) unless Object.const_defined? "CONFIGURATION"
+describe BoardsController do
+
+ def mock_board(stubs={})
+ @mock_board ||= mock_model(Board, stubs)
+ end
+
+ def mock_array(*args)
+ a = args
+ def a.model
+ Board
+ end
+ a
+ end
+
+ def mock_arguments(merge = {})
+ args = merge
+ args.merge!(:current_user= => nil, :errors => {})
+ args.merge!(:model => Board, :key => 12)
+ args
+ end
+
+ before(:each) do
+ user = Object.new
+ def user.id; 1; end
+ def user.login; "root"; end
+ def user.groups
+ g = Object.new
+ def g.name; "root"; end
+ [g]
+ end
+ controller.send(:current_user=, user)
+ mock_configuration = mock_model(CONFIGURATION,{})
+ CONFIGURATION.should_receive(:instance).any_number_of_times.and_return(mock_configuration)
+ mock_configuration.should_receive(:session_idle_timeout).any_number_of_times.and_return(1)
+ end
+
+ describe "GET index" do
+
+ it "exposes all boards as @boards" do
+ Board.should_receive(:all).and_return(mock_array(mock_board))
+ get :index
+ assigns[:boards].should == mock_array(mock_board)
+ end
+
+ describe "with mime type of xml" do
+
+ it "renders all boardses as xml" do
+ Board.should_receive(:all).and_return(boards = mock_array("Array of Boards"))
+ boards.should_receive(:to_xml).and_return("generated XML")
+ get :index, :format => 'xml'
+ response.body.should == "generated XML"
+ end
+
+ end
+
+ end
+
+ describe "GET show" do
+
+ it "exposes the requested board as @board" do
+ Board.should_receive(:get!).with("37").and_return(mock_board(mock_arguments))
+ get :show, :id => "37"
+ assigns[:board].should equal(mock_board)
+ end
+
+ describe "with mime type of xml" do
+
+ it "renders the requested board as xml" do
+ Board.should_receive(:get!).with("37").and_return(mock_board(mock_arguments))
+ mock_board.should_receive(:to_xml).and_return("generated XML")
+ get :show, :id => "37", :format => 'xml'
+ response.body.should == "generated XML"
+ end
+
+ end
+
+ end
+
+ describe "GET new" do
+
+ it "exposes a new board as @board" do
+ Board.should_receive(:new).and_return(mock_board(mock_arguments))
+ get :new
+ assigns[:board].should equal(mock_board)
+ end
+
+ end
+
+ describe "GET edit" do
+
+ it "exposes the requested board as @board" do
+ Board.should_receive(:get!).with("37").and_return(mock_board(mock_arguments))
+ get :edit, :id => "37"
+ assigns[:board].should equal(mock_board)
+ end
+
+ end
+
+ describe "POST create" do
+
+ describe "with valid params" do
+
+ it "exposes a newly created board as @board" do
+ Board.should_receive(:new).with({'these' => 'params'}).and_return(mock_board(mock_arguments(:save => true)))
+ post :create, :board => {:these => 'params'}
+ assigns(:board).should equal(mock_board)
+ end
+
+ it "redirects to the created board" do
+ Board.stub!(:new).and_return(mock_board(mock_arguments(:save => true)))
+ post :create, :board => {}
+ response.should redirect_to(board_url(mock_board))
+ end
+
+ end
+
+ describe "with invalid params" do
+
+ it "exposes a newly created but unsaved board as @board" do
+ Board.stub!(:new).with({'these' => 'params'}).and_return(mock_board(mock_arguments(:save => false)))
+ post :create, :board => {:these => 'params'}
+ assigns(:board).should equal(mock_board)
+ end
+
+ it "re-renders the 'new' template" do
+ Board.stub!(:new).and_return(mock_board(mock_arguments(:save => false)))
+ post :create, :board => {}
+ response.should render_template('new')
+ end
+
+ end
+
+ end
+
+ describe "PUT udpate" do
+
+ describe "with valid params" do
+
+ it "updates the requested board" do
+ Board.should_receive(:get!).with("37").and_return(mock_board(mock_arguments))
+ mock_board.should_receive(:update).with({'these' => 'params'})
+ mock_board.should_receive(:dirty?)
+ put :update, :id => "37", :board => {:these => 'params'}
+ end
+
+ it "exposes the requested board as @board" do
+ Board.stub!(:get!).and_return(mock_board(mock_arguments(:update => true)))
+ put :update, :id => "1"
+ assigns(:board).should equal(mock_board)
+ end
+
+ it "redirects to the board" do
+ Board.stub!(:get!).and_return(mock_board(mock_arguments(:update => true)))
+ put :update, :id => "1"
+ response.should redirect_to(board_url(mock_board))
+ end
+
+ end
+
+ describe "with invalid params" do
+
+ it "updates the requested board" do
+ Board.should_receive(:get!).with("37").and_return(mock_board(mock_arguments))
+ mock_board.should_receive(:update).with({'these' => 'params'})
+ mock_board.should_receive(:dirty?)
+ put :update, :id => "37", :board => {:these => 'params'}
+ end
+
+ it "exposes the board as @board" do
+ Board.stub!(:get!).and_return(mock_board(mock_arguments(:update => false)))
+ mock_board.should_receive(:dirty?)
+ put :update, :id => "1"
+ assigns(:board).should equal(mock_board)
+ end
+
+ it "re-renders the 'edit' template" do
+ Board.stub!(:get!).and_return(mock_board(mock_arguments(:update => false, :dirty? => true)))
+ put :update, :id => "1"
+ response.should render_template('edit')
+ end
+
+ end
+
+ end
+
+ describe "DELETE destroy" do
+
+ it "destroys the requested board" do
+ Board.should_receive(:get).with("37").and_return(mock_board(mock_arguments))
+ mock_board.should_receive(:destroy)
+ delete :destroy, :id => "37"
+ end
+
+ it "redirects to the boards list" do
+ Board.should_receive(:get).with("1").and_return(mock_board(mock_arguments(:destroy => true)))
+ delete :destroy, :id => "1"
+ response.should redirect_to(boards_url)
+ end
+
+ end
+
+end
View
204 spec/controllers/listings_controller_spec.rb
@@ -0,0 +1,204 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+CONFIGURATION = Object.full_const_get(Ixtlan::Models::CONFIGURATION) unless Object.const_defined? "CONFIGURATION"
+describe ListingsController do
+
+ def mock_listing(stubs={})
+ @mock_listing ||= mock_model(Listing, stubs)
+ end
+
+ def mock_array(*args)
+ a = args
+ def a.model
+ Listing
+ end
+ a
+ end
+
+ def mock_arguments(merge = {})
+ args = merge
+ args.merge!(:current_user= => nil, :errors => {})
+ args.merge!(:model => Listing, :key => 12)
+ args
+ end
+
+ before(:each) do
+ user = Object.new
+ def user.id; 1; end
+ def user.login; "root"; end
+ def user.groups
+ g = Object.new
+ def g.name; "root"; end
+ [g]
+ end
+ controller.send(:current_user=, user)
+ mock_configuration = mock_model(CONFIGURATION,{})
+ CONFIGURATION.should_receive(:instance).any_number_of_times.and_return(mock_configuration)
+ mock_configuration.should_receive(:session_idle_timeout).any_number_of_times.and_return(1)
+ end
+
+ describe "GET index" do
+
+ it "exposes all listings as @listings" do
+ Listing.should_receive(:all).and_return(mock_array(mock_listing))
+ get :index
+ assigns[:listings].should == mock_array(mock_listing)
+ end
+
+ describe "with mime type of xml" do
+
+ it "renders all listingses as xml" do
+ Listing.should_receive(:all).and_return(listings = mock_array("Array of Listings"))
+ listings.should_receive(:to_xml).and_return("generated XML")
+ get :index, :format => 'xml'
+ response.body.should == "generated XML"
+ end
+
+ end
+
+ end
+
+ describe "GET show" do
+
+ it "exposes the requested listing as @listing" do
+ Listing.should_receive(:get!).with("37").and_return(mock_listing(mock_arguments))
+ get :show, :id => "37"
+ assigns[:listing].should equal(mock_listing)
+ end
+
+ describe "with mime type of xml" do
+
+ it "renders the requested listing as xml" do
+ Listing.should_receive(:get!).with("37").and_return(mock_listing(mock_arguments))
+ mock_listing.should_receive(:to_xml).and_return("generated XML")