Modify

Opened 5 years ago

Closed 4 years ago

#5486 closed enhancement (fixed)

[Patch] "Back to ticket #X" should be located in contextual navigation

Reported by: rjollos Owned by: rjollos
Priority: high Component: TicketModifiedFilesPlugin
Severity: minor Keywords: patch
Cc: Trac Release: 0.11

Description

It would be more consistent with the layout of Trac if the "Back to ticket #X." link appeared in the contextual navigation rather than at the bottom of the page. For instance, when you select a particular ticket from a report page, the contextual navigation contains:
| ← Previous Ticket | Back to Query | Next Ticket → |

Attachments (2)

ticketmodifiedfiles.html.patch (940 bytes) - added by rjollos 5 years ago.
Patch for ticketmodifiedfiles.html
ctxtnav.patch (1.8 KB) - added by rjollos 5 years ago.
Improved patch

Download all attachments as: .zip

Change History (22)

comment:1 Changed 5 years ago by anonymous

  • Type changed from defect to enhancement

comment:2 follow-ups: Changed 5 years ago by e2jk

  • Severity changed from normal to minor

Are you familiar with trac plugins creation? If no, this might be a good opportunity to start by creating a patch so that the "Back to ticket #X" link appears in the contextual navigation ;)

I have to admit that I don't have much time to develop this myself, so if you want to see this enhancement I'd be happy to review any patch that you submit.

comment:3 in reply to: ↑ 2 Changed 5 years ago by anonymous

Hi,

I am not familiar with Trac development, or event Python for that matter (my experience is with C/C++/C# and MATLAB), but I am somewhat familiar with Trac administration and intend to learn to do plug-in development.

I see that there is some fairly nice looking development documentation so I imagine it will be fairly straightforward to get started. Thank you for offering to review the patch. I will let you know what I have within a few weeks.

  • Ryan

Replying to e2jk:

Are you familiar with trac plugins creation? If no, this might be a good opportunity to start by creating a patch so that the "Back to ticket #X" link appears in the contextual navigation ;)

I have to admit that I don't have much time to develop this myself, so if you want to see this enhancement I'd be happy to review any patch that you submit.

comment:4 Changed 5 years ago by e2jk

The documentation is pretty good, in fact this was my first Trac plugin and I did it all following the documentation. And Python is really not hard, learning it could be of great use to you. If you need a good Python resource, I greatly recommend Dive Into Python: http://diveintopython.org/

Have fun learning! I hope to hear back from you in a few weeks!

comment:5 Changed 5 years ago by e2jk

  • Priority changed from normal to lowest
  • Status changed from new to assigned

comment:6 in reply to: ↑ 2 Changed 5 years ago by rjollos

  • Owner changed from e2jk to rjollos
  • Status changed from assigned to new

Replying to e2jk:

Are you familiar with trac plugins creation? If no, this might be a good opportunity to start by creating a patch so that the "Back to ticket #X" link appears in the contextual navigation ;)

Hello again,

I have created a patch to address this enhancement. It took me quite a while to get up and running with the Trac install, but after that, it was a fairly straightforward enhancement. I will upload shortly.

  • Ryan

Changed 5 years ago by rjollos

Patch for ticketmodifiedfiles.html

comment:7 Changed 5 years ago by rjollos

Hello,

I have one other quick question for you. Although the plugin install seemed to go fine, I was seeing an error at the very end of the output of the install. The presumed error is bad local file header. I installed the plugin by checking out from svn and using easy_install. When I made a change to the source, I would run easy_install again and restart apache. That seemed to effectively 'upgrade' the plugin.

rjollos@pc-rjollos-ubuntu-server-9:~/ticketmodifiedfilesplugin$ sudo easy_install 0.11
Processing 0.11
Running setup.py -q bdist_egg --dist-dir /home/rjollos/ticketmodifiedfilesplugin/0.11/egg-dist-tmp-Bo_lYC
zip_safe flag not set; analyzing archive contents...
TicketModifiedFiles 1.00 is already the active version in easy-install.pth

