This commit is contained in:
Connor Turland 2014-10-20 12:33:16 -04:00
commit 551c46e24e
20 changed files with 63 additions and 161 deletions

View file

@ -55,6 +55,9 @@ $(document).ready(function () {
} }
} }
if (Metamaps.Active.Mapper) {
Metamaps.GlobalUI.Search.authInit();
}
}); });
Metamaps.GlobalUI = { Metamaps.GlobalUI = {
@ -63,9 +66,11 @@ Metamaps.GlobalUI = {
init: function () { init: function () {
var self = Metamaps.GlobalUI; var self = Metamaps.GlobalUI;
self.Search.init(); if (Metamaps.Active.Mapper) {
self.CreateMap.init(); self.Search.init();
self.Account.init(); self.CreateMap.init();
self.Account.init();
}
//bind lightbox clicks //bind lightbox clicks
$('.openLightbox').click(function (event) { $('.openLightbox').click(function (event) {

View file

@ -1588,6 +1588,7 @@ Metamaps.Util = {
Metamaps.Realtime = { Metamaps.Realtime = {
stringForLocalhost: 'http://localhost:5001', stringForLocalhost: 'http://localhost:5001',
stringForMetamaps: 'http://metamaps.cc:5001', stringForMetamaps: 'http://metamaps.cc:5001',
stringForTVW: 'http://tvw.mooo.com:5001',
stringForHeroku: 'http://gentle-savannah-1303.herokuapp.com', stringForHeroku: 'http://gentle-savannah-1303.herokuapp.com',
socket: null, socket: null,
isOpen: false, isOpen: false,
@ -1610,7 +1611,7 @@ Metamaps.Realtime = {
$('body').click(self.close); $('body').click(self.close);
var railsEnv = $('body').data('env'); 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.socket = io.connect(whichToConnect);
self.startActiveMap(); self.startActiveMap();
}, },

View file

@ -71,7 +71,7 @@ body,
height: 100%; height: 100%;
} }
.homePage .famousYield { .homePage .famousYield {
background: url(homepage-bg.png) no-repeat -515px -40px;
} }
.wrapper.mapPage { .wrapper.mapPage {
overflow: hidden; overflow: hidden;

View file

@ -1,6 +1,8 @@
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
protect_from_forgery protect_from_forgery
before_filter :require_user
# this is for global login # this is for global login
include ContentHelper include ContentHelper
@ -32,9 +34,13 @@ private
def require_user def require_user
unless authenticated? unless authenticated?
flash[:warning] = "You must be logged in."
store_location and redirect_to new_user_session_path path = request.env["PATH_INFO"]
return false
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
end end

View file

@ -1,7 +1,5 @@
class MappingsController < ApplicationController class MappingsController < ApplicationController
before_filter :require_user, only: [:create, :update, :destroy]
respond_to :json respond_to :json
# GET /mappings/1.json # GET /mappings/1.json

View file

@ -1,7 +1,5 @@
class MapsController < ApplicationController class MapsController < ApplicationController
before_filter :require_user, only: [:create, :update, :destroy]
respond_to :html, :json respond_to :html, :json
autocomplete :map, :name, :full => true, :extra_data => [:user_id] autocomplete :map, :name, :full => true, :extra_data => [:user_id]

View file

@ -1,8 +1,6 @@
class SynapsesController < ApplicationController class SynapsesController < ApplicationController
include TopicsHelper include TopicsHelper
before_filter :require_user, only: [:create, :update, :destroy]
respond_to :json respond_to :json
# GET /synapses/1.json # GET /synapses/1.json

View file

@ -1,8 +1,6 @@
class TopicsController < ApplicationController class TopicsController < ApplicationController
include TopicsHelper include TopicsHelper
before_filter :require_user, only: [:create, :update, :destroy]
respond_to :html, :js, :json respond_to :html, :js, :json
# GET /topics/autocomplete_topic # GET /topics/autocomplete_topic

View file

@ -1,7 +1,5 @@
class UsersController < ApplicationController class UsersController < ApplicationController
before_filter :require_user, only: [:edit, :update, :updatemetacodes]
respond_to :html, :json respond_to :html, :json
# GET /users/1.json # GET /users/1.json

View file

@ -3,7 +3,6 @@
# The inner HTML of the account box that comes up in the bottom left # The inner HTML of the account box that comes up in the bottom left
#%> #%>
<% if authenticated? %>
<% account = current_user %> <% account = current_user %>
<%= image_tag user.image.url(:thumb), :size => "48x48", :class => "sidebarAccountImage" %> <%= image_tag user.image.url(:thumb), :size => "48x48", :class => "sidebarAccountImage" %>
<h3 class="accountHeader"><%= account.name.split[0...1][0] %></h3> <h3 class="accountHeader"><%= account.name.split[0...1][0] %></h3>
@ -18,40 +17,8 @@
<%= link_to "Admin", metacodes_path, :data => { :bypass => 'true'} %> <%= link_to "Admin", metacodes_path, :data => { :bypass => 'true'} %>
</li> </li>
<% end %> <% end %>
<li class="accountListItem accountInvite openLightbox" data-open="invite">
<div class="accountIcon"></div>
<span>Share Invite</span>
</li>
<li class="accountListItem accountLogout"> <li class="accountListItem accountLogout">
<div class="accountIcon"></div> <div class="accountIcon"></div>
<%= link_to "Sign Out", "/logout", id: "Logout", :data => { :bypass => 'true'} %> <%= link_to "Sign Out", "/logout", id: "Logout", :data => { :bypass => 'true'} %>
</li> </li>
</ul> </ul>
<% else %>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { class: "loginAnywhere" }) do |f| %>
<div class="accountImage"></div>
<div class="accountInput accountEmail">
<%= f.email_field :email, :placeholder => "Email" %>
</div>
<div class="accountInput accountPassword">
<%= f.password_field :password, :placeholder => "Password" %>
</div>
<div class="accountSubmit"><%= f.submit "SIGN IN" %></div>
<% if devise_mapping.rememberable? -%>
<div class="accountRememberMe">
<%= f.label :remember_me, "Stay signed in" %>
<%= f.check_box :remember_me %>
<div class="clearfloat"></div>
</div>
<% end -%>
<div class="clearfloat"></div>
<div class="accountForgotPass">
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
<%= link_to "Forgot password?", new_password_path(resource_name),
:data => { :bypass => 'true'} %>
<% end -%>
</div>
<% end %>
<% end %>
<% # Rails.logger.info(stored_location_for(:user)) %>

View file

@ -6,7 +6,7 @@
<script type="text/javascript"> <script type="text/javascript">
var _gaq = _gaq || []; var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-35984510-1']); _gaq.push(['_setAccount', 'UA-55855180-1']);
_gaq.push(['_trackPageview']); _gaq.push(['_trackPageview']);
(function() { (function() {

View file

@ -155,44 +155,6 @@
</div> </div>
<div class="lightboxContent" id="getInvolved">
<h3>GET INVOLVED!</h3>
<div class="leaveSpace"></div>
<p>Want to help us with design, code, marketing and management for Metamaps? We are an open value network, which for us means that we want to invite and empower peers to participate in creating value together.</p>
<p>We welcome contributions in many forms. One of the easiest and best things you can do is to keep on mapping your ideas into the commons on the platform!</p>
<p>We welcome people of all skillsets to contribute to the project in different ways. Designers, researchers, academics, strategists, and facilitators can get in touch about opportunities to contribute to the project. If you're a developer, help us advance the code and take a look around our <a href="http://github.com/connoropolous/metamaps_gen002" target="_blank">Github</a>.</p>
<p>Financial contributions are greatly appreciated in support of our work. All financial contributions are transparently governed and recorded in our value accounting system.</p>
<script data-gratipay-username="Metamaps.cc" src="//gttp.co/v1.js" style="float:left;display:inline;"></script>
<div style="font-size:16px; width:250px; display:inline; float:right" class="blockchain-btn"
data-address="14GontNS1FKoiTQDEB5WBCUDZaFTiyxkzN"
data-shared="false">
<div class="blockchain stage-begin">
<img src="https://blockchain.info//Resources/buttons/donate_64.png"/>
</div>
<div class="blockchain stage-loading" style="display:inline;float:right;">
<img src="https://blockchain.info//Resources/loading-large.gif"/>
</div>
<div class="blockchain stage-ready">
<p align="center">Please Donate To Bitcoin Address: <b>[[address]]</b></p>
<p align="center" class="qr-code"></p>
</div>
<div class="blockchain stage-paid">
Donation of <b>[[value]] BTC</b> Received. Thank You.
</div>
<div class="blockchain stage-error">
<font color="red">[[error]]</font>
</div>
</div>
<div class="clearfloat"></div>
</div>
<div class="lightboxContent" id="tutorial"> <div class="lightboxContent" id="tutorial">
<h3>Tutorial</h3> <h3>Tutorial</h3>
<iframe src="//player.vimeo.com/video/88334167?title=0&amp;byline=0&amp;portrait=0" width="510" height="319" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> <iframe src="//player.vimeo.com/video/88334167?title=0&amp;byline=0&amp;portrait=0" width="510" height="319" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
@ -203,20 +165,6 @@
</div> </div>
<% if authenticated? %> <% if authenticated? %>
<div class="lightboxContent" id="invite">
<h3>SHARE INVITE</h3>
<div class="leaveSpace"></div>
<p>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.</p>
<p>Copy and send the link + access code below. The access code below is your personal code and can be used multiple times.</p>
<div id="joinCodesBox">
<p class="joinCodes">HTTP://METAMAPS.CC/JOIN</p>
<% mapper = current_user %>
<p class="joinCodes">ACCESS CODE: <%= mapper.code %></p>
</div>
</div>
<% # this is the create new map form %> <% # this is the create new map form %>
<div class="lightboxContent" id="newmap"> <div class="lightboxContent" id="newmap">
<%= render :partial => 'layouts/newmap' %> <%= render :partial => 'layouts/newmap' %>

View file

@ -4,7 +4,7 @@
<div class="upperLeftUI"> <div class="upperLeftUI">
<!-- home button --> <!-- home button -->
<div class="homeButton"> <div class="homeButton">
<a href="<%= root_url %>" <% if !authenticated? %><%= 'data-bypass=true' %><% end %>></a> <a href="<%= root_url %>"></a>
</div> <!-- end homeButton --> </div> <!-- end homeButton -->
<!-- search box --> <!-- search box -->
@ -19,7 +19,6 @@
<div class="upperRightUI"> <div class="upperRightUI">
<div class="mapElement upperRightEl upperRightMapButtons"> <div class="mapElement upperRightEl upperRightMapButtons">
<% if authenticated? %>
<!-- Realtime --> <!-- Realtime -->
<div class="sidebarCollaborate upperRightEl"> <div class="sidebarCollaborate upperRightEl">
<div class="sidebarCollaborateIcon upperRightIcon blue"></div> <div class="sidebarCollaborateIcon upperRightIcon blue"></div>
@ -39,7 +38,6 @@
</div> </div>
</div> </div>
</div> <!-- end sidebarCollaborate a.k.a realtime --> </div> <!-- end sidebarCollaborate a.k.a realtime -->
<% end %>
<!-- filtering --> <!-- filtering -->
<div class="sidebarFilter upperRightEl"> <div class="sidebarFilter upperRightEl">
@ -49,37 +47,27 @@
</div> </div>
</div> <!-- end sidebarFilter --> </div> <!-- end sidebarFilter -->
<% if authenticated? %>
<!-- fork map --> <!-- fork map -->
<div class="sidebarFork upperRightEl"> <div class="sidebarFork upperRightEl">
<div class="sidebarForkIcon upperRightIcon"></div> <div class="sidebarForkIcon upperRightIcon"></div>
</div> <!-- end sidebarFork --> </div> <!-- end sidebarFork -->
<% end %>
<div class="clearfloat"></div> <div class="clearfloat"></div>
</div> <!-- end mapElement --> </div> <!-- end mapElement -->
<% if authenticated? %>
<!-- create new map --> <!-- create new map -->
<div class="addMap openLightbox upperRightEl upperRightIcon" data-open="newmap"> <div class="addMap openLightbox upperRightEl upperRightIcon" data-open="newmap">
</div><!-- end addMap --> </div><!-- end addMap -->
<% end %>
<!-- Account / Sign in --> <!-- Account / Sign in -->
<% if !(controller_name == "sessions" && action_name == "new") %>
<div class="sidebarAccount upperRightEl"> <div class="sidebarAccount upperRightEl">
<div class="sidebarAccountIcon"> <div class="sidebarAccountIcon">
<% if user && user.image %>
<%= image_tag user.image.url(:thumb), :size => "32x32" %> <%= image_tag user.image.url(:thumb), :size => "32x32" %>
<% elsif !authenticated? %>
SIGN IN
<div class="accountInnerArrow"></div>
<% end %>
</div> </div>
<div class="sidebarAccountBox upperRightBox"> <div class="sidebarAccountBox upperRightBox">
<%= render :partial => 'layouts/account' %> <%= render :partial => 'layouts/account' %>
</div> </div>
</div><!-- end sidebarAccount --> </div><!-- end sidebarAccount -->
<% end %>
<div class="clearfloat"></div> <div class="clearfloat"></div>
</div><!-- end upperRightUI --> </div><!-- end upperRightUI -->

View file

@ -51,19 +51,21 @@
<div class="wrapper <%= classes %>" id="wrapper"> <div class="wrapper <%= classes %>" id="wrapper">
<% if authenticated? %>
<%= render :partial => 'layouts/upperelements' %> <%= render :partial => 'layouts/upperelements' %>
<% end %>
<%= yield %> <%= yield %>
<div class="showcard mapElement mapElementHidden" id="showcard"></div> <!-- the topic card -->
<% if authenticated? %> <% if authenticated? %>
<% # for creating and pulling in topics and synapses %> <div class="showcard mapElement mapElementHidden" id="showcard"></div> <!-- the topic card -->
<%= render :partial => 'maps/newtopic' %> <% # for creating and pulling in topics and synapses %>
<%= render :partial => 'maps/newsynapse' %> <%= render :partial => 'maps/newtopic' %>
<% # for populating the change metacode list on the topic card %> <%= render :partial => 'maps/newsynapse' %>
<%= render :partial => 'shared/metacodeoptions' %> <% # for populating the change metacode list on the topic card %>
<%= render :partial => 'shared/metacodeoptions' %>
<%= render :partial => 'layouts/lowermapelements' %>
<% end %> <% end %>
<%= render :partial => 'layouts/lowermapelements' %>
<div id="famousOverlay"></div> <div id="famousOverlay"></div>
<div id="loading"></div> <div id="loading"></div>

View file

@ -8,22 +8,33 @@
<% content_for :title, "Home | Metamaps" %> <% content_for :title, "Home | Metamaps" %>
<div id="yield"> <div id="yield">
<div class="homeWrapper"> <div class="homeWrapper">
<div class="homeTitle">EXPERIENCE METAMAPS</div> <div class="homeTitle">THE VALUE WEB</div>
<div class="homeIntro">
<span class="green">metamaps.cc</span> 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... <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { class: "loginAnywhere" }) do |f| %>
</div> <div class="accountInput accountEmail">
<iframe class="homeVideo" src="//player.vimeo.com/video/88334167?title=0&amp;byline=0&amp;portrait=0" width="560" height="315" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> <%= f.email_field :email, :placeholder => "Email" %>
<div class="callToAction"> </div>
<a href="/request" class="requestInviteCTA" data-bypass="true">REQUEST INVITE</a> <div class="accountInput accountPassword">
<a href="/explore/featured" class="exploreFeaturedCTA">EXPLORE FEATURED MAPS</a> <%= f.password_field :password, :placeholder => "Password" %>
</div> </div>
<div class="accountSubmit"><%= f.submit "SIGN IN" %></div>
<% if devise_mapping.rememberable? -%>
<div class="accountRememberMe">
<%= f.label :remember_me, "Stay signed in" %>
<%= f.check_box :remember_me %>
<div class="clearfloat"></div>
</div>
<% end -%>
<div class="clearfloat"></div>
<div class="accountForgotPass">
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
<%= link_to "Forgot password?", new_password_path(resource_name),
:data => { :bypass => 'true'} %>
<% end -%>
</div>
<% end %>
</div> </div>
</div><!-- end yield --> </div><!-- end yield -->
<div class="github-fork-ribbon-wrapper left-bottom">
<div class="github-fork-ribbon">
<a href="https://github.com/connoropolous/metamaps_gen002" target="_blank">Fork me on GitHub</a>
</div>
</div>
<script> <script>
Metamaps.currentSection = ""; Metamaps.currentSection = "";
Metamaps.currentPage = ""; Metamaps.currentPage = "";

View file

@ -1,11 +0,0 @@
<%#
# @file
# Located at /request
# Shows a form where people can request an invite
#%>
<% content_for :title, "Request Invite | Metamaps" %>
<div id="yield">
<iframe class="requestInvite" src="https://docs.google.com/forms/d/1lWoKPFHErsDfV5l7-SvcHxwX3vDi9nNNVW0rFMgJwgg/viewform?embedded=true" width="700" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
</div>

View file

@ -22,8 +22,6 @@
<%= f.text_field :joinedwithcode %></div> <%= f.text_field :joinedwithcode %></div>
<div><%= f.submit "Sign up!" %></div> <div><%= f.submit "Sign up!" %></div>
<div class = "smallText"><br />Don't have an access code?<br /><a href="/request" data-bypass="true">Request an Invite</a></div>
<% end %> <% end %>
</div> </div>

View file

@ -7,8 +7,6 @@ Metamaps::Application.routes.draw do
#To debug sidekiq and monitor processes, enable this route #To debug sidekiq and monitor processes, enable this route
#mount Sidekiq::Web, at: '/sidekiq' #mount Sidekiq::Web, at: '/sidekiq'
match 'request', to: 'main#requestinvite', via: :get, as: :request
match 'search/topics', to: 'main#searchtopics', via: :get, as: :searchtopics match 'search/topics', to: 'main#searchtopics', via: :get, as: :searchtopics
match 'search/maps', to: 'main#searchmaps', via: :get, as: :searchmaps match 'search/maps', to: 'main#searchmaps', via: :get, as: :searchmaps
match 'search/mappers', to: 'main#searchmappers', via: :get, as: :searchmappers match 'search/mappers', to: 'main#searchmappers', via: :get, as: :searchmappers

View file

@ -6,8 +6,7 @@ t.logoContent = '<div class="logo">METAMAPS</div>';
t.logoContent += '<ul class="bottomLinks">'; t.logoContent += '<ul class="bottomLinks">';
t.logoContent += '<li onclick="Metamaps.GlobalUI.openLightbox(\'about\')">About /&nbsp;</li>'; t.logoContent += '<li onclick="Metamaps.GlobalUI.openLightbox(\'about\')">About /&nbsp;</li>';
t.logoContent += '<li><a href="http://metamaps.cc/maps/331" data-bypass="true">Terms of Use /&nbsp;</a></li>'; t.logoContent += '<li><a href="http://metamaps.cc/maps/331" data-bypass="true">Terms of Use /&nbsp;</a></li>';
t.logoContent += '<li onclick="Metamaps.GlobalUI.openLightbox(\'colophon\')">Colophon /&nbsp;</li>'; t.logoContent += '<li onclick="Metamaps.GlobalUI.openLightbox(\'colophon\')">Colophon</li>';
t.logoContent += '<li onclick="Metamaps.GlobalUI.openLightbox(\'getInvolved\')">Get Involved!</li>';
t.logoContent += '</ul>'; t.logoContent += '</ul>';
/* logged out explore maps bars */ /* logged out explore maps bars */

View file

@ -9,7 +9,7 @@ if (args.length <= 1) {
//configurable variables - CHANGE ME //configurable variables - CHANGE ME
var mapID = args[1]; var mapID = args[1];
var environment = args[2]; var environment = args[2];
var address = environment === 'development' ? 'http://localhost:3000' : 'http://metamaps.herokuapp.com'; var address = environment === 'development' ? 'http://localhost:3000' : 'http://tvw.mooo.com';
var url = address + '/maps/' + mapID; var url = address + '/maps/' + mapID;
var width = 940; var width = 940;
var height = 630; var height = 630;