metamaps--metamaps/app/views/maps/_newtopic.html.erb

38 lines
1.6 KiB
Text
Raw Normal View History

<%= form_for Topic.new, url: topics_url, remote: true do |form| %>
<div class="openMetacodeSwitcher openLightbox" data-open="switchMetacodes">
<div class="tooltipsAbove">Switch Metacodes</div>
</div>
2016-09-24 04:27:34 +00:00
<div id="metacodeImg">
2016-09-18 15:22:51 +00:00
<% @metacodes = [user_metacode()].concat(user_metacodes()).uniq %>
2017-01-04 15:50:59 +00:00
<% set = metacodeset() %>
<% @metacodes.each do |metacode| %>
2015-10-23 15:42:21 +00:00
<img class="cloudcarousel" width="40" height="40" src="<%= asset_path metacode.icon %>" alt="<%= metacode.name %>" title="<%= metacode.name %>" data-id="<%= metacode.id %>" />
<% end %>
2016-09-18 15:22:51 +00:00
</div>
<div class="selectedMetacode">
<img src="<%= asset_path user_metacode().icon %>" />
<span><%= user_metacode().name %></span>
<div class="downArrow"></div>
</div>
2017-01-12 05:04:49 +00:00
<%= form.text_field :name, :maxlength => 140, :placeholder => "what are you thinking..." %>
2016-09-18 15:22:51 +00:00
<div class="clearfloat"></div>
<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 %>");
<% end %>
Metamaps.Create.newTopic.metacode = <%= user_metacode().id %>
2016-09-18 15:22:51 +00:00
<% current_user.recentMetacodes.each do |id| %>
Metamaps.Create.recentMetacodes.push(<%= id %>);
<% end %>
<% current_user.mostUsedMetacodes.each do |id| %>
Metamaps.Create.mostUsedMetacodes.push(<%= id %>);
<% end %>
</script>
<% end %>