diff --git a/app/models/character.rb b/app/models/character.rb
index b30dfc97..0f93c531 100644
--- a/app/models/character.rb
+++ b/app/models/character.rb
@@ -48,30 +48,30 @@ class Character < ActiveRecord::Base
def self.attribute_categories
{
- general: {
+ overview: {
icon: 'info',
attributes: %w(name role gender age universe_id)
},
- appearance: {
+ looks: {
icon: 'face',
attributes: %w(weight height haircolor hairstyle facialhair eyecolor race skintone bodytype identmarks)
},
social: {
icon: 'groups',
- attributes: %w(best_friends religion politics prejudices occupation)
+ attributes: %w(best_friends archenemies religion politics prejudices occupation)
},
# TODO: remove schema for mannerisms
history: {
icon: 'info',
attributes: %w(birthday birthplaces education background)
},
- favorites: {
+ faves: {
icon: 'star',
attributes: %w(fave_color fave_food fave_possession fave_weapon fave_animal)
},
- relations: {
+ family: {
icon: 'face',
- attributes: %w(mothers fathers spouses siblings archenemies children)
+ attributes: %w(mothers fathers spouses siblings children)
},
notes: {
icon: 'edit',
diff --git a/app/models/item.rb b/app/models/item.rb
index f194b02a..d8749b4f 100644
--- a/app/models/item.rb
+++ b/app/models/item.rb
@@ -32,20 +32,20 @@ class Item < ActiveRecord::Base
def self.attribute_categories
{
- general_information: {
+ overview: {
icon: 'info',
attributes: %w(name item_type description universe_id)
},
- appearance: {
- icon: 'face',
+ looks: {
+ icon: 'redeem',
attributes: %w(weight)
},
history: {
- icon: 'face',
+ icon: 'book',
attributes: %w(original_owners current_owners makers materials year_made)
},
abilities: {
- icon: 'face',
+ icon: 'flash_on',
attributes: %w(magic)
},
notes: {
diff --git a/app/models/location.rb b/app/models/location.rb
index d56f0749..82914f53 100644
--- a/app/models/location.rb
+++ b/app/models/location.rb
@@ -38,7 +38,7 @@ class Location < ActiveRecord::Base
def self.attribute_categories
{
- general_information: {
+ overview: {
icon: 'info',
attributes: %w(name type_of description universe_id)
},
@@ -48,15 +48,15 @@ class Location < ActiveRecord::Base
attributes: %w(leaders population language currency motto)
},
cities: {
- icon: 'face',
+ icon: 'business',
attributes: %w(capital_cities largest_cities notable_cities)
},
geography: {
- icon: 'edit',
+ icon: 'map',
attributes: %w(area crops located_at)
},
history: {
- icon: 'edit',
+ icon: 'book',
attributes: %w(established_year notable_wars)
},
notes: {
diff --git a/app/models/universe.rb b/app/models/universe.rb
index 009c6305..8c7d800e 100644
--- a/app/models/universe.rb
+++ b/app/models/universe.rb
@@ -35,21 +35,21 @@ class Universe < ActiveRecord::Base
def self.attribute_categories
{
- general_information: {
+ overview: {
icon: 'info',
attributes: %w(name description)
},
history: {
- icon: 'face',
+ icon: 'book',
attributes: %w(history)
},
- settings: {
- icon: 'face',
- attributes: %w(privacy)
- },
notes: {
icon: 'edit',
attributes: %w(notes private_notes)
+ },
+ settings: {
+ icon: 'build',
+ attributes: %w(privacy)
}
}
end
diff --git a/app/views/content/_form.html.erb b/app/views/content/_form.html.erb
index 48d7cb1b..fa768fbd 100644
--- a/app/views/content/_form.html.erb
+++ b/app/views/content/_form.html.erb
@@ -6,7 +6,7 @@
- <%= content.class.icon %>
+ <%= content.class.icon %>
<%= render 'content/form/actions_dropdown', content: content %>
@@ -14,32 +14,65 @@
<%# Tabs %>
-
+
+
+ <% content.class.attribute_categories.each do |category, data| %>
+ -
+
+ <%= data[:icon] %>
+
+
+ <% end %>
+
<%# Content panels %>
<% content.class.attribute_categories.each do |category, data| %>
<% data[:attributes].each do |attribute| %>
-
+
+ <% # Do some dynamic resizing of columns based on how many columns there are
+ # TODO: move this into some service or something? Dunno, doesn't belong here.
+
+ s_width = 12
+ m_width = 6
+ l_width = 4
+
+ if data[:attributes].length == 1
+ # If there's only one field on this tab, go full-width on all screen sizes
+ s_width = m_width = l_width = 12
+ elsif data[:attributes].length == 2
+ # If there's two fields on this tab, go half-width on medium- and large-screens
+ s_width = 12
+ m_width = l_width = 6
+ elsif data[:attributes].length > 2
+ # If there's at least 3 fields, use the defaults (detailed above)
+ end
+ %>
+
+
">
+
<% value = content.send(attribute) %>
<% if value.is_a?(ActiveRecord::Associations::CollectionProxy) %>
+ <%# Relation-setting UI %>
<% through_class = content.class.reflect_on_association(attribute).options[:through].to_s %>
<%= render 'content/form/relation_input', f: f, attribute: attribute, relation: through_class %>
+
<% elsif attribute == 'universe_id' %>
<%= f.label attribute %>
<%= f.select attribute, current_user.universes.sort_by(&:name).map { |u| [u.name, u.id] }.compact, include_blank: true, selected: (f.object.persisted? ? f.object.universe_id : session[:universe_id]) %>
+
<% elsif attribute == 'privacy' %>
<%= f.label attribute %>
@@ -49,8 +82,16 @@
characters, locations, and items within this universe also.
+
+ <% elsif attribute == 'private_notes' %>
+ <%= render 'content/form/text_input', f: f, attribute: attribute %>
+
+ Private notes are always visible to only you, even if content is made public and shared.
+
+
<% else %>
<%= render 'content/form/text_input', f: f, attribute: attribute %>
+
<% end %>
<% end %>
diff --git a/app/views/content/_share.html.erb b/app/views/content/_share.html.erb
index b3fad05d..d9fee497 100644
--- a/app/views/content/_share.html.erb
+++ b/app/views/content/_share.html.erb
@@ -1,43 +1,43 @@
-
-
Share <%= shared_content.name %>
+
+
Share <%= shared_content.name %>
-
-
- <% if current_user && shared_content.user == current_user %>
-
-
-
To be shareable, content must be public or in a public Universe.
-
-
- <% if ((shared_content.respond_to? :universe) && shared_content.universe.present?) %>
-
- <%= render partial: 'content/form/privacy_toggle', locals: { content: shared_content.universe } %>
-
- <% end %>
-
- <% if shared_content.respond_to? :privacy %>
-
- <%= render partial: 'content/form/privacy_toggle', locals: { content: shared_content } %>
-
- <% end %>
-
- <% else %>
-
-
-
- This <%= shared_content.class.to_s.downcase %> is being shared on Notebook.ai by <%= link_to shared_content.user.name, shared_content.user %>.
-
-
-
- <% end %>
-
-
+
diff --git a/app/views/content/_show.html.erb b/app/views/content/_show.html.erb
index 89a66cc4..ca3bda5d 100644
--- a/app/views/content/_show.html.erb
+++ b/app/views/content/_show.html.erb
@@ -32,6 +32,7 @@ set_meta_tags title: content.name, description: content.description
<% data[:attributes].each do |attribute| %>
<% next if attribute.start_with?("private") && @content.user != current_user %>
+ <% next if content.send(attribute).blank? %>
<%= attribute.humanize.capitalize %>
diff --git a/app/views/content/form/_groupship_fields.html.erb b/app/views/content/form/_groupship_fields.html.erb
index e406fe54..ed384870 100644
--- a/app/views/content/form/_groupship_fields.html.erb
+++ b/app/views/content/form/_groupship_fields.html.erb
@@ -18,10 +18,20 @@
<% klass = parent.send(attribute.pluralize).build.class.name.downcase %>