Some renaming and cleaning

This commit is contained in:
Senén Rodero Rodríguez
2017-09-21 12:30:22 +02:00
parent 34a0aa25b6
commit 95016a1bf3
8 changed files with 34 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
App.Imageable =
initialize: ->
inputFiles = $('input.direct_upload_image_attachment[type=file]')
inputFiles = $('input.js-document-attachment[type=file]')
$.each inputFiles, (index, input) ->
App.Imageable.initializeDirectUploadInput(input)

View File

@@ -28,7 +28,6 @@
background-color: $light-gray;
}
input.direct_upload_image_attachment[type=file],
.js-document-attachment{
display: none;
}

View File

@@ -29,8 +29,7 @@
background-color: $light-gray;
}
input.direct_upload_image_attachment[type=file],
input.direct_upload_document_attachment[type=file] {
.js-image-attachment{
display: none;
}

View File

@@ -76,7 +76,7 @@ module ImagesHelper
def render_image_attachment(image)
html = file_field_tag :attachment,
accept: imageable_accepted_content_types_extensions,
class: 'direct_upload_image_attachment',
class: 'js-document-attachment',
data: {
url: image_direct_upload_url(image),
cached_attachment_input_field: image_nested_field_id(image, :cached_attachment),

View File

@@ -24,7 +24,7 @@
<%= f.file_field :attachment,
accept: imageable_accepted_content_types_extensions,
label: false,
class: 'direct_upload_image_attachment',
class: 'js-document-attachment',
data: {
url: direct_uploads_url("direct_upload[resource_type]": @image.imageable_type,
"direct_upload[resource_id]": @image.imageable_id,

View File

@@ -2,7 +2,6 @@ en:
images:
upload_image: Upload image
remove_image: Remove image
remove_alert: Are you sure you want to remove the image?
form:
title: Descriptive image

View File

@@ -2,7 +2,6 @@ es:
images:
upload_image: Subir imagen
remove_image: Eliminar imagen
remove_alert: ¿Está seguro que desea eliminar la imagen del proyecto?
form:
title: Imagen descriptiva

View File

@@ -1290,44 +1290,42 @@ feature 'Proposals' do
it_behaves_like "followable", "proposal", "proposal_path", { "id": "id" }
describe "my specs group" do
it_behaves_like "imageable", "proposal", "proposal_path", { "id": "id" }
it_behaves_like "imageable", "proposal", "proposal_path", { "id": "id" }
it_behaves_like "nested imageable",
"proposal",
"new_proposal_path",
{ },
"imageable_fill_new_valid_proposal",
"Create proposal",
"Proposal created successfully"
it_behaves_like "nested imageable",
"proposal",
"new_proposal_path",
{ },
"imageable_fill_new_valid_proposal",
"Create proposal",
"Proposal created successfully"
it_behaves_like "nested imageable",
"proposal",
"edit_proposal_path",
{ "id": "id" },
nil,
"Save changes",
"Proposal updated successfully"
it_behaves_like "nested imageable",
"proposal",
"edit_proposal_path",
{ "id": "id" },
nil,
"Save changes",
"Proposal updated successfully"
it_behaves_like "documentable", "proposal", "proposal_path", { "id": "id" }
it_behaves_like "documentable", "proposal", "proposal_path", { "id": "id" }
it_behaves_like "nested documentable",
"proposal",
"new_proposal_path",
{ },
"documentable_fill_new_valid_proposal",
"Create proposal",
"Proposal created successfully"
it_behaves_like "nested documentable",
"proposal",
"new_proposal_path",
{ },
"documentable_fill_new_valid_proposal",
"Create proposal",
"Proposal created successfully"
it_behaves_like "nested documentable",
"proposal",
"edit_proposal_path",
{ "id": "id" },
nil,
"Save changes",
"Proposal updated successfully"
it_behaves_like "nested documentable",
"proposal",
"edit_proposal_path",
{ "id": "id" },
nil,
"Save changes",
"Proposal updated successfully"
end
scenario 'Erased author' do
user = create(:user)
proposal = create(:proposal, author: user)