Permalink
Browse files

Don't display Add link at all when nothing is addable.

We might want to bring the 'disabled' style back in the future.
  • Loading branch information...
1 parent 4c6ec98 commit f73de231dea2f96fdb299e5c9e149dbf91f92b46 @dnouri dnouri committed Mar 5, 2012
Showing with 7 additions and 13 deletions.
  1. +0 −4 kotti/static/base.css
  2. +0 −3 kotti/templates/add-dropdown.pt
  3. +7 −6 kotti/tests/browser.txt
View
@@ -13,7 +13,3 @@ body.logged-in {
padding-top: 0;
}
}
-
-.navbar .nav > li.disabled > a:hover {
- color: #999;
-}
@@ -1,8 +1,5 @@
<ul class="nav"
i18n:domain="Kotti">
- <li class="disabled" tal:condition="not:factories">
- <a><span i18n:translate="">Add</span></a>
- </li>
<li class="dropdown" tal:condition="factories">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span i18n:translate="">Add</span>
View
@@ -152,20 +152,21 @@ Add another grandchild with the same name:
>>> browser.url == testing.BASE_URL + '/second-child/grandchild-1/'
True
-If it's not possible to add something, the add menu is disabled:
+There's no Add link if nothing can be added:
- >>> browser.open(testing.BASE_URL + '/second-child/grandchild-1')
- >>> 'class="disabled"' in browser.contents
- False
+ >>> browser.open(testing.BASE_URL + '/second-child/grandchild-1/')
+ >>> browser.getLink("Add").text
+ 'Add'
>>> try:
... Document.type_info.addable_to = ()
... File.type_info.addable_to = ()
... browser.reload()
- ... 'class="disabled"' in browser.contents
+ ... browser.getLink("Add")
... finally:
... Document.type_info.addable_to = save_addable_document
... File.type_info.addable_to = save_addable_file
- True
+ Traceback (most recent call last):
+ LinkNotFoundError
Reorder documents
-----------------

0 comments on commit f73de23

Please sign in to comment.