more merges with develop

This commit is contained in:
Connor Turland 2017-02-05 06:37:37 +00:00
parent 3a4fa90c49
commit 9b0ead24a3
4 changed files with 13 additions and 27 deletions

View file

@ -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

View file

@ -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) }

View file

@ -4,15 +4,15 @@
</div>
<div id="metacodeImg">
<% @metacodes = [user_metacode()].concat(user_metacodes()).uniq %>
<% set = metacodeset() %>
<% @metacodes.each do |metacode| %>
<img class="cloudcarousel" width="40" height="40" src="<%= asset_path metacode.icon %>" alt="<%= metacode.name %>" title="<%= metacode.name %>" data-id="<%= metacode.id %>" />
<% @metacodes = user_metacodes()
metacode = user_metacode() ? user_metacode() : user_metacodes[0]
@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 user_metacode().icon %>" />
<span><%= user_metacode().name %></span>
<img src="<%= asset_path metacode.icon %>" />
<span><%= metacode.name %></span>
<div class="downArrow"></div>
</div>
<%= form.text_field :name, :maxlength => 140, :placeholder => "what are you thinking..." %>
@ -20,13 +20,13 @@
<div id="metacodeSelector"></div>
<div class="clearfloat"></div>
<script>
<% @metacodes.each do |metacode| %>
Metamaps.Create.selectedMetacodes.push("<%= metacode.id %>");
Metamaps.Create.newSelectedMetacodes.push("<%= metacode.id %>");
Metamaps.Create.selectedMetacodeNames.push("<%= metacode.name %>");
Metamaps.Create.newSelectedMetacodeNames.push("<%= metacode.name %>");
<% @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 = <%= user_metacode().id %>
Metamaps.Create.newTopic.metacode = <%= metacode.id %>
<% current_user.recent_metacodes.each do |id| %>
Metamaps.Create.recentMetacodes.push(<%= id %>);
<% end %>

View file

@ -93,7 +93,7 @@
<div id="metacodeSwitchTabsCustom">
<p class="setDesc">Choose Your Metacodes</p>
<% @list = '' %>
<% metacodesInUse = [user_metacode()].concat(user_metacodes()).uniq %>
<% metacodesInUse = user_metacodes() %>
<% Metacode.order("name").all.each_with_index do |m, index| %>
<% mClass = metacodesInUse.index(m) == nil ? "toggledOff" : "" %>
<% @list += '<li id="' + m.id.to_s + '" data-name="' + m.name + '" class="' + mClass + '"><img src="' + asset_path(m.icon) + '" alt="' + m.name + '" /><p>' + m.name.downcase + '</p><div class="clearfloat"></div></li>' %>