Modify

Opened 2 years ago

Closed 19 months ago

Last modified 11 months ago

#13289 closed enhancement (fixed)

Hide submit and delete buttons when not applicable to the current user

Reported by: Richard Lyders Owned by: Cauly
Priority: normal Component: AccreditationPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.2

Description

To hide the submit and delete buttons when they couldn't be used by the current user, I updated Accreditation.py.

Specific changes:

  1. get_delete_btn: new function to return the HTML for a delete button for an accreditation record only if the user has permissions to delete
  2. get_topic_submit_change_btn: new function to return the HTML for a submit button for a change to an existing accreditation record only if the user is one of the authors in the list for the topic's list of authors

Attachments (2)

Accreditation.py (13.7 KB) - added by Richard Lyders 2 years ago.
Hide submit and delete buttons when not applicable to the current user
accreditationplugin-trunk-16851-adds-configs-btns-perms-redirects.diff (14.8 KB) - added by Richard Lyders 2 years ago.
This is the complete path that includes all my changes to date: configs for labels, ACCREDITATION_CREATE, ACCREDITATION_DELETE, redirects to wrapper, hide unusable buttons

Download all attachments as: .zip

Change History (9)

Changed 2 years ago by Richard Lyders

Attachment: Accreditation.py added

Hide submit and delete buttons when not applicable to the current user

comment:1 in reply to:  description ; Changed 2 years ago by Cauly

Does this attachment includes all code from #13284 to #13289?

comment:2 Changed 2 years ago by Ryan J Ollos

It customary to submit patches rather than attaching the whole file (TracDev/SubmittingPatches).

comment:3 in reply to:  1 Changed 2 years ago by Richard Lyders

Replying to Cauly:

Does this attachment includes all code from #13284 to #13289?

Yes, I'm sending the whole file that includes all changes to date.

comment:4 in reply to:  2 ; Changed 2 years ago by Richard Lyders

Replying to Ryan J Ollos:

It customary to submit patches rather than attaching the whole file (TracDev/SubmittingPatches).

Great! I reviewed many pages of help and couldn't find how to submit a patch. I'll do that.

Changed 2 years ago by Richard Lyders

This is the complete path that includes all my changes to date: configs for labels, ACCREDITATION_CREATE, ACCREDITATION_DELETE, redirects to wrapper, hide unusable buttons

comment:5 Changed 2 years ago by Richard Lyders

Complete patch attached with all changes to date ... (the attachment description erroneously calls it a "complete path".

Thanks again for this plugin. We are getting some good use out of it.

comment:6 in reply to:  4 Changed 2 years ago by Richard Lyders

Replying to Richard Lyders:

Replying to Ryan J Ollos:

It customary to submit patches rather than attaching the whole file (TracDev/SubmittingPatches).

I was in my Git mode of thinking and looking for help on "pull", "request", etc when I should have been looking for help with "submit" and "patch".

comment:7 Changed 19 months ago by Cauly

Resolution: fixed
Status: newclosed

merged in r17082

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Cauly.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.