benwbrum / fromthepage

FromThePage is a wiki-like application for crowdsourcing transcription of handwritten documents.
http://fromthepage.com
GNU Affero General Public License v3.0
170 stars 50 forks source link

activity emails shouldn't link to "transcribe" page #2527

Closed saracarl closed 3 months ago

saracarl commented 3 years ago

Transcribers get activity emails with comments on pages, etc. Those emails contain links to pages ("Click here" in the example below) that link to the "transcribe" tab for the page. The problem with that is if you aren't logged in you get the login page and lose the page.

We should change the link to be a link to the "overview" for the page.


New Notes
Click here  to view the note on page Trustees Records, Vol. 4, 1865 (page 250) in Mount Auburn Cemetery: 1865 Trustees Meeting Minutes, Volume 4, 1831.005.004, which has been added since you worked on it.
Thanks,

FromThePage
sylvieed commented 2 years ago

The transcribe link is in both the note added email and the nightly user activity email. In the views for both emails (note added, nightly activity), the link to the comment is collection_transcribe_page_url(...). Changing this to collection_display_page_url(...) should link the user to the "Overview" page instead.

So, change line 7 of user_mailer/added_note.html.slim to

span =link_to "Click here", collection_display_url(@page.collection.owner, @page.collection, @page.work, @page, only_path: false)

and line 18 of nightly_user_activity.html.slim to

=link_to t('.click_here'), collection_display_page_url(page.collection.owner, page.collection, page.work, page, only_path: false)

If the .text.erb files need to be changed as well, change line 7 of added_note.text.erb to

You can view the note in <%=@page.collection.title%>: <%=@page.work.title%> at the URL: <%= collection_display_page_url(@page.collection.owner, @page.collection, @page.work, @page, only_path: false)%>.

and line 17 of nightly_user_activity.text.erb to

To view the note on page <%=page.work.title%>: <%=page.title%>, visit the following URL: <%=collection_display_page_url(page.collection.owner, page.collection, page.work, page, only_path: false)%>
saracarl commented 2 years ago

This looks right to me. We do need to change the text emails.

On Sun, Jan 30, 2022 at 5:14 PM sylvie daines @.***> wrote:

The transcribe link is in both the note added email and the nightly user activity email. In the views for both emails (note added https://github.com/benwbrum/fromthepage/blob/fb125e13ba0c816036ed2b931e7a653194ff7267/app/views/user_mailer/added_note.html.slim#L7, nightly activity https://github.com/benwbrum/fromthepage/blob/fc2575286a46b518ac184391de48742ee1c4c522/app/views/user_mailer/nightly_user_activity.html.slim#L18), the link to the comment is collection_transcribe_page_url(...). Changing this to collection_display_page_url(...) should link the user to the "Overview" page instead.

So, change line 7 of user_mailer/added_note.html.slim https://github.com/benwbrum/fromthepage/blob/fb125e13ba0c816036ed2b931e7a653194ff7267/app/views/user_mailer/added_note.html.slim#L7 to

span =link_to "Click here", @.***, @page.collection, @page.work, @page, only_path: false)

and line 18 of nightly_user_activity.html.slim https://github.com/benwbrum/fromthepage/blob/fc2575286a46b518ac184391de48742ee1c4c522/app/views/user_mailer/nightly_user_activity.html.slim#L18 to

=link_to t('.click_here'), collection_display_page_url(page.collection.owner, page.collection, page.work, page, only_path: false)

If the .text.erb files need to be changed as well, change line 7 of added_note.text.erb https://github.com/benwbrum/fromthepage/blob/fb125e13ba0c816036ed2b931e7a653194ff7267/app/views/user_mailer/added_note.text.erb#L7 to

You can view the note in @.%>: @.%> at the URL: <%= @.***, @page.collection, @page.work, @page, only_path: false)%>.

and line 17 of nightly_user_activity.text.erb https://github.com/benwbrum/fromthepage/blob/fb125e13ba0c816036ed2b931e7a653194ff7267/app/views/user_mailer/nightly_user_activity.text.erb#L17 to

To view the note on page <%=page.work.title%>: <%=page.title%>, visit the following URL: <%=collection_display_page_url(page.collection.owner, page.collection, page.work, page, only_path: false)%>

— Reply to this email directly, view it on GitHub https://github.com/benwbrum/fromthepage/issues/2527#issuecomment-1025255610, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFM7VSUJVOPCSUBJADO6H3UYXA5PANCNFSM43XM223Q . You are receiving this because you authored the thread.Message ID: @.***>

-- Sara Brumfield Partner, Brumfield Labs Creators of FromThePage http://www.fromthepage.com https://www.fromthepage.com