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 = {
@ -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) {

View file

@ -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();
},

View file

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

View file

@ -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

View file

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

View file

@ -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]

View file

@ -1,7 +1,5 @@
class SynapsesController < ApplicationController
include TopicsHelper
before_filter :require_user, only: [:create, :update, :destroy]
respond_to :json

View file

@ -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

View file

@ -1,6 +1,4 @@
class UsersController < ApplicationController
before_filter :require_user, only: [:edit, :update, :updatemetacodes]
respond_to :html, :json

View file

@ -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" %>
<h3 class="accountHeader"><%= account.name.split[0...1][0] %></h3>
@ -18,40 +17,8 @@
<%= link_to "Admin", metacodes_path, :data => { :bypass => 'true'} %>
</li>
<% end %>
<li class="accountListItem accountInvite openLightbox" data-open="invite">
<div class="accountIcon"></div>
<span>Share Invite</span>
</li>
<li class="accountListItem accountLogout">
<div class="accountIcon"></div>
<%= link_to "Sign Out", "/logout", id: "Logout", :data => { :bypass => 'true'} %>
</li>
</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)) %>
</ul>

View file

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

View file

@ -154,44 +154,6 @@
<p id="noIEbody">While it's downloading, explore our <a href="http://blog.metamaps.cc/">blog</a>,<br> watch the <a href="http://vimeo.com/88334167">tutorials</a>, or visit our <a href="http://support.metamaps.cc/">knowledge base</a>!
</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">
<h3>Tutorial</h3>
@ -203,20 +165,6 @@
</div>
<% 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 %>
<div class="lightboxContent" id="newmap">
<%= render :partial => 'layouts/newmap' %>

View file

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

View file

@ -51,19 +51,21 @@
<div class="wrapper <%= classes %>" id="wrapper">
<% if authenticated? %>
<%= render :partial => 'layouts/upperelements' %>
<% end %>
<%= yield %>
<div class="showcard mapElement mapElementHidden" id="showcard"></div> <!-- the topic card -->
<% 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' %>
<div class="showcard mapElement mapElementHidden" id="showcard"></div> <!-- the topic card -->
<% # 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' %>
<div id="famousOverlay"></div>
<div id="loading"></div>

View file

@ -8,22 +8,33 @@
<% content_for :title, "Home | Metamaps" %>
<div id="yield">
<div class="homeWrapper">
<div class="homeTitle">EXPERIENCE METAMAPS</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...
</div>
<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>
<div class="callToAction">
<a href="/request" class="requestInviteCTA" data-bypass="true">REQUEST INVITE</a>
<a href="/explore/featured" class="exploreFeaturedCTA">EXPLORE FEATURED MAPS</a>
</div>
<div class="homeTitle">THE VALUE WEB</div>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { class: "loginAnywhere" }) do |f| %>
<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 %>
</div>
</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>
</div><!-- end yield -->
<script>
Metamaps.currentSection = "";
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>
<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 %>
</div>

View file

@ -6,9 +6,7 @@ Metamaps::Application.routes.draw do
#To debug sidekiq and monitor processes, enable this route
#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/maps', to: 'main#searchmaps', via: :get, as: :searchmaps
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 += '<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 onclick="Metamaps.GlobalUI.openLightbox(\'colophon\')">Colophon /&nbsp;</li>';
t.logoContent += '<li onclick="Metamaps.GlobalUI.openLightbox(\'getInvolved\')">Get Involved!</li>';
t.logoContent += '<li onclick="Metamaps.GlobalUI.openLightbox(\'colophon\')">Colophon</li>';
t.logoContent += '</ul>';
/* logged out explore maps bars */

View file

@ -9,7 +9,7 @@ if (args.length <= 1) {
//configurable variables - CHANGE ME
var mapID = args[1];
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 width = 940;
var height = 630;