Installed /usr/local/lib/python2.6/dist-packages/TicketModifiedFiles-1.00-py2.6.egg
Processing dependencies for TicketModifiedFiles==1.00
Traceback (most recent call last):
  File "/usr/local/bin/easy_install", line 8, in <module>
    load_entry_point('setuptools==0.6c9', 'console_scripts', 'easy_install')()
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 1671, in main
    
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 1659, in with_ei_usage
    
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 1675, in <lambda>
    
  File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 211, in run
    
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 427, in easy_install
    
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 478, in install_item
    
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 519, in process_distribution
    
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 529, in resolve
    requirements.extend(dist.requires(req.extras)[::-1])
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 2108, in requires
    dm = self._dep_map
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 2100, in _dep_map
    for extra,reqs in split_sections(self._get_metadata(name)):
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 2519, in split_sections
    for line in yield_lines(s):
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 1813, in yield_lines
    for ss in strs:
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 2122, in _get_metadata
    for line in self.get_metadata_lines(name):
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 1140, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 1137, in get_metadata
    return self._get(self._fn(self.egg_info,name))
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 1197, in _get
    return self.loader.get_data(path)
zipimport.ZipImportError: bad local file header in /usr/local/lib/python2.6/dist-packages/TicketModifiedFiles-1.00-py2.6.egg

comment:8 Changed 5 years ago by rjollos

  • Status changed from new to assigned

comment:9 Changed 5 years ago by anonymous

  • Summary changed from "Back to ticket #X" should be located in contextual navigation to [Patch] "Back to ticket #X" should be located in contextual navigation

comment:10 Changed 5 years ago by rjollos

  • Owner changed from rjollos to e2jk
  • Status changed from assigned to new

Improved patch is attached: ctxtnav.patch.

Changed 5 years ago by rjollos

Improved patch

comment:11 Changed 5 years ago by rjollos

The first attempt I made at this patch was to modify the template, which was incorrect. The correct way was using the add_ctxtnav function. Tested under Trac 0.11.7stable-r9029.

comment:12 Changed 4 years ago by rjollos

Hello,

Just wanted to inquire as to whether you might be able to apply this simple patch to the trunk.

Thanks,

  • Ryan

comment:13 Changed 4 years ago by e2jk

Hi Ryan,

This is on my TODO list, but I haven't found the time to test it yet. I'll have a look at it soon...

comment:14 Changed 4 years ago by rjollos

If its okay with you, I'd like to just go ahead and apply the patch. Its a simple patch and I have global r/w access, so I could commit it given the go-ahead by you ;)

comment:15 follow-up: Changed 4 years ago by e2jk

Hi rjollos,

As I am no longer working for my previous company Rentalia, I have to ask them permission before (they wanted to add a specific term in the licence). I have thus sent them an email to ask if the patch can be applied, and also (more importantly IMO) if we can release this plugin to the community, and have someone adopt it.

I will let you know, so please don't apply the patch in the meantime.

Just a question, would you potentially be interested in owning this plugin?

comment:16 in reply to: ↑ 15 Changed 4 years ago by rjollos

Replying to e2jk:

I will let you know, so please don't apply the patch in the meantime.

Certainly.

Just a question, would you potentially be interested in owning this plugin?

I'd be happy to take over maintainership.

comment:17 Changed 4 years ago by e2jk

  • Keywords patch added

comment:18 Changed 4 years ago by e2jk

  • Owner changed from e2jk to rjollos

Reassigning as part of maintainership transfer of TicketModifiedFiles to rjollos.

comment:19 Changed 4 years ago by rjollos

  • Priority changed from lowest to high
  • Status changed from new to assigned

comment:20 Changed 4 years ago by rjollos

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [9703]) Moved 'Back to Ticket #X' link to the contextual navigation. Fixes #5486.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from rjollos. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.