Browse Source

HUE-6337 [dashboard] Broken page when there is no collection available

Romain Rigaux 8 năm trước cách đây
mục cha
commit
359b32a

+ 5 - 3
desktop/libs/dashboard/src/dashboard/templates/no_collections.mako

@@ -15,14 +15,15 @@
 ## limitations under the License.
 
 <%!
-from desktop.views import commonheader, commonfooter
 from django.utils.translation import ugettext as _
+from desktop.views import commonheader, commonfooter
 %>
 
 <%namespace name="macros" file="macros.mako" />
 
+% if not is_embeddable:
 ${ commonheader(_('Dashboard'), "dashboard", user, request, "120px") | n,unicode }
-
+% endif
 
 <style type="text/css">
   .waiting {
@@ -53,5 +54,6 @@ ${ commonheader(_('Dashboard'), "dashboard", user, request, "120px") | n,unicode
   </div>
 </div>
 
-
+% if not is_embeddable:
 ${ commonfooter(request, messages) | n,unicode }
+% endif

+ 1 - 1
desktop/libs/dashboard/src/dashboard/views.py

@@ -208,7 +208,7 @@ def save(request):
 
 
 def no_collections(request):
-  return render('no_collections.mako', request, {})
+  return render('no_collections.mako', request, {'is_embeddable': request.GET.get('is_embeddable', False)})
 
 
 def admin_collections(request, is_redirect=False, is_mobile=False):