Re: [Django] #13749: Link from admin-site to site

30 views
Skip to first unread message

Django

unread,
Jun 10, 2011, 7:04:21 AM6/10/11
to django-...@googlegroups.com
#13749: Link from admin-site to site
---------------------------------------+-------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New feature | Status: reopened
Milestone: | Component: contrib.admin
Version: 1.2 | Severity: Normal
Resolution: | Keywords: admin url
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
---------------------------------------+-------------------------------
Changes (by DHessing):

* needs_better_patch: 1 => 0
* easy: => 0


Comment:

I chose to use 'view site' as the link text, so it looks like the 'view on
site' text that's available on models on the admin site. Do I need to do
anything special about this new translation string? Also I'm not sure what
the {{ root_path }} thing is supposed to do, I just copied/pasted it from
base.html. It looked like some default fallback that's used everywhere.

I also implemented the link to the main page (as per adrian), as it is a
convention on most websites.

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 10, 2011, 8:36:11 AM6/10/11
to django-...@googlegroups.com
#13749: Link from admin-site to site
-------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New | Status: reopened
feature | Component: contrib.admin
Milestone: | Severity: Normal
Version: 1.2 | Keywords: admin url dceu2011
Resolution: | Has patch: 1
Triage Stage: Ready for | Needs tests: 0
checkin | Easy pickings: 0
Needs documentation: 0 |
Patch needs improvement: 0 |
UI/UX: 1 |
-------------------------------------+-------------------------------------
Changes (by Horst Gutmann <zerok@…>):

* keywords: admin url => admin url dceu2011
* stage: Accepted => Ready for checkin


Comment:

The patch looks fine to me. Personally some kind of integration with the
sites-framework would be nice, but it would add a usually unnecessary
dependency and could also be done by people who customize the admin
templates.

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:13>

Django

unread,
Jun 13, 2011, 7:15:09 AM6/13/11
to django-...@googlegroups.com
#13749: Link from admin-site to site
-------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New | Status: reopened
feature | Component: contrib.admin
Milestone: | Severity: Normal
Version: 1.2 | Keywords: admin url dceu2011
Resolution: | Has patch: 1
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
UI/UX: 1 |
-------------------------------------+-------------------------------------
Changes (by julien):

* stage: Ready for checkin => Accepted


Comment:

This is looking good. However, `{% url 'admin:index' %}` should always
return a url, so the conditional test and the use of `root_path` are
redundant. The template code could be simplified to:

{{{
<h1 id="site-name"><a href="{% url 'admin:index' %}">{% trans 'Django
administration' %}</a></h1>
}}}

Note that `root_path` should eventually be made completely redundant by
#15294.

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:14>

Django

unread,
Jun 13, 2011, 7:15:29 AM6/13/11
to django-...@googlegroups.com
#13749: Link from admin-site to site
-------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New | Status: reopened
feature | Component: contrib.admin
Milestone: | Severity: Normal
Version: 1.2 | Keywords: admin url dceu2011
Resolution: | Has patch: 1
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 1 |
UI/UX: 1 |
-------------------------------------+-------------------------------------
Changes (by julien):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:15>

Django

unread,
Jun 13, 2011, 1:37:39 PM6/13/11
to django-...@googlegroups.com
#13749: Link from admin-site to site
-------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New | Status: reopened
feature | Component: contrib.admin
Milestone: | Severity: Normal
Version: 1.2 | Keywords: admin url dceu2011
Resolution: | Has patch: 1
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
UI/UX: 1 |
-------------------------------------+-------------------------------------
Changes (by DHessing):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:16>

Django

unread,
Oct 7, 2013, 1:40:00 PM10/7/13
to django-...@googlegroups.com
#13749: Link from admin-site to site
------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New feature | Status: new

Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: admin url dceu2011 | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 1
------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"259a6ea82cfb8bf242449666e4b643a19e54a423"]:
{{{
#!CommitTicketReference repository=""
revision="259a6ea82cfb8bf242449666e4b643a19e54a423"
Added a link in admin branding block to admin index.

Refs #13749 and #21220.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:18>

Django

unread,
Jun 15, 2014, 4:50:50 AM6/15/14
to django-...@googlegroups.com
#13749: Link from admin-site to site
------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: admin url dceu2011 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
------------------------------------+-------------------------------------

Comment (by nemesisdesign):

So I guess this ticket can be closed, right?

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:19>

Django

unread,
Jun 15, 2014, 6:27:48 AM6/15/14
to django-...@googlegroups.com
#13749: Link from admin-site to site
------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: admin url dceu2011 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
------------------------------------+-------------------------------------

Comment (by nemesisdesign):

pull request opened on github:
https://github.com/django/django/pull/2809/files

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:20>

Django

unread,
Jun 15, 2014, 6:32:10 AM6/15/14
to django-...@googlegroups.com
#13749: Link from admin-site to site
------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: admin url dceu2011 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 1
------------------------------------+-------------------------------------
Changes (by bmispelon):

* needs_better_patch: 0 => 1

* needs_tests: 0 => 1
* needs_docs: 0 => 1


Comment:

Hi!

Patch looks good but it needs documentation (a mention in the release
notes) and some tests.

Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:21>

Django

unread,
Jun 15, 2014, 7:07:55 AM6/15/14
to django-...@googlegroups.com
#13749: Link from admin-site to site
------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: admin url dceu2011 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
------------------------------------+-------------------------------------
Changes (by nemesisdesign):

* needs_docs: 1 => 0
* easy: 0 => 1
* needs_tests: 1 => 0


* needs_better_patch: 1 => 0


Comment:

Hi Baptiste,
I added a line in the release notes (1.8) and added one test for the "View
site" string.

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:22>

Django

unread,
Jun 15, 2014, 1:33:08 PM6/15/14
to django-...@googlegroups.com
#13749: Link from admin-site to site
------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New feature | Status: new
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: admin url dceu2011 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
------------------------------------+-------------------------------------
Changes (by nemesisdesign):

* version: 1.2 => master


--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:23>

Django

unread,
Jul 26, 2014, 8:49:41 AM7/26/14
to django-...@googlegroups.com
#13749: Link from admin-site to site
-------------------------------------+-------------------------------------

Reporter: romankrv | Owner: joelklabo
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin url dceu2011 | Triage Stage: Ready for
Has patch: 1 | checkin

Needs tests: 0 | Needs documentation: 0
Easy pickings: 1 | Patch needs improvement: 0
| UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by johmik):

* stage: Accepted => Ready for checkin


Comment:

Ran tests with {{{ PYTHONPATH=.. python runtests.py --settings=test_sqlite
admin_views }}} Looks ok

What about the translations for this new field? Do the translators get
informed about it automatically (is there a 'list' functionality for
untranslated fields?), or should I write a new ticket for this?

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:24>

Django

unread,
Jul 26, 2014, 12:11:23 PM7/26/14
to django-...@googlegroups.com
#13749: Link from admin-site to site
-------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin url dceu2011 | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 1 | Patch needs improvement: 0
| UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by claudep):

No need for a ticket, if the string is marked for translation (with
`trans`), the traditional translation workflow will take care of it.

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:25>

Django

unread,
Jul 27, 2014, 8:51:26 AM7/27/14
to django-...@googlegroups.com
#13749: Link from admin-site to site
------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin url dceu2011 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
------------------------------------+-------------------------------------
Changes (by bmispelon):

* needs_better_patch: 0 => 1

* easy: 1 => 0


* stage: Ready for checkin => Accepted


Comment:

Hi,

I've had a chance to discuss this with a few people at EuroPython and we
came to the conclusion that another approach is needed.

Create a new attribute on `Adminsite` (maybe call it `site_url`, similar
to `site_header`, `site_title`, etc) which would default to '/' and use
this in the template.

Users could customize this link to be what matches their setup (but the
default should be good enough for the general case) and even disable it if
they want (the template should check if this attribute is set and not show
any link if that's not the case).

I'll remove the `easy pickings` flag because it might be a bit more
complicated to implement it this way.

Thanks

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:26>

Django

unread,
Jul 27, 2014, 6:42:27 PM7/27/14
to django-...@googlegroups.com
#13749: Link from admin-site to site
------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin url dceu2011 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
------------------------------------+-------------------------------------

Comment (by russellm):

It shouldn't be *that* complicated - it should just be an attribute on
AdminSite that returns reverse('%s:index" % self.name). The ability to
have multiple installations of admin was one of the design requirements
for namespaced URLs when we added them.

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:27>

Django

unread,
Aug 22, 2014, 10:34:44 AM8/22/14
to django-...@googlegroups.com
#13749: Link from admin-site to site
------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New feature | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin url dceu2011 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
------------------------------------+-------------------------------------
Changes (by areski):

* cc: areski (added)


Comment:

Here a PR that follow bmispelon suggestions:
https://github.com/django/django/pull/3103
Comments will be welcome!

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:28>

Django

unread,
Aug 27, 2014, 8:35:16 AM8/27/14
to django-...@googlegroups.com
#13749: Link from admin-site to site
------------------------------------+-------------------------------------
Reporter: romankrv | Owner: joelklabo
Type: New feature | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed

Keywords: admin url dceu2011 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"a81af7f49de7ff3f51f111de28ed3a682f67ea89"]:
{{{
#!CommitTicketReference repository=""
revision="a81af7f49de7ff3f51f111de28ed3a682f67ea89"
Fixed #13749 -- Added link from admin site to front-end site.

Thanks romankrv for the suggestion.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/13749#comment:29>

Reply all
Reply to author
Forward
0 new messages