Skip to content

Commit

Permalink
Add button to add more content at the top of content#index pages
Browse files Browse the repository at this point in the history
  • Loading branch information
drusepth committed Oct 5, 2016
1 parent 6eda3a9 commit 9ddcb31
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/characters_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def content_param_list
:facialhair, :eyecolor, :race, :skintone, :bodytype, :identmarks, :hairstyle,
:religion, :politics, :prejudices, :occupation, :pets, :aliases,
:mannerisms, :birthday, :education, :background,
:motivations, :flaws, :talents, :hobbies, :personality_type
:motivations, :flaws, :talents, :hobbies, :personality_type,
:fave_color, :fave_food, :fave_possession, :fave_weapon, :fave_animal,
:notes, :private_notes, :privacy,
siblingships_attributes: [:id, :sibling_id, :_destroy],
Expand Down
16 changes: 14 additions & 2 deletions app/views/content/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,24 @@
<% end %>
<% if @content.any? %>
<h4>You've created <%= pluralize(@content.count, content_type) %></h4>
<h4>
You've created <%= pluralize(@content.count, content_type) %>
<% if @content.count > 0 %>
<small class="right">
<%= link_to new_polymorphic_path(@content.build), class: "btn white #{content_type_class.color}-text" do %>
+
<i class="material-icons <%= content_type_class.color %>-text">
<%= content_type_class.icon %>
</i>
<% end %>
</small>
<% end %>
</h4>
<%= render partial: 'content/list/list', locals: { content_list: @content } %>
<%= link_to "Create another #{content_type}", new_polymorphic_path(@content.build), :class => 'btn' %>
<% elsif @content.empty? %>
<div class="center">
<div class="center" style="margin-bottom: 50px;">
<h4>You haven't created any <%= content_type.pluralize %> yet!</h4>
<h1>
<i class="material-icons <%= content_type_class.color %>-text" style="font-size: 200%">
Expand Down

0 comments on commit 9ddcb31

Please sign in to comment.