Add share buttons and wire them up

This commit is contained in:
Robert Richter 2016-09-20 17:09:43 -05:00
parent d80f6f9596
commit 286d06c60e
No known key found for this signature in database
GPG Key ID: BEC39BF873A0103B
4 changed files with 9 additions and 3 deletions

View File

@ -0,0 +1,3 @@
$(document).ready ->
$('.share').click ->
$('#share-modal').openModal()

View File

@ -10,6 +10,7 @@
<div class="card-content">
<div class="card-title center">
<span class="<%= content.class.color %>-text"><i class="material-icons right"><%= content.class.icon %></i></span>
<a href="#" title="Share" class="share <%= content.class.color %>-text"><i class="material-icons right">share</i></a>
<%= content.name %>
</div>
<ul class="tabs">

View File

@ -6,7 +6,7 @@
<ul id='options-menu' class='dropdown-content'>
<%# TODO: something with these %>
<li><a href="#!">Share this <%= content.class.to_s.downcase %></a></li>
<li><a href="#!" class="share">Share this <%= content.class.to_s.downcase %></a></li>
<li><a href="#!">Do something else</a></li>
<li class="divider"></li>
<% if content.persisted? %>
@ -17,4 +17,4 @@
:confirm => 'Are you sure? This action cannot be undone!' %>
</li>
<% end %>
</ul>
</ul>

View File

@ -1,3 +1,5 @@
<%= form_for @content do |form| %>
<%= render partial: 'content/form', locals: { f: form, content: @content } %>
<% end %>
<% end %>
<%= render partial: 'content/share', locals: { shared_content: @content} %>