Show heading name and amount on single heading new form
Note we're using an extra `<span>` element but we could use a CSS grid layout instead. We're not using it because browser compatibility is only 94.56% at the time of writing.
This commit is contained in:
@@ -41,7 +41,6 @@
|
|||||||
font-size: rem-calc(36);
|
font-size: rem-calc(36);
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
padding: $line-height * 2 0;
|
padding: $line-height * 2 0;
|
||||||
position: relative;
|
|
||||||
|
|
||||||
@include breakpoint(large) {
|
@include breakpoint(large) {
|
||||||
clip-path: polygon(
|
clip-path: polygon(
|
||||||
@@ -69,6 +68,12 @@
|
|||||||
margin-right: rem-calc(60);
|
margin-right: rem-calc(60);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span span {
|
||||||
|
display: block;
|
||||||
|
font-size: 0.75em;
|
||||||
|
margin-top: $line-height / 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@mixin background-till-left-of-screen {
|
@mixin background-till-left-of-screen {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
background: inherit;
|
background: inherit;
|
||||||
content: "";
|
content: "";
|
||||||
|
|||||||
@@ -3,7 +3,19 @@
|
|||||||
<%= back_link_to budgets_path %>
|
<%= back_link_to budgets_path %>
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<h1><%= t("budgets.investments.form.title") %></h1>
|
<h1>
|
||||||
|
<span>
|
||||||
|
<%= t("budgets.investments.form.title") %>
|
||||||
|
|
||||||
|
<% if @budget.single_heading? %>
|
||||||
|
<span>
|
||||||
|
<%= t("budgets.investments.form.subtitle",
|
||||||
|
heading: @budget.headings.first.name,
|
||||||
|
price: @budget.formatted_heading_price(@budget.headings.first)) %>
|
||||||
|
</span>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ en:
|
|||||||
investments:
|
investments:
|
||||||
form:
|
form:
|
||||||
title: "Create a budget investment"
|
title: "Create a budget investment"
|
||||||
|
subtitle: "%{heading} (%{price})"
|
||||||
tag_category_label: "Categories"
|
tag_category_label: "Categories"
|
||||||
tags_instructions: "Tag this proposal. You can choose from proposed categories or add your own"
|
tags_instructions: "Tag this proposal. You can choose from proposed categories or add your own"
|
||||||
tags_label: Tags
|
tags_label: Tags
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ es:
|
|||||||
investments:
|
investments:
|
||||||
form:
|
form:
|
||||||
title: "Crear nuevo proyecto"
|
title: "Crear nuevo proyecto"
|
||||||
|
subtitle: "%{heading} (%{price})"
|
||||||
tag_category_label: "Categorías"
|
tag_category_label: "Categorías"
|
||||||
tags_instructions: "Etiqueta este proyecto. Puedes elegir entre las categorías propuestas o introducir las que desees"
|
tags_instructions: "Etiqueta este proyecto. Puedes elegir entre las categorías propuestas o introducir las que desees"
|
||||||
tags_label: Etiquetas
|
tags_label: Etiquetas
|
||||||
|
|||||||
@@ -545,6 +545,7 @@ describe "Budget Investments" do
|
|||||||
visit new_budget_investment_path(budget)
|
visit new_budget_investment_path(budget)
|
||||||
|
|
||||||
expect(page).not_to have_field "budget_investment_heading_id"
|
expect(page).not_to have_field "budget_investment_heading_id"
|
||||||
|
expect(page).to have_content("#{heading.name} (#{budget.formatted_heading_price(heading)})")
|
||||||
|
|
||||||
fill_in "Title", with: "Build a skyscraper"
|
fill_in "Title", with: "Build a skyscraper"
|
||||||
fill_in_ckeditor "Description", with: "I want to live in a high tower over the clouds"
|
fill_in_ckeditor "Description", with: "I want to live in a high tower over the clouds"
|
||||||
@@ -576,6 +577,7 @@ describe "Budget Investments" do
|
|||||||
|
|
||||||
visit new_budget_investment_path(budget)
|
visit new_budget_investment_path(budget)
|
||||||
|
|
||||||
|
expect(page).not_to have_content("#{heading.name} (#{budget.formatted_heading_price(heading)})")
|
||||||
expect(page).to have_select "Heading",
|
expect(page).to have_select "Heading",
|
||||||
options: ["", "More hospitals", "Medical supplies", "Even more hospitals"]
|
options: ["", "More hospitals", "Medical supplies", "Even more hospitals"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user