restyled PAQ and Request pages.

This commit is contained in:
Connor Turland 2014-02-09 23:36:23 -05:00
parent ac12c2a9ae
commit 5181c91aa7
12 changed files with 240 additions and 122 deletions

View file

@ -63,9 +63,10 @@ body {
background-attachment:fixed;
color:#FFF;
}
body.bodyFAQ {
background: #031924 url(mushroom.jpg) no-repeat center center;
background-size: cover;
/*background: #031924 url(mushroom.jpg) no-repeat center center;
background-size: cover;*/
}
h1,h2,h3,h4,h5,h6 {
@ -1170,7 +1171,10 @@ left: 13px;
}
#cards {
height:100%;
height:100%;
width:800px;
margin:0 auto;
overflow-y:scroll;
}
#cards p.empty {
@ -1817,17 +1821,14 @@ font-weight: bold;
/* FAQ */
#wrapper > div.FAQ {
width: 530px;
margin: -275px auto 0;
width: 700px;
margin: 0 auto;
padding: 20px 0 20px 20px;
background: rgba(0,0,0,0.4);
color: white;
height: 510px;
height: 100%;
overflow: hidden;
position: relative;
left: 130px;
top: 50%;
border-radius: 5px;
}
.FAQ .question {
@ -1871,17 +1872,13 @@ background-image: url('/assets/MMCCicon_minimize_arrow.png') !important;
/* request */
#wrapper .requestInvite {
width: 510px;
margin: -275px auto 0;
width: 700px;
margin: 0 auto;
padding: 20px;
background: rgba(0,0,0,0.4);
color: white;
height: 510px;
height: 100%;
overflow: hidden;
position: relative;
left: 130px;
top: 50%;
border-radius: 5px;
}

View file

