From 415c9b8ac38677ba2149e2d2b0fad670938b0d60 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Thu, 24 Mar 2016 21:26:07 -0700 Subject: [PATCH] final touchups on oauth --- app/controllers/application_controller.rb | 10 +- app/helpers/application_helper.rb | 10 +- app/views/layouts/_foot.html.erb | 32 ++++++ app/views/layouts/_head.html.erb | 71 ++++++++++++++ app/views/layouts/_lightboxes.html.erb | 61 ++++++------ app/views/layouts/application.html.erb | 114 +--------------------- app/views/layouts/doorkeeper.html.erb | 109 +++------------------ 7 files changed, 160 insertions(+), 247 deletions(-) create mode 100644 app/views/layouts/_foot.html.erb create mode 100644 app/views/layouts/_head.html.erb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6e67ba25..0568813b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,12 +1,12 @@ class ApplicationController < ActionController::Base + include ApplicationHelper include Pundit include PunditExtra rescue_from Pundit::NotAuthorizedError, with: :handle_unauthorized protect_from_forgery - before_action :get_invite_link after_action :allow_embedding - + def default_serializer_options { root: false } end @@ -33,7 +33,7 @@ class ApplicationController < ActionController::Base def handle_unauthorized head :forbidden # TODO make this better end - + private def require_no_user @@ -69,10 +69,6 @@ private authenticated? && current_user.admin end - def get_invite_link - @invite_link = "#{request.base_url}/join" + (current_user ? "?code=#{current_user.code}" : "") - end - def allow_embedding #allow all response.headers.except! 'X-Frame-Options' diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3db990db..38e82922 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,12 +1,12 @@ -module ApplicationHelper +module ApplicationHelper def get_metacodeset - @m = user.settings.metacodes + @m = current_user.settings.metacodes set = @m[0].include?("metacodeset") ? MetacodeSet.find(@m[0].sub("metacodeset-","").to_i) : false return set end def user_metacodes - @m = user.settings.metacodes + @m = current_user.settings.metacodes set = get_metacodeset if set @metacodes = set.metacodes.to_a @@ -15,4 +15,8 @@ module ApplicationHelper end @metacodes.sort! {|m1,m2| m2.name.downcase <=> m1.name.downcase }.rotate!(-1) end + + def determine_invite_link + "#{request.base_url}/join" + (current_user ? "?code=#{current_user.code}" : "") + end end diff --git a/app/views/layouts/_foot.html.erb b/app/views/layouts/_foot.html.erb new file mode 100644 index 00000000..6900fa23 --- /dev/null +++ b/app/views/layouts/_foot.html.erb @@ -0,0 +1,32 @@ +<%= render :partial => 'layouts/lightboxes' %> +<%= render :partial => 'layouts/templates' %> +<%= render :partial => 'shared/metacodeBgColors' %> + + +<%= render :partial => 'layouts/googleanalytics' if Rails.env.production? %> + + diff --git a/app/views/layouts/_head.html.erb b/app/views/layouts/_head.html.erb new file mode 100644 index 00000000..07881bce --- /dev/null +++ b/app/views/layouts/_head.html.erb @@ -0,0 +1,71 @@ + + + + + + <%=h yield(:title) %> + <%= csrf_meta_tags %> + + + <%= stylesheet_link_tag "application", :media => "all" %> + <%= javascript_include_tag "application" %> + + + + + + + + + + diff --git a/app/views/layouts/_lightboxes.html.erb b/app/views/layouts/_lightboxes.html.erb index 7487adad..603c99a3 100644 --- a/app/views/layouts/_lightboxes.html.erb +++ b/app/views/layouts/_lightboxes.html.erb @@ -6,7 +6,7 @@ +
+
+ + -

Metamaps.cc is a free and open source web platform that supports real-time sense-making and distributed collaboration between individuals, communities and organizations.

Using an intuitive graph-based interface, Metamaps.cc helps map out networks of people, ideas, resources, stories, experiences, conversations and much more. The platform is evolving for a range of applications amidst a growing network of designers, developers, facilitators, practitioners, entrepreneurs, and artists.

Metamaps.cc is created and maintained by a distributed community of contributors passionate about the evolution of collaboration, alternative forms of value creation and increase of collective intelligence through the lens of the open culture and the peer-to-peer revolution.

- +