adding routes and removing old files

This commit is contained in:
Connor Turland 2018-02-15 15:17:59 -05:00
parent 9cd5246411
commit 6309d764f9
11 changed files with 130 additions and 261 deletions

51
src/routes/Join.js Normal file
View file

@ -0,0 +1,51 @@
import React, { Component } from 'react'
class Join extends Component {
render = () => {
return (
<div id="yield">
<form className="new_user centerGreyForm" id="new_user" action="/users" acceptCharset="UTF-8" method="post">
<input name="utf8" type="hidden" value="✓" />
<input type="hidden" name="authenticity_token" value="2tn+UQ0ovmjyJOBObmSLGbN6vrRH+SOqT8s4GPtWIA2jN03P9LGdj55le6bRduSHgo8cM379hoOJ5COgRqx6fA==" />
<h3>Sign Up</h3>
<div>
<label className="firstFieldText" htmlFor="user_name">Name:</label>
<input autoFocus="autofocus" type="text" name="user[name]" id="user_name" />
</div>
<div>
<label className="fieldText" htmlFor="user_email">Email:</label>
<input type="email" name="user[email]" id="user_email" />
</div>
<div>
<label className="fieldText" htmlFor="user_password">Password:</label>
<input type="password" name="user[password]" id="user_password" />
</div>
<div>
<label className="fieldText" htmlFor="user_password_confirmation">Password Confirmation:</label>
<input type="password" name="user[password_confirmation]" id="user_password_confirmation" />
</div>
<div>
<label className="fieldText" htmlFor="user_Access Code:">Access code:</label>
<input type="text" name="user[joinedwithcode]" id="user_joinedwithcode" />
</div>
<div>
<input type="submit" name="commit" value="Sign up!" data-disable-with="Sign up!" />
</div>
<div className="smallText">
<br />Don't have an access code?<br /><a href="/request">Request an Invite</a>
</div>
</form>
</div>
)
}
}
export default Join

38
src/routes/Login.js Normal file
View file

@ -0,0 +1,38 @@
import React, { Component } from 'react'
class Login extends Component {
render = () => {
return (
<div id="yield">
<form className="centerGreyForm login" id="new_user" action="/login" acceptCharset="UTF-8" method="post">
<input name="utf8" type="hidden" value="✓" />
<input type="hidden" name="authenticity_token" value="lUpsAx9IJuu8tbp6FEWtzgj5iE/juyOGXP3O3m3tqdzspN+d5tEFDND0IZKrV8JQOQwqyNq/hq+a0tVm0BfzrQ==" />
<h3>SIGN IN</h3>
<div className="accountImage"></div>
<div>
<input autoFocus="autofocus" placeholder="Email" type="email" name="user[email]" id="user_email" /></div>
<div>
<input placeholder="Password" type="password" name="user[password]" id="user_password" /></div>
<div className="accountSubmit">
<input type="submit" name="commit" value="Sign in" data-disable-with="Sign in" />
</div>
<div className="accountRememberMe">
<label htmlFor="user_remember_me">Stay signed in</label>
<input name="user[remember_me]" type="hidden" value="0" />
<input type="checkbox" value="1" name="user[remember_me]" id="user_remember_me" />
<div className="clearfloat"></div>
</div>
<div className="clearfloat"></div>
<div className="accountForgotPass">
<a href="/users/password/new">Forgot password?</a>
</div>
</form>
</div>
)
}
}
export default Login

View file

@ -1,22 +1,24 @@
<%#
# @file
# Code to request access to a map
# /maps/:id/request_access
#%>
import React, { Component } from 'react'
<% content_for :title, 'Request Access | Metamaps' %>
<% content_for :mobile_title, 'Request Access' %>
class RequestAccess extends Component {
render = () => {
return (
<div id="yield">
<div className='request_access'>
<div className='monkey'></div>
<div className='explainer_text'>
Hmmm. This map is private, but you can request to edit it from the map creator.
</div>
<div className='make_request'>REQUEST ACCESS</div>
</div>
</div>
)
}
}
<div id="yield">
<div class='request_access'>
<div class='monkey'></div>
<div class='explainer_text'>
Hmmm. This map is private, but you can request to edit it from the map creator.
</div>
<div class='make_request'>REQUEST ACCESS</div>
</div>
</div>
export default RequestAccess
/*
<script>
$(document).ready(function() {
$('.make_request').click(function() {
@ -35,3 +37,4 @@ $(document).ready(function() {
})
})
</script>
*/

View file

@ -0,0 +1,14 @@
import React, { Component } from 'react'
class RequestAccess extends Component {
render = () => {
return (
<div>
<div className="requestInviteHeader"></div>
<iframe className="requestInvite" src="https://docs.google.com/forms/d/1lWoKPFHErsDfV5l7-SvcHxwX3vDi9nNNVW0rFMgJwgg/viewform?embedded=true" width="700" frameBorder="0" marginHeight="0" marginWidth="0">Loading...</iframe>
</div>
)
}
}
export default RequestAccess

View file

@ -8,6 +8,10 @@ import MapView from './MapView'
import Notifications from './Notifications'
import TopicView from './TopicView'
import LoggedOutHome from './LoggedOutHome'
import RequestAccess from './RequestAccess'
import RequestInvite from './RequestInvite'
import Login from './Login'
import Join from './Join'
function nullComponent(props) {
return null
@ -27,13 +31,12 @@ export default function makeRoutes (currentUser) {
</Route>
<Route path="maps/:id">
<IndexRoute component={MapView} />
<Route path="conversation" component={MapView} />
<Route path="request_access" component={nullComponent} />
<Route path="request_access" component={RequestAccess} />
</Route>
<Route path="topics/:id" component={TopicView} />
<Route path="login" component={nullComponent} />
<Route path="join" component={nullComponent} />
<Route path="request" component={nullComponent} />
<Route path="login" component={Login} />
<Route path="join" component={Join} />
<Route path="request" component={RequestInvite} />
<Route path="notifications">
<IndexRoute component={Notifications} />
<Route path=":id" component={Notifications} />

View file

@ -1,40 +0,0 @@
<%#
# @file
# Located at /
# Shows 3 most recently created topics, synapses, and maps.
#
%>
<% content_for :title, "Home | Metamaps" %>
<% content_for :mobile_title, "Home" %>
<div id="yield">
<div class="homeWrapper homeText">
<div class="homeTitle">Make Sense with Metamaps</div>
<div class="homeIntro">
<span class="green din-medium">METAMAPS.CC</span> is a free and open source platform that supports real-time sense-making, distributed collaboration, and the creative intelligence of individuals, organizations and communities. We are currently in an <span class="din-medium">invite-only beta.</span>
</div>
</div>
<div class="fullWidthWrapper withVideo">
<div class="homeWrapper">
<iframe class="homeVideo" src="https://player.vimeo.com/video/113154814" width="560" height="315" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<div class="callToAction">
<h3>Who finds it useful?</h3>
<p>Designers, inventors, artists, educators, strategists, consultants, facilitators, entrepreneurs, systems thinkers, changemakers, analysts, students, researchers... maybe you!</p>
<button type="button" class="button learnMoreCTA" onclick="Metamaps.GlobalUI.openLightbox('about');">LEARN MORE</button>
<a href="/explore/featured" data-router="true" class="exploreFeaturedCTA">EXPLORE FEATURED MAPS</a>
<a href="/request" class="requestInviteCTA">REQUEST INVITE</a>
</div>
<div class="clearfloat"></div>
</div>
</div>
<div class="fullWidthWrapper withPartners">
<div class="homeWrapper homePartners">
<% # our partners %>
</div>
</div>
</div><!-- end yield -->
<script>
Metamaps.currentSection = ''
Metamaps.currentPage = ''
</script>

View file

@ -1,10 +0,0 @@
<%#
# @file
# Located at /request
# Shows a form where people can request an invite
#%>
<% content_for :title, "Request Invite | Metamaps" %>
<% content_for :mobile_title, "Request Invite" %>
<div class="requestInviteHeader"></div>
<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>

View file

@ -1,96 +0,0 @@
<%#
# Partial rendering form for a new topic on a map
# This code is called when viewing a metamap in show.html.erb in the views/maps folder
#%>
<div class="mapInfoBox mapElement mapElementHidden permission
<%= @map && @map.user == user ? " yourMap" : "" %>
<%= @map && policy(@map).update? ? " canEdit" : "" %>
<%= @map && @map.permission != 'private' ? " shareable" : "" %>">
<% if current_user %>
<div class="requestTitle">
Click here to name this map
</div>
<% end %>
<% if @map %>
<div class="mapInfoName" id="mapInfoName">
<% if policy(@map).update? %>
<span class="best_in_place best_in_place_name" id="best_in_place_map_<%= @map.id %>_name" data-bip-url="/maps/<%= @map.id %>" data-bip-object="map" data-bip-attribute="name" data-bip-type="textarea" data-bip-activator="#mapInfoName" data-bip-value="<%= @map.name %>"><%= @map.name %></span>
<% else %>
<%= @map.name %>
<% end %>
</div>
<div class="mapInfoStat">
<div class="infoStatIcon mapContributors hoverForTip">
<% relevantPeople = @map.permission == "commons" ? @map.contributors : @map.editors %>
<% if relevantPeople.count == 0 %>
<img id="mapContribs" width="25" height="25" src="<%= asset_path('user.png'); %>" />
<% elsif relevantPeople.count == 1 %>
<img id="mapContribs" width="25" height="25" src="<%= relevantPeople[0].image.url(:thirtytwo) %>" />
<% elsif relevantPeople.count == 2 %>
<img id="mapContribs" width="25" height="25" src="<%= relevantPeople[0].image.url(:thirtytwo) %>" class="multiple mTwo" />
<% elsif relevantPeople.count > 2 %>
<img id="mapContribs" width="25" height="25" src="<%= relevantPeople[0].image.url(:thirtytwo) %>" class="multiple" />
<% end %>
<span class="count"><%= relevantPeople.count %></span>
<div class="tip">
<ul><% relevantPeople.each_with_index do |c, index| %>
<li>
<a href="/explore/mapper/<%= c.id %>" > <img class="rtUserImage" width="25" height="25" src="<%= asset_path c.image.url(:thirtytwo) %>" />
<%= c.name %>
<% if @map.user == c %> (creator)<% end %>
</a>
<% if @map.user != c && @map.user == current_user %>
<span class="removeCollaborator" data-id=" + m.get('id') + "></span>
<% end %>
</li>
<% end %>
</ul>
<% if @map.user == current_user %>
<div class="collabSearchField"><span class="addCollab"></span><input class="collaboratorSearchField" placeholder="Add a collaborator!"></input></div>
<% end %>
</div>
</div>
<div class="infoStatIcon mapTopics">
<%= @map.topics.count %>
</div>
<div class="infoStatIcon mapSynapses">
<%= @map.synapses.count %>
</div>
<div class="infoStatIcon mapPermission <%= @map.permission %> hoverForTip">
<div class="tooltips">As the creator, you can change the permission of this map, and the permission of all the topics and synapses you have authority to change will change as well.</div>
</div>
<div class="clearfloat"></div>
</div>
<div class="mapInfoDesc" id="mapInfoDesc">
<% if policy(@map).update? %>
<span class="best_in_place best_in_place_desc" id="best_in_place_map_<%= @map.id %>_desc" data-bip-url="/maps/<%= @map.id %>" data-bip-object="map" data-bip-attribute="desc" data-bip-nil="Click to add description..." data-bip-type="textarea" data-bip-activator="#mapInfoDesc" data-bip-value="<%= @map.desc %>"><%= @map.desc %></span>
<% else %>
<%= @map.desc %>
<% end %>
</div>
<div class="mapInfoMeta">
<p class="mapCreatedAt"><span>Created by:</span> <%= @map.user == user ? "You" : @map.user.name %> on <%= @map.created_at.strftime("%m/%d/%Y") %></p>
<p class="mapEditedAt"><span>Last edited:</span> <%= @map.updated_at.strftime("%m/%d/%Y") %></p>
<div class="mapInfoButtonsWrapper">
<div class="mapInfoThumbnail">
<div class="thumbnail"></div>
<div class="tooltip">Update Thumbnail</div>
<span>Thumb</span>
</div>
<div class="mapInfoDelete">
<div class="deleteMap"></div>
<span>Delete</span>
</div>
<div class="mapInfoShare">
<div class="mapInfoShareIcon"></div>
<span>Share</span>
</div>
</div>
</div>
<% end %>
</div>

View file

@ -1,36 +0,0 @@
<%= form_for Topic.new, url: topics_url, remote: true do |form| %>
<div class="openMetacodeSwitcher openLightbox" data-open="switchMetacodes">
<div class="tooltipsAbove">Switch Metacodes</div>
</div>
<div id="metacodeImg">
<% @metacodes = user_metacodes()
@metacodes.each do |m| %>
<img class="cloudcarousel" width="40" height="40" src="<%= asset_path m.icon %>" alt="<%= m.name %>" title="<%= m.name %>" data-id="<%= m.id %>" />
<% end %>
</div>
<div class="selectedMetacode">
<img src="<%= asset_path @metacodes[0].icon %>" />
<span><%= @metacodes[0].name %></span>
<div class="downArrow"></div>
</div>
<%= form.text_field :name, :maxlength => 140, :placeholder => "what are you thinking..." %>
<div class="clearfloat"></div>
<div id="metacodeSelector"></div>
<div class="clearfloat"></div>
<script>
<% @metacodes.each do |m| %>
Metamaps.Create.selectedMetacodes.push("<%= m.id %>");
Metamaps.Create.newSelectedMetacodes.push("<%= m.id %>");
Metamaps.Create.selectedMetacodeNames.push("<%= m.name %>");
Metamaps.Create.newSelectedMetacodeNames.push("<%= m.name %>");
<% end %>
Metamaps.Create.newTopic.metacode = <%= @metacodes[0].id %>
<% current_user.recent_metacodes.each do |id| %>
Metamaps.Create.recentMetacodes.push(<%= id %>);
<% end %>
<% current_user.most_used_metacodes.each do |id| %>
Metamaps.Create.mostUsedMetacodes.push(<%= id %>);
<% end %>
</script>
<% end %>

View file

@ -1,23 +0,0 @@
<%#
# @file
# Code to display a map
# /maps/:id
#%>
<% content_for :title, @map.name + " | Metamaps" %>
<% content_for :mobile_title, @map.name %>
<script>
Metamaps.currentSection = "map";
Metamaps.currentPage = <%= @map.id.to_s %>;
Metamaps.ServerData = Metamaps.ServerData || {}
Metamaps.ServerData.ActiveMap = <%= @map.to_json.html_safe %>;
Metamaps.ServerData.Mappers = <%= @allmappers.to_json.html_safe %>;
Metamaps.ServerData.Collaborators = <%= @allcollaborators.to_json.html_safe %>;
Metamaps.ServerData.Topics = <%= @alltopics.to_json(user: current_user).html_safe %>;
Metamaps.ServerData.Synapses = <%= @allsynapses.to_json.html_safe %>;
Metamaps.ServerData.Mappings = <%= @allmappings.to_json.html_safe %>;
Metamaps.ServerData.Messages = <%= @allmessages.to_json.html_safe %>;
Metamaps.ServerData.Stars = <%= @allstars.to_json.html_safe %>;
Metamaps.ServerData.requests = <%= @allrequests.to_json.html_safe %>;
Metamaps.ServerData.VisualizeType = "ForceDirected";
</script>

View file

@ -1,35 +0,0 @@
<%#
# @file
# This file contains code for rendering a new topic form.
# It's called from the show topic / radial view pages
#%>
<div class="anypage">
<%= form_for Topic.new, url: topics_url, remote: true do |form| %>
<div class="openMetacodeSwitcher openLightbox" data-open="switchMetacodes">
<div class="tooltipsAbove">Switch Metacodes</div>
</div>
<div class="pinCarousel">
<div class="tooltipsAbove">Keep Open</div>
</div>
<div id="metacodeImg">
<% @m = user.settings.metacodes %>
<% set = @m[0].include?("metacodeset") ? MetacodeSet.find(@m[0].sub("metacodeset-","").to_i) : false %>
<% if set %>
<% @metacodes = set.metacodes %>
<% else %>
<% @metacodes = [] %>
<% @m.each do |m| %>
<% @metacodes.push(Metacode.find(m.to_i)) %>
<% end %>
<% end %>
<% @metacodes.sort! {|m1,m2| m2.name.downcase <=> m1.name.downcase }.rotate!(-1) %>
<% @metacodes.each do |metacode| %>
<img class="cloudcarousel" width="40" height="40" src="<%= asset_path metacode.icon %>" alt="<%= metacode.name %>" title="<%= metacode.name %>"/>
<% end %>
</div>
<%= form.text_field :name, :maxlength => 140, :placeholder => "title..." %>
<div id="metacodeImgTitle"></div>
<div class="clearfloat"></div>
<% end %>
</div>