@ -140,7 +140,7 @@ font-family: 'LatoLight';
border-top: 1px solid #AAAAAA;
}
.CardOnGraph .linkItem {
.linkItem {
float:left;
min-width:40px;
height:40px;
@ -383,3 +383,85 @@ font-family: 'LatoLight';
#edit_synapse .click-to-edit {
margin-left: 0.3em;
}
/* Map Cards */
.map {
float:left;
display:block;
width:226px;
height:320px;
color:#FFF;
text-align: left;
overflow: visible;
background: #FFF;
border-radius:5px;
box-shadow: 6px 6px 8px rgba(0,0,0,0.4);
margin:16px;
}
.mapCard {
display:block;
position:relative;
width:100%;
height:100%;
color:#000;
z-index: 25;
}
.mapCard .metacodeImage {
width: 50px;
height: 50px;
position: absolute;
left: -25px;
top: -5px;
background-size: 50px 50px;
background-position: 0 0;
background-repeat: no-repeat;
}
.mapCard .scroll {
display:block;
padding:5px 10px;
}
.mapCard .type {
position: absolute;
color: white;
top: -22px;
right: 0;
font-weight: bold;
font-size: 20px;
line-height: 24px;
}
.mapCard .title {
font-size:22px;
line-height:25px;
display:block;
padding:5px;
font-weight: bold;
text-align: center;
}
.mapCard .links {
position:relative;
border-bottom: 1px solid #AAAAAA;
border-top: 1px solid #AAAAAA;
}
.mapCard .icon {
position:absolute;
width:100%;
z-index:1;
}
.linkItem.topicCount {
background-image: url(MMCCicon_topic.png);
background-size: 22px 22px;
background-position: 0px center;
line-height: 40px;
min-width: 16px;
padding-left: 24px;
}

View file

@ -1,56 +1,39 @@
// Place all the styles related to the maps controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// explore maps page
.white_bg {
background: white !important;
.mapOrder {
display: block;
background: #0F1519;
padding:5px 15px;
margin:5px auto 0;
font-weight: bold;
line-height: 24px;
position: relative;
width:770px;
height:25px;
}
.mapdata {
color: #1A1;
font-style: italic;
.mapOrder .displaying, .mapOrder .whichMaps {
float:left;
}
#MapRealtime {
display:none;
.whichMaps a {
color: white;
text-decoration: underline;
padding: 0 10px;
cursor:default;
font-weight:normal;
}
.whichMaps a.active {
text-decoration: none;
font-weight:bold;
}
.whichMaps a:hover {
text-decoration: none;
}
.map { display:block; float:left; position:relative; width:175px; height:300px; padding:10px 5px 10px 35px; background: url('bg.png'); border-radius:15px; margin:30px 0 30px 50px; color:#000; }
.map .delete {position: absolute;
top: -14px;
left: 0px;
background: none;
border: 0;
color: white;
border: none;
font-size: 14px;
margin: 0;
padding: 0;
cursor:pointer;
}
.map .scroll { display:block; height:250px; }
.map .type {position: absolute;
color: white;
top: -22px;
right: 0;
font-weight: bold;
font-size: 20px;
line-height: 24px;}
.map .icon { position:absolute; top:135px; left:-25px; }
.map .title { font-size:22px; line-height:27px; display:block; border-bottom:2px solid #000; padding-bottom:5px; }
.map .desc { font-size:15px; font-family:Arial, Helvetica, sans-serif; }
.map .desc h3 { font-style:normal; margin-top:5px; }
.map .link { position:absolute; width:170px; top:295px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
// add topic on maps pages
.selecttype { border:1px solid #000; margin-top: 20px; border-radius:15px; }
.mapspages .new_topic h3 { padding: 10px 26px; display: block; cursor: pointer; color: #2d6a5d; float:left; }

View file

@ -6,20 +6,42 @@ class MapsController < ApplicationController
autocomplete :map, :name, :full => true, :extra_data => [:user_id]
# GET /maps
# or GET /users/:user_id/maps
# GET /maps/recent
# GET /maps/featured
# GET /maps/new
# GET /maps/mappers/:id
def index
@current = current_user
if params[:user_id]
@user = User.find(params[:user_id])
@maps = Map.order("name ASC").visibleToUser(@current, @user)
elsif
@maps = Map.order("name ASC").visibleToUser(@current, nil)
if request.path == "/maps"
redirect_to activemaps_url and return
end
respond_with(@maps,@user)
@current = current_user
@user = nil
if request.path =="/maps/active"
@maps = Map.visibleToUser(@current, nil).sort! { |a,b| b.last_edited <=> a.last_edited }
@maps = @maps.slice(0,20)
@request = "active"
elsif request.path =="/maps/featured"
@maps = Map.order("name ASC").find_all_by_featured(true)
@request = "featured"
elsif request.path =="/maps/new"
@maps = Map.visibleToUser(@current, nil).sort! { |a,b| b.created_at <=> a.created_at }
@maps = @maps.slice(0,20)
@request = "new"
elsif params[:id] # looking for maps by a mapper
@user = User.find(params[:id])
@maps = Map.order("name ASC").visibleToUser(@current, @user)
@request = "you" if authenticated? && @user == @current
@request = "other" if authenticated? && @user != @current
end
respond_with(@maps, @request, @user)
end
# GET maps/new

View file

@ -7,7 +7,7 @@
<% content_for :title, "Possibly Asked Questions | Metamaps" %>
<h1 class="index">
PAQ
P(ossibly)AQ
</h1>
<div class="FAQ">
@ -48,15 +48,12 @@
<div class="question">Someone else changed my cool map (or favorite topic) without asking me...sad face :( <div class="switch"></div></div>
<p class="answer off">If your map / topic was set to Commons permission for editing, than any other logged-in user on the site will be able to make changes. We consider this a feature, not a bug, which encourages collaborative maps and an evolving collective knowledge garden. You can easily avoid unwanted changes by setting your permissions to Public, which others may still view and copy to another version if they wish. Courtesy, care, and the benefit of the doubt will go a long ways towards maintaining a happy, healthy, and productive communal atmosphere on Metamaps.cc</p>
<div class="question">How do I "_________" on metamaps? <div class="switch"></div></div>
<p class="answer off">Link to our cheatsheet stuff...and manual.</p>
</div>
<script>
$(document).ready(function() {
$('.FAQ').mCustomScrollbar();
$('.FAQ').height( (parseInt($('body').height()) - 40) ).mCustomScrollbar();
$('.FAQ .question').click(function() {

View file

@ -6,8 +6,15 @@
<% content_for :title, "Request Invite | Metamaps" %>
<iframe class="requestInvite" src="https://docs.google.com/forms/d/1lWoKPFHErsDfV5l7-SvcHxwX3vDi9nNNVW0rFMgJwgg/viewform?embedded=true" width="510" height="510" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
<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>
<h1 class="index">
Request Invite
</h1>
<script>
$(document).ready(function() {
$('.requestInvite').height( (parseInt($('body').height()) - 40) );
});
</script>

View file

@ -4,46 +4,33 @@
# Any list of maps uses this rendering.
#%>
<%= div_for map do %>
<% if map.authorize_to_edit(user) %>
<div class="permission canEdit">
<% end %>
<div class="permission <%= map.authorize_to_edit(user) ? "canEdit" : "cannotEdit" %>">
<div class="mapCard">
<span class="title">
<%= best_in_place map, :name, :type => :input, :classes => 'best_in_place_name' %>
</span>
<div class="links">
<div class="linkItem icon">
<div class="metacodeImage" style="background-image:url(/assets/map.png);"></div>
</div>
<div class="linkItem contributor">
</div>
<div class="linkItem topicCount"><%= map.topics.count %></div>
<div class="linkItem synapseCount"><%= map.synapses.count %></div>
<div class="linkItem mapPerm <%= map.mk_permission %>"></div>
<a href="/maps/<%= map.id %>" class="linkItem topicPopout" title="Open Map in New Tab" target="_blank"></a>
<div class="clearfloat"></div>
</div>
<div class="scroll">
<div class="desc">
<%= best_in_place map, :desc, :type => :textarea, :nil => "<span class='gray'>Click to add description.</span>", :classes => 'best_in_place_desc' %>
<div class="clearfloat"></div>
</div>
</div>
<div class="clearfloat"></div>
</div>
<% if map.user == user %><%= link_to 'Delete', map_path(map), :class => 'delete', :confirm => 'Delete this map (nodes and synapses will remain)?', :method => :delete, :remote => true %><% end %>
<p class="type">Map</p>
<%= image_tag 'map.png', :class => 'icon', :size => '50x50' %>
<div class="cardSettings">
<div class="mapPerm" title="<%= map.permission %>"><%= map.mk_permission %></div>
<% if map.user == user %>
<div class="permActivator">
<div class="editSettings">
<span>Permissions:&nbsp;</span>
<span title="Click to Edit"><%= best_in_place map, :permission, :type => :select, :collection => [['commons', 'commons'], ['public','public'], ['private','private']], :classes => 'best_in_place_permission' %></span>
<div class="clearfloat"></div>
</div>
</div>
<% end %>
</div>
<span class="title">
<span><%= best_in_place map, :name, :type => :input, :classes => 'best_in_place_name' %></span>
<a href="/maps/<%=map.id %>" class="topic-go-arrow">
<img class="topic-go-arrow"
title="Go to map"
src="/assets/go-arrow.png" />
</a>
<div class="clearfloat"></div>
</span>
<div class="contributor">
Added by: <a href="/users/<%=map.user.id %>" target="_blank"><%=map.user.name %>
</a>
</div>
<div class="scroll">
<div class="desc">
<p class="mapdata"><%= map.topics.count %> topics and <%= map.synapses.count %> synapses</p>
<p><%= best_in_place map, :desc, :type => :textarea, :nil => "<span class='gray'>Click to add description.</span>", :classes => 'best_in_place_desc' %></p>
</div>
</div>
<% if map.authorize_to_edit(user) %>
</div>
<% end %>
<% end %>

View file

@ -8,12 +8,34 @@
<h1 class="index">Explore Maps</h1>
<div class="mapOrder">
<span class="displaying">Displaying:</span>
<div class="whichMaps">
<% if @request == "other" %>
<a href="/maps/mappers/<%= @user.id %>" class="active">By <%= @user.name %></a> /
<% end %>
<a href="/maps/active" class="<%= @request == "active" ? "active" : "" %>">Recently Active</a> /
<a href="/maps/featured" class="<%= @request == "featured" ? "active" : "" %>">Featured</a> /
<a href="/maps/new" class="<%= @request == "new" ? "active" : "" %>">Newest First</a>
<% if authenticated? %>
/ <a href="/maps/mappers/<%= @current.id %>" class="<%= @request == "you" ? "active" : "" %>">Yours</a>
<% end %>
</div>
<div class="clearfloat"></div>
</div>
<div class="maps" id="cards">
<% @maps.each do |map| %>
<%= render map %>
<% end %>
<% if @maps.empty? %>
<p class="empty"><br>Shucks, there are no maps. <% if authenticated? %><%= link_to "Create one if you want.", new_map_url %><% end %></p>
<% end %>
<div class="clearfloat"></div>
</div>
<div class="clearfloat"></div>
<script>
$(document).ready(function() {
$('.authenticated div.permission.canEdit .best_in_place').best_in_place();
$('.maps').height( (parseInt($('body').height()) - 54) ); /*.mCustomScrollbar();*/
});
</script>

View file

@ -22,6 +22,11 @@ ISSAD::Application.routes.draw do
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
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

View file

@ -0,0 +1,7 @@
class AddFeaturedToMaps < ActiveRecord::Migration
def change
add_column :maps, :featured, :boolean
Map.reset_column_information
Map.update_all(:featured => false)
end
end

View file

@ -0,0 +1,7 @@
class AddAdminToUsers < ActiveRecord::Migration
def change
add_column :users, :admin, :boolean
User.reset_column_information
User.update_all(:admin => false)
end
end

View file

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130709212556) do
ActiveRecord::Schema.define(:version => 20140210031525) do
create_table "mappings", :force => true do |t|
t.text "category"
@ -33,6 +33,7 @@ ActiveRecord::Schema.define(:version => 20130709212556) do
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "featured"
end
create_table "metacodes", :force => true do |t|
@ -87,6 +88,7 @@ ActiveRecord::Schema.define(:version => 20130709212556) do
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