Fix universe edit html for submission

This commit is contained in:
Andrew Brown 2014-07-28 22:37:33 -05:00
parent b293481da8
commit 7798532f1b
3 changed files with 88 additions and 63 deletions

View File

@ -1,6 +1,6 @@
<div class="hidden section starter_section general_section">
<%= generate_form_row_for(f, :name, nil, [{:action => 'location_name_generator', :icon => 'random'}]) %>
<%= generate_form_row_for(f, :type_of, 'Type of location') %>
<%= generate_form_row_for(f, :type_of, 'Location type') %>
<%= generate_form_row_for(f, :description, nil) %>
<%= generate_form_row_for(f, :universe, nil, [{:action => 'universe_picker', :icon => 'globe'}]) %>
</div>

View File

@ -1,8 +1,37 @@
<%- model_class = @location.class -%>
<div class="card">
<%= render :partial => 'tabs' %>
<div class="card-body">
<%= render :partial => 'edit_form' %>
<div class="row">
<div class="col-xs-3">
<div class="card">
<h1 class="card-heading">Facets</h1>
<%= render :partial => 'tabs' %>
</div>
<div class="card">
<h1 class="card-heading">Danger-zone</h1>
<div class="card-body">
<%= link_to 'Delete location forever', character_path,
:class => 'btn btn-danger',
:method => :delete,
:confirm => 'Are you sure? This action cannot be undone!' %>
</div>
</div>
</div>
<div class="col-xs-8">
<div class="card">
<h1 class="card-heading">Editing <%= @location.name %></h1>
<%= form_for @location,
:url => character_edit_process_path,
:html => { :class => 'form-horizontal' } do |form| %>
<div class="card-body">
<%= render :partial => 'form', :locals => { :f => form } %>
</div>
<div class="card-comments">
<%= form.submit nil, :class => 'btn btn-primary' %>
<%= link_to 'Cancel', character_list_path, :class => 'btn' %>
</div>
<% end %>
</div>
</div>
</div>

View File

@ -1,66 +1,62 @@
<%= form_for @universe, :url => universe_create_process_path, :html => { :class => 'form-horizontal' } do |f| %>
<div class="hidden section starter_section general_section">
<div class="control-group">
<%= f.label :name, :class => 'control-label' %>
<div class="controls">
<%= f.text_field :name, :class => 'text_field' %>
<span class="muted">Can't think of a name? Name it after your story!</span>
</div>
<div class="hidden section starter_section general_section">
<div class="control-group">
<%= f.label :name, :class => 'control-label' %>
<div class="controls">
<%= f.text_field :name, :class => 'text_field' %>
<span class="muted">Can't think of a name? Name it after your story!</span>
</div>
<div class="control-group">
<%= f.label :description, :class => 'control-label' %>
<div class="controls">
<%= f.text_area :description, :class => 'text_area', :rows => 4, :style => "width: 80%;" %>
</div>
</div>
</div>
<div class="hidden section history_section">
<div class="control-group">
<%= f.label 'Relevant history', :class => 'control-label' %>
<div class="controls">
<%= f.text_area :history, :class => 'text_area', :rows => 6, :style => "width: 80%;" %>
</div>
</div>
</div>
<div class="hidden section notes_section">
<div class="control-group">
<%= f.label 'Notes', :class => 'control-label' %>
<div class="controls">
<%= f.text_area :notes, :class => 'text_area', :rows => 10, :style => "width: 80%;" %>
</div>
</div>
<div class="control-group">
<%= f.label 'Private Notes', :class => 'control-label' %>
<div class="controls">
<%= f.text_area :private_notes, :class => 'text_area', :rows => 8, :style => "width: 80%;" %>
<div class="muted">
By default, all content is private and only accessible by you. Even if you decide to make something<br />
public, the private notes section will always be only visible to you, no matter what.
</div>
</div>
<div class="control-group">
<%= f.label :description, :class => 'control-label' %>
<div class="controls">
<%= f.text_area :description, :class => 'text_area', :rows => 4, :style => "width: 80%;" %>
</div>
</div>
<div class="hidden section settings_section">
<div class="control-group">
<%= f.label :privacy, :class => 'control-label' %>
<div class="controls">
<%= f.select :privacy, [['Private', 'Private'], ['Public', 'Public']] %>
<div class="muted">
By default, all universes are <strong>private</strong>, which means only you
can see them. If you choose to make your
universe <strong>public</strong>, <em>all</em> content within it (characters,
locations, etc) will be visible to anyone on the Internet, regardless of that
content's individual privacy setting. Even if a universe is marked public, only
you will have access to edit its contents.
</div>
</div>
</div>
</div>
<div class="hidden section history_section">
<div class="control-group">
<%= f.label 'Relevant history', :class => 'control-label' %>
<div class="controls">
<%= f.text_area :history, :class => 'text_area', :rows => 6, :style => "width: 80%;" %>
</div>
</div>
<% end %>
</div>
<div class="hidden section notes_section">
<div class="control-group">
<%= f.label 'Notes', :class => 'control-label' %>
<div class="controls">
<%= f.text_area :notes, :class => 'text_area', :rows => 10, :style => "width: 80%;" %>
</div>
</div>
<div class="control-group">
<%= f.label 'Private Notes', :class => 'control-label' %>
<div class="controls">
<%= f.text_area :private_notes, :class => 'text_area', :rows => 8, :style => "width: 80%;" %>
<div class="muted">
By default, all content is private and only accessible by you. Even if you decide to make something<br />
public, the private notes section will always be only visible to you, no matter what.
</div>
</div>
</div>
</div>
<div class="hidden section settings_section">
<div class="control-group">
<%= f.label :privacy, :class => 'control-label' %>
<div class="controls">
<%= f.select :privacy, [['Private', 'Private'], ['Public', 'Public']] %>
<div class="muted">
By default, all universes are <strong>private</strong>, which means only you
can see them. If you choose to make your
universe <strong>public</strong>, <em>all</em> content within it (characters,
locations, etc) will be visible to anyone on the Internet, regardless of that
content's individual privacy setting. Even if a universe is marked public, only
you will have access to edit its contents.
</div>
</div>
</div>
</div>