Skip to content

Commit

Permalink
Base structure and sketchy dummy app
Browse files Browse the repository at this point in the history
  • Loading branch information
vala committed Feb 7, 2012
0 parents commit 886de17
Show file tree
Hide file tree
Showing 139 changed files with 6,022 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.bundle/
log/*.log
pkg/
test/dummy/db/*.sqlite3
test/dummy/log/*.log
test/dummy/tmp/
test/dummy/.sass-cache
16 changes: 16 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
source "http://rubygems.org"

# Declare your gem's dependencies in glysellin.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec

# jquery-rails is used by the dummy application
gem "jquery-rails"
gem "devise"
gem 'paperclip'

gem 'sass-rails', '~> 3.1'
gem 'bootstrap-sass', '~> 2.0.0'

gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git'
161 changes: 161 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
GIT
remote: git://github.com/sferik/rails_admin.git
revision: 8048e7d844c2bcf438037ac793dd9677ed6d4042
specs:
rails_admin (0.0.1)
bbenezech-nested_form (~> 0.0)
bootstrap-sass (~> 2.0)
builder (~> 3.0)
coffee-rails (~> 3.1)
haml (~> 3.1)
jquery-rails (>= 1.0)
kaminari (~> 0.12)
rack-pjax (~> 0.5)
rails (~> 3.1)
remotipart (~> 1.0)
sass-rails (~> 3.1)

PATH
remote: .
specs:
glysellin (0.0.1)
paperclip
rails (~> 3.2.0)

GEM
remote: http://rubygems.org/
specs:
actionmailer (3.2.1)
actionpack (= 3.2.1)
mail (~> 2.4.0)
actionpack (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.1)
rack (~> 1.4.0)
rack-cache (~> 1.1)
rack-test (~> 0.6.1)
sprockets (~> 2.1.2)
activemodel (3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
activerecord (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
arel (~> 3.0.0)
tzinfo (~> 0.3.29)
activeresource (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
activesupport (3.2.1)
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.0)
bbenezech-nested_form (0.0.2)
bcrypt-ruby (3.0.1)
bootstrap-sass (2.0.0)
builder (3.0.0)
cocaine (0.2.1)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.2.0)
devise (2.0.0)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
railties (~> 3.1)
warden (~> 1.1)
erubis (2.7.0)
execjs (1.3.0)
multi_json (~> 1.0)
haml (3.1.4)
hike (1.2.1)
hpricot (0.8.6)
i18n (0.6.0)
journey (1.0.1)
jquery-rails (2.0.0)
railties (< 5.0, >= 3.2.0.beta)
thor (~> 0.14)
json (1.6.5)
kaminari (0.13.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
mail (2.4.1)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.17.2)
multi_json (1.0.4)
mysql2 (0.3.11)
orm_adapter (0.0.6)
paperclip (2.5.2)
activerecord (>= 2.3.0)
activesupport (>= 2.3.2)
cocaine (>= 0.0.2)
mime-types
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.1)
rack (>= 0.4)
rack-pjax (0.5.7)
hpricot (~> 0.8.6)
rack (~> 1.3)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.2.1)
actionmailer (= 3.2.1)
actionpack (= 3.2.1)
activerecord (= 3.2.1)
activeresource (= 3.2.1)
activesupport (= 3.2.1)
bundler (~> 1.0)
railties (= 3.2.1)
railties (3.2.1)
actionpack (= 3.2.1)
activesupport (= 3.2.1)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
remotipart (1.0.2)
sass (3.1.12)
sass-rails (3.2.4)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
tilt (!= 1.3.0, ~> 1.1)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.31)
warden (1.1.0)
rack (>= 1.0)

PLATFORMS
ruby

DEPENDENCIES
bootstrap-sass (~> 2.0.0)
devise
glysellin!
jquery-rails
mysql2
paperclip
rails_admin!
sass-rails (~> 3.1)
20 changes: 20 additions & 0 deletions MIT-LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright 2012 Valentin Ballestrino

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Glysellin

Glysellin is a lightweight e-commerce solution that helps you get simple products, orders and payment gateways without the whole set of functionalities a real e-commerce needs.

It is exposed as a mountable engine so you can customize what you want.

29 changes: 29 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env rake
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
begin
require 'rdoc/task'
rescue LoadError
require 'rdoc/rdoc'
require 'rake/rdoctask'
RDoc::Task = Rake::RDocTask
end

RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'Glysellin'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end

APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'



Bundler::GemHelper.install_tasks

Empty file.
15 changes: 15 additions & 0 deletions app/assets/javascripts/glysellin/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require_tree .
2 changes: 2 additions & 0 deletions app/assets/javascripts/glysellin/orders.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
2 changes: 2 additions & 0 deletions app/assets/javascripts/glysellin/products.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
13 changes: 13 additions & 0 deletions app/assets/stylesheets/glysellin/application.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*/
4 changes: 4 additions & 0 deletions app/assets/stylesheets/glysellin/orders.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
Place all the styles related to the matching controller here.
They will automatically be included in application.css.
*/
4 changes: 4 additions & 0 deletions app/assets/stylesheets/glysellin/products.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
Place all the styles related to the matching controller here.
They will automatically be included in application.css.
*/
16 changes: 16 additions & 0 deletions app/controllers/glysellin/application_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module Glysellin
class ApplicationController < ActionController::Base
before_filter :init

protected
# Init before filter
def init
get_customer!
end

# Get current customer
def get_customer!
@active_customer = user_signed_in? ? current_user.customer : Customer.new(:id => 0)
end
end
end
43 changes: 43 additions & 0 deletions app/controllers/glysellin/orders_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module Glysellin
class OrdersController < ApplicationController
protect_from_forgery :except => :gateway_response

def index
@orders = @active_customer.orders
end

def show
user_order = Order.where('id = ? AND customer_id = ?', params[:id], @active_customer.id)
if user_order.length > 0
@order = user_order.first
else
flash[:alert] = t('glysellin.controllers.errors.order_doesnt_exist')
redirect_to :action => 'index'
end
end

def cart
end

def validate_cart
end

def fill_addresses
end

def validate_addresses
end

def recap
end

def offline_payment
end

def gateway_response
end

def payment_response
end
end
end
12 changes: 12 additions & 0 deletions app/controllers/glysellin/products_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module Glysellin
class ProductsController < ApplicationController
def index
end

def filter
end

def show
end
end
end
4 changes: 4 additions & 0 deletions app/helpers/glysellin/application_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Glysellin
module ApplicationHelper
end
end
4 changes: 4 additions & 0 deletions app/helpers/glysellin/orders_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Glysellin
module OrdersHelper
end
end
4 changes: 4 additions & 0 deletions app/helpers/glysellin/products_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Glysellin
module ProductsHelper
end
end
5 changes: 5 additions & 0 deletions app/models/glysellin/address.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Glysellin
class Address < ActiveRecord::Base
has_many :orders
end
end
Loading

0 comments on commit 886de17

Please sign in to comment.