<% content_for :heading do -%><%= controller.new_title %><% end -%>
<h1><%= controller.new_title %></h1>
<%= flashes! %>

<%= form_for @obj, :url => @url, :remote => controller.may_upload, data: { ajax: !controller.may_upload } do |f| %>

<%= render partial: "shared/model_form", locals: { form_name: controller.form_path, edit: false, autofocus: true, f: f } %>

  <%= yield %>

  <div data-role="footer" data-position="fixed" data-tap-toggle="false">
    <div data-role="navbar">
      <ul>
        <li>
          <%= f.submit(controller.new_save_text, "data-icon" => "check", "data-iconpos" => "top", "style" => "background-color: green") %>
        </li>
        <% if content_for?(:footerlinks) %>
          <%= content_for(:footerlinks) %>
        <% end %>
        <% if true %>
          <li><%= link_to t("myplaceonline.general.cancel"), controller.index_path, "data-icon" => "back" %></li>
        <% end %>
      </ul>
    </div>
  </div>

  <script type="text/javascript">
  myplaceonline.onPageLoad(function() {
    myplaceonline.maybeFocus(".autofocus");
  });
  </script>

<% end %>

<% content_for :heading do -%><%= controller.new_title %><% end -%>
<h1><%= controller.new_title %></h1>
<%= flashes! %>

<%= form_for @obj, :url => @url, :remote => controller.may_upload, data: { ajax: !controller.may_upload } do |f| %>

<%= render partial: "shared/model_form", locals: { form_name: controller.form_path, edit: false, autofocus: true, f: f } %>

  <%= yield %>

  <div data-role="footer" data-position="fixed" data-tap-toggle="false">
    <div data-role="navbar">
      <ul>
        <li>
          <%= f.submit(controller.new_save_text, "data-icon" => "check", "data-iconpos" => "top", "style" => "background-color: green") %>
        </li>
        <% if content_for?(:footerlinks) %>
          <%= content_for(:footerlinks) %>
        <% end %>
        <% if true %>
          <li><%= link_to t("myplaceonline.general.cancel"), controller.index_path, "data-icon" => "back" %></li>
        <% end %>
      </ul>
    </div>
  </div>

  <script type="text/javascript">
  myplaceonline.onPageLoad(function() {
    <% if !params[:prefill].blank? %>
      $(".autofocus").attr("value", <%= raw(params[:prefill].to_json) %>);
    <% end %>
    myplaceonline.maybeFocus(".autofocus");
  });
  </script>

<% end %>

Set the form's prefill value if found
Set the form's prefill value if found
