Browse Source

Removing everything that is not necessary (keeping them in dev branch)

denney-disable-on-select
Jason Denney 12 years ago
parent
commit
855565dcc4
  1. 35
      app/controllers/acts_as_loggable/bike_actions_controller.rb
  2. 48
      app/controllers/acts_as_loggable/logs_controller.rb
  3. 35
      app/controllers/acts_as_loggable/transaction_actions_controller.rb
  4. 35
      app/controllers/acts_as_loggable/user_actions_controller.rb
  5. 21
      app/controllers/bike_brands_controller.rb
  6. 35
      app/controllers/bike_conditions_controller.rb
  7. 9
      app/controllers/bike_logs_controller.rb
  8. 21
      app/controllers/bike_models_controller.rb
  9. 35
      app/controllers/bike_statuses_controller.rb
  10. 35
      app/controllers/bike_styles_controller.rb
  11. 35
      app/controllers/bikes_controller.rb
  12. 36
      app/controllers/team_controller.example
  13. 9
      app/controllers/user_logs_controller.rb
  14. 8
      app/views/acts_as_loggable/bike_actions/_form.html.haml
  15. 4
      app/views/acts_as_loggable/bike_actions/edit.html.haml
  16. 21
      app/views/acts_as_loggable/bike_actions/index.html.haml
  17. 4
      app/views/acts_as_loggable/bike_actions/new.html.haml
  18. 13
      app/views/acts_as_loggable/bike_actions/show.html.haml
  19. 47
      app/views/acts_as_loggable/logs/_form.html.haml
  20. 4
      app/views/acts_as_loggable/logs/edit.html.haml
  21. 36
      app/views/acts_as_loggable/logs/index.html.haml
  22. 4
      app/views/acts_as_loggable/logs/new.html.haml
  23. 8
      app/views/acts_as_loggable/transaction_actions/_form.html.haml
  24. 4
      app/views/acts_as_loggable/transaction_actions/edit.html.haml
  25. 21
      app/views/acts_as_loggable/transaction_actions/index.html.haml
  26. 4
      app/views/acts_as_loggable/transaction_actions/new.html.haml
  27. 13
      app/views/acts_as_loggable/transaction_actions/show.html.haml
  28. 8
      app/views/acts_as_loggable/user_actions/_form.html.haml
  29. 4
      app/views/acts_as_loggable/user_actions/edit.html.haml
  30. 21
      app/views/acts_as_loggable/user_actions/index.html.haml
  31. 4
      app/views/acts_as_loggable/user_actions/new.html.haml
  32. 13
      app/views/acts_as_loggable/user_actions/show.html.haml
  33. 8
      app/views/bike_brands/_form.html.haml
  34. 15
      app/views/bike_brands/index.html.haml
  35. 4
      app/views/bike_brands/new.html.haml
  36. 22
      app/views/bike_brands/show.html.haml
  37. 8
      app/views/bike_conditions/_form.html.haml
  38. 4
      app/views/bike_conditions/edit.html.haml
  39. 21
      app/views/bike_conditions/index.html.haml
  40. 4
      app/views/bike_conditions/new.html.haml
  41. 13
      app/views/bike_conditions/show.html.haml
  42. 12
      app/views/bike_models/_form.html.haml
  43. 4
      app/views/bike_models/edit.html.haml
  44. 17
      app/views/bike_models/index.html.haml
  45. 4
      app/views/bike_models/new.html.haml
  46. 15
      app/views/bike_models/show.html.haml
  47. 8
      app/views/bike_statuses/_form.html.haml
  48. 4
      app/views/bike_statuses/edit.html.haml
  49. 21
      app/views/bike_statuses/index.html.haml
  50. 4
      app/views/bike_statuses/new.html.haml
  51. 13
      app/views/bike_statuses/show.html.haml
  52. 8
      app/views/bike_styles/_form.html.haml
  53. 4
      app/views/bike_styles/edit.html.haml
  54. 21
      app/views/bike_styles/index.html.haml
  55. 4
      app/views/bike_styles/new.html.haml
  56. 13
      app/views/bike_styles/show.html.haml
  57. 48
      app/views/bikes/_form.html.haml
  58. 4
      app/views/bikes/edit.html.haml
  59. 41
      app/views/bikes/index.html.haml
  60. 4
      app/views/bikes/new.html.haml
  61. 53
      app/views/bikes/show.html.haml
  62. 1
      app/views/site/index.html.haml
  63. 9
      app/views/teams_examples/index.html.haml
  64. 21
      app/views/teams_examples/new.html.haml
  65. 11
      app/views/teams_examples/show.html.haml
  66. 35
      config/routes.rb

35
app/controllers/acts_as_loggable/bike_actions_controller.rb

@ -1,35 +0,0 @@
class ActsAsLoggable::BikeActionsController < AuthenticatedController
#TODO Fix this so updating works
expose(:bike_action)
expose(:bike_actions) { ActsAsLoggable::BikeAction.order('id').paginate(:page => params[:page]) }
def index
end
def show
end
def new
end
def create
if bike_action.save
redirect_to acts_as_loggable_bike_actions_url
else
render :new
end
end
def update
if bike_action.save
redirect_to acts_as_loggable_bike_actions_url
else
render :edit
end
end
def destroy
bike_action.destroy
redirect_to acts_as_loggable_bike_actions_url
end
end

48
app/controllers/acts_as_loggable/logs_controller.rb

