#13 flavored version (with templates)
Merged 7 years ago by clime. Opened 7 years ago by praiskup.
Unknown source flavored-approach  into  master

file modified
+33 -27
@@ -9,18 +9,21 @@

  %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_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

+ %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 +89,8 @@

  Requires:   python-marshmallow >= 2.0.0

  Requires:   python2-modulemd

  Requires:   python-pygments

- Requires:   %{name}-design = %{version}

+ 

+ Requires:   %flavor_guard

  

  # for tests:

  Requires:   pytest
@@ -216,14 +220,15 @@

  only.

  

  

- %package design

+ %package fedora

  Summary: Template files for %{name}

  Requires: %{name} = %{version}

+ Provides: %flavor_guard

  

- %description design

+ %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}-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 +237,7 @@

  

  %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 +286,9 @@

  

  ln -fs /usr/share/copr/coprs_frontend/manage.py %{buildroot}/%{_bindir}/copr-frontend

  

- mkdir -p %buildroot/$(dirname %design_files)

- cat <<EOF > %buildroot%design_files_list

- %design_files

+ mkdir -p %buildroot/$(dirname %flavor_files_list)

+ cat <<EOF > %buildroot%flavor_files_list

+ %flavor_files

  EOF

  

  %check
@@ -299,11 +304,12 @@

  

  mkdir -p %buildroot%macrosdir

  cat <<EOF >%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_guard      %flavor_guard

+ %%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 +367,18 @@

  %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 fedora

  %license LICENSE

- %design_files

+ %flavor_files

  

  

  %files devel

  %license LICENSE

- %design_files_list

+ %flavor_files_list

  %devel_files

  %macrosdir/*

  

@@ -1,1 +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

@@ -115,23 +115,14 @@

              <div class="row">

                <div class="col-sm-4">

                  <dl>

-                   <dt><h3>Copr Project</h3></dt>

-                   <dd>

-                     <ul class="list-unstyled">

-                       <li><a href="https://fedorahosted.org/copr/">Project Homepage</a></li>

-                       <li><a href="https://fedorahosted.org/copr/wiki/UserDocs">User Documentation</a></li>

-                       <li><a href="https://bugzilla.redhat.com/enter_bug.cgi?product=Copr">Report a Bug</a></li>

-                       <li><a href="https://bugzilla.redhat.com/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=MODIFIED&bug_status=ON_QA&classification=Community&list_id=6150623&product=Copr&query_format=advanced">Known Issues</a></li>

-                       <li><a href="https://fedorahosted.org/copr/wiki/UserDocs#FAQ">FAQ</a></li>

-                     </ul>

-                   </dd>

+                   {% include 'project_info.html' %}

                  </dl>

                </div>

                <div class="col-sm-4">

                  <dl>

                    <dt><h3>Site Navigation</h3></dt>

                    <dd>

-                     <ul class="list-unstyled">

+                     <ul>

                        <li> <a href="{{ url_for('coprs_ns.coprs_show') }}">Home</a> </li>

                        <li> <a href="{{url_for('status_ns.importing')}}">Task Queue</a> </li>

                        <li> <a href="{{ url_for('api_ns.api_home') }}">API</a> </li>
@@ -143,7 +134,7 @@

                  <dl>

                    <dt><h3>Powered by</h3></dt>

                    <dd>

-                     <ul class="list-unstyled">

+                     <ul>

                        <li><a href="https://www.python.org">Python</a></li>

                        <li><a href="http://www.openstack.org">OpenStack</a></li>

                        <li><a href="https://www.patternfly.org">PatternFly</a></li>

@@ -0,0 +1,10 @@

+ <dt><h3>Copr Project</h3></dt>

+ <dd>

+   <ul>

+     <li><a href="https://fedorahosted.org/copr/">Project Homepage</a></li>

+     <li><a href="https://fedorahosted.org/copr/wiki/UserDocs">User Documentation</a></li>

+     <li><a href="https://bugzilla.redhat.com/enter_bug.cgi?product=Copr">Report a Bug</a></li>

+     <li><a href="https://bugzilla.redhat.com/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=MODIFIED&bug_status=ON_QA&classification=Community&list_id=6150623&product=Copr&query_format=advanced">Known Issues</a></li>

+     <li><a href="https://fedorahosted.org/copr/wiki/UserDocs#FAQ">FAQ</a></li>

+   </ul>

+ </dd>

@@ -55,6 +55,11 @@

  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 ()

After discussion in https://pagure.io/copr/copr/pull-request/9
renaming the subpackage '-design' into '-flavor', because
templates are not about "design" anymore.

You were very quick with renaming. Actually I think the name should be copr-frontend-<flavor> where <flavor> is "fedora" or "redhat" or other.

I think, copr-frontend-flavor is actually a possible name for current copr-frontend-devel but I will need to look at it again on Monday.

You were very quick with renaming.

Yup, there's a lot of work to do .. and it is not easily possible to paralelize the pull-request efforts.,.

Actually I think the name should be copr-frontend-<flavor> where <flavor> is "fedora" or "redhat" or other.

Technically, copr-frontend needs to require copr-frontend-flavor anyway -> and both *-redhat and *-fedora would have to have explicit provides. I have to give a dnf try -- because I'm not sure the dependency solving with dnf's 'priority' option will work correctly (you never know ...). I'll update the pull request, hopefully that will be fine ;) otherwise please give more precise hints.

1 new commit added

  • [frontend] renamd '-flavor' to '-fedora'
7 years ago

Seems to work fine, and looks nicer :) does that sound like acceptable approach?

Seems to work fine, and looks nicer :) does that sound like acceptable approach?

Yes, I think it's quite fine.

But could you put the login-related changes into a separate pull request. These should not be part of this PR based on the title and I would like to review them again separately.

rebased

7 years ago

Rebased, the middle patch will be moved to separate PR once this is merged (because of prerequisites).

2 new commits added

  • [frontend] renamed '-flavor' to '-fedora'
  • [frontend] move footer "project info" into separate template
7 years ago

Pull-Request has been merged by clime

7 years ago