diff --git a/app/assets/javascripts/src/Metamaps.GlobalUI.js b/app/assets/javascripts/src/Metamaps.GlobalUI.js index 055ec38d..66850cc5 100644 --- a/app/assets/javascripts/src/Metamaps.GlobalUI.js +++ b/app/assets/javascripts/src/Metamaps.GlobalUI.js @@ -55,6 +55,9 @@ $(document).ready(function () { } } + if (Metamaps.Active.Mapper) { + Metamaps.GlobalUI.Search.authInit(); + } }); Metamaps.GlobalUI = { @@ -63,9 +66,11 @@ Metamaps.GlobalUI = { init: function () { var self = Metamaps.GlobalUI; - self.Search.init(); - self.CreateMap.init(); - self.Account.init(); + if (Metamaps.Active.Mapper) { + self.Search.init(); + self.CreateMap.init(); + self.Account.init(); + } //bind lightbox clicks $('.openLightbox').click(function (event) { diff --git a/app/assets/javascripts/src/Metamaps.js b/app/assets/javascripts/src/Metamaps.js index 74974814..745a46bf 100644 --- a/app/assets/javascripts/src/Metamaps.js +++ b/app/assets/javascripts/src/Metamaps.js @@ -1588,6 +1588,7 @@ Metamaps.Util = { Metamaps.Realtime = { stringForLocalhost: 'http://localhost:5001', stringForMetamaps: 'http://metamaps.cc:5001', + stringForTVW: 'http://tvw.mooo.com:5001', stringForHeroku: 'http://gentle-savannah-1303.herokuapp.com', socket: null, isOpen: false, @@ -1610,7 +1611,7 @@ Metamaps.Realtime = { $('body').click(self.close); var railsEnv = $('body').data('env'); - var whichToConnect = railsEnv === 'development' ? self.stringForLocalhost : self.stringForHeroku; + var whichToConnect = railsEnv === 'development' ? self.stringForLocalhost : self.stringForTVW; self.socket = io.connect(whichToConnect); self.startActiveMap(); }, diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index c6002195..75f071ac 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -71,7 +71,7 @@ body, height: 100%; } .homePage .famousYield { - background: url(homepage-bg.png) no-repeat -515px -40px; + } .wrapper.mapPage { overflow: hidden; diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bd95bd64..437ffcad 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,7 @@ class ApplicationController < ActionController::Base protect_from_forgery + + before_filter :require_user # this is for global login include ContentHelper @@ -32,9 +34,13 @@ private def require_user unless authenticated? - flash[:warning] = "You must be logged in." - store_location and redirect_to new_user_session_path - return false + + path = request.env["PATH_INFO"] + + unless path == "/" || path == new_user_registration_path || path == new_user_session_path + store_location_for(:user, path) and redirect_to root_url + return false + end end end diff --git a/app/controllers/mappings_controller.rb b/app/controllers/mappings_controller.rb index b28c7638..315cfc8f 100644 --- a/app/controllers/mappings_controller.rb +++ b/app/controllers/mappings_controller.rb @@ -1,7 +1,5 @@ class MappingsController < ApplicationController - - before_filter :require_user, only: [:create, :update, :destroy] - + respond_to :json # GET /mappings/1.json diff --git a/app/controllers/maps_controller.rb b/app/controllers/maps_controller.rb index 72d81656..17c6c71f 100644 --- a/app/controllers/maps_controller.rb +++ b/app/controllers/maps_controller.rb @@ -1,7 +1,5 @@ class MapsController < ApplicationController - before_filter :require_user, only: [:create, :update, :destroy] - respond_to :html, :json autocomplete :map, :name, :full => true, :extra_data => [:user_id] diff --git a/app/controllers/synapses_controller.rb b/app/controllers/synapses_controller.rb index c048627c..45fc4eda 100644 --- a/app/controllers/synapses_controller.rb +++ b/app/controllers/synapses_controller.rb @@ -1,7 +1,5 @@ class SynapsesController < ApplicationController include TopicsHelper - - before_filter :require_user, only: [:create, :update, :destroy] respond_to :json diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb index c2690756..388322cf 100644 --- a/app/controllers/topics_controller.rb +++ b/app/controllers/topics_controller.rb @@ -1,8 +1,6 @@ class TopicsController < ApplicationController include TopicsHelper - before_filter :require_user, only: [:create, :update, :destroy] - respond_to :html, :js, :json # GET /topics/autocomplete_topic diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 26085e6b..f4ae90c9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,6 +1,4 @@ class UsersController < ApplicationController - - before_filter :require_user, only: [:edit, :update, :updatemetacodes] respond_to :html, :json diff --git a/app/views/layouts/_account.html.erb b/app/views/layouts/_account.html.erb index ffe69b7e..e1e73cd6 100644 --- a/app/views/layouts/_account.html.erb +++ b/app/views/layouts/_account.html.erb @@ -3,7 +3,6 @@ # The inner HTML of the account box that comes up in the bottom left #%> -<% if authenticated? %> <% account = current_user %> <%= image_tag user.image.url(:thumb), :size => "48x48", :class => "sidebarAccountImage" %>

<%= account.name.split[0...1][0] %>

@@ -18,40 +17,8 @@ <%= link_to "Admin", metacodes_path, :data => { :bypass => 'true'} %> <% end %> -
  • -
    - Share Invite -
  • <%= link_to "Sign Out", "/logout", id: "Logout", :data => { :bypass => 'true'} %>
  • - -<% else %> - <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { class: "loginAnywhere" }) do |f| %> -
    -
    - <%= f.email_field :email, :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 %> -<% end %> - -<% # Rails.logger.info(stored_location_for(:user)) %> + \ No newline at end of file diff --git a/app/views/layouts/_googleanalytics.html.erb b/app/views/layouts/_googleanalytics.html.erb index 104ff8ab..484aa762 100644 --- a/app/views/layouts/_googleanalytics.html.erb +++ b/app/views/layouts/_googleanalytics.html.erb @@ -6,7 +6,7 @@ -
    -
    - -
    -
    - - -
    -
    -

    Please Donate To Bitcoin Address: [[address]]

    -

    -
    -
    - Donation of [[value]] BTC Received. Thank You. -
    -
    - [[error]] -
    -
    - -
    -

    Tutorial

    @@ -203,20 +165,6 @@
    <% if authenticated? %> -
    -

    SHARE INVITE

    - -
    -

    The Metamaps platform is currently in an invite-only beta with the express purpose of creating a high value knowledge ecosystem, as well as building a community of contributors. As a valued beta tester, you have the ability to invite your peers, colleagues and collaborators onto the platform.

    -

    Copy and send the link + access code below. The access code below is your personal code and can be used multiple times.

    -
    -

    HTTP://METAMAPS.CC/JOIN

    - <% mapper = current_user %> -

    ACCESS CODE: <%= mapper.code %>

    -
    - -
    - <% # this is the create new map form %>
    <%= render :partial => 'layouts/newmap' %> diff --git a/app/views/layouts/_upperelements.html.erb b/app/views/layouts/_upperelements.html.erb index 07aea898..f2bbd85f 100644 --- a/app/views/layouts/_upperelements.html.erb +++ b/app/views/layouts/_upperelements.html.erb @@ -4,7 +4,7 @@
    @@ -19,7 +19,6 @@
    - <% if authenticated? %>
    @@ -39,7 +38,6 @@
    - <% end %>
    @@ -49,37 +47,27 @@
    - <% if authenticated? %>
    - <% end %>
    - <% if authenticated? %>
    - <% end %> - <% if !(controller_name == "sessions" && action_name == "new") %>
    - <% if user && user.image %> <%= image_tag user.image.url(:thumb), :size => "32x32" %> - <% elsif !authenticated? %> - SIGN IN -
    - <% end %>
    <%= render :partial => 'layouts/account' %>
    - <% end %> +
    \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 87f8829d..97da10cd 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -51,19 +51,21 @@
    + <% if authenticated? %> <%= render :partial => 'layouts/upperelements' %> + <% end %> <%= yield %> -
    <% if authenticated? %> - <% # for creating and pulling in topics and synapses %> - <%= render :partial => 'maps/newtopic' %> - <%= render :partial => 'maps/newsynapse' %> - <% # for populating the change metacode list on the topic card %> - <%= render :partial => 'shared/metacodeoptions' %> +
    + <% # for creating and pulling in topics and synapses %> + <%= render :partial => 'maps/newtopic' %> + <%= render :partial => 'maps/newsynapse' %> + <% # for populating the change metacode list on the topic card %> + <%= render :partial => 'shared/metacodeoptions' %> + <%= render :partial => 'layouts/lowermapelements' %> <% end %> - <%= render :partial => 'layouts/lowermapelements' %>
    diff --git a/app/views/main/home.html.erb b/app/views/main/home.html.erb index 71dd5e5b..62affb41 100644 --- a/app/views/main/home.html.erb +++ b/app/views/main/home.html.erb @@ -8,22 +8,33 @@ <% content_for :title, "Home | Metamaps" %>
    -
    EXPERIENCE METAMAPS
    -
    - metamaps.cc is a free and open source platform. It enables individuals, communities, and organizations to build and visualize their shared knowledge and unlock their collective intelligence... -
    - - +
    THE VALUE WEB
    + + <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { class: "loginAnywhere" }) do |f| %> +
    + <%= f.email_field :email, :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 %>
    -
    -
    - -
    +