From 1daf925ade3c32f26a1168af53dd225d19fea0c5 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Nov 28 2016 09:46:21 +0000 Subject: [PATCH 1/2] [frontend] move footer "project info" into separate template After discussion in https://pagure.io/copr/copr/pull-request/9 renaming the subpackage '*-design' into '*-flavor', because templates are not about "design" anymore. --- diff --git a/frontend/copr-frontend.spec b/frontend/copr-frontend.spec index d514eac..b884120 100644 --- a/frontend/copr-frontend.spec +++ b/frontend/copr-frontend.spec @@ -9,18 +9,20 @@ %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) -%global design_files_list %_datadir/copr/copr-design-filelist -%global design_generator %_datadir/copr/coprs_frontend/generate_colorscheme -%global static_files %_datadir/copr/coprs_frontend/coprs/static - -%global design_files \ -%static_files/header_background.png \ -%static_files/favicon.ico \ -%static_files/copr_logo.png \ -%static_files/css/style-overwrite.css +%global flavor_files_list %_datadir/copr/copr-flavor-filelist +%global flavor_generator %_datadir/copr/coprs_frontend/generate_colorscheme +%global staticdir %_datadir/copr/coprs_frontend/coprs/static +%global templatedir %_datadir/copr/coprs_frontend/coprs/templates + +%global flavor_files \ +%staticdir/header_background.png \ +%staticdir/favicon.ico \ +%staticdir/copr_logo.png \ +%staticdir/css/style-overwrite.css \ +%templatedir/project_info.html %global devel_files \ -%design_generator +%flavor_generator %define exclude_files() %{lua: macro = "%" .. rpm.expand("%1") .. "_files" @@ -86,7 +88,7 @@ Requires: python-flask-restful Requires: python-marshmallow >= 2.0.0 Requires: python2-modulemd Requires: python-pygments -Requires: %{name}-design = %{version} +Requires: %{name}-flavor = %{version} # for tests: Requires: pytest @@ -216,14 +218,14 @@ This package include documentation for COPR code. Mostly useful for developers only. -%package design +%package flavor Summary: Template files for %{name} Requires: %{name} = %{version} -%description design +%description flavor Template files for %{name} (basically colors, logo, etc.). This package is designed to be replaced - build your replacement package against %{name}-devel -to produce compatible {name}-design package, then use man dnf.conf(5) 'priority' +to produce compatible {name}-flavor package, then use man dnf.conf(5) 'priority' option to prioritize your package against the default package we provide. @@ -232,7 +234,7 @@ Summary: Development files to build against %{name} %description devel Files which allow a build against %{name}, currently it's useful to build -custom %{name}-design package. +custom %{name}-flavor package. %prep @@ -281,9 +283,9 @@ touch %{buildroot}%{_var}/log/copr-frontend/frontend.log ln -fs /usr/share/copr/coprs_frontend/manage.py %{buildroot}/%{_bindir}/copr-frontend -mkdir -p %buildroot/$(dirname %design_files) -cat < %buildroot%design_files_list -%design_files +mkdir -p %buildroot/$(dirname %flavor_files_list) +cat < %buildroot%flavor_files_list +%flavor_files EOF %check @@ -300,10 +302,11 @@ EOF mkdir -p %buildroot%macrosdir cat <%buildroot%macrosdir/macros.coprfrontend %%copr_frontend_version %version -%%copr_frontend_design_filelist %design_files_list -%%copr_frontend_design_generator %design_generator -%%copr_frontend_static_files %static_files -%%copr_frontend_chroot_logodir %%copr_frontend_static_files/chroot_logodir +%%copr_frontend_flavor_filelist %flavor_files_list +%%copr_frontend_flavor_generator %flavor_generator +%%copr_frontend_staticdir %staticdir +%%copr_frontend_templatedir %templatedir +%%copr_frontend_chroot_logodir %%copr_frontend_staticdir/chroot_logodir EOF @@ -361,18 +364,18 @@ service logstash condrestart %config(noreplace) %{_sysconfdir}/copr/copr_unit_test.conf %config(noreplace) %attr(0755, root, root) %{_sysconfdir}/cron.hourly/copr-frontend -%exclude_files design +%exclude_files flavor %exclude_files devel -%files design +%files flavor %license LICENSE -%design_files +%flavor_files %files devel %license LICENSE -%design_files_list +%flavor_files_list %devel_files %macrosdir/* diff --git a/frontend/coprs_frontend/coprs/static/css/style-overwrite.css b/frontend/coprs_frontend/coprs/static/css/style-overwrite.css index 42cd42d..2fd4589 100644 --- a/frontend/coprs_frontend/coprs/static/css/style-overwrite.css +++ b/frontend/coprs_frontend/coprs/static/css/style-overwrite.css @@ -1 +1 @@ -a{color:#2b64b4}a:hover,a:focus{color:#214d8b}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active{color:#214d8b}h3 a{color:#214d8b !important}.btn-primary{background-color:#214d8b;background-image:linear-gradient(to bottom, #2b64b4 0, #214d8b 100%);border-color:#2b64b4}.btn-primary:hover,.btn-primary:focus{background-color:#558bd7;border-color:#558bd7}table.datatable thead .sorting_asc,table.datatable thead .sorting_desc{color:#214d8b !important} \ No newline at end of file +a{color:#2b64b4}a:hover,a:focus{color:#214d8b}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active{color:#214d8b}h3 a{color:#214d8b !important}.btn-primary{background-color:#214d8b;background-image:linear-gradient(to bottom, #2b64b4 0, #214d8b 100%);border-color:#2b64b4}.btn-primary:hover,.btn-primary:focus{background-color:#558bd7;border-color:#558bd7}table.datatable thead .sorting_asc,table.datatable thead .sorting_desc{color:#214d8b !important}.footer dd ul{padding-left:0;list-style:none} \ No newline at end of file diff --git a/frontend/coprs_frontend/coprs/templates/layout.html b/frontend/coprs_frontend/coprs/templates/layout.html index 4bcdb0b..ad62849 100644 --- a/frontend/coprs_frontend/coprs/templates/layout.html +++ b/frontend/coprs_frontend/coprs/templates/layout.html @@ -115,23 +115,14 @@
-