@ -1,48 +0,0 @@
class ActsAsLoggable::LogsController < AuthenticatedController
def index
if params[:loggable_id]
@loggable_path = ActsAsLoggable::Log.new( :loggable_type => @loggable_type,
:loggable_id => params[:loggable_id]).loggable_path
@logs = ActsAsLoggable::Log.where( :loggable_type => @loggable_type,
:loggable_id => params[:loggable_id])
.order('id').paginate(:page => params[:page])
else
@logs = ActsAsLoggable::Log.order('id').paginate(:page => params[:page])
end
end
def show
end
def new
@log = ActsAsLoggable::Log.new(:loggable_type => @loggable_type, :loggable_id => params[:loggable_id])
end
def create
params[:acts_as_loggable_log][:logger_id] = current_user.id.to_s
params[:acts_as_loggable_log][:logger_type] = current_user.class.to_s
log = ActsAsLoggable::Log.new(params[:acts_as_loggable_log])
if log.save
redirect_to log.loggable_path
else
puts log.errors.inspect
render :new
end
end
def edit
@log = ActsAsLoggable::Log.find_by_id(params[:id])
end
def update
@log = ActsAsLoggable::Log.find_by_id(params[:id])
@log.update_attributes(params[:acts_as_loggable_log].except(:loggable_type, :loggable_type,
:logger_type, :logger_id,))
redirect_to @log.loggable_path
end
def destroy
end
end

35
app/controllers/acts_as_loggable/transaction_actions_controller.rb

@ -1,35 +0,0 @@
class ActsAsLoggable::TransactionActionsController < AuthenticatedController
#TODO Fix this so updating works
expose(:transaction_action)
expose(:transaction_actions) { ActsAsLoggable::TransactionAction.order('id').paginate(:page => params[:page]) }
def index
end
def show
end
def new
end
def create
if transaction_action.save
redirect_to acts_as_loggable_transaction_actions_url
else
render :new
end
end
def update
if transaction_action.save
redirect_to acts_as_loggable_transaction_actions_url
else
render :edit
end
end
def destroy
transaction_action.destroy
redirect_to acts_as_loggable_transaction_actions_url
end
end

35
app/controllers/acts_as_loggable/user_actions_controller.rb

@ -1,35 +0,0 @@
class ActsAsLoggable::UserActionsController < AuthenticatedController
#TODO Fix this so updating works
expose(:user_action)
expose(:user_actions) { ActsAsLoggable::UserAction.order('id').paginate(:page => params[:page]) }
def index
end
def show
end
def new
end
def create
if user_action.save
redirect_to acts_as_loggable_user_actions_url
else
render :new
end
end
def update
if user_action.save
redirect_to acts_as_loggable_user_actions_url
else
render :edit
end
end
def destroy
user_action.destroy
redirect_to acts_as_loggable_user_actions_url
end
end

21
app/controllers/bike_brands_controller.rb

@ -1,21 +0,0 @@
class BikeBrandsController < AuthenticatedController
expose(:bike_brand)
expose(:bike_brands) { BikeBrand.order('id').paginate(:page => params[:page]) }
def index
end
def show
end
def new
end
def create
if bike_brand.save
redirect_to bike_brands_url
else
render :new
end
end
end

35
app/controllers/bike_conditions_controller.rb

@ -1,35 +0,0 @@
class BikeConditionsController < AuthenticatedController
expose(:bike_condition)
expose(:bike_conditions) { BikeCondition.order('id').paginate(:page => params[:page]) }
def index
end
def show
end
def new
end
def create
if bike_condition.save
redirect_to bike_conditions_url
else
render :new
end
end
def update
if bike_condition.save
redirect_to bike_conditions_url
else
render :edit
end
end
def destroy
bike_condition.destroy
redirect_to bike_conditions_url
end
end

9
app/controllers/bike_logs_controller.rb

@ -1,9 +0,0 @@
class BikeLogsController < ActsAsLoggable::LogsController
before_filter :set_loggable_type
private
def set_loggable_type
@loggable_type = 'Bike'
end
end

21
app/controllers/bike_models_controller.rb

@ -1,21 +0,0 @@
class BikeModelsController < AuthenticatedController
expose(:bike_model)
expose(:bike_models) { BikeModel.order('id').paginate(:page => params[:page]) }
def index
end
def show
end
def new
end
def create
if bike_model.save
redirect_to bike_models_url
else
render :new
end
end
end

35
app/controllers/bike_statuses_controller.rb

@ -1,35 +0,0 @@
class BikeStatusesController < AuthenticatedController
expose(:bike_status)
expose(:bike_statuses) { BikeStatus.order('id').paginate(:page => params[:page]) }
def index
end
def show
end
def new
end
def create
if bike_status.save
redirect_to bike_statuses_url
else
render :new
end
end
def update
if bike_status.save
redirect_to bike_statuses_url
else
render :edit
end
end
def destroy
bike_status.destroy
redirect_to bike_statuses_url
end
end

35
app/controllers/bike_styles_controller.rb

@ -1,35 +0,0 @@
class BikeStylesController < AuthenticatedController
expose(:bike_style)
expose(:bike_styles) { BikeStyle.order('id').paginate(:page => params[:page]) }
def index
end
def show
end
def new
end
def create
if bike_style.save
redirect_to bike_styles_url
else
render :new
end
end
def update
if bike_style.save
redirect_to bike_styles_url
else
render :edit
end
end
def destroy
bike_style.destroy
redirect_to bike_styles_url
end
end

35
app/controllers/bikes_controller.rb

@ -1,35 +0,0 @@
class BikesController < AuthenticatedController
expose(:bike)
expose(:bikes) { Bike.order('id').paginate(:page => params[:page]) }
def index
end
def show
end
def new
end
def create
if bike.save
redirect_to bike
else
render :new
end
end
def update
if bike.save
redirect_to bike
else
render :edit
end
end
def destroy
bike.destroy
redirect_to bikes_url
end
end

36
app/controllers/team_controller.example

@ -1,36 +0,0 @@
class TeamsController < AuthenticatedController
expose(:team) do
if params[:id]
Team.find(params[:id])
elsif params[:team]
Team.new(params[:team])
else
Team.new(:max_members => 16)
end
end
expose(:teams) { Team.order('lower(name)').paginate(:page => params[:page]) }
def index
end
def show
end
def new
end
def create
team.captain = current_user
if team.save
redirect_to teams_url
else
render :new
end
end
def join
current_user.teams << team
redirect_to team
end
end

9
app/controllers/user_logs_controller.rb

@ -1,9 +0,0 @@
class UserLogsController < ActsAsLoggable::LogsController
before_filter :set_loggable_type
private
def set_loggable_type
@loggable_type = 'User'
end
end

8
app/views/acts_as_loggable/bike_actions/_form.html.haml

@ -1,8 +0,0 @@
= form_for bike_action, :html => { :class => 'form-horizontal' } do |f|
.control-group
= f.label :action, :class => 'control-label'
.controls
= f.text_field :action, :class => 'text_field'
.form-actions
= f.submit nil, :class => 'btn btn-primary'
= link_to t('.cancel', :default => t("helpers.links.cancel")), acts_as_loggable_bike_actions_path, :class => 'btn'

4
app/views/acts_as_loggable/bike_actions/edit.html.haml

@ -1,4 +0,0 @@
- model_class = bike_action.class
.page-header
%h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}")
= render :partial => "form"

21
app/views/acts_as_loggable/bike_actions/index.html.haml

@ -1,21 +0,0 @@
- model_class = ActsAsLoggable::BikeAction.new.class
.page-header
%h1=t '.title', :default => model_class.model_name.human.pluralize
%table.table.table-striped
%thead
%tr
%th= model_class.human_attribute_name(:id)
%th= model_class.human_attribute_name(:action)
%th= model_class.human_attribute_name(:created_at)
%th=t '.actions', :default => t("helpers.actions")
%tbody
- bike_actions.each do |bike_action|
%tr
%td= link_to bike_action.id, acts_as_loggable_bike_action_path(bike_action)
%td= bike_action.action
%td=l bike_action.created_at
%td
= link_to t('.edit', :default => t("helpers.links.edit")), edit_acts_as_loggable_bike_action_path(bike_action), :class => 'btn btn-mini'
= link_to t('.destroy', :default => t("helpers.links.destroy")), acts_as_loggable_bike_action_path(bike_action), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger'
= link_to t('.new', :default => t("helpers.links.new")), new_acts_as_loggable_bike_action_path, :class => 'btn btn-primary'

4
app/views/acts_as_loggable/bike_actions/new.html.haml

@ -1,4 +0,0 @@
- model_class = bike_action.class
.page-header
%h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
= render :partial => "form"

13
app/views/acts_as_loggable/bike_actions/show.html.haml

@ -1,13 +0,0 @@
- model_class = bike_action.class
.page-header
%h1=t '.title', :default => model_class.model_name.human
%p
%strong= model_class.human_attribute_name(:action) + ':'
%br
= bike_action.action
.form-actions
= link_to t('.back', :default => t("helpers.links.back")), acts_as_loggable_bike_actions_path, :class => 'btn'
= link_to t('.edit', :default => t("helpers.links.edit")), edit_acts_as_loggable_bike_action_path(bike_action), :class => 'btn'
= link_to t('.destroy', :default => t("helpers.links.destroy")), acts_as_loggable_bike_action_path(bike_action), :method => "delete", :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-danger'

47
app/views/acts_as_loggable/logs/_form.html.haml

@ -1,47 +0,0 @@
= form_for @log, :html => { :class => 'form-horizontal' }, :url => @log.loggable_path do |f|
- if @log.loggable_type or @log.loggable_id
= f.hidden_field :loggable_id, :class => 'number_field'
= f.hidden_field :loggable_type, :class => 'text_field'
= f.hidden_field :logger_id, :class => 'number_field'
= f.hidden_field :logger_type, :class => 'text_field'
= f.hidden_field :context, :class => 'text_field'
- else
.control-group
= f.label :loggable_id, :class => 'control-label'
.controls
= f.number_field :loggable_id, :class => 'number_field'
.control-group
= f.label :loggable_type, :class => 'control-label'
.controls
= f.text_field :loggable_type, :class => 'text_field'
.control-group
= f.label :logger_id, :class => 'control-label'
.controls
= f.number_field :logger_id, :class => 'number_field'
.control-group
= f.label :logger_type, :class => 'control-label'
.controls
= f.text_field :logger_type, :class => 'text_field'
.control-group
= f.label :context, :class => 'control-label'
.controls
= f.text_field :context, :class => 'text_field'
.control-group
= f.label :start_date, :class => 'control-label'
.controls
= f.datetime_select :start_date, :class => 'datetime_select'
.control-group
= f.label :end_date, :class => 'control-label'
.controls
= f.datetime_select :end_date, :class => 'datetime_select'
.control-group
= f.label :description, :class => 'control-label'
.controls
= f.text_area :description, :class => 'text_area'
.control-group
= f.label :action_id, :class => 'control-label'
.controls
= f.number_field :action_id, :class => 'number_field'
.form-actions
= f.submit nil, :class => 'btn btn-primary'
= link_to t('.cancel', :default => t("helpers.links.cancel")), @log.loggable_path, :class => 'btn'

4
app/views/acts_as_loggable/logs/edit.html.haml

