Added upload image button. Created function to show file upload name. Added translation.
This commit is contained in:
committed by
Senén Rodero Rodríguez
parent
4ce8e14f86
commit
6cde1c1c10
@@ -942,6 +942,15 @@
|
|||||||
.note-marked p{
|
.note-marked p{
|
||||||
margin-bottom:0;
|
margin-bottom:0;
|
||||||
}
|
}
|
||||||
|
.image-upload{
|
||||||
|
.button, p{
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
p{
|
||||||
|
margin-left:1rem;
|
||||||
|
margin-top: 0.8rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.investment-project-show .supports,
|
.investment-project-show .supports,
|
||||||
|
|||||||
@@ -1,30 +1,29 @@
|
|||||||
<%= form_for([@investment.budget, @investment], url: update_image_budget_investment_path(@investment.budget, @investment), multipart: true, method: :put) do |f| %>
|
<%= form_for([@investment.budget, @investment], url: update_image_budget_investment_path(@investment.budget, @investment), multipart: true, method: :put) do |f| %>
|
||||||
<%= render 'shared/errors', resource: @investment %>
|
<%= render 'shared/errors', resource: @investment %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<span class="note-marked">
|
<span class="note-marked">
|
||||||
<% note_key = @investment.image.exists? ? "edit_note" : "add_note" %>
|
<% note_key = @investment.image.exists? ? "edit_note" : "add_note" %>
|
||||||
<%= t("budgets.investments.edit_image.#{note_key}", title: @investment.title) %></p>
|
<%= t("budgets.investments.edit_image.#{note_key}", title: @investment.title) %></p>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if @investment.image.exists? %>
|
<% if @investment.image.exists? %>
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= image_tag @investment.image.url(:large) %>
|
<%= image_tag @investment.image.url(:large) %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= f.file_field :image, accept: 'image/jpeg' %>
|
<div class="image-upload">
|
||||||
|
<%= f.file_field :image, accept: 'image/jpeg', label: false, class:'show-for-sr' %>
|
||||||
|
<br>
|
||||||
|
<%= f.label :image, t("images.upload_image"), class:'button' %>
|
||||||
|
<p><%= @investment.image.url.split('/').last.split("?")[0] %></p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= f.label :image_title, t("budgets.investments.edit_image.form.image_title") %>
|
<%= f.label :image_title, t("budgets.investments.edit_image.form.image_title") %>
|
||||||
<%= f.text_field :image_title, placeholder: t("budgets.investments.edit_image.form.image_title"), label: false %>
|
<%= f.text_field :image_title, placeholder: t("budgets.investments.edit_image.form.image_title"), label: false %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actions small-12 column">
|
<div class="actions small-12 column">
|
||||||
<%= f.submit(class: "button", value: t("budgets.investments.edit_image.form.submit_button")) %>
|
<%= f.submit(class: "button", value: t("budgets.investments.edit_image.form.submit_button")) %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
<%= investment.heading.name %>
|
<%= investment.heading.name %>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<!-- TODO: ROCK&ROR: Markup rework accordingly to mockup definition -->
|
<!-- TODO: ROCK&ROR: Markup rework accordingly to mockup definition -->
|
||||||
<% if investment.image.exists? %>
|
<% if investment.image.exists? %>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -43,8 +42,6 @@
|
|||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<p id="investment_code">
|
<p id="investment_code">
|
||||||
<%= t("budgets.investments.show.code_html", code: investment.id) %>
|
<%= t("budgets.investments.show.code_html", code: investment.id) %>
|
||||||
|
|||||||
@@ -184,6 +184,8 @@ en:
|
|||||||
geozones:
|
geozones:
|
||||||
none: All city
|
none: All city
|
||||||
all: All scopes
|
all: All scopes
|
||||||
|
images:
|
||||||
|
upload_image: Upload Image
|
||||||
layouts:
|
layouts:
|
||||||
application:
|
application:
|
||||||
chrome: Google Chrome
|
chrome: Google Chrome
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ es:
|
|||||||
title: "Título"
|
title: "Título"
|
||||||
location: "Ubicación"
|
location: "Ubicación"
|
||||||
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, escribe su nombre"
|
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, escribe su nombre"
|
||||||
image: "Imagen descriptiva de la propueta"
|
image: "Imagen descriptiva de la propuesta"
|
||||||
image_title: "Título de la imagen"
|
image_title: "Título de la imagen"
|
||||||
comment:
|
comment:
|
||||||
body: "Comentario"
|
body: "Comentario"
|
||||||
|
|||||||
@@ -184,6 +184,8 @@ es:
|
|||||||
geozones:
|
geozones:
|
||||||
none: Toda la ciudad
|
none: Toda la ciudad
|
||||||
all: Todos los ámbitos de actuación
|
all: Todos los ámbitos de actuación
|
||||||
|
images:
|
||||||
|
upload_image: Subir una imagen
|
||||||
layouts:
|
layouts:
|
||||||
application:
|
application:
|
||||||
chrome: Google Chrome
|
chrome: Google Chrome
|
||||||
|
|||||||
Reference in New Issue
Block a user