Copr Project

-
- -
+ {% include 'project_info.html' %}

Site Navigation

-
    +
    • Home
    • Task Queue
    • API
    • @@ -143,7 +134,7 @@

      Powered by

      -
        +
        • Python
        • OpenStack
        • PatternFly
        • diff --git a/frontend/coprs_frontend/coprs/templates/project_info.html b/frontend/coprs_frontend/coprs/templates/project_info.html new file mode 100644 index 0000000..b6b767b --- /dev/null +++ b/frontend/coprs_frontend/coprs/templates/project_info.html @@ -0,0 +1,10 @@ +

          Copr Project

          +
          + +
          diff --git a/frontend/coprs_frontend/generate_colorscheme b/frontend/coprs_frontend/generate_colorscheme index 4b7c191..ec5db86 100755 --- a/frontend/coprs_frontend/generate_colorscheme +++ b/frontend/coprs_frontend/generate_colorscheme @@ -55,6 +55,11 @@ h3 a { table.datatable thead .sorting_asc, table.datatable thead .sorting_desc { color: @base !important; } + +.footer dd ul { + padding-left: 0; + list-style: none; +} EOF lighten_base () From 51de17ff13e7b7739e5f9eb2776d37909f96fabd Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Nov 28 2016 09:54:20 +0000 Subject: [PATCH 2/2] [frontend] renamed '*-flavor' to '*-fedora' Per Michal's suggestion in PR 13. The `copr-frontend-fedora` is definitely more semantically correct package name, and it will not collide in "Name" with `copr-frontend-redhat`. The counterpart: https://pagure.io/rhcopr/design --- diff --git a/frontend/copr-frontend.spec b/frontend/copr-frontend.spec index b884120..c837287 100644 --- a/frontend/copr-frontend.spec +++ b/frontend/copr-frontend.spec @@ -9,6 +9,7 @@ %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) +%global flavor_guard %name-flavor = %version %global flavor_files_list %_datadir/copr/copr-flavor-filelist %global flavor_generator %_datadir/copr/coprs_frontend/generate_colorscheme %global staticdir %_datadir/copr/coprs_frontend/coprs/static @@ -88,7 +89,8 @@ Requires: python-flask-restful Requires: python-marshmallow >= 2.0.0 Requires: python2-modulemd Requires: python-pygments -Requires: %{name}-flavor = %{version} + +Requires: %flavor_guard # for tests: Requires: pytest @@ -218,11 +220,12 @@ This package include documentation for COPR code. Mostly useful for developers only. -%package flavor +%package fedora Summary: Template files for %{name} Requires: %{name} = %{version} +Provides: %flavor_guard -%description flavor +%description fedora Template files for %{name} (basically colors, logo, etc.). This package is designed to be replaced - build your replacement package against %{name}-devel to produce compatible {name}-flavor package, then use man dnf.conf(5) 'priority' @@ -301,7 +304,7 @@ EOF mkdir -p %buildroot%macrosdir cat <%buildroot%macrosdir/macros.coprfrontend -%%copr_frontend_version %version +%%copr_frontend_flavor_guard %flavor_guard %%copr_frontend_flavor_filelist %flavor_files_list %%copr_frontend_flavor_generator %flavor_generator %%copr_frontend_staticdir %staticdir @@ -368,7 +371,7 @@ service logstash condrestart %exclude_files devel -%files flavor +%files fedora %license LICENSE %flavor_files