@ -1,4 +0,0 @@
- model_class = @log.class
.page-header
%h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}")
= render :partial => "form"

36
app/views/acts_as_loggable/logs/index.html.haml

@ -1,36 +0,0 @@
- model_class = ActsAsLoggable::Log.new.class
.page-header
%h1=t '.title', :default => model_class.model_name.human.pluralize
%table.table.table-striped
%thead
%tr
%th= model_class.human_attribute_name(:id)
%th= model_class.human_attribute_name(:loggable_id)
%th= model_class.human_attribute_name(:loggable_type)
%th= model_class.human_attribute_name(:logger_id)
%th= model_class.human_attribute_name(:logger_type)
%th= model_class.human_attribute_name(:context)
%th= model_class.human_attribute_name(:start_date)
%th= model_class.human_attribute_name(:end_date)
%th= model_class.human_attribute_name(:description)
%th= model_class.human_attribute_name(:action_id)
%th= model_class.human_attribute_name(:created_at)
%th=t '.actions', :default => t("helpers.actions")
%tbody
- @logs.each do |log|
%tr
%td= link_to log.id, acts_as_loggable_log_path(log)
%td= log.loggable_id
%td= log.loggable_type
%td= log.logger_id
%td= log.logger_type
%td= log.context
%td= log.start_date
%td= log.end_date
%td= log.description
%td= log.action
%td=l log.created_at
%td
= link_to t('.edit', :default => t("helpers.links.edit")), edit_acts_as_loggable_log_path(log), :class => 'btn btn-mini'
= link_to t('.destroy', :default => t("helpers.links.destroy")), acts_as_loggable_log_path(log), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger'
= link_to t('.new', :default => t("helpers.links.new")), "#{@loggable_path}/new", :class => 'btn btn-primary'

4
app/views/acts_as_loggable/logs/new.html.haml

@ -1,4 +0,0 @@
- model_class = @log.class
.page-header
%h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
= render :partial => "form"

8
app/views/acts_as_loggable/transaction_actions/_form.html.haml

@ -1,8 +0,0 @@
= form_for transaction_action, :html => { :class => 'form-horizontal' } do |f|
.control-group
= f.label :action, :class => 'control-label'
.controls
= f.text_field :action, :class => 'text_field'
.form-actions
= f.submit nil, :class => 'btn btn-primary'
= link_to t('.cancel', :default => t("helpers.links.cancel")), acts_as_loggable_transaction_actions_path, :class => 'btn'

4
app/views/acts_as_loggable/transaction_actions/edit.html.haml

@ -1,4 +0,0 @@
- model_class = transaction_action.class
.page-header
%h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}")
= render :partial => "form"

21
app/views/acts_as_loggable/transaction_actions/index.html.haml

@ -1,21 +0,0 @@
- model_class = ActsAsLoggable::TransactionAction.new.class
.page-header
%h1=t '.title', :default => model_class.model_name.human.pluralize
%table.table.table-striped
%thead
%tr
%th= model_class.human_attribute_name(:id)
%th= model_class.human_attribute_name(:action)
%th= model_class.human_attribute_name(:created_at)
%th=t '.actions', :default => t("helpers.actions")
%tbody
- transaction_actions.each do |transaction_action|
%tr
%td= link_to transaction_action.id, acts_as_loggable_transaction_action_path(transaction_action)
%td= transaction_action.action
%td=l transaction_action.created_at
%td
= link_to t('.edit', :default => t("helpers.links.edit")), edit_acts_as_loggable_transaction_action_path(transaction_action), :class => 'btn btn-mini'
= link_to t('.destroy', :default => t("helpers.links.destroy")), acts_as_loggable_transaction_action_path(transaction_action), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger'
= link_to t('.new', :default => t("helpers.links.new")), new_acts_as_loggable_transaction_action_path, :class => 'btn btn-primary'

4
app/views/acts_as_loggable/transaction_actions/new.html.haml

@ -1,4 +0,0 @@
- model_class = transaction_action.class
.page-header
%h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
= render :partial => "form"

13
app/views/acts_as_loggable/transaction_actions/show.html.haml

@ -1,13 +0,0 @@
- model_class = transaction_action.class
.page-header
%h1=t '.title', :default => model_class.model_name.human
%p
%strong= model_class.human_attribute_name(:action) + ':'
%br
= transaction_action.action
.form-actions
= link_to t('.back', :default => t("helpers.links.back")), acts_as_loggable_transaction_actions_path, :class => 'btn'
= link_to t('.edit', :default => t("helpers.links.edit")), edit_acts_as_loggable_transaction_action_path(transaction_action), :class => 'btn'
= link_to t('.destroy', :default => t("helpers.links.destroy")), acts_as_loggable_transaction_action_path(transaction_action), :method => "delete", :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-danger'

8
app/views/acts_as_loggable/user_actions/_form.html.haml

@ -1,8 +0,0 @@
= form_for user_action, :html => { :class => 'form-horizontal' } do |f|
.control-group
= f.label :action, :class => 'control-label'
.controls
= f.text_field :action, :class => 'text_field'
.form-actions
= f.submit nil, :class => 'btn btn-primary'
= link_to t('.cancel', :default => t("helpers.links.cancel")), acts_as_loggable_user_actions_path, :class => 'btn'

4
app/views/acts_as_loggable/user_actions/edit.html.haml

@ -1,4 +0,0 @@
- model_class = user_action.class
.page-header
%h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}")
= render :partial => "form"

21
app/views/acts_as_loggable/user_actions/index.html.haml

