Move new proposal view to a component
This commit is contained in:
25
app/components/proposals/new_component.html.erb
Normal file
25
app/components/proposals/new_component.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<div class="proposal-new">
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= back_link_to %>
|
||||
|
||||
<h1><%= t("proposals.new.start_new") %></h1>
|
||||
<div data-alert class="callout primary">
|
||||
<%= link_to help_path(anchor: "proposals"), title: t("shared.target_blank"), target: "_blank" do %>
|
||||
<%= t("proposals.new.more_info") %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= render Proposals::FormComponent.new(proposal, url: proposals_path) %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<span class="icon-proposals float-right"></span>
|
||||
<h2><%= t("proposals.new.recommendations_title") %></h2>
|
||||
<ul class="recommendations">
|
||||
<li><%= t("proposals.new.recommendation_one") %></li>
|
||||
<li><%= t("proposals.new.recommendation_two") %></li>
|
||||
<li><%= t("proposals.new.recommendation_three") %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
7
app/components/proposals/new_component.rb
Normal file
7
app/components/proposals/new_component.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class Proposals::NewComponent < ApplicationComponent
|
||||
attr_reader :proposal
|
||||
|
||||
def initialize(proposal)
|
||||
@proposal = proposal
|
||||
end
|
||||
end
|
||||
@@ -1,24 +1 @@
|
||||
<div class="proposal-new">
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= back_link_to %>
|
||||
|
||||
<h1><%= t("proposals.new.start_new") %></h1>
|
||||
<div data-alert class="callout primary">
|
||||
<%= link_to help_path(anchor: "proposals"), title: t("shared.target_blank"), target: "_blank" do %>
|
||||
<%= t("proposals.new.more_info") %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= render "proposals/form", form_url: proposals_path %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<span class="icon-proposals float-right"></span>
|
||||
<h2><%= t("proposals.new.recommendations_title") %></h2>
|
||||
<ul class="recommendations">
|
||||
<li><%= t("proposals.new.recommendation_one") %></li>
|
||||
<li><%= t("proposals.new.recommendation_two") %></li>
|
||||
<li><%= t("proposals.new.recommendation_three") %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<%= render Proposals::NewComponent.new(@proposal) %>
|
||||
|
||||
Reference in New Issue
Block a user