-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
break templates#new into multiple forms #114
- Loading branch information
Showing
3 changed files
with
110 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<%= form_for(@template, :url => import_templates_path, :html => { :multipart => true }) do |f| %> | ||
<% if @template.errors.any? %> | ||
<div id="errorExplanation"> | ||
<h2><%= pluralize(@template.errors.count, "error") %> prohibited this template from being saved:</h2> | ||
<ul> | ||
<% @template.errors.full_messages.each do |msg| %> | ||
<li><%= msg %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<div class="field"> | ||
<%= label_tag :package %><br /> | ||
<%= file_field_tag :package %> | ||
</div> | ||
<hr /> | ||
<div class="field"> | ||
<%= label_tag :image %><br /> | ||
<%= file_field_tag :image %> | ||
</div> | ||
<div class="field"> | ||
<%= label_tag :descriptor %><br /> | ||
<%= file_field_tag :descriptor %> | ||
</div> | ||
|
||
|
||
<div class="actions"> | ||
<%= f.submit("Import Template") %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,50 @@ | ||
<section class="MS-frame"> | ||
<header> | ||
<h1>Select Template Source:</h1> | ||
</header> | ||
<div class="MS-outer"> | ||
<article> | ||
|
||
<ul class="MS"> | ||
<li> | ||
<%= link_to new_template_path(:type=> "import") do %> | ||
<%= image_tag("ph/ph.png", :alt => "") %> | ||
<div class="content"> | ||
<h2><%= "Import" %></h2> | ||
</div> | ||
<% end %> | ||
</li> | ||
<li> | ||
<%= link_to new_template_path(:type=> "create") do %> | ||
<%= image_tag("ph/ph.png", :alt => "") %> | ||
<div class="content"> | ||
<h2><%= "Create" %></h2> | ||
</div> | ||
<% end %> | ||
</li> | ||
|
||
<div class="clear"></div> | ||
</ul> | ||
</article> | ||
</div> | ||
</section> | ||
|
||
<section class="C no"> | ||
<header id="browse-header"> | ||
<%= back_button :back %> | ||
<h1>New Template</h1> | ||
</header> | ||
<div id="browse-body" class="C-cont"> | ||
<%= render 'form' %> | ||
</div> | ||
<header id="template-header"> | ||
<%= back_button "#", :back %> | ||
<h1><%= (params[:type] || 'import').capitalize + " Template" %></h1> | ||
</header> | ||
<div class="C-cont"> | ||
<article> | ||
<% if params[:type] == "create" %> | ||
<%= render 'create_form' %> | ||
<% else %> | ||
<%= render 'import_form' %> | ||
<% end %> | ||
|
||
</article> | ||
<aside> | ||
</aside> | ||
<div class="clear"></div> | ||
</div> | ||
</section> |