@ -1,21 +0,0 @@
- model_class = ActsAsLoggable::UserAction.new.class
.page-header
%h1=t '.title', :default => model_class.model_name.human.pluralize
%table.table.table-striped
%thead
%tr
%th= model_class.human_attribute_name(:id)
%th= model_class.human_attribute_name(:action)
%th= model_class.human_attribute_name(:created_at)
%th=t '.actions', :default => t("helpers.actions")
%tbody
- user_actions.each do |user_action|
%tr
%td= link_to user_action.id, acts_as_loggable_user_action_path(user_action)
%td= user_action.action
%td=l user_action.created_at
%td
= link_to t('.edit', :default => t("helpers.links.edit")), edit_acts_as_loggable_user_action_path(user_action), :class => 'btn btn-mini'
= link_to t('.destroy', :default => t("helpers.links.destroy")), acts_as_loggable_user_action_path(user_action), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger'
= link_to t('.new', :default => t("helpers.links.new")), new_acts_as_loggable_user_action_path, :class => 'btn btn-primary'

4
app/views/acts_as_loggable/user_actions/new.html.haml

@ -1,4 +0,0 @@
- model_class = user_action.class
.page-header
%h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
= render :partial => "form"

13
app/views/acts_as_loggable/user_actions/show.html.haml

@ -1,13 +0,0 @@
- model_class = user_action.class
.page-header
%h1=t '.title', :default => model_class.model_name.human
%p
%strong= model_class.human_attribute_name(:action) + ':'
%br
= user_action.action
.form-actions
= link_to t('.back', :default => t("helpers.links.back")), acts_as_loggable_user_actions_path, :class => 'btn'
= link_to t('.edit', :default => t("helpers.links.edit")), edit_acts_as_loggable_user_action_path(user_action), :class => 'btn'
= link_to t('.destroy', :default => t("helpers.links.destroy")), acts_as_loggable_user_action_path(user_action), :method => "delete", :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-danger'

8
app/views/bike_brands/_form.html.haml

@ -1,8 +0,0 @@
= form_for bike_brand, :html => { :class => 'form-horizontal' } do |f|
.control-group
= f.label :brand, :class => 'control-label'
.controls
= f.text_field :brand, :class => 'text_field'
.form-actions
= f.submit nil, :class => 'btn btn-primary'
= link_to t('.cancel', :default => t("helpers.links.cancel")), bike_brands_path, :class => 'btn'

15
app/views/bike_brands/index.html.haml

@ -1,15 +0,0 @@
- model_class = BikeBrand.new.class
.page-header
%h1=t '.title', :default => model_class.model_name.human.pluralize
%table.table.table-striped
%thead
%tr
%th= model_class.human_attribute_name(:id)
%th= model_class.human_attribute_name(:brand)
%tbody
- bike_brands.each do |bike_brand|
%tr
%td= link_to bike_brand.id, bike_brand_path(bike_brand)
%td= link_to bike_brand.brand, bike_brand_path(bike_brand)
= will_paginate bike_brands
= link_to t('.new', :default => t("helpers.links.new")), new_bike_brand_path, :class => 'btn btn-primary'

4
app/views/bike_brands/new.html.haml

@ -1,4 +0,0 @@
- model_class = bike_brand.class
.page-header
%h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
= render :partial => "form"

22
app/views/bike_brands/show.html.haml

@ -1,22 +0,0 @@
- model_class = bike_brand.class
.page-header
%h1=t '.title', :default => model_class.model_name.human
%p
%strong= model_class.human_attribute_name(:brand) + ':'
%br
= bike_brand.brand
%table.table.table-striped
%thead
%tr
%th= model_class.human_attribute_name(:id)
%th= model_class.human_attribute_name(:model)
%tbody
- bike_brand.models.each do |bike_model|
%tr
%td= link_to bike_model.id, bike_model_path(bike_model)
%td= link_to bike_model, bike_model_path(bike_model)
.form-actions
= link_to t('.back', :default => t("helpers.links.back")), bike_brands_path, :class => 'btn'

8
app/views/bike_conditions/_form.html.haml

@ -1,8 +0,0 @@
= form_for bike_condition, :html => { :class => 'form-horizontal' } do |f|
.control-group
= f.label :condition, :class => 'control-label'
.controls
= f.text_field :condition, :class => 'text_field'
.form-actions
= f.submit nil, :class => 'btn btn-primary'
= link_to t('.cancel', :default => t("helpers.links.cancel")), bike_conditions_path, :class => 'btn'

4
app/views/bike_conditions/edit.html.haml

@ -1,4 +0,0 @@
- model_class = bike_condition.class
.page-header
%h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}")
= render :partial => "form"

21
app/views/bike_conditions/index.html.haml

@ -1,21 +0,0 @@
- model_class = BikeCondition.new.class
.page-header
%h1=t '.title', :default => model_class.model_name.human.pluralize
%table.table.table-striped
%thead
%tr
%th= model_class.human_attribute_name(:id)
%th= model_class.human_attribute_name(:condition)
%th= model_class.human_attribute_name(:created_at)
%th=t '.actions', :default => t("helpers.actions")
%tbody
- bike_conditions.each do |bike_condition|
%tr
%td= link_to bike_condition.id, bike_condition_path(bike_condition)
%td= bike_condition.condition
%td=l bike_condition.created_at
%td
= link_to t('.edit', :default => t("helpers.links.edit")), edit_bike_condition_path(bike_condition), :class => 'btn btn-mini'
= link_to t('.destroy', :default => t("helpers.links.destroy")), bike_condition_path(bike_condition), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger'
= link_to t('.new', :default => t("helpers.links.new")), new_bike_condition_path, :class => 'btn btn-primary'

