|
64 | 64 | </div> |
65 | 65 | <tal:condition tal:condition="row/can_edit"> |
66 | 66 | <div class="edit-options features-list d-flex gap-2 align-items-start mb-3" |
67 | | - tal:define="features_list row/featured_list" tal:condition="features_list"> |
68 | | - <tal:featured repeat="featured_brain features_list"> |
69 | | - <div tal:define="featured_obj featured_brain/getObject;"> |
70 | | - <div class="btn-group" data-elementid="${featured_obj/id}" data-parenturl="${row/absolute_url}" |
71 | | - data-elementurl="${featured_obj/absolute_url}" data-delete-target="true" data-move-target="true"> |
72 | | - <a tal:attributes="class python:featured_obj.review_state() == 'published' and |
| 67 | + tal:define="features_list row/featured_list"> |
| 68 | + <tal:conditionfeatures tal:condition="features_list"> |
| 69 | + <tal:featured repeat="featured_brain features_list"> |
| 70 | + <div tal:define="featured_obj featured_brain/getObject;"> |
| 71 | + <div class="btn-group" data-elementid="${featured_obj/id}" data-parenturl="${row/absolute_url}" |
| 72 | + data-elementurl="${featured_obj/absolute_url}" data-delete-target="true" |
| 73 | + data-move-target="true"> |
| 74 | + <a tal:attributes="class python:featured_obj.review_state() == 'published' and |
73 | 75 | 'position-relative btn btn-outline-success btn-sm bg-success-subtle dropdown-toggle' or |
74 | 76 | 'position-relative btn btn-outline-danger btn-sm bg-danger-subtle dropdown-toggle'" |
75 | | - type="button" class="btn btn-secondary dropdown-toggle" data-bs-toggle="dropdown" |
76 | | - data-bs-display="static" aria-expanded="false"> |
77 | | - ${featured_obj/Title} |
78 | | - <span |
79 | | - tal:attributes="class python:featured_obj.review_state() == 'published' and 'text-white position-absolute top-0 start-100 translate-middle p-1 bg-success border border-light rounded-circle' or 'text-white position-absolute top-0 start-100 translate-middle p-1 bg-danger border border-light rounded-circle'"> |
80 | | - </span> |
81 | | - </a> |
82 | | - <ul class="dropdown-menu"> |
83 | | - <li><a class="dropdown-item" href="${featured_obj/absolute_url}/edit">Edit</a> |
84 | | - </li> |
85 | | - <li> |
86 | | - <h5 class="dropdown-header">State</h5> |
87 | | - </li> |
88 | | - <tal:define |
89 | | - tal:define="featured_transitions python:context.portal_workflow.getTransitionsFor(featured_obj)"> |
90 | | - <tal:featured_transitions repeat="featured_transition featured_transitions"> |
91 | | - <li><a class="dropdown-item" |
92 | | - href="${featured_transition/url}&_authenticator=${context/@@authenticator/token}">${featured_transition/name}</a> |
93 | | - </li> |
94 | | - </tal:featured_transitions> |
95 | | - </tal:define> |
96 | | - <li> |
97 | | - <h5 class="dropdown-header">Move actions</h5> |
98 | | - </li> |
99 | | - <li><a class="dropdown-item" href="#" data-action="move-up" |
100 | | - tal:condition="python:not(repeat['featured_brain'].start)">Move up</a></li> |
101 | | - <li><a class="dropdown-item" href="#" data-action="move-down" |
102 | | - tal:condition="python:not(repeat['featured_brain'].end)">Move down</a></li> |
103 | | - <li> |
104 | | - <hr class="dropdown-divider"> |
105 | | - </li> |
106 | | - <li><a class="ms-3 btn btn-sm btn-danger align-self-start btn-delete-element" href="#" |
107 | | - data-bs-toggle="modal" data-bs-target="#deleteElementModal">Delete</a></li> |
108 | | - </ul> |
| 77 | + type="button" class="btn btn-secondary dropdown-toggle" data-bs-toggle="dropdown" |
| 78 | + data-bs-display="static" aria-expanded="false"> |
| 79 | + ${featured_obj/Title} |
| 80 | + <span |
| 81 | + tal:attributes="class python:featured_obj.review_state() == 'published' and 'text-white position-absolute top-0 start-100 translate-middle p-1 bg-success border border-light rounded-circle' or 'text-white position-absolute top-0 start-100 translate-middle p-1 bg-danger border border-light rounded-circle'"> |
| 82 | + </span> |
| 83 | + </a> |
| 84 | + <ul class="dropdown-menu"> |
| 85 | + <li><a class="dropdown-item" href="${featured_obj/absolute_url}/edit">Edit</a> |
| 86 | + </li> |
| 87 | + <li> |
| 88 | + <h5 class="dropdown-header">State</h5> |
| 89 | + </li> |
| 90 | + <tal:define |
| 91 | + tal:define="featured_transitions python:context.portal_workflow.getTransitionsFor(featured_obj)"> |
| 92 | + <tal:featured_transitions repeat="featured_transition featured_transitions"> |
| 93 | + <li><a class="dropdown-item" |
| 94 | + href="${featured_transition/url}&_authenticator=${context/@@authenticator/token}">${featured_transition/name}</a> |
| 95 | + </li> |
| 96 | + </tal:featured_transitions> |
| 97 | + </tal:define> |
| 98 | + <li> |
| 99 | + <h5 class="dropdown-header">Move actions</h5> |
| 100 | + </li> |
| 101 | + <li><a class="dropdown-item" href="#" data-action="move-up" |
| 102 | + tal:condition="python:not(repeat['featured_brain'].start)">Move up</a></li> |
| 103 | + <li><a class="dropdown-item" href="#" data-action="move-down" |
| 104 | + tal:condition="python:not(repeat['featured_brain'].end)">Move down</a></li> |
| 105 | + <li> |
| 106 | + <hr class="dropdown-divider"> |
| 107 | + </li> |
| 108 | + <li><a class="ms-3 btn btn-sm btn-danger align-self-start btn-delete-element" href="#" |
| 109 | + data-bs-toggle="modal" data-bs-target="#deleteElementModal">Delete</a></li> |
| 110 | + </ul> |
| 111 | + </div> |
109 | 112 | </div> |
110 | | - </div> |
111 | | - </tal:featured> |
112 | | - <tal:featured_add_button tal:condition="python:row.show_featured_add_button(request)"> |
| 113 | + </tal:featured> |
| 114 | + </tal:conditionfeatures> |
| 115 | + |
| 116 | + <tal:featured_add_button tal:condition="row/show_featured_add_button"> |
113 | 117 | <a class="btn btn-outline-primary btn-sm align-self-start" |
114 | 118 | href="${row/absolute_url}/++add++DynamicPageRowFeatured">Add new featured</a> |
115 | 119 | </tal:featured_add_button> |
|
0 commit comments