Unify the way we display document information

We were displaying documents in five places, and in five different ways.
Sometimes with the metadata in parenthesis after the title, sometimes
with the metadata below the title, sometimes without metadata, sometimes
with an icon in front of the document, and sometimes with a separate
link to download the file.

So we're now displaying the same thing everywhere. Not sure whether this
is the best solution, but at least it's consistent.

We aren't unifying the way we display a list of documents, though, since
different sections look pretty different and I'm not sure whether the
same style would look well everywhere.

Note that we're renaming the `document` HTML class in the documents
table to `document-row` so the styles for the `document` class don't
apply here.
This commit is contained in:
Javi Martín
2023-10-13 12:50:38 +02:00
parent a2e4b056ee
commit 7c6134fdee
21 changed files with 74 additions and 80 deletions

View File

@@ -14,9 +14,11 @@ shared_examples "documentable" do |documentable_factory_name, documentable_path,
scenario "Download action should be availabe to anyone and open in a new window" do
visit send(documentable_path, arguments)
expect(page).to have_link "Download file"
expect(page).to have_selector "a[target=_blank]", text: "Download file"
expect(page).to have_selector "a[rel=nofollow]", text: "Download file"
within "#documents" do
expect(page).to have_link text: document.title
expect(page).to have_selector "a[target=_blank]", text: document.title
expect(page).to have_selector "a[rel=nofollow]", text: document.title
end
end
describe "Destroy action" do