From ae46c27bec318b6e63e773fbf77e532f80c720c0 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Wed, 5 Feb 2014 12:37:21 -0500 Subject: [PATCH] started styling map forms --- app/assets/javascripts/application.js | 18 ++++----- app/assets/stylesheets/application.css | 29 +++++++------- app/controllers/synapses_controller.rb | 43 +------------------- app/controllers/topics_controller.rb | 26 +------------ app/views/layouts/_lightboxes.html.erb | 26 +++++++++++-- app/views/layouts/application.html.erb | 7 +--- app/views/main/faq.html.erb | 54 ++++++++++++++++++++++++++ app/views/maps/_fork.html.erb | 5 ++- app/views/maps/_new.html.erb | 7 ++-- app/views/maps/show.html.erb | 3 +- app/views/topics/show.html.erb | 3 +- config/routes.rb | 8 ++-- 12 files changed, 118 insertions(+), 111 deletions(-) create mode 100644 app/views/main/faq.html.erb diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index bf23855d..bee80917 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -495,11 +495,6 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, $(this).parents('.CardOnGraph').find('.go-link').attr('href', link); }); - // when you click the addmap button - $('.addMap').click(function(event) { - createNewMap(); - }); - //bind lightbox clicks $('.openLightbox').click(function() { openLightbox($(this).attr('data-open')); @@ -627,11 +622,7 @@ function saveToMap() { $('#map_topicsToMap').val(nodes_data); $('#map_synapsesToMap').val(synapses_data); - $('#fork_map').fadeIn('fast'); -} - -function createNewMap() { - $('#new_map').fadeIn('fast'); + openLightbox('forkmap'); } function fetchRelatives(node) { @@ -701,6 +692,13 @@ function openNodeShowcard(node) { function openLightbox(which) { $('.lightboxContent').hide(); $('#' + which).show(); + + if (which == "forkmap" || which == "newmap") { + $('#lightbox_content').css('background','white'); + } else { + $('#lightbox_content').css('background','silver'); + } + $('#lightbox_overlay').show(); $('#lightbox_main').css('margin-top', '-' + ($('#lightbox_main').height() / 2) + 'px' ); } diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 5c7c6f80..6016de2e 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -185,10 +185,6 @@ box-shadow: 0 1px 0 rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.2); .new_session, .new_user, -.new_map, -.edit_topic, -.edit_synapse, -.edit_map, .invite { display: block; width: 350px; @@ -218,15 +214,6 @@ box-shadow: 0 1px 0 rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.2); border:2px solid #000; } -.onConsole .new_map { - display:none; -} - -.onConsole .new_map button, .onConsole .new_map input.add { - float:left; - margin-top:5px; -} - .invite p { margin:10px 0; } @@ -1558,6 +1545,13 @@ border: solid 2px #000; cursor:pointer; } +#about > p { + color: #000; + font-size: 16px; + line-height: 20px; + margin:10px 0; +} + #about ul { list-style:none; } @@ -1569,6 +1563,15 @@ border: solid 2px #000; color:#097A51; } +/* new map */ +.new_map { + color:black; +} +.onConsole .new_map button, .onConsole .new_map input.add { + float:left; + margin-top:5px; +} + /* --- styling the logo button ---*/ /*.footer { width: 188px; diff --git a/app/controllers/synapses_controller.rb b/app/controllers/synapses_controller.rb index eb5a74d2..74b67b3b 100644 --- a/app/controllers/synapses_controller.rb +++ b/app/controllers/synapses_controller.rb @@ -1,37 +1,10 @@ class SynapsesController < ApplicationController include TopicsHelper - before_filter :require_user, only: [:new, :create, :edit, :update, :removefrommap, :destroy] + before_filter :require_user, only: [:create, :update, :removefrommap, :destroy] respond_to :html, :js, :json - # Get synapses/new - def new - @synapse = Synapse.new - @user = current_user - - respond_with(@synapse) - end - - # GET synapses/:id - def show - @current = current_user - @synapse = Synapse.find(params[:id]).authorize_to_show(@current) - @topic1 = @synapse.topic1.authorize_to_show(@current) - @topic2 = @synapse.topic2.authorize_to_show(@current) - - if @synapse && @topic1 && @topic2 - @synapsejson = @synapse.selfplusnodes_as_json.html_safe - else - redirect_to root_url and return - end - - respond_to do |format| - format.html - format.json { respond_with(@synapsejson) } - end - end - # GET synapses/:id/json def json @current = current_user @@ -91,20 +64,6 @@ class SynapsesController < ApplicationController end - # GET synapses/:id/edit - def edit - @current = current_user - @synapse = Synapse.find(params[:id]).authorize_to_edit(@current) - - if @synapse - @topics = Topic.visibleToUser(@current, nil) - elsif not @synapse - redirect_to root_url and return - end - - respond_with(@synapse, @topics) - end - # PUT synapses/:id def update @current = current_user diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb index f9cfb701..d9b60180 100644 --- a/app/controllers/topics_controller.rb +++ b/app/controllers/topics_controller.rb @@ -1,12 +1,10 @@ class TopicsController < ApplicationController include TopicsHelper - before_filter :require_user, only: [:new, :create, :edit, :update, :removefrommap, :destroy] + before_filter :require_user, only: [:create, :update, :removefrommap, :destroy] respond_to :html, :js, :json - - #autocomplete :topic, :name, :full => true, :extra_data => [:user_id], :display_value => :topic_autocomplete_method - + # GET /topics/autocomplete_topic def autocomplete_topic @current = current_user @@ -22,14 +20,6 @@ class TopicsController < ApplicationController render json: autocomplete_array_json(@topics) end - # Get topics/new - def new - @topic = Topic.new - @user = current_user - - respond_with(@topic) - end - # GET topics/:id def show @current = current_user @@ -123,18 +113,6 @@ class TopicsController < ApplicationController end end - # GET topics/:id/edit - def edit - @current = current_user - @topic = Topic.find(params[:id]).authorize_to_edit(@current) - - if not @topic - redirect_to root_url and return - end - - respond_with(@topic) - end - # PUT topics/:id def update @current = current_user diff --git a/app/views/layouts/_lightboxes.html.erb b/app/views/layouts/_lightboxes.html.erb index 7d829a64..a14f3b5a 100644 --- a/app/views/layouts/_lightboxes.html.erb +++ b/app/views/layouts/_lightboxes.html.erb @@ -6,15 +6,20 @@ - + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b9ec78ce..e97951ce 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -76,17 +76,12 @@
<%= link_to "metamaps", root_url %>
<% if authenticated? %> -
+
<% end %> <% end %> - <% if authenticated? %> - <% # this is the create new map form %> - <%= render :partial => 'maps/new' %> - <% end %> -