diff options
| author | mo <mokha@cisco.com> | 2017-09-02 10:45:46 -0600 |
|---|---|---|
| committer | mo <mokha@cisco.com> | 2017-09-02 10:45:46 -0600 |
| commit | e6cdc39bb6fb152005754ec6aad8735b1a0141b9 (patch) | |
| tree | b072ac50deefaca91c46d767e69b4fb72fbe585b /app | |
| parent | 9d2cadab1f5c7f8a5d0ab1f690c0d459172ea663 (diff) | |
update search and tutorials#show page.
Diffstat (limited to 'app')
| -rw-r--r-- | app/views/search/index.html.erb | 168 | ||||
| -rw-r--r-- | app/views/tutorials/show.html.erb | 30 |
2 files changed, 97 insertions, 101 deletions
diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb index 3fc3c010..877ccb3c 100644 --- a/app/views/search/index.html.erb +++ b/app/views/search/index.html.erb @@ -1,96 +1,92 @@ <% provide(:title, "#{@search}") -%> -<div class="row-fluid"> - <div class="span12"> - <div class="tabbable tabs-left"> - <ul class="nav nav-tabs"> - <li class="active"><a href="#tab1" data-toggle="tab">Creations</a></li> - <li><a href="#tab2" data-toggle="tab">Tutorials</a></li> - <li><a href="#tab3" data-toggle="tab">Artists</a></li> - </ul> - <div class="tab-content"> - <div class="tab-pane active" id="tab1"> - <% if @creations.any? %> - <table class="table table-striped"> - <thead> - <th></th> - <th>Artist</th> - <th>Name</th> - <th>Description</th> - </thead> - <tbody> - <% @creations.each_with_index do |creation, index| %> - <% cache creation do %> - <tr> - <td> - <%= link_to cake_path(creation) do %> - <%= image_tag creation.primary_image.url_for(:thumb), class: 'thumbnail', style: "width:65px;" %> - <% end %> - </td> - <td><%= link_to creation.user.name, profile_path(creation.user) %></td> - <td><%= creation.name %></td> - <td><%= creation.story %></td> - </tr> - <% end %> +<div class="row"> + <div class="col"> + <ul class="nav nav-tabs"> + <li class="nav-item"><a class="nav-link active" href="#tab1" data-toggle="tab">Creations</a></li> + <li class="nav-item"><a class="nav-link" href="#tab2" data-toggle="tab">Tutorials</a></li> + <li class="nav-item"><a class="nav-link" href="#tab3" data-toggle="tab">Artists</a></li> + </ul> + <div class="tab-content"> + <div class="tab-pane show active" id="tab1"> + <% if @creations.any? %> + <table class="table table-striped"> + <thead> + <th></th> + <th>Artist</th> + <th>Name</th> + <th>Description</th> + </thead> + <tbody> + <% @creations.each_with_index do |creation, index| %> + <% cache creation do %> + <tr> + <td> + <%= link_to cake_path(creation) do %> + <%= image_tag creation.primary_image.url_for(:thumb), class: 'thumbnail', style: "width:65px;" %> + <% end %> + </td> + <td><%= link_to creation.user.name, profile_path(creation.user) %></td> + <td><%= creation.name %></td> + <td><%= creation.story %></td> + </tr> <% end %> - </tbody> - </table> - <% else %> - <p>No creations found.</p> <% end %> - </div> - <div class="tab-pane" id="tab2"> - <% if @tutorials.any? %> - <table class="table table-striped"> - <thead> - <th>Name</th> - <th>Description</th> - </thead> - <tbody> - <% @tutorials.each_with_index do |tutorial, index| %> - <% cache tutorial do %> - <tr> - <td><%= link_to tutorial.heading, tutorial_path(tutorial) %></td> - <td><%= tutorial.description %></td> - </tr> - <% end %> + </tbody> + </table> + <% else %> + <p>No creations found.</p> + <% end %> + </div> + <div class="tab-pane" id="tab2"> + <% if @tutorials.any? %> + <table class="table table-striped"> + <thead> + <th>Name</th> + <th>Description</th> + </thead> + <tbody> + <% @tutorials.each_with_index do |tutorial, index| %> + <% cache tutorial do %> + <tr> + <td><%= link_to tutorial.heading, tutorial_path(tutorial) %></td> + <td><%= tutorial.description %></td> + </tr> <% end %> - </tbody> - </table> - <% else %> - <p>No tutorials found.</p> <% end %> - </div> - <div class="tab-pane" id="tab3"> - <% if @members.any? %> - <table class="table table-striped"> - <thead> - <th>Artists</th> - <th>Name</th> - </thead> - <tbody> - <% @members.each_with_index do |artist, index| %> - <tr> - <td> - <%= link_to profile_path(artist) do %> - <%= avatar_for(artist, size: 65) %> - <% end %> - </td> - <td><%= link_to artist.name, profile_path(artist) %></td> - <td><%= link_to artist.website, artist.website if artist.website %></td> - <td><%= link_to artist.twitter, "https://twitter.com/#{artist.twitter}" if artist.twitter.present? %></td> - <td><%= link_to artist.facebook, artist.facebook if artist.facebook %></td> - <td><%= artist.city %></td> - </tr> - <% end %> - </tbody> - </table> - <% else %> - <p>No artists found.</p> + </tbody> + </table> + <% else %> + <p>No tutorials found.</p> + <% end %> + </div> + <div class="tab-pane" id="tab3"> + <% if @members.any? %> + <table class="table table-striped"> + <thead> + <th>Artists</th> + <th>Name</th> + </thead> + <tbody> + <% @members.each_with_index do |artist, index| %> + <tr> + <td> + <%= link_to profile_path(artist) do %> + <%= avatar_for(artist, size: 65) %> + <% end %> + </td> + <td><%= link_to artist.name, profile_path(artist) %></td> + <td><%= link_to artist.website, artist.website if artist.website %></td> + <td><%= link_to artist.twitter, "https://twitter.com/#{artist.twitter}" if artist.twitter.present? %></td> + <td><%= link_to artist.facebook, artist.facebook if artist.facebook %></td> + <td><%= artist.city %></td> + </tr> <% end %> - </div> + </tbody> + </table> + <% else %> + <p>No artists found.</p> + <% end %> </div> </div> - - </div> </div> diff --git a/app/views/tutorials/show.html.erb b/app/views/tutorials/show.html.erb index 381f414a..c4ae624f 100644 --- a/app/views/tutorials/show.html.erb +++ b/app/views/tutorials/show.html.erb @@ -1,20 +1,20 @@ <%= provide(:search_path, tutorials_path) %> + <div class="row"> <div class="col"> - <div class="thumbnail"> - <img src="<%= @tutorial.image_url %>" /> - <div class="caption"> - <h3><a href="<%= @tutorial.url %>" target="_blank"><%= @tutorial.heading %></a> <small><%= @tutorial.created_at.to_s :foomat %></small></h3> - <p> - <% @tutorial.tags.each do |tag| -%> - <%= link_to tutorial_tag_path(tag.name) do %> - <span class="label"><%= tag.name %></span> - <% end %> - <% end -%> - </p> - <p><%= @tutorial.description %></p> - <p><a class="btn btn-primary" href="<%= @tutorial.url %>">Read full article</a></p> - </div> - </div> + <img src="<%= @tutorial.image_url %>" /> + </div> + <div class="col"> + <h3><%= @tutorial.heading %></h3> + <small><%= @tutorial.created_at.to_s :foomat %></small> + <p> + <% @tutorial.tags.each do |tag| -%> + <%= link_to tutorial_tag_path(tag.name) do %> + <span class="badge badge-info"><%= tag.name %></span> + <% end %> + <% end -%> + </p> + <p><%= @tutorial.description %></p> + <p><a class="btn btn-primary" href="<%= @tutorial.url %>" target="_blank">Read full article</a></p> </div> </div> |
