master
1<% provide(:title, "#{@search}") -%>
2<div class="row">
3 <div class="col">
4 <ul class="nav nav-tabs">
5 <li class="nav-item"><a class="nav-link active" href="#tab1" data-toggle="tab">Creations</a></li>
6 <li class="nav-item"><a class="nav-link" href="#tab2" data-toggle="tab">Tutorials</a></li>
7 <li class="nav-item"><a class="nav-link" href="#tab3" data-toggle="tab">Artists</a></li>
8 </ul>
9 <div class="tab-content">
10 <div class="tab-pane show active" id="tab1">
11 <% if @creations.any? %>
12 <table class="table table-striped">
13 <thead>
14 <th></th>
15 <th>Artist</th>
16 <th>Name</th>
17 <th>Description</th>
18 </thead>
19 <tbody>
20 <% @creations.each_with_index do |creation, index| %>
21 <% cache creation do %>
22 <tr>
23 <td>
24 <%= link_to cake_path(creation) do %>
25 <%= image_tag creation.primary_image.url_for(:thumb), class: 'thumbnail', style: "width:65px;" %>
26 <% end %>
27 </td>
28 <td><%= link_to creation.user.name, profile_path(creation.user) %></td>
29 <td><%= creation.name %></td>
30 <td><%= creation.story %></td>
31 </tr>
32 <% end %>
33 <% end %>
34 </tbody>
35 </table>
36 <% else %>
37 <p>No creations found.</p>
38 <% end %>
39 </div>
40 <div class="tab-pane" id="tab2">
41 <% if @tutorials.any? %>
42 <table class="table table-striped">
43 <thead>
44 <th>Name</th>
45 <th>Description</th>
46 </thead>
47 <tbody>
48 <% @tutorials.each_with_index do |tutorial, index| %>
49 <% cache tutorial do %>
50 <tr>
51 <td><%= link_to tutorial.heading, tutorial_path(tutorial) %></td>
52 <td><%= tutorial.description %></td>
53 </tr>
54 <% end %>
55 <% end %>
56 </tbody>
57 </table>
58 <% else %>
59 <p>No tutorials found.</p>
60 <% end %>
61 </div>
62 <div class="tab-pane" id="tab3">
63 <% if @members.any? %>
64 <table class="table table-striped">
65 <thead>
66 <th>Artists</th>
67 <th>Name</th>
68 </thead>
69 <tbody>
70 <% @members.each_with_index do |artist, index| %>
71 <tr>
72 <td>
73 <%= link_to profile_path(artist) do %>
74 <%= avatar_for(artist, size: 65) %>
75 <% end %>
76 </td>
77 <td><%= link_to artist.name, profile_path(artist) %></td>
78 <td><%= link_to artist.website, artist.website if artist.website %></td>
79 <td><%= link_to artist.twitter, "https://twitter.com/#{artist.twitter}" if artist.twitter.present? %></td>
80 <td><%= link_to artist.facebook, artist.facebook if artist.facebook %></td>
81 <td><%= artist.city %></td>
82 </tr>
83 <% end %>
84 </tbody>
85 </table>
86 <% else %>
87 <p>No artists found.</p>
88 <% end %>
89 </div>
90 </div>
91 </div>
92</div>