4
app/views/bike_conditions/new.html.haml

@ -1,4 +0,0 @@
- model_class = bike_condition.class
.page-header
%h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
= render :partial => "form"

13
app/views/bike_conditions/show.html.haml

@ -1,13 +0,0 @@
- model_class = bike_condition.class
.page-header
%h1=t '.title', :default => model_class.model_name.human
%p
%strong= model_class.human_attribute_name(:condition) + ':'
%br
= bike_condition.condition
.form-actions
= link_to t('.back', :default => t("helpers.links.back")), bike_conditions_path, :class => 'btn'
= link_to t('.edit', :default => t("helpers.links.edit")), edit_bike_condition_path(bike_condition), :class => 'btn'
= link_to t('.destroy', :default => t("helpers.links.destroy")), bike_condition_path(bike_condition), :method => "delete", :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-danger'

12
app/views/bike_models/_form.html.haml

@ -1,12 +0,0 @@
= form_for bike_model, :html => { :class => 'form-horizontal' } do |f|
.control-group
= f.label :model, :class => 'control-label'
.controls
= f.text_field :model, :class => 'text_field'
.control-group
= f.label :bike_brand_id, :class => 'control-label'
.controls
= f.number_field :bike_brand_id, :class => 'number_field'
.form-actions
= f.submit nil, :class => 'btn btn-primary'
= link_to t('.cancel', :default => t("helpers.links.cancel")), bike_models_path, :class => 'btn'

4
app/views/bike_models/edit.html.haml

@ -1,4 +0,0 @@
- model_class = bike_model.class
.page-header
%h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}")
= render :partial => "form"

17
app/views/bike_models/index.html.haml

@ -1,17 +0,0 @@
- model_class = BikeModel.new.class
.page-header
%h1=t '.title', :default => model_class.model_name.human.pluralize
%table.table.table-striped
%thead
%tr
%th= model_class.human_attribute_name(:id)
%th= model_class.human_attribute_name(:model)
%th= model_class.human_attribute_name(:bike_brand_id)
%tbody
- bike_models.each do |bike_model|
%tr
%td= link_to bike_model.id, bike_model_path(bike_model)
%td= bike_model.model
%td= link_to bike_model.brand, bike_brand_path(bike_model.brand)
= will_paginate bike_models
= link_to t('.new', :default => t("helpers.links.new")), new_bike_model_path, :class => 'btn btn-primary'

4
app/views/bike_models/new.html.haml

@ -1,4 +0,0 @@
- model_class = bike_model.class
.page-header
%h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
= render :partial => "form"

15
app/views/bike_models/show.html.haml

@ -1,15 +0,0 @@
- model_class = bike_model.class
.page-header
%h1=t '.title', :default => model_class.model_name.human
%p
%strong= model_class.human_attribute_name(:model) + ':'
%br
= bike_model.model
%p
%strong= model_class.human_attribute_name(:bike_brand_id) + ':'
%br
= link_to bike_model.brand, bike_brand_path(bike_model.brand)
.form-actions
= link_to t('.back', :default => t("helpers.links.back")), bike_models_path, :class => 'btn'

8
app/views/bike_statuses/_form.html.haml

@ -1,8 +0,0 @@
= form_for bike_status, :html => { :class => 'form-horizontal' } do |f|
.control-group
= f.label :status, :class => 'control-label'
.controls
= f.text_field :status, :class => 'text_field'
.form-actions
= f.submit nil, :class => 'btn btn-primary'
= link_to t('.cancel', :default => t("helpers.links.cancel")), bike_statuses_path, :class => 'btn'

4
app/views/bike_statuses/edit.html.haml

@ -1,4 +0,0 @@
- model_class = bike_status.class
.page-header
%h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}")
= render :partial => "form"

21
app/views/bike_statuses/index.html.haml

@ -1,21 +0,0 @@
- model_class = BikeStatus.new.class
.page-header
%h1=t '.title', :default => model_class.model_name.human.pluralize
%table.table.table-striped
%thead
%tr
%th= model_class.human_attribute_name(:id)
%th= model_class.human_attribute_name(:status)
%th= model_class.human_attribute_name(:created_at)
%th=t '.actions', :default => t("helpers.actions")
%tbody
- bike_statuses.each do |bike_status|
%tr
%td= link_to bike_status.id, bike_status_path(bike_status)
%td= bike_status.status
%td=l bike_status.created_at
%td
= link_to t('.edit', :default => t("helpers.links.edit")), edit_bike_status_path(bike_status), :class => 'btn btn-mini'
= link_to t('.destroy', :default => t("helpers.links.destroy")), bike_status_path(bike_status), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger'
= link_to t('.new', :default => t("helpers.links.new")), new_bike_status_path, :class => 'btn btn-primary'

4
app/views/bike_statuses/new.html.haml

@ -1,4 +0,0 @@
- model_class = bike_status.class
.page-header
%h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
= render :partial => "form"

13
app/views/bike_statuses/show.html.haml

@ -1,13 +0,0 @@
- model_class = bike_status.class
.page-header
%h1=t '.title', :default => model_class.model_name.human
%p
%strong= model_class.human_attribute_name(:status) + ':'
%br
= bike_status.status
.form-actions
= link_to t('.back', :default => t("helpers.links.back")), bike_statuses_path, :class => 'btn'
= link_to t('.edit', :default => t("helpers.links.edit")), edit_bike_status_path(bike_status), :class => 'btn'
= link_to t('.destroy', :default => t("helpers.links.destroy")), bike_status_path(bike_status), :method => "delete", :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-danger'

8
app/views/bike_styles/_form.html.haml

