diff --git a/.gitignore b/.gitignore index 6793344..b5346ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,42 +1,9 @@ -# database -db - -# rdoc generated -rdoc - -# yard generated -doc -.yardoc - -# bundler .bundle -*.gem - -# jeweler generated -pkg - -# -# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line) -# -# For MacOS: -# +.config +.yardoc +tmp +.idea +.yardoc +.sass-cache .DS_Store - -# For TextMate -#*.tmproj -#tmtags - -# For emacs: -#*~ -#\#* -#.\#* - -# For vim: -#*.swp - - -# Object files -*.o -log - -tmp/ +compiled \ No newline at end of file diff --git a/Gemfile b/Gemfile index 414d782..343a39d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'volt', :path => "../volt" +gem 'volt', '0.9.4' # volt uses mongo as the default data store. gem 'volt-mongo', '~> 0.1.0' @@ -9,16 +9,28 @@ gem 'volt-mongo', '~> 0.1.0' # Twitter bootstrap gem 'volt-bootstrap', '~> 0.0.10' +# Simple theme for bootstrap, remove to theme yourself. +gem 'volt-bootstrap_jumbotron_theme', '~> 0.1.0' + +# User templates for login, signup, and logout menu. +gem 'volt-user_templates', '~> 0.4.0' + +# Add ability to send e-mail from apps. +gem 'volt-mailer', '~> 0.1.0' + +# Use rbnacl for message bus encrpytion +# (optional, if you don't need encryption, disable in app.rb and remove) +# +# Message Bus encryption is not supported on Windows at the moment. +platform :ruby, :jruby do + gem 'rbnacl', require: false + gem 'rbnacl-libsodium', require: false +end + # Asset compilation gems, they will be required when needed. gem 'csso-rails', '~> 0.3.4', require: false gem 'uglifier', '>= 2.4.0', require: false -gem "parslet" , path: "../parslet" -#gem "salama" , path: "../salama" -gem "salama-reader" , path: "../salama-reader" -gem "salama-object-file" , path: "../salama-object-file" - - group :test do # Testing dependencies gem 'rspec', '~> 3.2.0' diff --git a/Gemfile.lock b/Gemfile.lock index 157b044..090270c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,36 +1,3 @@ -PATH - remote: ../parslet - specs: - parslet (1.7.0) - -PATH - remote: ../salama-object-file - specs: - salama-object-file (0.2.0) - -PATH - remote: ../salama-reader - specs: - salama-reader (0.2.0) - parslet (~> 1.7.0) - -PATH - remote: ../volt - specs: - volt (0.9.4) - bcrypt (~> 3.1.9) - bundler (>= 1.5) - concurrent-ruby (= 0.8.0) - configurations (~> 2.0.0.pre) - faye-websocket (~> 0.9.2) - listen (~> 3.0.1) - opal (~> 0.7.2) - pry (~> 0.10.1) - rack (~> 1.5.0) - sass (~> 3.2.5) - sprockets-sass (~> 1.0.0) - thor (~> 0.19.0) - GEM remote: https://rubygems.org/ specs: @@ -67,9 +34,11 @@ GEM ffi (1.9.10) hike (1.2.3) json (1.8.3) - listen (3.0.2) + listen (3.0.3) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) + mail (2.6.3) + mime-types (>= 1.16, < 3) method_source (0.8.2) mime-types (2.6.1) mini_portile (0.6.2) @@ -90,6 +59,8 @@ GEM cliver (~> 0.3.1) multi_json (~> 1.0) websocket-driver (>= 0.2.0) + pony (1.11) + mail (>= 2.0) pry (0.10.1) coderay (~> 1.1.0) method_source (~> 0.8.1) @@ -100,6 +71,10 @@ GEM rb-fsevent (0.9.5) rb-inotify (0.9.5) ffi (>= 0.5.0) + rbnacl (3.2.0) + ffi + rbnacl-libsodium (1.0.3) + rbnacl (~> 3.0, >= 3.0.1) ref (1.0.5) rspec (3.2.0) rspec-core (~> 3.2.0) @@ -140,11 +115,31 @@ GEM uglifier (2.7.1) execjs (>= 0.3.0) json (>= 1.8.0) + volt (0.9.4) + bcrypt (~> 3.1.9) + bundler (>= 1.5) + concurrent-ruby (= 0.8.0) + configurations (~> 2.0.0.pre) + faye-websocket (~> 0.9.2) + listen (~> 3.0.1) + opal (~> 0.7.2) + pry (~> 0.10.1) + rack (~> 1.5.0) + sass (~> 3.2.5) + sprockets-sass (~> 1.0.0) + thor (~> 0.19.0) volt-bootstrap (0.0.10) + volt-bootstrap_jumbotron_theme (0.1.0) + volt-fields (0.1.3) + volt-mailer (0.1.0) + pony (~> 1.11) volt-mongo (0.1.1) mongo (~> 1.9.0) + volt-user_templates (0.4.0) + volt-fields (~> 0.1.0) + volt-mailer (~> 0.1.0) websocket (1.2.2) - websocket-driver (0.5.4) + websocket-driver (0.6.2) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) xpath (2.0.0) @@ -160,14 +155,19 @@ DEPENDENCIES concurrent-ruby-ext (~> 0.8.0) csso-rails (~> 0.3.4) opal-rspec (~> 0.4.2) - parslet! poltergeist (~> 1.5.0) + rbnacl + rbnacl-libsodium rspec (~> 3.2.0) - salama-object-file! - salama-reader! selenium-webdriver (~> 2.43.0) thin (~> 1.6.0) uglifier (>= 2.4.0) - volt! + volt (= 0.9.4) volt-bootstrap (~> 0.0.10) + volt-bootstrap_jumbotron_theme (~> 0.1.0) + volt-mailer (~> 0.1.0) volt-mongo (~> 0.1.0) + volt-user_templates (~> 0.4.0) + +BUNDLED WITH + 1.10.5 diff --git a/app/main/assets/css/app.css.scss b/app/main/assets/css/app.css.scss new file mode 100644 index 0000000..f64375c --- /dev/null +++ b/app/main/assets/css/app.css.scss @@ -0,0 +1 @@ +// Place your apps css here \ No newline at end of file diff --git a/app/main/config/dependencies.rb b/app/main/config/dependencies.rb new file mode 100644 index 0000000..c43f808 --- /dev/null +++ b/app/main/config/dependencies.rb @@ -0,0 +1,11 @@ +# Specify which components you wish to include when +# the "home" component loads. + +# bootstrap css framework +component 'bootstrap' + +# a default theme for the bootstrap framework +component 'bootstrap_jumbotron_theme' + +# provides templates for login, signup, and logout +component 'user_templates' diff --git a/app/main/config/initializers/boot.rb b/app/main/config/initializers/boot.rb new file mode 100644 index 0000000..a4bbae3 --- /dev/null +++ b/app/main/config/initializers/boot.rb @@ -0,0 +1,10 @@ +# Place any code you want to run when the component is included on the client +# or server. + +# To include code only on the client use: +# if RUBY_PLATFORM == 'opal' +# +# To include code only on the server, use: +# unless RUBY_PLATFORM == 'opal' +# ^^ this will not send compile in code in the conditional to the client. +# ^^ this include code required in the conditional. \ No newline at end of file diff --git a/app/main/config/routes.rb b/app/main/config/routes.rb new file mode 100644 index 0000000..6cfa548 --- /dev/null +++ b/app/main/config/routes.rb @@ -0,0 +1,14 @@ +# See https://github.com/voltrb/volt#routes for more info on routes + +client '/about', action: 'about' + +# Routes for login and signup, provided by user_templates component gem +client '/signup', component: 'user_templates', controller: 'signup' +client '/login', component: 'user_templates', controller: 'login', action: 'index' +client '/password_reset', component: 'user_templates', controller: 'password_reset', action: 'index' +client '/forgot', component: 'user_templates', controller: 'login', action: 'forgot' +client '/account', component: 'user_templates', controller: 'account', action: 'index' + +# The main route, this should be last. It will match any params not +# previously matched. +client '/', {} diff --git a/app/main/controllers/main_controller.rb b/app/main/controllers/main_controller.rb new file mode 100644 index 0000000..41ff0ca --- /dev/null +++ b/app/main/controllers/main_controller.rb @@ -0,0 +1,27 @@ +# By default Volt generates this controller for your Main component +module Main + class MainController < Volt::ModelController + def index + # Add code for when the index view is loaded + end + + def about + # Add code for when the about view is loaded + end + + private + + # The main template contains a #template binding that shows another + # template. This is the path to that template. It may change based + # on the params._component, params._controller, and params._action values. + def main_path + "#{params._component || 'main'}/#{params._controller || 'main'}/#{params._action || 'index'}" + end + + # Determine if the current nav component is the active one by looking + # at the first part of the url against the href attribute. + def active_tab? + url.path.split('/')[1] == attrs.href.split('/')[1] + end + end +end diff --git a/app/main/models/user.rb b/app/main/models/user.rb new file mode 100644 index 0000000..1dbf70a --- /dev/null +++ b/app/main/models/user.rb @@ -0,0 +1,12 @@ +# By default Volt generates this User model which inherits from Volt::User, +# you can rename this if you want. +class User < Volt::User + # login_field is set to :email by default and can be changed to :username + # in config/app.rb + field login_field + field :name + + validate login_field, unique: true, length: 8 + validate :email, email: true + +end diff --git a/app/main/views/main/about.html b/app/main/views/main/about.html new file mode 100644 index 0000000..7720e4c --- /dev/null +++ b/app/main/views/main/about.html @@ -0,0 +1,7 @@ +<:Title> + About + +<:Body> +
About page...
diff --git a/app/main/views/main/index.html b/app/main/views/main/index.html new file mode 100644 index 0000000..8838ea1 --- /dev/null +++ b/app/main/views/main/index.html @@ -0,0 +1,6 @@ +<:Title> + Home + +<:Body> +