#3555 Project list macro should link directly to first tool

unreleased
open
nobody
seo (6)
General
nobody
2014-12-26
2012-01-06
No

Rather than linking to the project which issues a 302 redirect, link directly to the first tool. Also handle redirecting tools (like Downloads, Summary, External Link) and use the final URL directly.

Related

Tickets: #3555

Discussion

  • Dave Brondsema

    Dave Brondsema - 2012-03-14
    • Description has changed:

    Diff:

    --- old 
    +++ new 
    @@ -1,1 +1,1 @@
    -Rather than linking to the project which issues a 302 redirect, link directly to the first tool.  If possible, handle redirecting tools (like Downloads, Summary, External Link) and use the final URL directly.
    +Rather than linking to the project which issues a 302 redirect, link directly to the first tool.  Also handle redirecting tools (like Downloads, Summary, External Link) and use the final URL directly.
    
     
  • Dave Brondsema

    Dave Brondsema - 2012-03-20
    • labels: seo --> seo, 42cc
     
  • Yaroslav Luzin

    Yaroslav Luzin - 2012-04-17

    created #37: [#3555] Project list macro should link directly to first tool (1cp)

     

    Related

    Tickets: #3555

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-04-19

    Originally by: tramadolmen

    I have added direct link to first tool for project header

    Also handle redirecting tools (like Downloads, Summary, External Link) and use the final URL directly.

    Where placed those links i can't find. Can you give me examples of this links or files where they can be found?

     
  • Dave Brondsema

    Dave Brondsema - 2012-04-19

    If you install the Downloads tool or the External Link tool into a project, those just redirect to a different URL. The Summary tool does the same thing but is in our non-OSS repo. I can make corresponding changes to that tool, if any are needed.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-04-19

    Originally by: tramadolmen

    Did you mean i must move this from ForgeDownloads/forgedownloads/dl_main.py:RootController.index:

    @expose()
    @with_trailing_slash
    def index(self, **kw):
        url='/projects/' + c.project.get_tool_data('sfx', 'unix_group_name') + '/files/'
        permanent_redirect(url)
    

    to [[projects]] macro. Where placed direct link:
    '/projects/' + c.project.get_tool_data('sfx', 'unix_group_name') + '/files/'

    ?

     
  • Dave Brondsema

    Dave Brondsema - 2012-04-19

    No, we need a generalized solution that will work without customizing the macro to have tool-specific logic. One possible way to do that would be to have the macro call the app.root.index() and catch HTTP redirect exception (either permanent or temporary). If that exception was caught, then you know it's going to do a redirect and you can have the macro link use the exception object's url. You'd want to try putting each type of tool as the first tool, to make sure that it works okay for other tools still.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-04-20

    Originally by: tramadolmen

    It seems only you can help to solve this problem. If i right understand your idea: in macro template must be some function which take url like an argument and call controller to check if it raised HTTPRedirect exception. I have added this function to macro widget class, but can't find example where explained how to call application root controller. Can you show me this code?

     
  • Dave Brondsema

    Dave Brondsema - 2012-04-20

    Okay. I'm not sure offhand how to implement my idea, but we can put this ticket on hold and when I have time, I can work on it and share what I come up with.

     
  • Dave Brondsema

    Dave Brondsema - 2012-05-09
    • labels: seo, 42cc --> seo
     

Log in to post a comment.