<%= f.label :email, "Email:", :class => "fieldText" %>
<%= f.email_field :email %>
<%= f.label :password %>
+
<%= f.label :password, "Password:", :class => "fieldText" %>
<%= f.password_field :password %>
-
<%= f.label :password_confirmation %>
+
<%= f.label :password_confirmation, "Password Confirmation:", :class => "fieldText" %>
<%= f.password_field :password_confirmation %>
-
<%= f.label "Access Code" %>
- <%= f.text_field :joinedwithcode %>
+
<%= f.label "Access Code:", :class => "fieldText" %>
+ <%= f.text_field :joinedwithcode, :value => params[:code] %>
-
<%= f.submit "Sign up" %>
+
<%= f.submit "Sign up!" %>
-
+
Don't have an access code?
Request an Invite
<% end %>
-
+
diff --git a/app/views/users/sessions/new.html.erb b/app/views/users/sessions/new.html.erb
index ef9866f5..16836175 100644
--- a/app/views/users/sessions/new.html.erb
+++ b/app/views/users/sessions/new.html.erb
@@ -1,28 +1,32 @@
<% content_for :title, "Sign In | Metamaps" %>
-
Sign In
-
-<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :method => :post, :class => "new_user centerGreyForm" }) do |f| %>
-
Sign in
-
-
<%= f.label :email %>
- <%= f.email_field :email, :autofocus => true %>
-
-
<%= f.label :password %>
- <%= f.password_field :password %>
-
- <% if devise_mapping.rememberable? -%>
-
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
- <% end -%>
-
-
<%= f.submit "Sign in" %>
+
+<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :method => :post, :class => "centerGreyForm login" }) do |f| %>
+
SIGN IN
-
- <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
- <%= link_to "Forgot your password?", new_password_path(resource_name) %>
+
+
+ <%= f.email_field :email, :autofocus => true, :placeholder => "Email" %>
+
+
+ <%= f.password_field :password, :placeholder => "Password" %>
+
+
<%= f.submit "Sign in" %>
+
+ <% if devise_mapping.rememberable? -%>
+
+ <%= f.label :remember_me, "Stay signed in" %>
+ <%= f.check_box :remember_me %>
+
+
<% end -%>
-
-
+
+
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
+ <%= link_to "Forgot password?", new_password_path(resource_name),
+ :data => { :bypass => 'true'} %>
+ <% end -%>
+
<% end %>
-
+
diff --git a/bin/configure.sh b/bin/configure.sh
new file mode 100755
index 00000000..5d2b9751
--- /dev/null
+++ b/bin/configure.sh
@@ -0,0 +1,17 @@
+# Make sure we've got NFS handy.
+if [ $(uname) == 'Linux' ] && [ ! -e /etc/init.d/nfs-kernel-server ]; then
+ sudo apt-get install -y nfs-common nfs-kernel-server rpcbind
+fi
+
+# Vagrant up
+vagrant up
+
+# Bundle!
+vagrant ssh --command "cd /vagrant; gem install bundler";
+vagrant ssh --command "cd /vagrant; bundle install";
+
+# copy the db config
+vagrant ssh --command "cd /vagrant; cp .example-env .env";
+
+# Rake all the things
+vagrant ssh --command "cd /vagrant; rake db:create; rake db:setup"
diff --git a/bin/jenkins-test.sh b/bin/jenkins-test.sh
new file mode 100755
index 00000000..313c23b3
--- /dev/null
+++ b/bin/jenkins-test.sh
@@ -0,0 +1,24 @@
+#!/bin/bash -l
+
+#prerequisites
+#sudo aptitude -q -y install libpq-dev
+
+source "$HOME/.rvm/scripts/rvm"
+rvm use $(cat .ruby-version) || \
+ rvm install $(cat .ruby-version)
+rvm gemset use $(cat .ruby-gemset) || \
+ rvm gemset create $(cat .ruby-gemset) && \
+ rvm gemset use $(cat .ruby-gemset)
+gem install bundler
+
+set -x
+
+#configure environment
+export RAILS_ENV=test
+cp .example-env .env
+sed -i -e "s/DB_USERNAME='.*'/DB_USERNAME='jenkins'/" .env
+
+#test
+bundle install
+rake db:create db:test:prepare
+bundle exec rspec
diff --git a/bin/start b/bin/start
new file mode 100755
index 00000000..ed2b0130
--- /dev/null
+++ b/bin/start
@@ -0,0 +1,2 @@
+#start rails server and realtime node server
+vagrant ssh --command "cd /vagrant; rails s -d; forever start ./realtime/realtime-server.js"
\ No newline at end of file
diff --git a/bin/stop b/bin/stop
new file mode 100755
index 00000000..b8bdaeb6
--- /dev/null
+++ b/bin/stop
@@ -0,0 +1,2 @@
+# stop rails server and node server
+vagrant ssh --command "cd /vagrant; kill -9 $(cat tmp/pids/server.pid); forever stopall"
\ No newline at end of file
diff --git a/config.ru b/config.ru
index 8d2cc245..e83757ab 100644
--- a/config.ru
+++ b/config.ru
@@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
-run ISSAD::Application
+run Metamaps::Application
diff --git a/config/application.rb b/config/application.rb
index dc87d823..399b32c9 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,22 +1,21 @@
require File.expand_path('../boot', __FILE__)
require 'rails/all'
+require 'dotenv'
-if defined?(Bundler)
- # If you precompile assets before deploying to production, use this line
- Bundler.require(*Rails.groups(:assets => %w(development test)))
- # If you want your assets lazily compiled in production, use this line
- # Bundler.require(:default, :assets, Rails.env)
-end
+Bundler.require(*Rails.groups)
-module ISSAD
+ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
+Dotenv.load ".env.#{ENV["RAILS_ENV"]}", '.env'
+
+module Metamaps
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
- # config.autoload_paths += %W(#{config.root}/extras)
+ config.autoload_paths << Rails.root.join('app', 'services')
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
@@ -44,17 +43,15 @@ module ISSAD
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
- # Enforce whitelist mode for mass assignment.
- # This will create an empty whitelist of attributes available for mass-assignment for all models
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
- # parameters by using an attr_accessible or attr_protected declaration.
- # config.active_record.whitelist_attributes = true
-
# Enable the asset pipeline
- config.assets.enabled = true
config.assets.initialize_on_precompile = false
-
+
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '2.0'
+
+ config.generators do |g|
+ g.test_framework :rspec
+ end
+ config.active_record.raise_in_transactional_callbacks = true
end
end
diff --git a/config/boot.rb b/config/boot.rb
index 4489e586..0f0d7c60 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,4 +1,12 @@
require 'rubygems'
+require 'rails/commands/server'
+module Rails
+ class Server
+ def default_options
+ super.merge(Host: '0.0.0.0', Port: 3000)
+ end
+ end
+end
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
diff --git a/config/database.yml b/config/database.yml
new file mode 100644
index 00000000..469ede34
--- /dev/null
+++ b/config/database.yml
@@ -0,0 +1,21 @@
+default: &default
+ min_messages: WARNING
+ encoding: unicode
+ pool: 5
+ adapter: postgresql
+ host: <%= ENV['DB_HOST'] %>
+ port: <%= ENV['DB_PORT'] %>
+ username: <%= ENV['DB_USERNAME'] %>
+ password: <%= ENV['DB_PASSWORD'] %>
+
+development:
+ <<: *default
+ database: <%= ENV['DB_NAME'] %>_development
+
+test:
+ <<: *default
+ database: <%= ENV['DB_NAME'] %>_test
+
+production:
+ <<: *default
+ database: <%= ENV['DB_NAME'] %>_production
diff --git a/config/database.yml.default b/config/database.yml.default
deleted file mode 100644
index 06bfae01..00000000
--- a/config/database.yml.default
+++ /dev/null
@@ -1,10 +0,0 @@
-development:
- min_messages: WARNING
- adapter: postgresql
- host: 127.0.0.1
- port: 5432
- encoding: unicode
- database: metamap002_development
- pool: 5
- username: postgres
- password: "3112"
\ No newline at end of file
diff --git a/config/environment.rb b/config/environment.rb
index d73e6cb7..6e9ad9e4 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__)
# Initialize the rails application
-ISSAD::Application.initialize!
+Metamaps::Application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 7f1b0375..593fbd3c 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,25 +1,36 @@
-ISSAD::Application.configure do
+Metamaps::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
+ config.log_level = :info
+ config.eager_load = false
+
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
- # Log error messages when you accidentally call methods on nil.
- config.whiny_nils = true
-
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
-
+ # S3 file storage
+ config.paperclip_defaults = {
+ storage: :s3,
+ s3_credentials: {
+ bucket: ENV['S3_BUCKET_NAME'],
+ access_key_id: ENV['AWS_ACCESS_KEY_ID'],
+ secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']
+ },
+ s3_protocol: 'https'
+ }
+
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
- address: 'mail.metamaps.cc',
- port: 587,
- user_name: 'team@metamaps.cc',
- password: 'RcxX+s:fht49UX',
+ address: ENV['SMTP_SERVER'],
+ port: ENV['SMTP_PORT'],
+ user_name: ENV['SMTP_USERNAME'],
+ password: ENV['SMTP_PASSWORD'],
+ #domain: ENV['SMTP_DOMAIN']
authentication: 'plain',
enable_starttls_auto: true,
openssl_verify_mode: 'none' }
@@ -30,19 +41,6 @@ ISSAD::Application.configure do
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
- # Only use best-standards-support built into browsers
- config.action_dispatch.best_standards_support = :builtin
-
- # Raise exception on mass assignment protection for Active Record models
- config.active_record.mass_assignment_sanitizer = :strict
-
- # Log the query plan for queries taking more than this (works
- # with SQLite, MySQL, and PostgreSQL)
- config.active_record.auto_explain_threshold_in_seconds = 0.5
-
- # Do not compress assets
- config.assets.compress = false
-
# Expands the lines which load the assets
config.assets.debug = true
end
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 8b1bf0f9..9654962a 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -1,6 +1,10 @@
-ISSAD::Application.configure do
+Metamaps::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
+ config.log_level = :warn
+ config.eager_load = true
+ config.assets.js_compressor = :uglifier
+
# Code is not reloaded between requests
config.cache_classes = true
@@ -9,21 +13,36 @@ ISSAD::Application.configure do
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
- config.serve_static_assets = false
+ config.serve_static_files = true
+
+ config.assets.compile = false
# Compress JavaScripts and CSS
config.assets.compress = true
+
+
+ # S3 file storage
+ config.paperclip_defaults = {
+ :storage => :s3,
+ s3_credentials: {
+ bucket: ENV['S3_BUCKET_NAME'],
+ access_key_id: ENV['AWS_ACCESS_KEY_ID'],
+ secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']
+ },
+ s3_protocol: 'https'
+ }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
- address: 'mail.metamaps.cc',
- port: 587,
- user_name: 'team@metamaps.cc',
- password: 'RcxX+s:fht49UX',
+ address: ENV['SMTP_SERVER'],
+ port: ENV['SMTP_PORT'],
+ user_name: ENV['SMTP_USERNAME'],
+ password: ENV['SMTP_PASSWORD'],
+ #domain: ENV['SMTP_DOMAIN']
authentication: 'plain',
enable_starttls_auto: true,
openssl_verify_mode: 'none' }
- config.action_mailer.default_url_options = { :host => 'metamaps.cc' }
+ config.action_mailer.default_url_options = { :host => ENV['MAILER_DEFAULT_URL'] }
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = true
@@ -59,7 +78,7 @@ ISSAD::Application.configure do
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
- # config.assets.precompile += %w( search.js )
+ #config.assets.precompile += %w( )
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 5f3706b8..be83469c 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -1,6 +1,8 @@
-ISSAD::Application.configure do
+Metamaps::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
+ config.eager_load = false
+
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
@@ -8,12 +10,9 @@ ISSAD::Application.configure do
config.cache_classes = true
# Configure static asset server for tests with Cache-Control for performance
- config.serve_static_assets = true
+ config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"
- # Log error messages when you accidentally call methods on nil
- config.whiny_nils = true
-
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
@@ -29,9 +28,12 @@ ISSAD::Application.configure do
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
- # Raise exception on mass assignment protection for Active Record models
- config.active_record.mass_assignment_sanitizer = :strict
-
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
+
+ #assets config
+ config.assets.compile = true
+ config.assets.compress = false
+ config.assets.debug = false
+ config.assets.digest = false
end
diff --git a/config/initializers/access_codes.rb b/config/initializers/access_codes.rb
new file mode 100644
index 00000000..adb4ae8b
--- /dev/null
+++ b/config/initializers/access_codes.rb
@@ -0,0 +1,4 @@
+ $codes = []
+ if ActiveRecord::Base.connection.table_exists? 'users'
+ $codes = ActiveRecord::Base.connection.execute("SELECT code FROM users").map {|user| user["code"] }
+ end
\ No newline at end of file
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index 2924b11e..6590fddf 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -1,21 +1,23 @@
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
+ # The secret key used by Devise. Devise uses this key to generate
+ # random tokens. Changing this key will render invalid all existing
+ # confirmation, reset password and unlock tokens in the database.
+ # Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
+ # by default. You can change it below and use your own secret key.
+ # config.secret_key = '4d38a819bcea6314ffccb156a8e84b1b52c51ed446d11877c973791b3cd88449e9dbd7990cbc6e7f37d84702168ec36391467000c842ed5bed4f0b05df2b9507'
+
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
- config.mailer_sender = "team@metamaps.cc"
+ config.mailer_sender = ENV['DEVISE_MAILER_SENDER']
# Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer"
- if Rails.env.development? # this is for Connors localhost
- config.secret_key = 'f71c467e526f23d614b3b08866cad4788c502bed869c282f06e73ee6c94675b62fe1f6d52fa7ba8196b33031f0d2f3b67e27ea07693c52ecebccb01700cad614'
- end
- if Rails.env.production? # this is for the heroku staging environment
- config.secret_key = 'd91ba0da95749174ee2b8922034783cbde4945409ed28b13383e18e72844beb74467f8199e9e216f0687cd2290c6e46bf74da24486d14bba3671d76c5b10c753'
- end
+ config.secret_key = ENV['DEVISE_SECRET_KEY']
# ==> ORM configuration
# Load and configure the ORM. Supports :active_record (default) and
@@ -121,6 +123,9 @@ Devise.setup do |config|
# The time the user will be remembered without asking for credentials again.
config.remember_for = 2.weeks
+ # Invalidates all the remember me tokens when the user signs out.
+ config.expire_all_remember_me_on_sign_out = true
+
# If true, extends the user's remember period when remembered via cookie.
# config.extend_remember_period = false
@@ -142,9 +147,6 @@ Devise.setup do |config|
# time the user will be asked for credentials again. Default is 30 minutes.
# config.timeout_in = 30.minutes
- # If true, expires auth token on session timeout.
- # config.expire_auth_token_on_timeout = false
-
# ==> Configuration for :lockable
# Defines which strategy will be used to lock an account.
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
@@ -152,7 +154,7 @@ Devise.setup do |config|
# config.lock_strategy = :failed_attempts
# Defines which key will be used when locking and unlocking an account
- # config.unlock_keys = [ :email ]
+ # config.unlock_keys = [:email]
# Defines which strategy will be used to unlock an account.
# :email = Sends an unlock link to the user email
@@ -168,16 +170,23 @@ Devise.setup do |config|
# Time interval to unlock the account if :time is enabled as unlock_strategy.
# config.unlock_in = 1.hour
+ # Warn on the last attempt before the account is locked.
+ # config.last_attempt_warning = true
+
# ==> Configuration for :recoverable
#
# Defines which key will be used when recovering the password for an account
- # config.reset_password_keys = [ :email ]
+ # config.reset_password_keys = [:email]
# Time interval you can reset your password with a reset password key.
# Don't put a too small interval or your users won't have the time to
# change their passwords.
config.reset_password_within = 24.hours
+ # When set to false, does not sign a user in automatically after their password is
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
+ # config.sign_in_after_reset_password = true
+
# ==> Configuration for :encryptable
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
@@ -186,10 +195,6 @@ Devise.setup do |config|
# REST_AUTH_SITE_KEY to pepper)
# config.encryptor = :sha512
- # ==> Configuration for :token_authenticatable
- # Defines name of the authentication token params key
- # config.token_authentication_key = :auth_token
-
# ==> Scopes configuration
# Turn scoped views on. Before rendering "sessions/new", it will first check for
# "users/sessions/new". It's turned off by default because it's slower if you
@@ -237,12 +242,12 @@ Devise.setup do |config|
# is mountable, there are some extra configurations to be taken into account.
# The following options are available, assuming the engine is mounted as:
#
- # mount MyEngine, at: "/my_engine"
+ # mount MyEngine, at: '/my_engine'
#
# The router that invoked `devise_for`, in the example above, would be:
# config.router_name = :my_engine
#
- # When using omniauth, Devise cannot automatically set Omniauth path,
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
# so you need to do it manually. For the users scope, it would be:
- # config.omniauth_path_prefix = "/my_engine/users/auth"
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
end
diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb
new file mode 100644
index 00000000..1447988b
--- /dev/null
+++ b/config/initializers/paperclip.rb
@@ -0,0 +1,2 @@
+Paperclip::Attachment.default_options[:url] = ':s3_domain_url'
+Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename'
\ No newline at end of file
diff --git a/config/initializers/redis.rb b/config/initializers/redis.rb
deleted file mode 100644
index a109199a..00000000
--- a/config/initializers/redis.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-if Rails.env.development? ## this also applies to metamaps.cc production mode
- $redis = Redis.new(:host => 'localhost', :port=> 6379)
-elsif Rails.env.production? ## this is for the heroku staging environment
- uri = URI.parse(ENV["REDISTOGO_URL"])
- $redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
-end
\ No newline at end of file
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
index 736a0d6c..9c1fb05e 100644
--- a/config/initializers/secret_token.rb
+++ b/config/initializers/secret_token.rb
@@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-ISSAD::Application.config.secret_token = '267c8a84f63963282f45bc3010eaddf027abfab58fc759d6e239c8005f85ee99d6d01b1ab6394cdee9ca7f8c9213a0cf91d3d8d3350f096123e2caccbcc0924f'
+Metamaps::Application.config.secret_key_base = '267c8a84f63963282f45bc3010eaddf027abfab58fc759d6e239c8005f85ee99d6d01b1ab6394cdee9ca7f8c9213a0cf91d3d8d3350f096123e2caccbcc0924f'
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index a6f08f8e..757d66cc 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file.
-ISSAD::Application.config.session_store :cookie_store, key: '_ISSAD_session'
+Metamaps::Application.config.session_store :cookie_store, key: '_Metamaps_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
-# ISSAD::Application.config.session_store :active_record_store
+# Metamaps::Application.config.session_store :active_record_store
diff --git a/config/initializers/uservoice.rb b/config/initializers/uservoice.rb
new file mode 100644
index 00000000..3a303174
--- /dev/null
+++ b/config/initializers/uservoice.rb
@@ -0,0 +1,7 @@
+require 'uservoice-ruby'
+
+def current_sso_token
+ @current_sso_token ||= UserVoice.generate_sso_token('metamapscc', ENV['SSO_KEY'], {
+ :email => current_user.email
+ }, 300) # Default expiry time is 5 minutes = 300 seconds
+end
\ No newline at end of file
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
index d01f375c..26a10f29 100644
--- a/config/locales/devise.en.yml
+++ b/config/locales/devise.en.yml
@@ -3,49 +3,50 @@
en:
devise:
confirmations:
- confirmed: "Your account was successfully confirmed. You are now signed in."
- send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
- send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
+ confirmed: "Your email address has been successfully confirmed."
+ send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
failure:
already_authenticated: "You are already signed in."
- inactive: "Your account was not activated yet."
- invalid: "Invalid email or password."
- invalid_token: "Invalid authentication token."
+ inactive: "Your account is not activated yet."
+ invalid: "Invalid %{authentication_keys} or password."
locked: "Your account is locked."
- not_found_in_database: "Invalid email or password."
- timeout: "Your session expired, please sign in again to continue."
+ last_attempt: "You have one more attempt before your account is locked."
+ not_found_in_database: "Invalid %{authentication_keys} or password."
+ timeout: "Your session expired. Please sign in again to continue."
unauthenticated: "You need to sign in or sign up before continuing."
- unconfirmed: "You have to confirm your account before continuing."
+ unconfirmed: "You have to confirm your email address before continuing."
mailer:
confirmation_instructions:
subject: "Confirmation instructions"
reset_password_instructions:
subject: "Reset password instructions"
unlock_instructions:
- subject: "Unlock Instructions"
+ subject: "Unlock instructions"
omniauth_callbacks:
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
success: "Successfully authenticated from %{kind} account."
passwords:
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
- send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes."
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
- updated: "Your password was changed successfully. You are now signed in."
- updated_not_active: "Your password was changed successfully."
+ updated: "Your password has been changed successfully. You are now signed in."
+ updated_not_active: "Your password has been changed successfully."
registrations:
- destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
+ destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
signed_up: "Welcome! You have signed up successfully."
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
- signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
- update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
- updated: "You updated your account successfully."
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
+ updated: "Your account has been updated successfully."
sessions:
signed_in: "Signed in successfully."
signed_out: "Signed out successfully."
+ already_signed_out: "Signed out successfully."
unlocks:
- send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
- send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
+ send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
errors:
messages:
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 179c14ca..46d3db07 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -2,4 +2,7 @@
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en:
- hello: "Hello world"
+ activerecord:
+ attributes:
+ user:
+ joinedwithcode: "Access code"
diff --git a/config/routes.rb b/config/routes.rb
index 803dea6d..a3ab6e3a 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,51 +1,43 @@
-ISSAD::Application.routes.draw do
+Metamaps::Application.routes.draw do
root to: 'main#home', via: :get
-
- get '/join', to: redirect('/users/sign_up')
- match 'request', to: 'main#requestinvite', via: :get, as: :request
- match 'paq', to: 'main#paq', via: :get, as: :paq
+ get 'request', to: 'main#requestinvite', as: :request
- match '/search/topics', to: 'main#searchtopics', via: :get, as: :searchtopics
- match '/search/maps', to: 'main#searchmaps', via: :get, as: :searchmaps
- match '/search/mappers', to: 'main#searchmappers', via: :get, as: :searchmappers
- match '/search/synapses', to: 'main#searchsynapses', via: :get, as: :searchsynapses
+ get 'search/topics', to: 'main#searchtopics', as: :searchtopics
+ get 'search/maps', to: 'main#searchmaps', as: :searchmaps
+ get 'search/mappers', to: 'main#searchmappers', as: :searchmappers
+ get 'search/synapses', to: 'main#searchsynapses', as: :searchsynapses
- match 'maps/:id/savelayout', to: 'maps#savelayout', via: :put, as: :savelayout
- match 'topics/:map_id/:topic_id/removefrommap', to: 'topics#removefrommap', via: :post, as: :removefrommap
- match 'synapses/:map_id/:synapse_id/removefrommap', to: 'synapses#removefrommap', via: :post, as: :removefrommap
-
- resources :in_metacode_sets
+ resources :mappings, except: [:index, :new, :edit]
resources :metacode_sets, :except => [:show]
resources :metacodes, :except => [:show, :destroy]
+ resources :synapses, except: [:index, :new, :edit]
resources :topics, except: [:index, :new, :edit] do
get :autocomplete_topic, :on => :collection
end
- match 'topics/:id/:format', to: 'topics#json', via: :get, as: :json
-
- resources :synapses, except: [:index, :new, :edit, :show]
- match 'synapses/:id/:format', to: 'synapses#json', via: :get, as: :json
-
- match 'maps/active', to: 'maps#index', via: :get, as: :activemaps
- match 'maps/featured', to: 'maps#index', via: :get, as: :featuredmaps
- match 'maps/new', to: 'maps#index', via: :get, as: :newmaps
- match 'maps/mappers/:id', to: 'maps#index', via: :get, as: :usermaps
- match 'maps/topics/:id', to: 'maps#index', via: :get, as: :topicmaps
-
+ get 'topics/:id/network', to: 'topics#network', as: :network
+ get 'topics/:id/relative_numbers', to: 'topics#relative_numbers', as: :relative_numbers
+ get 'topics/:id/relatives', to: 'topics#relatives', as: :relatives
+ get 'explore/active', to: 'maps#index', as: :activemaps
+ get 'explore/featured', to: 'maps#index', as: :featuredmaps
+ get 'explore/mine', to: 'maps#index', as: :mymaps
+ get 'explore/mapper/:id', to: 'maps#index', as: :usermaps
resources :maps, except: [:new, :edit]
- match 'maps/:id/embed', to: 'maps#embed', via: :get, as: :embed
- match 'maps/:id/:format', to: 'maps#json', via: :get, as: :json
+ get 'maps/:id/contains', to: 'maps#contains', as: :contains
+ post 'maps/:id/upload_screenshot', to: 'maps#screenshot', as: :screenshot
- devise_for :users, :controllers => { :registrations => "registrations" }, :path_names => { :sign_in => 'login', :sign_out => 'logout' }
- devise_scope :user do
- get "sign_out", :to => "devise/sessions#destroy"
- end
- match 'user/updatemetacodes', to: 'users#updatemetacodes', via: :post, as: :updatemetacodes
-
- resources :users, except: [:show, :index]
+ devise_for :users, controllers: { registrations: 'users/registrations', passwords: 'users/passwords', sessions: 'devise/sessions' }, :skip => :sessions
- resources :mappings
-
+ devise_scope :user do
+ get 'login' => 'devise/sessions#new', :as => :new_user_session
+ post 'login' => 'devise/sessions#create', :as => :user_session
+ get 'logout' => 'devise/sessions#destroy', :as => :destroy_user_session
+ get 'join' => 'devise/registrations#new', :as => :new_user_registration_path
+ end
+
+ get 'users/:id/details', to: 'users#details', as: :details
+ post 'user/updatemetacodes', to: 'users#updatemetacodes', as: :updatemetacodes
+ resources :users, except: [:index, :destroy]
end
diff --git a/db/migrate/20140625212637_add_image_and_audio_to_topics.rb b/db/migrate/20140625212637_add_image_and_audio_to_topics.rb
new file mode 100644
index 00000000..46bead64
--- /dev/null
+++ b/db/migrate/20140625212637_add_image_and_audio_to_topics.rb
@@ -0,0 +1,11 @@
+class AddImageAndAudioToTopics < ActiveRecord::Migration
+ def self.up
+ add_attachment :topics, :image
+ add_attachment :topics, :audio
+ end
+
+ def self.down
+ remove_attachment :topics, :image
+ remove_attachment :topics, :audio
+ end
+end
diff --git a/db/migrate/20140707161810_add_image_to_users.rb b/db/migrate/20140707161810_add_image_to_users.rb
new file mode 100644
index 00000000..0a479fda
--- /dev/null
+++ b/db/migrate/20140707161810_add_image_to_users.rb
@@ -0,0 +1,9 @@
+class AddImageToUsers < ActiveRecord::Migration
+ def self.up
+ add_attachment :users, :image
+ end
+
+ def self.down
+ remove_attachment :users, :image
+ end
+end
diff --git a/db/migrate/20140815162253_add_screenshot_to_maps.rb b/db/migrate/20140815162253_add_screenshot_to_maps.rb
new file mode 100644
index 00000000..c42cca51
--- /dev/null
+++ b/db/migrate/20140815162253_add_screenshot_to_maps.rb
@@ -0,0 +1,9 @@
+class AddScreenshotToMaps < ActiveRecord::Migration
+ def self.up
+ add_attachment :maps, :screenshot
+ end
+
+ def self.down
+ remove_attachment :maps, :screenshot
+ end
+end
diff --git a/db/migrate/20140930013020_add_color_to_metacodes.rb b/db/migrate/20140930013020_add_color_to_metacodes.rb
new file mode 100644
index 00000000..59c8f89f
--- /dev/null
+++ b/db/migrate/20140930013020_add_color_to_metacodes.rb
@@ -0,0 +1,5 @@
+class AddColorToMetacodes < ActiveRecord::Migration
+ def change
+ add_column :metacodes, :color, :string
+ end
+end
diff --git a/db/migrate/20141121204712_add_generation_to_users.rb b/db/migrate/20141121204712_add_generation_to_users.rb
new file mode 100644
index 00000000..b31e2832
--- /dev/null
+++ b/db/migrate/20141121204712_add_generation_to_users.rb
@@ -0,0 +1,5 @@
+class AddGenerationToUsers < ActiveRecord::Migration
+ def change
+ add_column :users, :generation, :integer
+ end
+end
diff --git a/db/migrate/20151001024122_mapping_polymorphism.rb b/db/migrate/20151001024122_mapping_polymorphism.rb
new file mode 100644
index 00000000..e6bbd5fc
--- /dev/null
+++ b/db/migrate/20151001024122_mapping_polymorphism.rb
@@ -0,0 +1,36 @@
+class MappingPolymorphism < ActiveRecord::Migration
+ def up
+ add_column :mappings, :mappable_id, :integer
+ add_column :mappings, :mappable_type, :string
+ add_index :mappings, [:mappable_id, :mappable_type]
+
+ Mapping.find_each do |mapping|
+ if mapping.synapse_id.nil? and mapping.topic_id.nil?
+ puts "Mapping id=#{mapping.id} has no valid id, skipping!"
+ next
+ end
+ if not mapping.synapse_id.nil? and not mapping.topic_id.nil?
+ puts "Mapping id=#{mapping.id} has both topic and synapse ids, skipping!"
+ next
+ end
+
+ unless mapping.synapse_id.nil?
+ mapping.mappable = Synapse.find_by(id: mapping.synapse_id)
+ else
+ mapping.mappable = Topic.find_by(id: mapping.topic_id)
+ end
+
+ if mapping.mappable.nil?
+ mapping.delete
+ else
+ mapping.save
+ end
+ end
+ end
+
+ def down
+ remove_index :mappings, [:mappable_id, :mappable_type]
+ remove_column :mappings, :mappable_id, :integer
+ remove_column :mappings, :mappable_type, :string
+ end
+end
diff --git a/db/migrate/20151023143719_add_missing_indexes.rb b/db/migrate/20151023143719_add_missing_indexes.rb
new file mode 100644
index 00000000..551f2319
--- /dev/null
+++ b/db/migrate/20151023143719_add_missing_indexes.rb
@@ -0,0 +1,16 @@
+class AddMissingIndexes < ActiveRecord::Migration
+ def change
+ add_index :topics, :user_id
+ add_index :topics, :metacode_id
+ add_index :synapses, [:node2_id, :node2_id]
+ add_index :synapses, [:node1_id, :node1_id]
+ add_index :synapses, :user_id
+ add_index :synapses, :node1_id
+ add_index :synapses, :node2_id
+ add_index :mappings, [:map_id, :topic_id]
+ add_index :mappings, [:map_id, :synapse_id]
+ add_index :mappings, :map_id
+ add_index :mappings, :user_id
+ add_index :maps, :user_id
+ end
+end
diff --git a/db/migrate/20160120061513_metacode_asset_path_update.rb b/db/migrate/20160120061513_metacode_asset_path_update.rb
new file mode 100644
index 00000000..a254597c
--- /dev/null
+++ b/db/migrate/20160120061513_metacode_asset_path_update.rb
@@ -0,0 +1,15 @@
+class Metacode < ActiveRecord::Base
+end
+
+class MetacodeAssetPathUpdate < ActiveRecord::Migration
+ def change
+ Metacode.first(50).each do |metacode|
+ if metacode.icon.start_with?("/assets/icons/")
+ metacode.icon = metacode.icon.sub(/^\/assets\/icons/, "https://s3.amazonaws.com/metamaps-assets/metacodes")
+ metacode.icon = metacode.icon.sub('blueprint_96px', 'blueprint/96px')
+ metacode.icon = metacode.icon.sub('generics_96px', 'generics/96px')
+ metacode.save
+ end
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 0a8292d7..9ecb3488 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,117 +1,157 @@
-# encoding: UTF-8
-# This file is auto-generated from the current state of the database. Instead
-# of editing this file, please use the migrations feature of Active Record to
-# incrementally modify your database, and then regenerate this schema definition.
-#
-# Note that this schema.rb definition is the authoritative source for your
-# database schema. If you need to create the application database on another
-# system, you should be using db:schema:load, not running all the migrations
-# from scratch. The latter is a flawed and unsustainable approach (the more migrations
-# you'll amass, the slower it'll run and the greater likelihood for issues).
-#
-# It's strongly recommended to check this file into your version control system.
-
-ActiveRecord::Schema.define(:version => 20140517115841) do
-
- create_table "in_metacode_sets", :force => true do |t|
- t.integer "metacode_id"
- t.integer "metacode_set_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "in_metacode_sets", ["metacode_id"], :name => "index_in_metacode_sets_on_metacode_id"
- add_index "in_metacode_sets", ["metacode_set_id"], :name => "index_in_metacode_sets_on_metacode_set_id"
-
- create_table "mappings", :force => true do |t|
- t.text "category"
- t.integer "xloc"
- t.integer "yloc"
- t.integer "topic_id"
- t.integer "synapse_id"
- t.integer "map_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "maps", :force => true do |t|
- t.text "name"
- t.boolean "arranged"
- t.text "desc"
- t.text "permission"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.boolean "featured"
- end
-
- create_table "metacode_sets", :force => true do |t|
- t.string "name"
- t.text "desc"
- t.integer "user_id"
- t.boolean "mapperContributed"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "metacode_sets", ["user_id"], :name => "index_metacode_sets_on_user_id"
-
- create_table "metacodes", :force => true do |t|
- t.text "name"
- t.string "icon"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "synapses", :force => true do |t|
- t.text "desc"
- t.text "category"
- t.text "weight"
- t.text "permission"
- t.integer "node1_id"
- t.integer "node2_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "topics", :force => true do |t|
- t.text "name"
- t.text "desc"
- t.text "link"
- t.text "permission"
- t.integer "user_id"
- t.integer "metacode_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "users", :force => true do |t|
- t.string "name"
- t.string "email"
- t.text "settings"
- t.string "code", :limit => 8
- t.string "joinedwithcode", :limit => 8
- t.string "crypted_password"
- t.string "password_salt"
- t.string "persistence_token"
- t.string "perishable_token"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "encrypted_password", :limit => 128, :default => ""
- t.string "remember_token"
- t.datetime "remember_created_at"
- t.string "reset_password_token"
- t.datetime "last_sign_in_at"
- t.string "last_sign_in_ip"
- t.integer "sign_in_count", :default => 0
- t.datetime "current_sign_in_at"
- t.string "current_sign_in_ip"
- t.datetime "reset_password_sent_at"
- t.boolean "admin"
- end
-
- add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
-
-end
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended that you check this file into your version control system.
+
+ActiveRecord::Schema.define(version: 20160120061513) do
+
+ # These are extensions that must be enabled in order to support this database
+ enable_extension "plpgsql"
+
+ create_table "in_metacode_sets", force: :cascade do |t|
+ t.integer "metacode_id"
+ t.integer "metacode_set_id"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ add_index "in_metacode_sets", ["metacode_id"], name: "index_in_metacode_sets_on_metacode_id", using: :btree
+ add_index "in_metacode_sets", ["metacode_set_id"], name: "index_in_metacode_sets_on_metacode_set_id", using: :btree
+
+ create_table "mappings", force: :cascade do |t|
+ t.text "category"
+ t.integer "xloc"
+ t.integer "yloc"
+ t.integer "topic_id"
+ t.integer "synapse_id"
+ t.integer "map_id"
+ t.integer "user_id"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.integer "mappable_id"
+ t.string "mappable_type"
+ end
+
+ add_index "mappings", ["map_id", "synapse_id"], name: "index_mappings_on_map_id_and_synapse_id", using: :btree
+ add_index "mappings", ["map_id", "topic_id"], name: "index_mappings_on_map_id_and_topic_id", using: :btree
+ add_index "mappings", ["map_id"], name: "index_mappings_on_map_id", using: :btree
+ add_index "mappings", ["mappable_id", "mappable_type"], name: "index_mappings_on_mappable_id_and_mappable_type", using: :btree
+ add_index "mappings", ["user_id"], name: "index_mappings_on_user_id", using: :btree
+
+ create_table "maps", force: :cascade do |t|
+ t.text "name"
+ t.boolean "arranged"
+ t.text "desc"
+ t.text "permission"
+ t.integer "user_id"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.boolean "featured"
+ t.string "screenshot_file_name"
+ t.string "screenshot_content_type"
+ t.integer "screenshot_file_size"
+ t.datetime "screenshot_updated_at"
+ end
+
+ add_index "maps", ["user_id"], name: "index_maps_on_user_id", using: :btree
+
+ create_table "metacode_sets", force: :cascade do |t|
+ t.string "name"
+ t.text "desc"
+ t.integer "user_id"
+ t.boolean "mapperContributed"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ add_index "metacode_sets", ["user_id"], name: "index_metacode_sets_on_user_id", using: :btree
+
+ create_table "metacodes", force: :cascade do |t|
+ t.text "name"
+ t.string "icon"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "color"
+ end
+
+ create_table "synapses", force: :cascade do |t|
+ t.text "desc"
+ t.text "category"
+ t.text "weight"
+ t.text "permission"
+ t.integer "node1_id"
+ t.integer "node2_id"
+ t.integer "user_id"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ add_index "synapses", ["node1_id", "node1_id"], name: "index_synapses_on_node1_id_and_node1_id", using: :btree
+ add_index "synapses", ["node1_id"], name: "index_synapses_on_node1_id", using: :btree
+ add_index "synapses", ["node2_id", "node2_id"], name: "index_synapses_on_node2_id_and_node2_id", using: :btree
+ add_index "synapses", ["node2_id"], name: "index_synapses_on_node2_id", using: :btree
+ add_index "synapses", ["user_id"], name: "index_synapses_on_user_id", using: :btree
+
+ create_table "topics", force: :cascade do |t|
+ t.text "name"
+ t.text "desc"
+ t.text "link"
+ t.text "permission"
+ t.integer "user_id"
+ t.integer "metacode_id"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "image_file_name"
+ t.string "image_content_type"
+ t.integer "image_file_size"
+ t.datetime "image_updated_at"
+ t.string "audio_file_name"
+ t.string "audio_content_type"
+ t.integer "audio_file_size"
+ t.datetime "audio_updated_at"
+ end
+
+ add_index "topics", ["metacode_id"], name: "index_topics_on_metacode_id", using: :btree
+ add_index "topics", ["user_id"], name: "index_topics_on_user_id", using: :btree
+
+ create_table "users", force: :cascade do |t|
+ t.string "name"
+ t.string "email"
+ t.text "settings"
+ t.string "code", limit: 8
+ t.string "joinedwithcode", limit: 8
+ t.string "crypted_password"
+ t.string "password_salt"
+ t.string "persistence_token"
+ t.string "perishable_token"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "encrypted_password", limit: 128, default: ""
+ t.string "remember_token"
+ t.datetime "remember_created_at"
+ t.string "reset_password_token"
+ t.datetime "last_sign_in_at"
+ t.string "last_sign_in_ip"
+ t.integer "sign_in_count", default: 0
+ t.datetime "current_sign_in_at"
+ t.string "current_sign_in_ip"
+ t.datetime "reset_password_sent_at"
+ t.boolean "admin"
+ t.string "image_file_name"
+ t.string "image_content_type"
+ t.integer "image_file_size"
+ t.datetime "image_updated_at"
+ t.integer "generation"
+ end
+
+ add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
+
+end
diff --git a/db/seeds.rb b/db/seeds.rb
index 4edb1e85..51aa01d9 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,7 +1,306 @@
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
-#
-# Examples:
-#
-# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
-# Mayor.create(name: 'Emanuel', city: cities.first)
+
+## USERS
+User.new({
+ name: 'user',
+ email: 'user@user.com',
+ password: 'toolsplusconsciousness',
+ code: 'qwertyui',
+ joinedwithcode: 'qwertyui',
+ admin: 'false'
+}).save(validate: false)
+
+User.new({
+ name: 'admin',
+ email: 'admin@admin.com',
+ password: 'toolsplusconsciousness',
+ code: 'iuytrewq',
+ joinedwithcode: 'iuytrewq',
+ admin: 'true'
+}).save(validate: false)
+## END USERS
+
+## METACODES
+Metacode.create({
+ name: 'Action',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_action.png',
+ color: '#BD6C85'
+})
+
+Metacode.create({
+ name: 'Activity',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_activity.png',
+ color: '#6EBF65'
+})
+
+Metacode.create({
+ name: 'Catalyst',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_catalyst.png',
+ color: '#EF8964',
+})
+
+Metacode.create({
+ name: 'Closed',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_closedissue.png',
+ color: '#ABB49F',
+})
+
+Metacode.create({
+ name: 'Process',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_process.png',
+ color: '#BDB25E',
+})
+
+Metacode.create({
+ name: 'Future',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_futuredev.png',
+ color: '#25A17F',
+})
+
+Metacode.create({
+ name: 'Group',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_group.png',
+ color: '#7076BC',
+})
+
+Metacode.create({
+ name: 'Implication',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_implication.png',
+ color: '#83DECA',
+})
+
+Metacode.create({
+ name: 'Insight',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_insight.png',
+ color: '#B074AD',
+})
+
+Metacode.create({
+ name: 'Intention',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_intention.png',
+ color: '#BAEAFF',
+})
+
+Metacode.create({
+ name: 'Knowledge',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_knowledge.png',
+ color: '#60ACF7',
+})
+
+Metacode.create({
+ name: 'Location',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_location.png',
+ color: '#ABD9A7',
+})
+
+Metacode.create({
+ name: 'Need',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_need.png',
+ color: '#D2A7D4',
+})
+
+Metacode.create({
+ name: 'Open',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_openissue.png',
+ color: '#9BBF71',
+})
+
+Metacode.create({
+ name: 'Opportunity',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_opportunity.png',
+ color: '#889F64',
+})
+
+Metacode.create({
+ name: 'Person',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_person.png',
+ color: '#DE925F',
+})
+
+Metacode.create({
+ name: 'Platform',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_platform.png',
+ color: '#21C8FE',
+})
+
+Metacode.create({
+ name: 'Problem',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_problem.png',
+ color: '#99CFC4',
+})
+
+Metacode.create({
+ name: 'Resource',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_resource.png',
+ color: '#C98C63',
+})
+
+Metacode.create({
+ name: 'Role',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_role.png',
+ color: '#A8595D',
+})
+
+Metacode.create({
+ name: 'Task',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_task.png',
+ color: '#3397C4',
+})
+
+Metacode.create({
+ name: 'Trajectory',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_trajectory.png',
+ color: '#D3AA4C',
+})
+
+Metacode.create({
+ name: 'Argument',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_argument.png',
+ color: '#7FAEFD',
+})
+
+Metacode.create({
+ name: 'Con',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_con.png',
+ color: '#CF7C74',
+})
+
+Metacode.create({
+ name: 'Subject',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_subject.png',
+ color: '#8293D8',
+})
+
+Metacode.create({
+ name: 'Decision',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_decision.png',
+ color: '#CCA866',
+})
+
+Metacode.create({
+ name: 'Event',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_event.png',
+ color: '#F5854B',
+})
+
+Metacode.create({
+ name: 'Example',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_example.png',
+ color: '#618C61',
+})
+
+Metacode.create({
+ name: 'Experience',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_experience.png',
+ color: '#BE995F',
+})
+
+Metacode.create({
+ name: 'Feedback',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_feedback.png',
+ color: '#54A19D',
+})
+
+Metacode.create({
+ name: 'Aim',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_aim.png',
+ color: '#B0B0B0',
+})
+
+Metacode.create({
+ name: 'Good',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_goodpractice.png',
+ color: '#BD9E86',
+})
+
+Metacode.create({
+ name: 'Idea',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_idea.png',
+ color: '#C4BC5E',
+})
+
+Metacode.create({
+ name: 'List',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_list.png',
+ color: '#B7A499',
+})
+
+Metacode.create({
+ name: 'Media',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_media.png',
+ color: '#6D94CC',
+})
+
+Metacode.create({
+ name: 'Metamap',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_metamap.png',
+ color: '#AEA9FD',
+})
+
+Metacode.create({
+ name: 'Model',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_model.png',
+ color: '#B385BA',
+})
+
+Metacode.create({
+ name: 'Note',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_note.png',
+ color: '#A389A1',
+})
+
+Metacode.create({
+ name: 'Perspective',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_perspective.png',
+ color: '#2EB6CC',
+})
+
+Metacode.create({
+ name: 'Pro',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_pro.png',
+ color: '#89B879',
+})
+
+Metacode.create({
+ name: 'Project',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_project.png',
+ color: '#85A050',
+})
+
+Metacode.create({
+ name: 'Question',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_question.png',
+ color: '#5CB3B3',
+})
+
+Metacode.create({
+ name: 'Reference',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_reference.png',
+ color: '#A7A7A7',
+})
+
+Metacode.create({
+ name: 'Research',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_research.png',
+ color: '#CD8E89',
+})
+
+Metacode.create({
+ name: 'Status',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_status.png',
+ color: '#EFA7C0',
+})
+
+Metacode.create({
+ name: 'Tool',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_tool.png',
+ color: '#828282',
+})
+
+Metacode.create({
+ name: 'Wildcard',
+ icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_wildcard.png',
+ color: '#73C7DE',
+})
+## END METACODES
diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md
new file mode 100644
index 00000000..c8168bb1
--- /dev/null
+++ b/doc/CHANGELOG.md
@@ -0,0 +1,7 @@
+## 2.6
+- Backbone.js in use for client side models
+- Realtime depends entirely on sockets for transmitting changes, rather than server using redis to push
+
+## 2.5
+
+- Initial release
diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md
new file mode 100644
index 00000000..e7d1eef2
--- /dev/null
+++ b/doc/CONTRIBUTING.md
@@ -0,0 +1,96 @@
+# Contributing to Metamaps
+
+Active involvement from the community is essential to help make Metamaps as
+beneficial for communities as it can be. You can help by reporting bugs, fixing
+bugs, adding features, contributing new modules and by providing feedback.
+
+## Reporting bugs and other issues
+
+If you think you've encountered a bug, do the following:
+
+1. Make sure you are working with the latest version of the Metamaps `develop`
+ branch.
+2. Browse through the [issues][metamaps-issues] to check if anyone else has
+ already reported. If someone has, feel free to add more information to that
+ issue to help us solve it.
+3. If no one has yet submitted the issue you are encountering, add it in! Please
+ be sure to include as much information as possible, include errors, warnings,
+ screenshots, links to a video showing the problem or code that can reproduce
+ the issue.
+
+## Contributing code
+
+Metamaps is made possible by open source contributors like you. We're very
+interested in getting help from the greater community, but before you start it's
+important that you become acquainted with our workflow. Following these
+guidelines below will make collaboration much smoother and increase the chances
+that we will accept your pull request without hiccups.
+
+### Development Process
+
+Our development process is very similar to the approach described in the
+well-known article [A Successful Git Branching Model by Vincent Driessen
+][git-branching-model]. Here's an overview:
+
+* The `master` branch is the current base for our deployed instances. This
+ branch *must* remain stable and always work.
+* The `develop` branch is the current state of development. Metamaps
+ developers base their work on this branch. It is not guaranteed to be
+ stable.
+* All code must be reviewed before being committed to develop or master. This
+ means all commits should take place on your own personal branch, and
+ submitted via a Github pull request when ready.
+* Only maintainers can accept pull requests from forks into the core
+ Metamaps.cc repository.
+
+### Getting started
+
+1. Make sure you have a [GitHub account](https://github.com/signup/free)
+2. [Fork metamaps][fork-metamaps]
+3. Keep your fork up to date. Metamaps is a fast moving project, and things
+ are changing all the time. It's important that any changes you make are
+ based on the most recent version of metamaps, since it's possible that
+ something may have changed that breaks your pull request or invalidates it.
+4. Make sure you have a [Contributor License Agreement](http://caa.metamaps.cc
+ ) on file.
+5. Read on ...
+
+
+### Contributor License Agreement
+
+Before we can accept any contributions to Metamaps, we first require that all
+individuals or companies agree to our Contributor License Agreement (CLA). The
+e-mail address used in the pull request will be used to check if a CLA has
+already been filed, so be sure to list all email addresses that you might use to
+submit your pull requests when filling it out. [Our CLA can be found here](
+http://caa.metamaps.cc).
+
+### Testing and Linting
+
+Please run `rspec` in the Metamaps root directory before submitting your pull
+request.
+
+### Branch grouping tokens
+
+All pull requests submitted to Metamaps.cc should occur on a new branch. For
+these branches, please use a short token indicating the nature of the branch in
+question followed by a `/` and then a very concise string describing the branch.
+This isn't a very important part of the workflow, but we are currently using the
+following branch prefixes:
+
+ fix // bug fixes
+ wip // work in progress (not suitable for a pull request)
+ instance // (internal) Tracks customizations made to metamaps instances
+ feature // All other new features
+
+### Bug fixes
+
+If you'd like to contribute a fix for a bug you've encountered, first read up on
+[how to report a bug](#reporting-bugs-and-other-issues) and report it so we are
+aware of the issue. By filing the issue first, we may be able to provide you
+with some insight that guides you in the right direction.
+
+[metamaps-issues]: https://github.com/metamaps/metamaps_gen002/labels/bug
+[git-branching-model]: http://nvie.com/posts/a-successful-git-branching-model/
+[fork-metamaps]: https://github.com/metamaps/metamaps_gen002/fork
+[cla]: http://metamaps.cc/cla
diff --git a/doc/MacInstallation.md b/doc/MacInstallation.md
new file mode 100644
index 00000000..2881f585
--- /dev/null
+++ b/doc/MacInstallation.md
@@ -0,0 +1,43 @@
+# OSX Install
+
+If you are doing an upgrade and or recent pull for changes you will need to change your default ruby package from 2.1.1 to ruby 2.1.2
+
+Some of these steps are pulled from http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/
+
+Install homebrew
+
+ \curl -sSL https://get.rvm.io | bash -s stable --rails
+ rvm install 2.1.3 --with-gcc=clang
+ rvm use 2.1.3
+ gem install lunchy
+
+Now install homebrew.
+
+ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+Then install nodejs
+
+ brew install nodejs
+
+And postgresql:
+
+ brew install postgresql
+ ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
+ createuser metamaps -P -s -d
+
+Set a password, then start the service:
+
+ lunchy start postgres
+
+Change directory to the metamaps git repository, and run:
+
+ bundle install
+
+Copy the .example-env file and rename it to .env. Then modify the DB_USERNAME and DB_PASSWORD values to match the postgres username and password you set
+
+ rake db:create
+ rake db:schema:load
+ rake db:fixtures:load
+ rails server
+
+Now open a browser to http://localhost:3000!
diff --git a/doc/README_FOR_APP b/doc/README_FOR_APP
deleted file mode 100644
index fe41f5cc..00000000
--- a/doc/README_FOR_APP
+++ /dev/null
@@ -1,2 +0,0 @@
-Use this README file to introduce your application and point to useful places in the API for learning more.
-Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
diff --git a/doc/RspecTesting.md b/doc/RspecTesting.md
new file mode 100644
index 00000000..82cf74f7
--- /dev/null
+++ b/doc/RspecTesting.md
@@ -0,0 +1,53 @@
+## Testing with RSpec
+
+RSpec is a ruby gem that allows you to test your code base. This is great -
+every time you make a change, you can do some basic sanity checks to make sure
+you didn't break anything.
+
+To test Metamaps, run
+
+ rspec
+
+in the top level directory. It will automatically search the `spec` directory
+for files called `*_spec.rb`, and run them as tests. When it's done testing, it
+will print a report telling you how many tests failed. With luck, the number
+will be 0.
+
+Note that if your test database doesn't exist yet, you'll need to create it
+first:
+
+ RAILS_ENV=test rake db:create
+
+At the time of writing, there are four directories in the spec folder. One,
+`support`, is for helper functions. `rails_helper.rb` and `spec_helper.rb` are
+also for helper functions.
+
+`factories` is for a gem called [factory-girl][factory-girl]. This gem lets you
+use the `create` and `build` functions to quickly create the simplest possible
+valid version of a given model. For instance:
+
+ let(:map1) { create :map }
+ let(:ronald) { create :user, name: "Ronald" }
+ let(:map2) { create :map, user: ronald }
+
+As you can see, you can also customize the factories. You can read the full
+documentation at the link above or check the existing specs to see how it works.
+It is worth reading through the factories to see how they are defined. If you
+add a model to `app/models`, please also create a factory for it that defines
+the minimum valid state for that model.
+
+Finally, `models` and `controllers` have the actual spec files. Writing specs is
+usually fairly simple but you do need to understand the syntax. You can read
+more at [rspec.info][rspec-docs].
+
+If you modify the metamaps codebase, please consider adding tests verifying that
+the added code works. This will help in a few ways:
+
+ - Unrelated changes in the future that break your code will be spotted earlier
+ - Your changes will be more easily understood, since the *purpose* will be
+ described by the spec
+
+Happy testing!
+
+[factory-girl]: https://github.com/thoughtbot/factory_girl
+[rspec-docs]: http://rspec.info
diff --git a/doc/UbuntuInstallation.md b/doc/UbuntuInstallation.md
new file mode 100644
index 00000000..77e2cb56
--- /dev/null
+++ b/doc/UbuntuInstallation.md
@@ -0,0 +1,98 @@
+Firstly this walkthrough is done with a 14.04 32bit install of Ubuntu.
+Let's check if all updates for the system are installed first. In a
+terminal type:
+
+ sudo apt-get update
+
+Now we need to install git:
+
+ sudo apt-get install git
+
+Now let's get our RVM installed (Ruby Version Manager). Now this is fun
+because the package you will get from apt-get is outdated. So we are going
+to use CURL to get RVM
+
+ sudo apt-get install curl
+
+Then lets install RVM with curl like this
+
+ gpg --keyserver hkp://keys.gnupg.net \
+ --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
+ \curl -sSL https://get.rvm.io | bash -s stable
+ PATH=$PATH:$HOME/.rvm/bin
+ [[ -s "$HOME/.profile" ]] && source "$HOME/.profile"
+ [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
+ source ~/.rvm/scripts/rvm
+
+Now we can actually install RVM
+
+ rvm requirements
+
+Running this will check your system for requirements as well so you will need to put your system password in.
+
+All right now we can download metamaps from the master using git
+
+ git clone https://github.com/metamaps/metamaps_gen002.git
+
+Now there is a couple other things we are going to need which is nodejs, postgresql, libpq-dev and redis-server
+
+ sudo apt-get install nodejs npm
+ sudo ln -s /usr/bin/nodejs /usr/bin/node
+ sudo apt-get install postgresql
+ sudo apt-get install libpq-dev
+ sudo apt-get install redis-server
+
+Furthermore, if you want to be able to work on profile picture uploading,
+or use it you'll need ImageMagick. On Ubuntu, you can just go find
+ImageMagick in the Ubuntu Software Centre
+
+Install the specific version of ruby needed this will take some time
+
+ rvm install $(cat metamaps_gen002/.ruby-version)
+
+Now we also need to copy .example-env to a new file named .env. Review the
+configuration in here to see if you need any changes.
+
+ cp .example-env .env
+
+Now run inside your metamaps_gen002 folder:
+
+ gem install bundle
+ bundle install
+
+in your top level directory for metamaps. This is a lengthy process so you might want to go and make a coffee or something :)
+
+All right now we need to make sure your postgres password is the same as
+it is listed in the .env file so we are going to set it by
+
+ sudo -u postgres psql
+
+Use these commands to set the password to 3112 and then quit:
+
+ \password postgres
+ \q
+
+now we can use rake to create, load the schema into, and load db/seeds.rb
+into the postgres database:
+
+ rake db:setup
+
+Open a new terminal, navigate to the metamaps directory, and execute the
+server:
+
+ rails s
+
+and dont forget to run the other server for realtime...
+
+ cd realtime
+ npm install
+ node realtime-server.js
+
+Now you're all set enjoy your personal server of metamaps :) Navigate your browser to localhost:3000 once you have the server running. Sign in with the default account
+
+ email: user@user.com
+ password: toolsplusconsciousness
+
+OR create a new account at /join, and use access code 'qwertyui'
+
+Start mapping and programming!
diff --git a/doc/WindowsInstallation.md b/doc/WindowsInstallation.md
new file mode 100644
index 00000000..59e21298
--- /dev/null
+++ b/doc/WindowsInstallation.md
@@ -0,0 +1,54 @@
+Before you begin, you'll need to install stuff:
+
+Ruby, Git, and Rails: http://railsinstaller.org/en
+PostgreSQL 9.2: http://www.enterprisedb.com/products-services-training/pgdownload
+nodejs: http://nodejs.org/download
+
+During the installation of the PostgreSQL database, you'll need to choose a
+database password. Anything is fine, just note down what you choose.
+
+Once you are ready, create a new folder to hold this and any other git
+repositories. As an example, let's pretend you've chose C:\git, and made that
+folder writable by your user account.
+
+Now you are ready to clone the Metamaps git repository:
+
+ git clone https://github.com/metamaps/metamaps_gen002.git --branch develop
+ cd metamaps_gen002
+ bundle install
+
+The third `bundle install` command downloads and installs the rubygem
+dependencies of Metamaps.
+
+At this point you should be in C:\git\metamaps_gen002, or whatever equivalent
+directory you've chosen. The next step is to set up your database
+configuration. From the metamaps_gen002 directory, run
+
+ start config
+
+This command will open a Windows Explorer window of the "config" directory of
+Metamaps. Copy `.example-env`, and rename the copy to `.env`. Edit the file and
+set the DB_PASSWORD to be whatever you set up with postgres earlier. Once
+you're done, then move back into the command prompt. The next few commands will
+fail unless `.env` is correctly configured and Postgres is running.
+
+ rake db:create
+ rake db:schema:load
+ rake db:fixtures:load
+
+And you're set up! At this point, you should be able to run the server at any
+time with only one command; you don't need to repeat any of the previous steps
+again. The command to run the server is:
+
+ rails s
+
+Navigate your browser to localhost:3000 once you have the server running
+
+Sign in with the default account
+
+ email: user@user.com
+ password: toolsplusconsciousness
+
+OR create a new account at /join, and use access code 'qwertyui'
+
+Start mapping and programming!
diff --git a/doc/metamaps-qa-steps.md b/doc/metamaps-qa-steps.md
new file mode 100644
index 00000000..a3f136ca
--- /dev/null
+++ b/doc/metamaps-qa-steps.md
@@ -0,0 +1,39 @@
+# Metamaps Tests
+
+Run these tests to be reasonably sure that your code changes haven't broken anything.
+
+### Users & Accounts
+
+ - Create an account using your join code
+ - Log in to the interface
+ - Check your user's "generation"
+ - Edit your profile picture, email, name, and password
+ - Remove your profile picture
+
+### Maps, Topics, Synapses, and Permissions
+
+ - Create three maps: private, public, and another public
+ - Change the last map's permissions to commons
+ - Change a map's name
+ - Create a topic on map #1
+ - Verify (in a private window or another browser) that the second user can't acccess map #1
+ - Create a topic on map #2
+ - Verify that the second user **can't** edit map #2
+ - Create a topic on map #3
+ - Verify that the second user **can** edit map #3
+ - Pull a topic from map #1 to map #3
+ - Create a private topic on map #1
+ - Verify that the private topic can be pulled from map #1 by the same user
+ - Verify that the private topic can't be pulled from map #1 by another user
+
+### Mappings
+
+ - Add a number of topics to one of your maps. Reload to see if they are still there.
+ - Add a number of synapses to one of your maps. Reload to see if they are still there.
+ - Rearrange one of your maps and save the layout. Reload to see if the layout is preserved.
+
+### Misc
+
+ - Login as admin. Change metacode sets.
+ - Set the screenshot for one of your maps, and verify the index of maps is updated.
+ - Open two browsers on map #3 and verify that realtime editing works (you'll need to be running the realtime server for this to work).
diff --git a/lib/tasks/heroku.rake b/lib/tasks/heroku.rake
index af2dddf9..3e35fcbf 100644
--- a/lib/tasks/heroku.rake
+++ b/lib/tasks/heroku.rake
@@ -1,6 +1,8 @@
+require 'dotenv/tasks'
+
namespace :heroku do
desc "Generate the Heroku gems manifest from gem dependencies"
- task :gems do
+ task :gems => :dotenv do
RAILS_ENV='production'
Rake::Task[:environment].invoke
list = Rails.configuration.gems.collect do |g|
@@ -12,4 +14,4 @@ namespace :heroku do
f.write(list)
end
end
-end
\ No newline at end of file
+end
diff --git a/lib/tasks/perms.rake b/lib/tasks/perms.rake
new file mode 100644
index 00000000..70cd60f0
--- /dev/null
+++ b/lib/tasks/perms.rake
@@ -0,0 +1,16 @@
+require 'dotenv/tasks'
+
+namespace :perms do
+ desc "Update the Unix permissions on the public directory"
+ task :fix => :environment do
+ # e.g. rake perms:fix user=mmstaging group=mmstaging
+ # e.g. rake perms:fix group=www-data #probably don't need this one
+ # e.g. rake perms:fix
+ user = ENV['user'] || 'metamaps'
+ group = ENV['group'] || 'metamaps'
+ public_dir = Rails.root.join('public').to_s
+ system "chown -R #{user}:#{group} #{public_dir}"
+ system "find #{public_dir} -type d -exec chmod 755 '{}' \\;"
+ system "find #{public_dir} -type f -exec chmod 644 '{}' \\;"
+ end
+end
diff --git a/public/404.html b/public/404.html
index 9a48320a..d07c1069 100644
--- a/public/404.html
+++ b/public/404.html
@@ -3,24 +3,128 @@
The page you were looking for doesn't exist (404)
-
-
The page you were looking for doesn't exist.
-
You may have mistyped the address or the page may have moved.
+
+
+
404 - You've Found Nothing
+
Nothing is here!
+
There are nothings that inspire and nothings that motivate, but there are no nothings that cannot stir your experience of nothing.
+
Therefore there is nothing to see here, nothing to behold here, nothing to be here, maybe there is but definitely not here.
+
Therefore, move along! Nothing is ending here...
+
EXPLORE FEATURED MAPS
+
GO TO OUR BLOG
+
+
+
+