@ -1,8 +0,0 @@
= form_for bike_style, :html => { :class => 'form-horizontal' } do |f|
.control-group
= f.label :style, :class => 'control-label'
.controls
= f.text_field :style, :class => 'text_field'
.form-actions
= f.submit nil, :class => 'btn btn-primary'
= link_to t('.cancel', :default => t("helpers.links.cancel")), bike_styles_path, :class => 'btn'

4
app/views/bike_styles/edit.html.haml

@ -1,4 +0,0 @@
- model_class = bike_style.class
.page-header
%h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}")
= render :partial => "form"

21
app/views/bike_styles/index.html.haml

@ -1,21 +0,0 @@
- model_class = BikeStyle.new.class
.page-header
%h1=t '.title', :default => model_class.model_name.human.pluralize
%table.table.table-striped
%thead
%tr
%th= model_class.human_attribute_name(:id)
%th= model_class.human_attribute_name(:style)
%th= model_class.human_attribute_name(:created_at)
%th=t '.actions', :default => t("helpers.actions")
%tbody
- bike_styles.each do |bike_style|
%tr
%td= link_to bike_style.id, bike_style_path(bike_style)
%td= bike_style.style
%td=l bike_style.created_at
%td
= link_to t('.edit', :default => t("helpers.links.edit")), edit_bike_style_path(bike_style), :class => 'btn btn-mini'
= link_to t('.destroy', :default => t("helpers.links.destroy")), bike_style_path(bike_style), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger'
= link_to t('.new', :default => t("helpers.links.new")), new_bike_style_path, :class => 'btn btn-primary'

4
app/views/bike_styles/new.html.haml

@ -1,4 +0,0 @@
- model_class = bike_style.class
.page-header
%h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
= render :partial => "form"

13
app/views/bike_styles/show.html.haml

@ -1,13 +0,0 @@
- model_class = bike_style.class
.page-header
%h1=t '.title', :default => model_class.model_name.human
%p
%strong= model_class.human_attribute_name(:style) + ':'
%br
= bike_style.style
.form-actions
= link_to t('.back', :default => t("helpers.links.back")), bike_styles_path, :class => 'btn'
= link_to t('.edit', :default => t("helpers.links.edit")), edit_bike_style_path(bike_style), :class => 'btn'
= link_to t('.destroy', :default => t("helpers.links.destroy")), bike_style_path(bike_style), :method => "delete", :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-danger'

48
app/views/bikes/_form.html.haml

@ -1,48 +0,0 @@
= form_for bike, :html => { :class => 'form-horizontal' } do |f|
.control-group
= f.label :serial_number, :class => 'control-label'
.controls
= f.text_field :serial_number, :class => 'text_field'
.control-group
= f.label :bike_brand_id, :class => 'control-label'
.controls
= f.number_field :bike_brand_id, :class => 'number_field'
.control-group
= f.label :bike_model_id, :class => 'control-label'
.controls
= f.number_field :bike_model_id, :class => 'number_field'
.control-group
= f.label :color, :class => 'control-label'
.controls
= f.text_field :color, :class => 'text_field'
.control-group
= f.label :bike_style_id, :class => 'control-label'
.controls
= f.number_field :bike_style_id, :class => 'number_field'
.control-group
= f.label :seat_tube_height, :class => 'control-label'
.controls
= f.text_field :seat_tube_height, :class => 'text_field'
.control-group
= f.label :top_tube_length, :class => 'control-label'
.controls
= f.text_field :top_tube_length, :class => 'text_field'
.control-group
= f.label :wheel_size, :class => 'control-label'
.controls
= f.number_field :wheel_size, :class => 'number_field'
.control-group
= f.label :value, :class => 'control-label'
.controls
= f.text_field :value, :class => 'text_field'
.control-group
= f.label :bike_condition_id, :class => 'control-label'
.controls
= f.text_field :bike_condition_id, :class => 'text_field'
.control-group
= f.label :bike_status_id, :class => 'control-label'
.controls
= f.number_field :bike_status_id, :class => 'number_field'
.form-actions
= f.submit nil, :class => 'btn btn-primary'
= link_to t('.cancel', :default => t("helpers.links.cancel")), bikes_path, :class => 'btn'

4
app/views/bikes/edit.html.haml

@ -1,4 +0,0 @@
- model_class = bike.class
.page-header
%h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}")
= render :partial => "form"

41
app/views/bikes/index.html.haml

@ -1,41 +0,0 @@
- model_class = Bike.new.class
.page-header
%h1=t '.title', :default => model_class.model_name.human.pluralize
%table.table.table-striped
%thead
%tr
%th= model_class.human_attribute_name(:id)
%th= model_class.human_attribute_name(:serial_number)
%th= model_class.human_attribute_name(:bike_brand_id)
%th= model_class.human_attribute_name(:bike_model_id)
%th= model_class.human_attribute_name(:color)
%th= model_class.human_attribute_name(:bike_style_id)
%th= model_class.human_attribute_name(:seat_tube_height)
%th= model_class.human_attribute_name(:top_tube_length)
%th= model_class.human_attribute_name(:wheel_size)
%th= model_class.human_attribute_name(:value)
%th= model_class.human_attribute_name(:bike_condition_id)
%th= model_class.human_attribute_name(:bike_status_id)
%th= model_class.human_attribute_name(:created_at)
%th=t '.actions', :default => t("helpers.actions")
%tbody
- bikes.each do |bike|
%tr
%td= link_to bike.id, bike_path(bike)
%td= link_to bike.serial_number, bike_path(bike)
%td= bike.brand
%td= bike.model
%td= bike.color
%td= bike.style
%td= bike.seat_tube_height
%td= bike.top_tube_length
%td= bike.wheel_size
%td= bike.value
%td= bike.condition
%td= bike.status
%td= bike.created_at
%td
= link_to t('.edit', :default => t("helpers.links.edit")), edit_bike_path(bike), :class => 'btn btn-mini'
= link_to t('.destroy', :default => t("helpers.links.destroy")), bike_path(bike), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger'
= will_paginate bikes
= link_to t('.new', :default => t("helpers.links.new")), new_bike_path, :class => 'btn btn-primary'

