Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds URLs to ETD show page, and degree awarded notification. #963

Merged
merged 1 commit into from
Apr 5, 2018

Conversation

rotated8
Copy link
Collaborator

@rotated8 rotated8 commented Apr 4, 2018

No tests, as these are in views, although I'm happy to add them.

Here's a before:
before

And after:
after

@rotated8
Copy link
Collaborator Author

rotated8 commented Apr 4, 2018

@coveralls
Copy link

coveralls commented Apr 4, 2018

Coverage Status

Coverage remained the same at 84.318% when pulling 2684dab on add-link into c262d33 on master.

@@ -5,7 +5,9 @@
<%= render 'work_title', presenter: @presenter %>
</header>

<span>Permanent URL: <%= Rails.application.routes.url_helpers.send(@presenter.model_name.singular_route_key + '_url', @presenter.id) %></span>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to do #send here? Don't we have access to the url_helpers natively in the view?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was the idiom I saw in the code base (https://github.com/curationexperts/laevigata/blob/master/app/services/hyrax/workflow/laevigata_notification.rb#L21). Rails.application.routes.url_helpers.hyrax_etd_url(@presenter) also works, but hyrax_etd_url(@presenter), and url_for(@presenter) do not.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the right thing main_app.etd_url(...)?

If not, we should probably at least do public_send instead of send. :)

@rotated8
Copy link
Collaborator Author

rotated8 commented Apr 5, 2018

main_app.hyrax_etd_url(@presenter.id) works. PR updated.

New after screenshot, includes language in the URL:
after

Copy link

@no-reply no-reply left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@bess bess merged commit 710b7ed into master Apr 5, 2018
@bess bess deleted the add-link branch April 5, 2018 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants