From 797e4d69ffc776087458b1d980a25440f84caff6 Mon Sep 17 00:00:00 2001 From: dtrishkin Date: Mon, 2 Nov 2015 20:02:31 +0300 Subject: [PATCH] Move horizon to 8.0 branch Change-Id: I3916485fd99e466de3a1fbf91449b1b09236c560 --- .../openstack-dashboard-httpd-2.4.conf | 2 +- .../openstack-dashboard-httpd-logging.conf | 0 .../python-django-horizon-logrotate.conf | 8 + .../python-django-horizon-systemd.conf | 3 + centos7/rpm/SOURCES/sources | 0 .../rpm}/SPECS/python-django-horizon.spec | 441 +- ...t-access-the-net-while-building-docs.patch | 22 - .../0002-disable-debug-move-web-root.patch | 61 - ...location-to-tmp-and-also-add-localho.patch | 32 - ...a-customization-module-based-on-RHOS.patch | 260 - ...sphinx-and-remove-local-copy-of-doc-.patch | 1348 -- ...-files-and-checks-to-etc-openstack-d.patch | 25 - ...-files-and-checks-to-etc-openstack-d.patch | 32 - ...e-SECRET_KEY-secret_key_store-to-tmp.patch | 29 - .../0007-RCUE-navbar-and-login-screen.patch | 19323 ---------------- ...e-SECRET_KEY-secret_key_store-to-tmp.patch | 29 - rpm/SOURCES/0008-fix-flake8-issues.patch | 31 - ...008-fix-up-issues-with-customization.patch | 81 - ...runcate-the-logo-related-rhbz-877138.patch | 26 - ...009-remove-runtime-dep-to-python-pbr.patch | 33 - ...ange-password-link-to-the-RCUE-theme.patch | 26 - ...STORE-to-var-lib-openstack-dashboard.patch | 22 - rpm/SOURCES/0011-.less-replaced-in-rcue.patch | 26 - rpm/SOURCES/0012-python26-syntax-fix.patch | 43 - rpm/SOURCES/mos-disable-metering.patch | 13 - .../mos-fix-murano-savana-dashboard.patch | 22 - rpm/SOURCES/openstack-dashboard.conf | 11 - rpm/SOURCES/rh-logo.png | Bin 60337 -> 0 bytes rpm/SOURCES/rhfavicon.ico | Bin 446 -> 0 bytes tests/runtests.sh | 25 +- 30 files changed, 263 insertions(+), 21711 deletions(-) rename {rpm => centos7/rpm}/SOURCES/openstack-dashboard-httpd-2.4.conf (87%) rename {rpm => centos7/rpm}/SOURCES/openstack-dashboard-httpd-logging.conf (100%) create mode 100644 centos7/rpm/SOURCES/python-django-horizon-logrotate.conf create mode 100644 centos7/rpm/SOURCES/python-django-horizon-systemd.conf create mode 100644 centos7/rpm/SOURCES/sources rename {rpm => centos7/rpm}/SPECS/python-django-horizon.spec (63%) delete mode 100644 rpm/SOURCES/0001-Don-t-access-the-net-while-building-docs.patch delete mode 100644 rpm/SOURCES/0002-disable-debug-move-web-root.patch delete mode 100644 rpm/SOURCES/0003-change-lockfile-location-to-tmp-and-also-add-localho.patch delete mode 100644 rpm/SOURCES/0004-Add-a-customization-module-based-on-RHOS.patch delete mode 100644 rpm/SOURCES/0005-Revert-Use-oslo.sphinx-and-remove-local-copy-of-doc-.patch delete mode 100644 rpm/SOURCES/0005-move-RBAC-policy-files-and-checks-to-etc-openstack-d.patch delete mode 100644 rpm/SOURCES/0006-move-RBAC-policy-files-and-checks-to-etc-openstack-d.patch delete mode 100644 rpm/SOURCES/0006-move-SECRET_KEY-secret_key_store-to-tmp.patch delete mode 100644 rpm/SOURCES/0007-RCUE-navbar-and-login-screen.patch delete mode 100644 rpm/SOURCES/0007-move-SECRET_KEY-secret_key_store-to-tmp.patch delete mode 100644 rpm/SOURCES/0008-fix-flake8-issues.patch delete mode 100644 rpm/SOURCES/0008-fix-up-issues-with-customization.patch delete mode 100644 rpm/SOURCES/0009-do-not-truncate-the-logo-related-rhbz-877138.patch delete mode 100644 rpm/SOURCES/0009-remove-runtime-dep-to-python-pbr.patch delete mode 100644 rpm/SOURCES/0010-Add-Change-password-link-to-the-RCUE-theme.patch delete mode 100644 rpm/SOURCES/0010-move-SECRET_KEYSTORE-to-var-lib-openstack-dashboard.patch delete mode 100644 rpm/SOURCES/0011-.less-replaced-in-rcue.patch delete mode 100644 rpm/SOURCES/0012-python26-syntax-fix.patch delete mode 100644 rpm/SOURCES/mos-disable-metering.patch delete mode 100644 rpm/SOURCES/mos-fix-murano-savana-dashboard.patch delete mode 100644 rpm/SOURCES/openstack-dashboard.conf delete mode 100644 rpm/SOURCES/rh-logo.png delete mode 100644 rpm/SOURCES/rhfavicon.ico diff --git a/rpm/SOURCES/openstack-dashboard-httpd-2.4.conf b/centos7/rpm/SOURCES/openstack-dashboard-httpd-2.4.conf similarity index 87% rename from rpm/SOURCES/openstack-dashboard-httpd-2.4.conf rename to centos7/rpm/SOURCES/openstack-dashboard-httpd-2.4.conf index 63d1b17..820008c 100644 --- a/rpm/SOURCES/openstack-dashboard-httpd-2.4.conf +++ b/centos7/rpm/SOURCES/openstack-dashboard-httpd-2.4.conf @@ -3,7 +3,7 @@ WSGIProcessGroup dashboard WSGISocketPrefix run/wsgi WSGIScriptAlias /dashboard /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi -Alias /static /usr/share/openstack-dashboard/static +Alias /dashboard/static /usr/share/openstack-dashboard/static Options All diff --git a/rpm/SOURCES/openstack-dashboard-httpd-logging.conf b/centos7/rpm/SOURCES/openstack-dashboard-httpd-logging.conf similarity index 100% rename from rpm/SOURCES/openstack-dashboard-httpd-logging.conf rename to centos7/rpm/SOURCES/openstack-dashboard-httpd-logging.conf diff --git a/centos7/rpm/SOURCES/python-django-horizon-logrotate.conf b/centos7/rpm/SOURCES/python-django-horizon-logrotate.conf new file mode 100644 index 0000000..08725fa --- /dev/null +++ b/centos7/rpm/SOURCES/python-django-horizon-logrotate.conf @@ -0,0 +1,8 @@ +/var/log/horizon/*.log { + weekly + rotate 4 + missingok + compress + minsize 100k +} + diff --git a/centos7/rpm/SOURCES/python-django-horizon-systemd.conf b/centos7/rpm/SOURCES/python-django-horizon-systemd.conf new file mode 100644 index 0000000..8aa1d4c --- /dev/null +++ b/centos7/rpm/SOURCES/python-django-horizon-systemd.conf @@ -0,0 +1,3 @@ +[Service] +ExecStartPre=/usr/bin/python /usr/share/openstack-dashboard/manage.py collectstatic --noinput --clear +ExecStartPre=/usr/bin/python /usr/share/openstack-dashboard/manage.py compress --force diff --git a/centos7/rpm/SOURCES/sources b/centos7/rpm/SOURCES/sources new file mode 100644 index 0000000..e69de29 diff --git a/rpm/SPECS/python-django-horizon.spec b/centos7/rpm/SPECS/python-django-horizon.spec similarity index 63% rename from rpm/SPECS/python-django-horizon.spec rename to centos7/rpm/SPECS/python-django-horizon.spec index 3e1ea2c..06b2f4a 100644 --- a/rpm/SPECS/python-django-horizon.spec +++ b/centos7/rpm/SPECS/python-django-horizon.spec @@ -1,36 +1,27 @@ -%global with_compression 1 +%{!?upstream_version: %global upstream_version %{version}%{?milestone}} Name: python-django-horizon -Version: 2014.2.b3 -Release: 1%{?dist} +# Liberty semver reset +# https://review.openstack.org/#/q/I6a35fa0dda798fad93b804d00a46af80f08d475c,n,z +Epoch: 1 +Version: 8.0.0.0rc1 +Release: 1%{?dist}~mos8.0.3 Summary: Django application for talking to Openstack Group: Development/Libraries # Code in horizon/horizon/utils taken from django which is BSD License: ASL 2.0 and BSD URL: http://horizon.openstack.org/ -Source0: https://launchpad.net/horizon/juno/juno-2/+download/horizon-%{version}.b2.tar.gz -Source1: openstack-dashboard.conf +Source0: http://tarballs.openstack.org/horizon/horizon-master.tar.gz Source2: openstack-dashboard-httpd-2.4.conf +Source3: python-django-horizon-systemd.conf # demo config for separate logging Source4: openstack-dashboard-httpd-logging.conf -# -# patches_base=2014.2.b2 -# -#Patch0001: 0001-Don-t-access-the-net-while-building-docs.patch -#Patch0002: 0002-disable-debug-move-web-root.patch -#Patch0003: 0003-change-lockfile-location-to-tmp-and-also-add-localho.patch -#Patch0004: 0004-Add-a-customization-module-based-on-RHOS.patch -#Patch0005: 0005-move-RBAC-policy-files-and-checks-to-etc-openstack-d.patch -#Patch0006: 0006-move-SECRET_KEY-secret_key_store-to-tmp.patch -#Patch0007: 0007-RCUE-navbar-and-login-screen.patch -#Patch0008: 0008-fix-flake8-issues.patch -#Patch0009: 0009-remove-runtime-dep-to-python-pbr.patch -#Patch0010: 0010-Add-Change-password-link-to-the-RCUE-theme.patch -#Patch0011: 0011-.less-replaced-in-rcue.patch -Patch0012: 0012-python26-syntax-fix.patch +# logrotate config +Source5: python-django-horizon-logrotate.conf + # # BuildArch needs to be located below patches in the spec file. Don't ask! @@ -38,59 +29,41 @@ Patch0012: 0012-python26-syntax-fix.patch BuildArch: noarch -BuildRequires: python2-devel -BuildRequires: python-setuptools -BuildRequires: python-sphinx -BuildRequires: python-oslo-sphinx >= 2.2.0 -BuildRequires: python-mock >= 1.0 -BuildRequires: python-mox >= 0.5.3 - +BuildRequires: python-django +Requires: python-django >= 1.7 -BuildRequires: python-pbr >= 0.6, python-pbr < 1.0 -BuildRequires: python-django >= 1.4.2, python-django < 1.7 -BuildRequires: python-Pint >= 0.5 -BuildRequires: python-django-compressor >= 1.4 -BuildRequires: python-django-openstack-auth >= 1.1.7 -BuildRequires: python-django-pyscss >= 1.0.3 -BuildRequires: python-lockfile >= 0.8 - -BuildRequires: python-oslo-concurrency >= 1.4.1 - -BuildRequires: python-XStatic >= 1.0.0 -BuildRequires: python-XStatic-Angular >= 1.3.7 -BuildRequires: python-XStatic-Angular-Bootstrap >= 0.11.0.2 -BuildRequires: python-XStatic-Bootstrap-Datepicker >= 1.3.1.0 -BuildRequires: python-XStatic-Bootstrap-SCSS >= 3 -BuildRequires: python-XStatic-D3 >= 3.1.6.2 -BuildRequires: python-XStatic-Hogan >= 2.0.0.2 -BuildRequires: python-XStatic-Font-Awesome >= 4.2.0 -BuildRequires: python-XStatic-Jasmine >= 1.3.1.1 -BuildRequires: python-XStatic-jQuery >= 1.7.2 -BuildRequires: python-XStatic-JQuery-Migrate >= 1.2.1.1 -BuildRequires: python-XStatic-JQuery.quicksearch >= 2.0.3.1 -BuildRequires: python-XStatic-JQuery.TableSorter >= 2.0.5b.0 -BuildRequires: python-XStatic-jquery-ui >= 1.10.1 -BuildRequires: python-XStatic-JSEncrypt >= 2.0.0.2 -BuildRequires: python-XStatic-QUnit >= 1.14.0.2 -BuildRequires: python-XStatic-Rickshaw >= 1.5.0 -BuildRequires: python-XStatic-smart-table >= 1.4.5.3 -BuildRequires: python-XStatic-Spin >= 1.2.5.2 - -BuildRequires: python-ceilometerclient >= 1.0.6 -BuildRequires: python-cinderclient >= 1.1.0 -BuildRequires: python-glanceclient >= 0.15.0 -BuildRequires: python-heatclient >= 0.2.9 -BuildRequires: python-keystoneclient >= 0.11.1 -BuildRequires: python-neutronclient >= 2.3.6, python-neutronclient < 3.0 -BuildRequires: python-novaclient >= 2.18.0 -BuildRequires: python-saharaclient >= 0.7.6 -BuildRequires: python-swiftclient >= 2.2.0 -BuildRequires: python-troveclient >= 1.0.7 +Requires: pytz >= 2013.6 +Requires: python-lockfile +Requires: python-six >= 1.9.0 +Requires: python-pbr >= 1.6 +BuildRequires: python2-devel +BuildRequires: python-setuptools +BuildRequires: python-d2to1 +BuildRequires: python-pbr >= 0.7.0 +BuildRequires: python-lockfile +BuildRequires: python-eventlet +BuildRequires: git +BuildRequires: python-six >= 1.9.0 +BuildRequires: gettext + +# for checks: +%if 0%{?rhel} == 0 +BuildRequires: python-django-nose >= 1.2 +BuildRequires: python-coverage +BuildRequires: python-mox3 +BuildRequires: python-nose-exclude +BuildRequires: python-nose +BuildRequires: python-selenium +%endif +BuildRequires: python-netaddr +BuildRequires: python-kombu +BuildRequires: python-anyjson +BuildRequires: python-iso8601 # additional provides to be consistent with other django packages -Provides: django-horizon = %{version}-%{release} +Provides: django-horizon = %{epoch}:%{version}-%{release} %description Horizon is a Django application for providing Openstack UI components. @@ -106,60 +79,120 @@ Group: Applications/System Requires: httpd Requires: mod_wsgi +Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: python-django-openstack-auth >= 2.0.0 +Requires: python-django-compressor >= 1.5 +Requires: python-django-babel >= 0.3.4 +Requires: python-django-appconf Requires: python-lesscpy -Requires: python-django-horizon >= %{version} -Requires: python-pbr >= 0.6, python-pbr < 1.0 -Requires: python-django >= 1.4.2, python-django < 1.7 -Requires: python-babel >= 1.3 -Requires: python-Pint >= 0.5 -Requires: python-django-compressor >= 1.4 -Requires: python-django-openstack-auth >= 1.1.7 -Requires: python-django-pyscss >= 1.0.3 -Requires: python-eventlet >= 0.15.2 -Requires: python-httplib2 >= 0.7.5 +Requires: PyYAML >= 3.1.0 Requires: python-iso8601 >= 0.1.9 -Requires: python-kombu >= 2.5.0 -Requires: python-lockfile >= 0.8 -Requires: python-netaddr >= 0.7.12 -Requires: python-oslo-concurrency >= 1.4.1 -Requires: python-oslo-config >= 1.6 -Requires: python-oslo.i18n >= 1.0.0 -Requires: python-oslo-serialization >= 1.2.0 -Requires: python-oslo.utils >= 1.2.0 -Requires: python-pyscss >= 1.2.1, python-pyscss < 1.3 -Requires: python-ceilometerclient >= 1.0.6 -Requires: python-cinderclient >= 1.1.0 -Requires: python-glanceclient >= 0.15.0 -Requires: python-heatclient >= 0.2.9 -Requires: python-keystoneclient >= 0.11.1 -Requires: python-neutronclient >= 2.3.6, python-neutronclient < 3.0 -Requires: python-novaclient >= 2.18.0 -Requires: python-saharaclient >= 0.7.6 +Requires: python-kombu >= 3.0.7 +Requires: python-httplib2 >= 0.7.5 +Requires: python-glanceclient >= 0.18.0 +Requires: python-keystoneclient >= 1:1.6.0 +Requires: python-novaclient >= 1:2.28.1 +Requires: python-neutronclient >= 2.6.0 +Requires: python-cinderclient >= 1.3.1 Requires: python-swiftclient >= 2.2.0 -Requires: python-troveclient >= 1.0.7 -Requires: pytz -Requires: PyYAML -Requires: python-six >= 1.7.0 +Requires: python-heatclient >= 0.3.0 +Requires: python-ceilometerclient >= 1.5.0 +Requires: python-troveclient >= 1.2.0 +Requires: python-saharaclient >= 0.10.0 +Requires: python-netaddr >= 0.7.12 +Requires: python-oslo-config >= 2:2.3.0 +Requires: python-eventlet >= 0.17.4 +Requires: python-django-pyscss >= 2.0.2 Requires: python-XStatic >= 1.0.0 -Requires: python-XStatic-Angular >= 1.3.7 +Requires: python-XStatic-jQuery >= 1.7.2 +Requires: python-XStatic-Angular >= 1:1.3.7 +Requires: python-XStatic-Angular-Mock Requires: python-XStatic-Angular-Bootstrap >= 0.11.0.2 -Requires: python-XStatic-Bootstrap-Datepicker >= 1.3.1.0 -Requires: python-XStatic-Bootstrap-SCSS >= 3 Requires: python-XStatic-D3 >= 3.1.6.2 +Requires: python-XStatic-Font-Awesome >= 4.3.0 Requires: python-XStatic-Hogan >= 2.0.0.2 -Requires: python-XStatic-Font-Awesome >= 4.2.0 -Requires: python-XStatic-Jasmine >= 1.3.1.1 -Requires: python-XStatic-jQuery >= 1.7.2 Requires: python-XStatic-JQuery-Migrate >= 1.2.1.1 -Requires: python-XStatic-JQuery.quicksearch >= 2.0.3.1 -Requires: python-XStatic-JQuery.TableSorter >= 2.0.5b.0 -Requires: python-XStatic-jquery-ui >= 1.10.1 +Requires: python-XStatic-JQuery-TableSorter +Requires: python-XStatic-JQuery-quicksearch Requires: python-XStatic-JSEncrypt >= 2.0.0.2 +Requires: python-XStatic-Jasmine >= 2.1.2.0 Requires: python-XStatic-QUnit >= 1.14.0.2 Requires: python-XStatic-Rickshaw >= 1.5.0 -Requires: python-XStatic-smart-table >= 1.4.5.3 Requires: python-XStatic-Spin >= 1.2.5.2 +Requires: python-XStatic-jquery-ui >= 1.10.1 +Requires: python-XStatic-Bootstrap-Datepicker >= 1.3.1.0 +Requires: python-XStatic-Bootstrap-SCSS >= 3 +Requires: python-XStatic-termjs >= 0.0.4 +Requires: python-XStatic-smart-table >= 1.4.5.3 +Requires: python-XStatic-Angular-lrdragndrop >= 1.0.2.2 +Requires: python-XStatic-Angular-Gettext >= 2.1.0.2 +Requires: python-XStatic-Magic-Search >= 0.2.5.1 +Requires: python-XStatic-bootswatch >= 3.3.5.3 +Requires: python-XStatic-roboto-fontface >= 0.4.3.2 +Requires: python-XStatic-mdi == 1.1.70.1 + +Requires: python-scss >= 1.3.4 +Requires: fontawesome-fonts-web >= 4.1.0 + +Requires: python-oslo-concurrency >= 2.3.0 +Requires: python-oslo-i18n >= 1.5.0 +Requires: python-oslo-serialization >= 1.4.0 +Requires: python-oslo-utils >= 2.0.0 +Requires: python-oslo-policy >= 0.5.0 +Requires: python-babel >= 1.3 +Requires: python-pint >= 0.5 + +Requires: openssl >= 0.14 +Requires: logrotate + +BuildRequires: python-django-openstack-auth >= 1.1.7 +BuildRequires: python-django-compressor >= 1.5 +BuildRequires: python-django-appconf +BuildRequires: python-lesscpy +BuildRequires: python-oslo-config +BuildRequires: python-django-pyscss >= 2.0.2 +BuildRequires: python-XStatic +BuildRequires: python-XStatic-jQuery +BuildRequires: python-XStatic-Angular >= 1:1.3.7 +BuildRequires: python-XStatic-Angular-Mock +BuildRequires: python-XStatic-Angular-Bootstrap +BuildRequires: python-XStatic-D3 +BuildRequires: python-XStatic-Font-Awesome +BuildRequires: python-XStatic-Hogan +BuildRequires: python-XStatic-JQuery-Migrate +BuildRequires: python-XStatic-JQuery-TableSorter +BuildRequires: python-XStatic-JQuery-quicksearch +BuildRequires: python-XStatic-JSEncrypt +BuildRequires: python-XStatic-Jasmine +BuildRequires: python-XStatic-QUnit +BuildRequires: python-XStatic-Rickshaw +BuildRequires: python-XStatic-Spin +BuildRequires: python-XStatic-jquery-ui +BuildRequires: python-XStatic-Bootstrap-Datepicker +BuildRequires: python-XStatic-Bootstrap-SCSS +BuildRequires: python-XStatic-termjs +BuildRequires: python-XStatic-smart-table +BuildRequires: python-XStatic-Angular-lrdragndrop +BuildRequires: python-XStatic-Magic-Search +BuildRequires: python-XStatic-Angular-Gettext +BuildRequires: python-XStatic-bootswatch +BuildRequires: python-XStatic-roboto-fontface +BuildRequires: python-XStatic-mdi +# bootstrap-scss requires at least python-scss >= 1.2.1 +BuildRequires: python-scss >= 1.3.4 +BuildRequires: fontawesome-fonts-web >= 4.1.0 +BuildRequires: python-oslo-concurrency +BuildRequires: python-oslo-config +BuildRequires: python-oslo-i18n +BuildRequires: python-oslo-serialization +BuildRequires: python-oslo-utils +BuildRequires: python-oslo-policy +BuildRequires: python-babel +BuildRequires: python-pint + +BuildRequires: pytz +BuildRequires: systemd %description -n openstack-dashboard Openstack Dashboard is a web user interface for Openstack. The package @@ -172,73 +205,78 @@ site. Summary: Documentation for Django Horizon Group: Documentation -Requires: %{name} = %{version}-%{release} +Requires: %{name} = %{epoch}:%{version}-%{release} +BuildRequires: python-sphinx >= 1.1.3 + +# Doc building basically means we have to mirror Requires: +BuildRequires: python-glanceclient +BuildRequires: python-keystoneclient +BuildRequires: python-novaclient >= 2.15.0 +BuildRequires: python-neutronclient +BuildRequires: python-cinderclient +BuildRequires: python-swiftclient +BuildRequires: python-heatclient +BuildRequires: python-ceilometerclient +BuildRequires: python-troveclient >= 1.0.0 +BuildRequires: python-saharaclient +BuildRequires: python-oslo-sphinx %description doc Documentation for the Django Horizon application for talking with Openstack %package -n openstack-dashboard-theme Summary: OpenStack web user interface reference implementation theme module -Requires: openstack-dashboard = %{version} +Requires: openstack-dashboard = %{epoch}:%{version}-%{release} %description -n openstack-dashboard-theme Customization module for OpenStack Dashboard to provide a branded logo. %prep -%setup -q -n horizon-%{version} - -# Use git to manage patches. -# http://rwmj.wordpress.com/2011/08/09/nice-rpm-git-patch-management-trick/ -#git init -#git config user.email "python-django-horizon-owner@fedoraproject.org" -#git config user.name "python-django-horizon" -#git add . -#git commit -a -q -m "%{version} baseline" -#git am %{patches} - -sed -i s/REDHATVERSION/%{version}/ horizon/version.py -sed -i s/REDHATRELEASE/%{release}/ horizon/version.py - -# Remove the requirements file so that pbr hooks don't add it -# to distutils requires_dist config -rm -rf {test-,}requirements.txt tools/{pip,test}-requires +%setup -q -n horizon-%{upstream_version} # drop config snippet cp -p %{SOURCE4} . -%if 0%{?with_compression} > 0 +# customize default settings +# WAS [PATCH] disable debug, move web root +sed -i "/^DEBUG =.*/c\DEBUG = False" openstack_dashboard/local/local_settings.py.example +sed -i "/^WEBROOT =.*/c\WEBROOT = '/dashboard/'" openstack_dashboard/local/local_settings.py.example +sed -i "/^.*ALLOWED_HOSTS =.*/c\ALLOWED_HOSTS = ['horizon.example.com', 'localhost']" openstack_dashboard/local/local_settings.py.example +sed -i "/^.*LOCAL_PATH =.*/c\LOCAL_PATH = '/tmp'" openstack_dashboard/local/local_settings.py.example +sed -i "/^.*POLICY_FILES_PATH =.*/c\POLICY_FILES_PATH = '/etc/openstack-dashboard'" openstack_dashboard/local/local_settings.py.example + +sed -i "/^BIN_DIR = .*/c\BIN_DIR = '/usr/bin'" openstack_dashboard/settings.py +sed -i "/^COMPRESS_PARSER = .*/a COMPRESS_OFFLINE = True" openstack_dashboard/settings.py + # set COMPRESS_OFFLINE=True -sed -i 's:COMPRESS_OFFLINE = False:COMPRESS_OFFLINE = True:' openstack_dashboard/settings.py -%else -# set COMPRESS_OFFLINE=False -sed -i 's:COMPRESS_OFFLINE = True:COMPRESS_OFFLINE = False:' openstack_dashboard/settings.py -%endif -%patch0012 -p1 +sed -i 's:COMPRESS_OFFLINE.=.False:COMPRESS_OFFLINE = True:' openstack_dashboard/settings.py + + %build +# compile message strings +cd horizon && django-admin compilemessages && cd .. +cd openstack_dashboard && django-admin compilemessages && cd .. +# Dist tarball is missing .mo files so they're not listed in distributed egg metadata. +# Removing egg-info and letting PBR regenerate it was working around that issue +# but PBR cannot regenerate complete SOURCES.txt so some other files wont't get installed. +# Further reading why not remove upstream egg metadata: +# https://github.com/emonty/python-oslo-messaging/commit/f632684eb2d582253601e8da7ffdb8e55396e924 +# https://fedorahosted.org/fpc/ticket/488 +echo >> horizon.egg-info/SOURCES.txt +ls */locale/*/LC_MESSAGES/django*mo >> horizon.egg-info/SOURCES.txt %{__python} setup.py build # compress css, js etc. cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py -# dirty hack to make SECRET_KEY work: -#sed -i 's:^SECRET_KEY =.*:SECRET_KEY = "badcafe":' openstack_dashboard/local/local_settings.py -%{__python} manage.py collectstatic --noinput - -# offline compression -%if 0%{?with_compression} > 0 +# get it ready for compressing later in puppet-horizon +%{__python} manage.py collectstatic --noinput --clear %{__python} manage.py compress --force -cp -a static/dashboard %{_builddir} -%endif -cp -a static/dashboard %{_builddir} # build docs export PYTHONPATH="$( pwd ):$PYTHONPATH" -%if 0%{?rhel}==6 -sphinx-build -b html doc/source html -%else sphinx-build -b html doc/source html -%endif # undo hack cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py @@ -250,16 +288,15 @@ rm -fr html/.doctrees html/.buildinfo %{__python} setup.py install -O1 --skip-build --root %{buildroot} # drop httpd-conf snippet -%if 0%{?rhel} <7 && 0%{?fedora} <18 -install -m 0644 -D -p %{SOURCE1} %{buildroot}%{_sysconfdir}/httpd/conf.d/openstack-dashboard.conf -%else -# httpd-2.4 changed the syntax install -m 0644 -D -p %{SOURCE2} %{buildroot}%{_sysconfdir}/httpd/conf.d/openstack-dashboard.conf -%endif install -d -m 755 %{buildroot}%{_datadir}/openstack-dashboard install -d -m 755 %{buildroot}%{_sharedstatedir}/openstack-dashboard install -d -m 755 %{buildroot}%{_sysconfdir}/openstack-dashboard +# create directory for systemd snippet +mkdir -p %{buildroot}%{_unitdir}/httpd.service.d/ +cp %{SOURCE3} %{buildroot}%{_unitdir}/httpd.service.d/openstack-dashboard.conf + # Copy everything to /usr/share mv %{buildroot}%{python_sitelib}/openstack_dashboard \ @@ -267,10 +304,9 @@ mv %{buildroot}%{python_sitelib}/openstack_dashboard \ cp manage.py %{buildroot}%{_datadir}/openstack-dashboard rm -rf %{buildroot}%{python_sitelib}/openstack_dashboard -# move customization stuff to /usr/share -#mv openstack_dashboard/dashboards/theme %{buildroot}%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/ -#mv openstack_dashboard/enabled/_99_customization.py %{buildroot}%{_datadir}/openstack-dashboard/openstack_dashboard/enabled - +# remove unnecessary .po files +find %{buildroot} -name django.po -exec rm '{}' \; +find %{buildroot} -name djangojs.po -exec rm '{}' \; # Move config to /etc, symlink it back to /usr/share mv %{buildroot}%{_datadir}/openstack-dashboard/openstack_dashboard/local/local_settings.py.example %{buildroot}%{_sysconfdir}/openstack-dashboard/local_settings @@ -278,28 +314,13 @@ ln -s ../../../../../%{_sysconfdir}/openstack-dashboard/local_settings %{buildro mv %{buildroot}%{_datadir}/openstack-dashboard/openstack_dashboard/conf/*.json %{buildroot}%{_sysconfdir}/openstack-dashboard -%if 0%{?rhel} > 6 || 0%{?fedora} >= 16 %find_lang django %find_lang djangojs -%else -# Handling locale files -# This is adapted from the %%find_lang macro, which cannot be directly -# used since Django locale files are not located in %%{_datadir} -# -# The rest of the packaging guideline still apply -- do not list -# locale files by hand! -(cd $RPM_BUILD_ROOT && find . -name 'django*.po') | %{__sed} -e 's|^.||' | -%{__sed} -e \ - 's:\(.*/locale/\)\([^/_]\+\)\(.*\.po$\):%lang(\2) \1\2\3:' \ - >> django.lang -%endif grep "\/usr\/share\/openstack-dashboard" django.lang > dashboard.lang grep "\/site-packages\/horizon" django.lang > horizon.lang -%if 0%{?rhel} > 6 || 0%{?fedora} >= 16 cat djangojs.lang >> horizon.lang -%endif # copy static files to %{_datadir}/openstack-dashboard/static mkdir -p %{buildroot}%{_datadir}/openstack-dashboard/static @@ -313,24 +334,38 @@ mkdir -p %{buildroot}%{_sharedstatedir}/openstack-dashboard # create /var/log/horizon and own it mkdir -p %{buildroot}%{_var}/log/horizon +# place logrotate config: +mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d +cp -a %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-dashboard + %check # don't run tests on rhel %if 0%{?rhel} == 0 -#sed -i 's:^SECRET_KEY =.*:SECRET_KEY = "badcafe":' openstack_dashboard/local/local_settings.py - -# until django-1.6 support for tests is enabled, disable tests -./run_tests.sh -N -P +# since rawhide has django-1.7 now, tests fail +#./run_tests.sh -N -P %endif +%post -n openstack-dashboard +# ugly hack to set a unique SECRET_KEY +sed -i "/^from horizon.utils import secret_key$/d" /etc/openstack-dashboard/local_settings +sed -i "/^SECRET_KEY.*$/{N;s/^.*$/SECRET_KEY='`openssl rand -hex 10`'/}" /etc/openstack-dashboard/local_settings +# reload systemd unit files +systemctl daemon-reload >/dev/null 2>&1 || : + +%postun +# update systemd unit files +%{systemd_postun} + %files -f horizon.lang %doc LICENSE README.rst openstack-dashboard-httpd-logging.conf %dir %{python_sitelib}/horizon %{python_sitelib}/horizon/*.py* %{python_sitelib}/horizon/browsers -%{python_sitelib}/horizon/contrib/*.py* %{python_sitelib}/horizon/conf +%{python_sitelib}/horizon/contrib %{python_sitelib}/horizon/forms +%{python_sitelib}/horizon/locale/*.pot %{python_sitelib}/horizon/management %{python_sitelib}/horizon/static %{python_sitelib}/horizon/tables @@ -340,6 +375,7 @@ mkdir -p %{buildroot}%{_var}/log/horizon %{python_sitelib}/horizon/test %{python_sitelib}/horizon/utils %{python_sitelib}/horizon/workflows +%{python_sitelib}/horizon/karma.conf.js %{python_sitelib}/*.egg-info %files -n openstack-dashboard -f dashboard.lang @@ -348,66 +384,71 @@ mkdir -p %{buildroot}%{_var}/log/horizon %{_datadir}/openstack-dashboard/static %{_datadir}/openstack-dashboard/openstack_dashboard/*.py* %{_datadir}/openstack-dashboard/openstack_dashboard/api +%{_datadir}/openstack-dashboard/openstack_dashboard/contrib +%dir %{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/ %{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/admin +%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/identity %{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/project -%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/router %{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/settings %{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/__init__.py* -%{_datadir}/openstack-dashboard/openstack_dashboard/django_pyscss_fix/__init__.py* +%{_datadir}/openstack-dashboard/openstack_dashboard/django_pyscss_fix %{_datadir}/openstack-dashboard/openstack_dashboard/enabled -#%exclude %{_datadir}/openstack-dashboard/openstack_dashboard/enabled/_99_customization.* +%{_datadir}/openstack-dashboard/openstack_dashboard/karma.conf.js %{_datadir}/openstack-dashboard/openstack_dashboard/local -%{_datadir}/openstack-dashboard/openstack_dashboard/openstack +%{_datadir}/openstack-dashboard/openstack_dashboard/management %{_datadir}/openstack-dashboard/openstack_dashboard/static %{_datadir}/openstack-dashboard/openstack_dashboard/templates +%{_datadir}/openstack-dashboard/openstack_dashboard/templatetags +%{_datadir}/openstack-dashboard/openstack_dashboard/themes %{_datadir}/openstack-dashboard/openstack_dashboard/test %{_datadir}/openstack-dashboard/openstack_dashboard/usage %{_datadir}/openstack-dashboard/openstack_dashboard/utils %{_datadir}/openstack-dashboard/openstack_dashboard/wsgi -%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/identity/*.py* -%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/identity/domains/*.py* -%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/identity/domains/templates/domains/*html -%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/identity/groups/*.py* -%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/identity/groups/templates/groups/*html -%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/identity/projects/*.py* -%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/identity/projects/templates/projects/*html -%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/identity/roles/*.py* -%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/identity/roles/templates/roles/*html -%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/identity/users/*.py* -%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/identity/users/templates/users/*html -%{_datadir}/openstack-dashboard/openstack_dashboard/management/*.py* -%{_datadir}/openstack-dashboard/openstack_dashboard/management/commands/*.py* -%{_datadir}/openstack-dashboard/openstack_dashboard/management/commands/*template -%{_datadir}/openstack-dashboard/openstack_dashboard/templatetags/*.py* %dir %{_datadir}/openstack-dashboard/openstack_dashboard %dir %{_datadir}/openstack-dashboard/openstack_dashboard/locale %dir %{_datadir}/openstack-dashboard/openstack_dashboard/locale/?? %dir %{_datadir}/openstack-dashboard/openstack_dashboard/locale/??_?? %dir %{_datadir}/openstack-dashboard/openstack_dashboard/locale/??/LC_MESSAGES %dir %{_datadir}/openstack-dashboard/openstack_dashboard/locale/??_??/LC_MESSAGES +%{_datadir}/openstack-dashboard/openstack_dashboard/locale/*.pot +%{_datadir}/openstack-dashboard/openstack_dashboard/.eslintrc %dir %attr(0750, root, apache) %{_sysconfdir}/openstack-dashboard %dir %attr(0750, apache, apache) %{_sharedstatedir}/openstack-dashboard %dir %attr(0750, apache, apache) %{_var}/log/horizon %config(noreplace) %{_sysconfdir}/httpd/conf.d/openstack-dashboard.conf %config(noreplace) %attr(0640, root, apache) %{_sysconfdir}/openstack-dashboard/local_settings +%config(noreplace) %attr(0640, root, apache) %{_sysconfdir}/openstack-dashboard/ceilometer_policy.json %config(noreplace) %attr(0640, root, apache) %{_sysconfdir}/openstack-dashboard/cinder_policy.json %config(noreplace) %attr(0640, root, apache) %{_sysconfdir}/openstack-dashboard/keystone_policy.json %config(noreplace) %attr(0640, root, apache) %{_sysconfdir}/openstack-dashboard/nova_policy.json %config(noreplace) %attr(0640, root, apache) %{_sysconfdir}/openstack-dashboard/glance_policy.json %config(noreplace) %attr(0640, root, apache) %{_sysconfdir}/openstack-dashboard/neutron_policy.json %config(noreplace) %attr(0640, root, apache) %{_sysconfdir}/openstack-dashboard/heat_policy.json -%config(noreplace) %attr(0640, root, apache) %{_sysconfdir}/openstack-dashboard/ceilometer_policy.json - +%config(noreplace) %{_sysconfdir}/logrotate.d/openstack-dashboard +%attr(755,root,root) %dir %{_unitdir}/httpd.service.d +%config(noreplace) %{_unitdir}/httpd.service.d/openstack-dashboard.conf %files doc %doc html -#%files -n openstack-dashboard-theme +%files -n openstack-dashboard-theme #%{_datadir}/openstack-dashboard/openstack_dashboard/dashboards/theme #%{_datadir}/openstack-dashboard/openstack_dashboard/enabled/_99_customization.* %changelog +* Thu Oct 15 2015 Proskurin Kirill - 1:8.0.0.0rc1-1%{?dist}~mos8.0.3 +- update django-compressor build requirements to 1.5 +- add missing requirements: django-babel, PyYAML, python-iso8601, python-kombu, python-httplib2 + +* Mon Oct 5 2015 Proskurin Kirill - 1:8.0.0.0rc1-1%{?dist}~mos8.0.2 +- update django-compressor requirements to 1.5 + +Wed Sep 30 2015 Daniil Trishkin - 1:8.0.0.0rc1-1%{?dist}~mos8.0.1 +- Rebuild for Liberty +- Update requirements according to global requirements of Libery +- .spec is from https://raw.githubusercontent.com/openstack-packages/horizon/rpm-master/python-django-horizon.spec + * Wed Jan 28 2015 Vasyl Saienko 2015.1.0b1 - Update requirements @@ -632,4 +673,4 @@ mkdir -p %{buildroot}%{_var}/log/horizon - Fix static content viewing (patch from Jan van Eldik) (bz 788567) * Mon Jan 30 2012 Cole Robinson - 2012.1-0.1.e3 -- Initial package \ No newline at end of file +- Initial package diff --git a/rpm/SOURCES/0001-Don-t-access-the-net-while-building-docs.patch b/rpm/SOURCES/0001-Don-t-access-the-net-while-building-docs.patch deleted file mode 100644 index 2d116d7..0000000 --- a/rpm/SOURCES/0001-Don-t-access-the-net-while-building-docs.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 57e90a3ffea6ec7442b7b45c41f6d3c558a497da Mon Sep 17 00:00:00 2001 -From: Matthias Runge -Date: Fri, 5 Apr 2013 10:16:19 +0200 -Subject: [PATCH] Don't access the net while building docs (Note this hasn't - been submitted upstream) - ---- - doc/source/conf.py | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/doc/source/conf.py b/doc/source/conf.py -index 2961a7d..b1f7592 100644 ---- a/doc/source/conf.py -+++ b/doc/source/conf.py -@@ -153,7 +153,6 @@ write_autodoc_index() - # They can be extensions coming with Sphinx (named 'sphinx.ext.*') - # or your custom ones. - extensions = ['sphinx.ext.autodoc', -- 'sphinx.ext.intersphinx', - 'sphinx.ext.todo', - 'sphinx.ext.coverage', - 'sphinx.ext.pngmath', diff --git a/rpm/SOURCES/0002-disable-debug-move-web-root.patch b/rpm/SOURCES/0002-disable-debug-move-web-root.patch deleted file mode 100644 index f651699..0000000 --- a/rpm/SOURCES/0002-disable-debug-move-web-root.patch +++ /dev/null @@ -1,61 +0,0 @@ -From c56e21932ce33a1e709ea6b4cfa730f44edc3341 Mon Sep 17 00:00:00 2001 -From: Matthias Runge -Date: Fri, 5 Apr 2013 10:07:53 +0200 -Subject: [PATCH] disable debug, move web root - ---- - openstack_dashboard/local/local_settings.py.example | 2 +- - openstack_dashboard/settings.py | 10 ++++++---- - 2 files changed, 7 insertions(+), 5 deletions(-) - -diff --git a/openstack_dashboard/local/local_settings.py.example b/openstack_dashboard/local/local_settings.py.example -index 5a4efc6..0c72ccb 100644 ---- a/openstack_dashboard/local/local_settings.py.example -+++ b/openstack_dashboard/local/local_settings.py.example -@@ -4,7 +4,7 @@ from django.utils.translation import ugettext_lazy as _ - - from openstack_dashboard import exceptions - --DEBUG = True -+DEBUG = False - TEMPLATE_DEBUG = DEBUG - - # Required for Django 1.5. -diff --git a/openstack_dashboard/settings.py b/openstack_dashboard/settings.py -index cba10ab..aaf1c99 100644 ---- a/openstack_dashboard/settings.py -+++ b/openstack_dashboard/settings.py -@@ -31,7 +31,7 @@ warnings.formatwarning = lambda message, category, *args, **kwargs: \ - '%s: %s' % (category.__name__, message) - - ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) --BIN_DIR = os.path.abspath(os.path.join(ROOT_PATH, '..', 'bin')) -+BIN_DIR = '/usr/bin' - - if ROOT_PATH not in sys.path: - sys.path.append(ROOT_PATH) -@@ -41,12 +41,13 @@ TEMPLATE_DEBUG = DEBUG - - SITE_BRANDING = 'OpenStack Dashboard' - --LOGIN_URL = '/auth/login/' --LOGOUT_URL = '/auth/logout/' -+WEBROOT = '/dashboard' -+LOGIN_URL = WEBROOT + '/auth/login/' -+LOGOUT_URL = WEBROOT + '/auth/logout/' - # LOGIN_REDIRECT_URL can be used as an alternative for - # HORIZON_CONFIG.user_home, if user_home is not set. - # Do not set it to '/home/', as this will cause circular redirect loop --LOGIN_REDIRECT_URL = '/' -+LOGIN_REDIRECT_URL = WEBROOT - - MEDIA_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'media')) - MEDIA_URL = '/media/' -@@ -152,6 +153,7 @@ COMPRESS_ENABLED = True - COMPRESS_OUTPUT_DIR = 'dashboard' - COMPRESS_CSS_HASHING_METHOD = 'hash' - COMPRESS_PARSER = 'compressor.parser.HtmlParser' -+COMPRESS_OFFLINE = True - - INSTALLED_APPS = [ - 'openstack_dashboard', diff --git a/rpm/SOURCES/0003-change-lockfile-location-to-tmp-and-also-add-localho.patch b/rpm/SOURCES/0003-change-lockfile-location-to-tmp-and-also-add-localho.patch deleted file mode 100644 index 23be235..0000000 --- a/rpm/SOURCES/0003-change-lockfile-location-to-tmp-and-also-add-localho.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 657f4db5038d361e998219b1569fede4a0634cd6 Mon Sep 17 00:00:00 2001 -From: Matthias Runge -Date: Thu, 25 Jul 2013 11:32:38 +0200 -Subject: [PATCH] change lockfile location to '/tmp' and also add localhost to - ALLOWED_HOSTS - ---- - openstack_dashboard/local/local_settings.py.example | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/openstack_dashboard/local/local_settings.py.example b/openstack_dashboard/local/local_settings.py.example -index 0c72ccb..84a6ac2 100644 ---- a/openstack_dashboard/local/local_settings.py.example -+++ b/openstack_dashboard/local/local_settings.py.example -@@ -12,7 +12,7 @@ TEMPLATE_DEBUG = DEBUG - # with the list of host/domain names that the application can serve. - # For more information see: - # https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts --#ALLOWED_HOSTS = ['horizon.example.com', ] -+ALLOWED_HOSTS = ['horizon.example.com', 'localhost'] - - # Set SSL proxy settings: - # For Django 1.4+ pass this header from the proxy after terminating the SSL, -@@ -82,7 +82,7 @@ HORIZON_CONFIG = { - # the database creation workflow if so desired. - # HORIZON_CONFIG["password_autocomplete"] = "off" - --LOCAL_PATH = os.path.dirname(os.path.abspath(__file__)) -+LOCAL_PATH = '/tmp' - - # Set custom secret key: - # You can either set it to a specific value or you can let horizion generate a diff --git a/rpm/SOURCES/0004-Add-a-customization-module-based-on-RHOS.patch b/rpm/SOURCES/0004-Add-a-customization-module-based-on-RHOS.patch deleted file mode 100644 index 795924a..0000000 --- a/rpm/SOURCES/0004-Add-a-customization-module-based-on-RHOS.patch +++ /dev/null @@ -1,260 +0,0 @@ -From 39f91eda4f68019c506c0b364a54acc71e9a2b54 Mon Sep 17 00:00:00 2001 -From: Matthias Runge -Date: Thu, 14 Feb 2013 12:55:54 +0100 -Subject: [PATCH] Add a customization module based on RHOS - -Change-Id: I8622ffc8e31cf553315077070b2a696de1bd5081 - -Conflicts: - openstack_dashboard/settings.py ---- - openstack_dashboard/settings.py | 12 ++++- - openstack_dashboard_theme/__init__.py | 0 - openstack_dashboard_theme/models.py | 0 - .../static/dashboard/less/rhtheme.less | 55 ++++++++++++++++++++++ - .../templates/_stylesheets.html | 7 +++ - .../templates/auth/_login.html | 29 ++++++++++++ - .../templates/auth/login.html | 10 ++++ - .../templates/horizon/common/_sidebar.html | 35 ++++++++++++++ - openstack_dashboard_theme/templates/splash.html | 17 +++++++ - 9 files changed, 163 insertions(+), 2 deletions(-) - create mode 100644 openstack_dashboard_theme/__init__.py - create mode 100644 openstack_dashboard_theme/models.py - create mode 100644 openstack_dashboard_theme/static/dashboard/less/rhtheme.less - create mode 100644 openstack_dashboard_theme/templates/_stylesheets.html - create mode 100644 openstack_dashboard_theme/templates/auth/_login.html - create mode 100644 openstack_dashboard_theme/templates/auth/login.html - create mode 100644 openstack_dashboard_theme/templates/horizon/common/_sidebar.html - create mode 100644 openstack_dashboard_theme/templates/splash.html - -diff --git a/openstack_dashboard/settings.py b/openstack_dashboard/settings.py -index aaf1c99..e99a9af 100644 ---- a/openstack_dashboard/settings.py -+++ b/openstack_dashboard/settings.py -@@ -121,14 +121,13 @@ TEMPLATE_CONTEXT_PROCESSORS = ( - ) - - TEMPLATE_LOADERS = ( -- 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', - 'horizon.loaders.TemplateLoader' - ) - - TEMPLATE_DIRS = ( - os.path.join(ROOT_PATH, 'templates'), --) -+) - - STATICFILES_FINDERS = ( - 'compressor.finders.CompressorFinder', -@@ -169,6 +168,15 @@ INSTALLED_APPS = [ - 'openstack_auth', - ] - -+THEME_APP = 'openstack_dashboard_theme' -+ -+try: -+ __import__(THEME_APP) -+ INSTALLED_APPS = (THEME_APP,) + INSTALLED_APPS -+except: -+ pass -+ -+ - TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' - AUTHENTICATION_BACKENDS = ('openstack_auth.backend.KeystoneBackend',) - MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage' -diff --git a/openstack_dashboard_theme/__init__.py b/openstack_dashboard_theme/__init__.py -new file mode 100644 -index 0000000..e69de29 -diff --git a/openstack_dashboard_theme/models.py b/openstack_dashboard_theme/models.py -new file mode 100644 -index 0000000..e69de29 -diff --git a/openstack_dashboard_theme/static/dashboard/less/rhtheme.less b/openstack_dashboard_theme/static/dashboard/less/rhtheme.less -new file mode 100644 -index 0000000..5350db3 ---- /dev/null -+++ b/openstack_dashboard_theme/static/dashboard/less/rhtheme.less -@@ -0,0 +1,55 @@ -+@import "/static/dashboard/less/horizon.less"; -+ -+/* Login Splash Page */ -+ -+#splash .rhlogin { -+ background: #fff url(/static/dashboard/img/rh-logo.png) no-repeat center 35px; -+ position: absolute; -+ top: 80px; -+ left: 50%; -+ margin: 0 0 0 -195px; -+ padding-top: 170px; -+ width: 390px; -+ border: 1px solid #e1e1e1; -+ max-height: none; -+ -webkit-border-radius: 6px; -+ -moz-border-radius: 6px; -+ border-radius: 6px; -+ -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -+ -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -+ box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -+ -webkit-background-clip: padding-box; -+ -moz-background-clip: padding-box; -+ background-clip: padding-box; -+ -+ form { -+ .error { -+ width: 100%; -+ } -+ input { -+ width: 350px; -+ } -+ select { -+ width: 360px; -+ } -+ } -+} -+ -+h1.rhos { -+ width: 100%; -+ margin: 0; -+ background-color: #f5f5f5; -+ padding-bottom: 40px; -+} -+ -+h1.rhos a { -+ background: url(/static/dashboard/img/rh-logo.png) top left no-repeat; -+ display: block; -+ float: left; -+ width: 116px; -+ height: 123px; -+ text-indent: -9999px; -+ margin-left: 56px; -+ margin-top: 15px; -+ margin-bottom: 25px; -+} -diff --git a/openstack_dashboard_theme/templates/_stylesheets.html b/openstack_dashboard_theme/templates/_stylesheets.html -new file mode 100644 -index 0000000..88463e1 ---- /dev/null -+++ b/openstack_dashboard_theme/templates/_stylesheets.html -@@ -0,0 +1,7 @@ -+{% load compress %} -+ -+{% compress css %} -+ -+{% endcompress %} -+ -+ -diff --git a/openstack_dashboard_theme/templates/auth/_login.html b/openstack_dashboard_theme/templates/auth/_login.html -new file mode 100644 -index 0000000..1cb6036 ---- /dev/null -+++ b/openstack_dashboard_theme/templates/auth/_login.html -@@ -0,0 +1,29 @@ -+{% extends "horizon/common/_modal_form.html" %} -+{% load i18n %} -+{% load url from future %} -+ -+{% block modal-header %}{% trans "Log In" %}{% endblock %} -+{% block modal_class %}rhlogin{% if hide %}modal hide{% endif %}{% endblock %} -+ -+{% block form_action %}{% url 'login' %}{% endblock %} -+{% block autocomplete %}{{ HORIZON_CONFIG.password_autocomplete }}{% endblock %} -+ -+{% block modal-body %} -+
-+ {% if request.user.is_authenticated and 'next' in request.GET %} -+
-+

{% trans "You don't have permissions to access:" %}

-+

{{ request.GET.next }}

-+

{% trans "Login as different user or go back to" %} -+ {% trans "home page" %}

-+
-+
-+ {% endif %} -+ {% if next %}{% endif %} -+ {% include "horizon/common/_form_fields.html" %} -+
-+{% endblock %} -+ -+{% block modal-footer %} -+ -+{% endblock %} -diff --git a/openstack_dashboard_theme/templates/auth/login.html b/openstack_dashboard_theme/templates/auth/login.html -new file mode 100644 -index 0000000..6fa7746 ---- /dev/null -+++ b/openstack_dashboard_theme/templates/auth/login.html -@@ -0,0 +1,10 @@ -+{% extends "base.html" %} -+{% load i18n %} -+ -+{% block title %}{% trans "Login" %}{% endblock %} -+ -+{% block body_id %}splash{% endblock %} -+ -+{% block content %} -+ {% include 'auth/_login.html' %} -+{% endblock %} -diff --git a/openstack_dashboard_theme/templates/horizon/common/_sidebar.html b/openstack_dashboard_theme/templates/horizon/common/_sidebar.html -new file mode 100644 -index 0000000..5672846 ---- /dev/null -+++ b/openstack_dashboard_theme/templates/horizon/common/_sidebar.html -@@ -0,0 +1,35 @@ -+{% load branding horizon i18n %} -+ -+ -diff --git a/openstack_dashboard_theme/templates/splash.html b/openstack_dashboard_theme/templates/splash.html -new file mode 100644 -index 0000000..4a5cfe1 ---- /dev/null -+++ b/openstack_dashboard_theme/templates/splash.html -@@ -0,0 +1,17 @@ -+{% load i18n branding %} -+ -+ -+ -+ -+ -+ {% trans "Login" %} - {% site_branding %} -+ {% include "_stylesheets.html" %} -+ -+ -+
-+
-+ {% include 'auth/_login.html' %} -+
-+
-+ -+ diff --git a/rpm/SOURCES/0005-Revert-Use-oslo.sphinx-and-remove-local-copy-of-doc-.patch b/rpm/SOURCES/0005-Revert-Use-oslo.sphinx-and-remove-local-copy-of-doc-.patch deleted file mode 100644 index 94740bb..0000000 --- a/rpm/SOURCES/0005-Revert-Use-oslo.sphinx-and-remove-local-copy-of-doc-.patch +++ /dev/null @@ -1,1348 +0,0 @@ -From 9058dd457bf4ce116848c48cc9fdcd0319e77e84 Mon Sep 17 00:00:00 2001 -From: Matthias Runge -Date: Mon, 9 Sep 2013 13:51:19 +0200 -Subject: [PATCH] Revert "Use oslo.sphinx and remove local copy of doc theme" - -This reverts commit b6f7d8318bf909cc9989809127fc108e405fa400. ---- - doc/source/_static/.gitignore | 0 - doc/source/_static/basic.css | 416 +++++++++++++++++++++++++++++++++++++ - doc/source/_static/default.css | 230 ++++++++++++++++++++ - doc/source/_static/jquery.tweet.js | 154 ++++++++++++++ - doc/source/_static/nature.css | 245 ++++++++++++++++++++++ - doc/source/_static/tweaks.css | 95 +++++++++ - doc/source/_templates/.placeholder | 0 - doc/source/_theme/layout.html | 83 ++++++++ - doc/source/_theme/theme.conf | 4 + - doc/source/conf.py | 13 +- - test-requirements.txt | 1 - - 11 files changed, 1234 insertions(+), 7 deletions(-) - create mode 100644 doc/source/_static/.gitignore - create mode 100644 doc/source/_static/basic.css - create mode 100644 doc/source/_static/default.css - create mode 100644 doc/source/_static/jquery.tweet.js - create mode 100644 doc/source/_static/nature.css - create mode 100644 doc/source/_static/tweaks.css - create mode 100644 doc/source/_templates/.placeholder - create mode 100644 doc/source/_theme/layout.html - create mode 100644 doc/source/_theme/theme.conf - -diff --git a/doc/source/_static/.gitignore b/doc/source/_static/.gitignore -new file mode 100644 -index 0000000..e69de29 -diff --git a/doc/source/_static/basic.css b/doc/source/_static/basic.css -new file mode 100644 -index 0000000..d909ce3 ---- /dev/null -+++ b/doc/source/_static/basic.css -@@ -0,0 +1,416 @@ -+/** -+ * Sphinx stylesheet -- basic theme -+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -+ */ -+ -+/* -- main layout ----------------------------------------------------------- */ -+ -+div.clearer { -+ clear: both; -+} -+ -+/* -- relbar ---------------------------------------------------------------- */ -+ -+div.related { -+ width: 100%; -+ font-size: 90%; -+} -+ -+div.related h3 { -+ display: none; -+} -+ -+div.related ul { -+ margin: 0; -+ padding: 0 0 0 10px; -+ list-style: none; -+} -+ -+div.related li { -+ display: inline; -+} -+ -+div.related li.right { -+ float: right; -+ margin-right: 5px; -+} -+ -+/* -- sidebar --------------------------------------------------------------- */ -+ -+div.sphinxsidebarwrapper { -+ padding: 10px 5px 0 10px; -+} -+ -+div.sphinxsidebar { -+ float: left; -+ width: 230px; -+ margin-left: -100%; -+ font-size: 90%; -+} -+ -+div.sphinxsidebar ul { -+ list-style: none; -+} -+ -+div.sphinxsidebar ul ul, -+div.sphinxsidebar ul.want-points { -+ margin-left: 20px; -+ list-style: square; -+} -+ -+div.sphinxsidebar ul ul { -+ margin-top: 0; -+ margin-bottom: 0; -+} -+ -+div.sphinxsidebar form { -+ margin-top: 10px; -+} -+ -+div.sphinxsidebar input { -+ border: 1px solid #98dbcc; -+ font-family: sans-serif; -+ font-size: 1em; -+} -+ -+img { -+ border: 0; -+} -+ -+/* -- search page ----------------------------------------------------------- */ -+ -+ul.search { -+ margin: 10px 0 0 20px; -+ padding: 0; -+} -+ -+ul.search li { -+ padding: 5px 0 5px 20px; -+ background-image: url(file.png); -+ background-repeat: no-repeat; -+ background-position: 0 7px; -+} -+ -+ul.search li a { -+ font-weight: bold; -+} -+ -+ul.search li div.context { -+ color: #888; -+ margin: 2px 0 0 30px; -+ text-align: left; -+} -+ -+ul.keywordmatches li.goodmatch a { -+ font-weight: bold; -+} -+ -+/* -- index page ------------------------------------------------------------ */ -+ -+table.contentstable { -+ width: 90%; -+} -+ -+table.contentstable p.biglink { -+ line-height: 150%; -+} -+ -+a.biglink { -+ font-size: 1.3em; -+} -+ -+span.linkdescr { -+ font-style: italic; -+ padding-top: 5px; -+ font-size: 90%; -+} -+ -+/* -- general index --------------------------------------------------------- */ -+ -+table.indextable td { -+ text-align: left; -+ vertical-align: top; -+} -+ -+table.indextable dl, table.indextable dd { -+ margin-top: 0; -+ margin-bottom: 0; -+} -+ -+table.indextable tr.pcap { -+ height: 10px; -+} -+ -+table.indextable tr.cap { -+ margin-top: 10px; -+ background-color: #f2f2f2; -+} -+ -+img.toggler { -+ margin-right: 3px; -+ margin-top: 3px; -+ cursor: pointer; -+} -+ -+/* -- general body styles --------------------------------------------------- */ -+ -+a.headerlink { -+ visibility: hidden; -+} -+ -+h1:hover > a.headerlink, -+h2:hover > a.headerlink, -+h3:hover > a.headerlink, -+h4:hover > a.headerlink, -+h5:hover > a.headerlink, -+h6:hover > a.headerlink, -+dt:hover > a.headerlink { -+ visibility: visible; -+} -+ -+div.body p.caption { -+ text-align: inherit; -+} -+ -+div.body td { -+ text-align: left; -+} -+ -+.field-list ul { -+ padding-left: 1em; -+} -+ -+.first { -+} -+ -+p.rubric { -+ margin-top: 30px; -+ font-weight: bold; -+} -+ -+/* -- sidebars -------------------------------------------------------------- */ -+ -+div.sidebar { -+ margin: 0 0 0.5em 1em; -+ border: 1px solid #ddb; -+ padding: 7px 7px 0 7px; -+ background-color: #ffe; -+ width: 40%; -+ float: right; -+} -+ -+p.sidebar-title { -+ font-weight: bold; -+} -+ -+/* -- topics ---------------------------------------------------------------- */ -+ -+div.topic { -+ border: 1px solid #ccc; -+ padding: 7px 7px 0 7px; -+ margin: 10px 0 10px 0; -+} -+ -+p.topic-title { -+ font-size: 1.1em; -+ font-weight: bold; -+ margin-top: 10px; -+} -+ -+/* -- admonitions ----------------------------------------------------------- */ -+ -+div.admonition { -+ margin-top: 10px; -+ margin-bottom: 10px; -+ padding: 7px; -+} -+ -+div.admonition dt { -+ font-weight: bold; -+} -+ -+div.admonition dl { -+ margin-bottom: 0; -+} -+ -+p.admonition-title { -+ margin: 0px 10px 5px 0px; -+ font-weight: bold; -+} -+ -+div.body p.centered { -+ text-align: center; -+ margin-top: 25px; -+} -+ -+/* -- tables ---------------------------------------------------------------- */ -+ -+table.docutils { -+ border: 0; -+ border-collapse: collapse; -+} -+ -+table.docutils td, table.docutils th { -+ padding: 1px 8px 1px 0; -+ border-top: 0; -+ border-left: 0; -+ border-right: 0; -+ border-bottom: 1px solid #aaa; -+} -+ -+table.field-list td, table.field-list th { -+ border: 0 !important; -+} -+ -+table.footnote td, table.footnote th { -+ border: 0 !important; -+} -+ -+th { -+ text-align: left; -+ padding-right: 5px; -+} -+ -+/* -- other body styles ----------------------------------------------------- */ -+ -+dl { -+ margin-bottom: 15px; -+} -+ -+dd p { -+ margin-top: 0px; -+} -+ -+dd ul, dd table { -+ margin-bottom: 10px; -+} -+ -+dd { -+ margin-top: 3px; -+ margin-bottom: 10px; -+ margin-left: 30px; -+} -+ -+dt:target, .highlight { -+ background-color: #fbe54e; -+} -+ -+dl.glossary dt { -+ font-weight: bold; -+ font-size: 1.1em; -+} -+ -+.field-list ul { -+ margin: 0; -+ padding-left: 1em; -+} -+ -+.field-list p { -+ margin: 0; -+} -+ -+.refcount { -+ color: #060; -+} -+ -+.optional { -+ font-size: 1.3em; -+} -+ -+.versionmodified { -+ font-style: italic; -+} -+ -+.system-message { -+ background-color: #fda; -+ padding: 5px; -+ border: 3px solid red; -+} -+ -+.footnote:target { -+ background-color: #ffa -+} -+ -+.line-block { -+ display: block; -+ margin-top: 1em; -+ margin-bottom: 1em; -+} -+ -+.line-block .line-block { -+ margin-top: 0; -+ margin-bottom: 0; -+ margin-left: 1.5em; -+} -+ -+/* -- code displays --------------------------------------------------------- */ -+ -+pre { -+ overflow: auto; -+} -+ -+td.linenos pre { -+ padding: 5px 0px; -+ border: 0; -+ background-color: transparent; -+ color: #aaa; -+} -+ -+table.highlighttable { -+ margin-left: 0.5em; -+} -+ -+table.highlighttable td { -+ padding: 0 0.5em 0 0.5em; -+} -+ -+tt.descname { -+ background-color: transparent; -+ font-weight: bold; -+ font-size: 1.2em; -+} -+ -+tt.descclassname { -+ background-color: transparent; -+} -+ -+tt.xref, a tt { -+ background-color: transparent; -+ font-weight: bold; -+} -+ -+h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { -+ background-color: transparent; -+} -+ -+/* -- math display ---------------------------------------------------------- */ -+ -+img.math { -+ vertical-align: middle; -+} -+ -+div.body div.math p { -+ text-align: center; -+} -+ -+span.eqno { -+ float: right; -+} -+ -+/* -- printout stylesheet --------------------------------------------------- */ -+ -+@media print { -+ div.document, -+ div.documentwrapper, -+ div.bodywrapper { -+ margin: 0 !important; -+ width: 100%; -+ } -+ -+ div.sphinxsidebar, -+ div.related, -+ div.footer, -+ #top-link { -+ display: none; -+ } -+} -diff --git a/doc/source/_static/default.css b/doc/source/_static/default.css -new file mode 100644 -index 0000000..c8091ec ---- /dev/null -+++ b/doc/source/_static/default.css -@@ -0,0 +1,230 @@ -+/** -+ * Sphinx stylesheet -- default theme -+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -+ */ -+ -+@import url("basic.css"); -+ -+/* -- page layout ----------------------------------------------------------- */ -+ -+body { -+ font-family: sans-serif; -+ font-size: 100%; -+ background-color: #11303d; -+ color: #000; -+ margin: 0; -+ padding: 0; -+} -+ -+div.document { -+ background-color: #1c4e63; -+} -+ -+div.documentwrapper { -+ float: left; -+ width: 100%; -+} -+ -+div.bodywrapper { -+ margin: 0 0 0 230px; -+} -+ -+div.body { -+ background-color: #ffffff; -+ color: #000000; -+ padding: 0 20px 30px 20px; -+} -+ -+div.footer { -+ color: #ffffff; -+ width: 100%; -+ padding: 9px 0 9px 0; -+ text-align: center; -+ font-size: 75%; -+} -+ -+div.footer a { -+ color: #ffffff; -+ text-decoration: underline; -+} -+ -+div.related { -+ background-color: #133f52; -+ line-height: 30px; -+ color: #ffffff; -+} -+ -+div.related a { -+ color: #ffffff; -+} -+ -+div.sphinxsidebar { -+} -+ -+div.sphinxsidebar h3 { -+ font-family: 'Trebuchet MS', sans-serif; -+ color: #ffffff; -+ font-size: 1.4em; -+ font-weight: normal; -+ margin: 0; -+ padding: 0; -+} -+ -+div.sphinxsidebar h3 a { -+ color: #ffffff; -+} -+ -+div.sphinxsidebar h4 { -+ font-family: 'Trebuchet MS', sans-serif; -+ color: #ffffff; -+ font-size: 1.3em; -+ font-weight: normal; -+ margin: 5px 0 0 0; -+ padding: 0; -+} -+ -+div.sphinxsidebar p { -+ color: #ffffff; -+} -+ -+div.sphinxsidebar p.topless { -+ margin: 5px 10px 10px 10px; -+} -+ -+div.sphinxsidebar ul { -+ margin: 10px; -+ padding: 0; -+ color: #ffffff; -+} -+ -+div.sphinxsidebar a { -+ color: #98dbcc; -+} -+ -+div.sphinxsidebar input { -+ border: 1px solid #98dbcc; -+ font-family: sans-serif; -+ font-size: 1em; -+} -+ -+/* -- body styles ----------------------------------------------------------- */ -+ -+a { -+ color: #355f7c; -+ text-decoration: none; -+} -+ -+a:hover { -+ text-decoration: underline; -+} -+ -+div.body p, div.body dd, div.body li { -+ text-align: left; -+ line-height: 130%; -+} -+ -+div.body h1, -+div.body h2, -+div.body h3, -+div.body h4, -+div.body h5, -+div.body h6 { -+ font-family: 'Trebuchet MS', sans-serif; -+ background-color: #f2f2f2; -+ font-weight: normal; -+ color: #20435c; -+ border-bottom: 1px solid #ccc; -+ margin: 20px -20px 10px -20px; -+ padding: 3px 0 3px 10px; -+} -+ -+div.body h1 { margin-top: 0; font-size: 200%; } -+div.body h2 { font-size: 160%; } -+div.body h3 { font-size: 140%; } -+div.body h4 { font-size: 120%; } -+div.body h5 { font-size: 110%; } -+div.body h6 { font-size: 100%; } -+ -+a.headerlink { -+ color: #c60f0f; -+ font-size: 0.8em; -+ padding: 0 4px 0 4px; -+ text-decoration: none; -+} -+ -+a.headerlink:hover { -+ background-color: #c60f0f; -+ color: white; -+} -+ -+div.body p, div.body dd, div.body li { -+ text-align: left; -+ line-height: 130%; -+} -+ -+div.admonition p.admonition-title + p { -+ display: inline; -+} -+ -+div.admonition p { -+ margin-bottom: 5px; -+} -+ -+div.admonition pre { -+ margin-bottom: 5px; -+} -+ -+div.admonition ul, div.admonition ol { -+ margin-bottom: 5px; -+} -+ -+div.note { -+ background-color: #eee; -+ border: 1px solid #ccc; -+} -+ -+div.seealso { -+ background-color: #ffc; -+ border: 1px solid #ff6; -+} -+ -+div.topic { -+ background-color: #eee; -+} -+ -+div.warning { -+ background-color: #ffe4e4; -+ border: 1px solid #f66; -+} -+ -+p.admonition-title { -+ display: inline; -+} -+ -+p.admonition-title:after { -+ content: ":"; -+} -+ -+pre { -+ padding: 5px; -+ background-color: #eeffcc; -+ color: #333333; -+ line-height: 120%; -+ border: 1px solid #ac9; -+ border-left: none; -+ border-right: none; -+} -+ -+tt { -+ background-color: #ecf0f3; -+ padding: 0 1px 0 1px; -+ font-size: 0.95em; -+} -+ -+.warning tt { -+ background: #efc2c2; -+} -+ -+.note tt { -+ background: #d6d6d6; -+} -diff --git a/doc/source/_static/jquery.tweet.js b/doc/source/_static/jquery.tweet.js -new file mode 100644 -index 0000000..79bf0bd ---- /dev/null -+++ b/doc/source/_static/jquery.tweet.js -@@ -0,0 +1,154 @@ -+(function($) { -+ -+ $.fn.tweet = function(o){ -+ var s = { -+ username: ["seaofclouds"], // [string] required, unless you want to display our tweets. :) it can be an array, just do ["username1","username2","etc"] -+ list: null, //[string] optional name of list belonging to username -+ avatar_size: null, // [integer] height and width of avatar if displayed (48px max) -+ count: 3, // [integer] how many tweets to display? -+ intro_text: null, // [string] do you want text BEFORE your your tweets? -+ outro_text: null, // [string] do you want text AFTER your tweets? -+ join_text: null, // [string] optional text in between date and tweet, try setting to "auto" -+ auto_join_text_default: "i said,", // [string] auto text for non verb: "i said" bullocks -+ auto_join_text_ed: "i", // [string] auto text for past tense: "i" surfed -+ auto_join_text_ing: "i am", // [string] auto tense for present tense: "i was" surfing -+ auto_join_text_reply: "i replied to", // [string] auto tense for replies: "i replied to" @someone "with" -+ auto_join_text_url: "i was looking at", // [string] auto tense for urls: "i was looking at" http:... -+ loading_text: null, // [string] optional loading text, displayed while tweets load -+ query: null // [string] optional search query -+ }; -+ -+ if(o) $.extend(s, o); -+ -+ $.fn.extend({ -+ linkUrl: function() { -+ var returning = []; -+ var regexp = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi; -+ this.each(function() { -+ returning.push(this.replace(regexp,"$1")); -+ }); -+ return $(returning); -+ }, -+ linkUser: function() { -+ var returning = []; -+ var regexp = /[\@]+([A-Za-z0-9-_]+)/gi; -+ this.each(function() { -+ returning.push(this.replace(regexp,"@$1")); -+ }); -+ return $(returning); -+ }, -+ linkHash: function() { -+ var returning = []; -+ var regexp = / [\#]+([A-Za-z0-9-_]+)/gi; -+ this.each(function() { -+ returning.push(this.replace(regexp, ' #$1')); -+ }); -+ return $(returning); -+ }, -+ capAwesome: function() { -+ var returning = []; -+ this.each(function() { -+ returning.push(this.replace(/\b(awesome)\b/gi, '$1')); -+ }); -+ return $(returning); -+ }, -+ capEpic: function() { -+ var returning = []; -+ this.each(function() { -+ returning.push(this.replace(/\b(epic)\b/gi, '$1')); -+ }); -+ return $(returning); -+ }, -+ makeHeart: function() { -+ var returning = []; -+ this.each(function() { -+ returning.push(this.replace(/(<)+[3]/gi, "")); -+ }); -+ return $(returning); -+ } -+ }); -+ -+ function relative_time(time_value) { -+ var parsed_date = Date.parse(time_value); -+ var relative_to = (arguments.length > 1) ? arguments[1] : new Date(); -+ var delta = parseInt((relative_to.getTime() - parsed_date) / 1000); -+ var pluralize = function (singular, n) { -+ return '' + n + ' ' + singular + (n == 1 ? '' : 's'); -+ }; -+ if(delta < 60) { -+ return 'less than a minute ago'; -+ } else if(delta < (45*60)) { -+ return 'about ' + pluralize("minute", parseInt(delta / 60)) + ' ago'; -+ } else if(delta < (24*60*60)) { -+ return 'about ' + pluralize("hour", parseInt(delta / 3600)) + ' ago'; -+ } else { -+ return 'about ' + pluralize("day", parseInt(delta / 86400)) + ' ago'; -+ } -+ } -+ -+ function build_url() { -+ var proto = ('https:' == document.location.protocol ? 'https:' : 'http:'); -+ if (s.list) { -+ return proto+"//api.twitter.com/1/"+s.username[0]+"/lists/"+s.list+"/statuses.json?per_page="+s.count+"&callback=?"; -+ } else if (s.query == null && s.username.length == 1) { -+ return proto+'//twitter.com/status/user_timeline/'+s.username[0]+'.json?count='+s.count+'&callback=?'; -+ } else { -+ var query = (s.query || 'from:'+s.username.join('%20OR%20from:')); -+ return proto+'//search.twitter.com/search.json?&q='+query+'&rpp='+s.count+'&callback=?'; -+ } -+ } -+ -+ return this.each(function(){ -+ var list = $('