4
app/views/bikes/new.html.haml

@ -1,4 +0,0 @@
- model_class = bike.class
.page-header
%h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
= render :partial => "form"

53
app/views/bikes/show.html.haml

@ -1,53 +0,0 @@
- model_class = bike.class
.page-header
%h1=t '.title', :default => model_class.model_name.human
%p
%strong= model_class.human_attribute_name(:serial_number) + ':'
%br
= bike.serial_number
%p
%strong= model_class.human_attribute_name(:bike_brand_id) + ':'
%br
= bike.brand
%p
%strong= model_class.human_attribute_name(:bike_model_id) + ':'
%br
= bike.model
%p
%strong= model_class.human_attribute_name(:color) + ':'
%br
= bike.color
%p
%strong= model_class.human_attribute_name(:bike_style_id) + ':'
%br
= bike.style
%p
%strong= model_class.human_attribute_name(:seat_tube_height) + ':'
%br
= bike.seat_tube_height
%p
%strong= model_class.human_attribute_name(:top_tube_length) + ':'
%br
= bike.top_tube_length
%p
%strong= model_class.human_attribute_name(:wheel_size) + ':'
%br
= bike.wheel_size
%p
%strong= model_class.human_attribute_name(:value) + ':'
%br
= bike.value
%p
%strong= model_class.human_attribute_name(:bike_condition_id) + ':'
%br
= bike.condition
%p
%strong= model_class.human_attribute_name(:bike_status_id) + ':'
%br
= bike.status
.form-actions
= link_to t('.back', :default => t("helpers.links.back")), bikes_path, :class => 'btn'
= link_to t('.edit', :default => t("helpers.links.edit")), edit_bike_path(bike), :class => 'btn'
= link_to t('.destroy', :default => t("helpers.links.destroy")), bike_path(bike), :method => "delete", :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-danger'

1
app/views/site/index.html.haml

@ -1 +0,0 @@
Do the monster mash!

9
app/views/teams_examples/index.html.haml

@ -1,9 +0,0 @@
%p
= link_to 'Create a Team', new_team_path, :class => 'btn btn-large btn-primary'
.teams
- teams.each do |team|
%h3.team= link_to team, team
= will_paginate teams

21
app/views/teams_examples/new.html.haml

@ -1,21 +0,0 @@
= form_for team, :html => { :class => 'form-horizontal' } do |f|
.control-group{:class => team.errors[:name].present? ? 'error' : ''}
= f.label :name, 'Name', :class => 'control-label'
.controls
= f.text_field :name
- if team.errors[:name].present?
.help-inline= team.errors[:name].join(', ')
.control-group{:class => team.errors[:max_members].present? ? 'error' : ''}
= f.label :max_members, 'Max members', :class => 'control-label'
.controls
= f.text_field :max_members
- if team.errors[:max_members].present?
.help-inline= team.errors[:max_members].join(', ')
.control-group{:class => team.errors[:private_team].present? ? 'error' : ''}
= f.label :private_team, 'Private team?', :class => 'control-label'
.controls
= f.check_box :private_team
- if team.errors[:private_team].present?
.help-inline= team.errors[:private_team].join(', ')
.form-actions
= f.submit 'Create Team', :class => 'btn btn-primary'

11
app/views/teams_examples/show.html.haml

@ -1,11 +0,0 @@
%h3= team
%ul.members
%li= team.captain
- team.members.each do |member|
%li= member
- unless current_user.is_a_member_of?(team)
= form_tag join_team_path(team) do
= submit_tag 'Join team', :class => 'btn'

35
config/routes.rb

@ -2,41 +2,6 @@ Velocipede::Application.routes.draw do
devise_for :users
netzke
=begin
resources :users
# The priority is based upon order of creation:
# first created -> highest priority.
match 'site/index' => 'site#index'
=end
resources :bike_brands, :except => [:edit, :delete]
resources :bike_models, :except => [:edit, :delete]
resources :bike_statuses
resources :bike_styles
resources :bike_conditions
resources :bikes
namespace :acts_as_loggable do
resources :logs
resources :bike_actions
resources :user_actions
resources :transaction_actions
end
#user logs
get 'users/:loggable_id/logs' => 'user_logs#index', :as => 'user_logs'
get 'users/:loggable_id/logs/new' => 'user_logs#new', :as => 'new_user_log'
post 'users/:loggable_id/logs' => 'user_logs#create'
get 'users/:loggable_id/logs/:id/edit' => 'user_logs#edit', :as => 'edit_bike_log'
#bike logs
get 'bikes/:loggable_id/logs' => 'bike_logs#index', :as => 'bike_logs'
get 'bikes/:loggable_id/logs/new' => 'bike_logs#new', :as => 'new_bike_log'
post 'bikes/:loggable_id/logs' => 'bike_logs#create'
get 'bikes/:loggable_id/logs/:id/edit' => 'bike_logs#edit', :as => 'edit_bike_log'
#match ':loggable_type/:loggable_id/logs' => 'acts_as_loggable/logs#index', :as => 'loggable_logs'
root :to => 'site#index'
end

Loading…
Cancel
Save