From 45f3d34e32f3e0694c53c9eafc18f663cb26c02c Mon Sep 17 00:00:00 2001 From: Diana Whitten Date: Fri, 5 Feb 2016 13:02:39 -0700 Subject: [PATCH] Container Loader Image now Themable The Container was still using the old loading.gif, which is a static file that cannot be made themable. Now, just like the pending table actions, it uses the bootstrap progress bar, thus making it theme compliant, and now we can completely remove that gif from the code base. Change-Id: I382078e9f07084ef723c8d3dbdc8114e1467d46c Partially-Implements: blueprint horizon-theme-css-reorg Partially-Implements: blueprint bootstrap-html-standards --- .../dashboards/project/containers/tables.py | 8 +++----- .../templates/containers/_container_loader.html | 5 +++++ .../static/dashboard/img/loading.gif | Bin 1907 -> 0 bytes .../static/dashboard/scss/_legacy.scss | 6 ------ .../dashboard/scss/components/_pending_bar.scss | 4 ++++ 5 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 openstack_dashboard/dashboards/project/containers/templates/containers/_container_loader.html delete mode 100644 openstack_dashboard/static/dashboard/img/loading.gif diff --git a/openstack_dashboard/dashboards/project/containers/tables.py b/openstack_dashboard/dashboards/project/containers/tables.py index fef97c5842..b283a72d8b 100644 --- a/openstack_dashboard/dashboards/project/containers/tables.py +++ b/openstack_dashboard/dashboards/project/containers/tables.py @@ -13,13 +13,11 @@ # under the License. import logging -from django.conf import settings from django.core.urlresolvers import reverse from django import shortcuts from django import template from django.template import defaultfilters as filters from django.utils import http -from django.utils import safestring from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy @@ -32,8 +30,6 @@ from openstack_dashboard.api import swift from openstack_dashboard.dashboards.project.containers import utils LOG = logging.getLogger(__name__) -static_url = getattr(settings, 'STATIC_URL', '/static/') -LOADING_IMAGE = '' % static_url class ViewContainer(tables.LinkAction): @@ -240,7 +236,9 @@ class ContainerAjaxUpdateRow(tables.Row): def get_metadata(container): # If the metadata has not been loading, display a loading image if not hasattr(container, 'is_public'): - return safestring.mark_safe(LOADING_IMAGE) + return template.loader.render_to_string( + 'project/containers/_container_loader.html' + ) template_name = 'project/containers/_container_metadata.html' context = {"container": container} return template.loader.render_to_string(template_name, context) diff --git a/openstack_dashboard/dashboards/project/containers/templates/containers/_container_loader.html b/openstack_dashboard/dashboards/project/containers/templates/containers/_container_loader.html new file mode 100644 index 0000000000..1f42aaf4ca --- /dev/null +++ b/openstack_dashboard/dashboards/project/containers/templates/containers/_container_loader.html @@ -0,0 +1,5 @@ +
+
+
+
+
diff --git a/openstack_dashboard/static/dashboard/img/loading.gif b/openstack_dashboard/static/dashboard/img/loading.gif deleted file mode 100644 index d8f18c2b1b1e3fa9ef2e342feeca375b20781e66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1907 zcmb`{c~Fz-9S87)yaD1X7!Q{bq*DkWMPa!&OC?;n z6LOJ+Gw=p-ha@CKFaaY$Bp7v7W{0x4x^f@dDMKCV(01Bw=!_jZvw!ya=b3r__&uNJ zJKuRy(vpuIC&wTH5PuCqY;SMR%*;3(j@jASot>S@$;k%~9!yM3%+1Zce*Jo5W8?Yr z=Qf+|@#Dv1V`EmUb#rsGzrVk`yZgoppU)9IX^o>r^X zMx$|MWu>>bcVJ+^Y&NS@Dj0^9N~OtUQYaLN|I;G=2%b&)&4tsaGLjPCPe38PW4%Y2 zzs`s{L#`%!chn~}60052n5fQh0>+Z`DzA%Yfo*IW2d1#ecoRje0qUx&LU%Yqz zFo(8rT|RrQdhwr$lOZWz8H;Wi0_fDu@@F4xS(9Xq+t5WMjgI`PzM<|@RC6H_5v(7IJ>esaD2S;@Dx^tqwR+h7OjOJ4& zykP;SfJZuUG_lKr77u<`k@IvWbuoJ>`P42MjrMB2WTcn8*GpEBxbBL>;i49{WU!!= zmlC6SdM4At@j<1p_*%b+{~F~}7re2(dbQ~2bN&r{Jm=tLuj0P8q$T1*xYt^;vcLgUP*C30*d%(e5?3 z+Z`i%pEWWt7G#|C}lWL_`of;P|VtUmD zrGcq2ZcN1c*twF#%Rdyjo?S4I59fH(cAqP~_2k<2M^`a`lY8<^0}!)yoto?)jze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stack_dashboard/static/dashboard/scss/_legacy.scss index 6173fc388b..18b3166a51 100644 --- a/openstack_dashboard/static/dashboard/scss/_legacy.scss +++ b/openstack_dashboard/static/dashboard/scss/_legacy.scss @@ -142,9 +142,3 @@ .dropdown_fix { overflow: visible; } - -/* Does something with CPU hungry spin.js with animated gif */ -.loading_gif { - margin-right: 0.5em; - float: left; -} diff --git a/openstack_dashboard/static/dashboard/scss/components/_pending_bar.scss b/openstack_dashboard/static/dashboard/scss/components/_pending_bar.scss index 97fd8f68e8..d1fc795fa3 100644 --- a/openstack_dashboard/static/dashboard/scss/components/_pending_bar.scss +++ b/openstack_dashboard/static/dashboard/scss/components/_pending_bar.scss @@ -11,4 +11,8 @@ left: calc(50% - .5em); bottom: calc(50% - .5em); } + + &.container-pending-bar .progress { + margin-bottom: 0; + } }