From 9b0ead24a3206dd728bac9b8801a872c80a7b697 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sun, 5 Feb 2017 06:37:37 +0000 Subject: [PATCH] more merges with develop --- app/controllers/users_controller.rb | 10 --------- app/helpers/application_helper.rb | 4 ---- app/views/maps/_newtopic.html.erb | 24 +++++++++++----------- app/views/shared/_switchmetacodes.html.erb | 2 +- 4 files changed, 13 insertions(+), 27 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 224d3ff6..7aff655d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -91,16 +91,6 @@ class UsersController < ApplicationController format.json { render json: @user } end end - - # PUT /user/update_metacode_focus - def update_metacode_focus - @user = current_user - @user.settings.metacode_focus = params[:value] - @user.save - respond_to do |format| - format.json { render json: { success: "success" }} - end - end # PUT /user/update_metacode_focus def update_metacode_focus diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 860cd38c..7d0f4f68 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -41,10 +41,6 @@ module ApplicationHelper def user_metacode current_user.settings.metacode_focus ? Metacode.find(current_user.settings.metacode_focus.to_i) : nil end - - def user_metacode - current_user.settings.metacode_focus ? Metacode.find(current_user.settings.metacode_focus.to_i) || user_metacodes()[0] : user_metacodes()[0] - end def user_most_used_metacodes @metacodes = current_user.most_used_metacodes.map { |id| Metacode.find(id) } diff --git a/app/views/maps/_newtopic.html.erb b/app/views/maps/_newtopic.html.erb index bd191cc5..a4088e03 100644 --- a/app/views/maps/_newtopic.html.erb +++ b/app/views/maps/_newtopic.html.erb @@ -4,15 +4,15 @@
- <% @metacodes = [user_metacode()].concat(user_metacodes()).uniq %> - <% set = metacodeset() %> - <% @metacodes.each do |metacode| %> - <%= metacode.name %> + <% @metacodes = user_metacodes() + metacode = user_metacode() ? user_metacode() : user_metacodes[0] + @metacodes.each do |m| %> + <%= m.name %> <% end %>
- - <%= user_metacode().name %> + + <%= metacode.name %>
<%= form.text_field :name, :maxlength => 140, :placeholder => "what are you thinking..." %> @@ -20,13 +20,13 @@