* Allow omitting the product number if there is only one product in a

[?]
Apr 8, 2009, 9:37 AM
MAOFG2TDQZUK62BT7W3JYAIOSEAKDZJOYAMLGXBJAUHABJHQQMHQC

Dependencies

  • [2] H3DLVNCJ * Support redirecting to some job of a release. For instance, this
  • [3] SMM4HQTP * Put actions related to builds under /build (e.g. /log/<buildid>
  • [4] 5NO7NCKT * Refactoring.
  • [5] JFZNAYJX * Showing releases.
  • [6] D3DIBMOK * For products that are directories (like manuals), allow a default
  • [7] XJFHFZCA * Provide some redirects to build products by type so that we can for
  • [8] LBNVQXUB * Build the /build stuff in a separate controller.

Change contents

  • edit in src/lib/Hydra/Controller/Build.pm at line 104
    [3.44]
    [3.2398]
    $productnr = 1 if !defined $productnr;
  • replacement in src/lib/Hydra/Controller/Build.pm at line 108
    [3.2485][3.1093:1176]()
    notFound($c, "Build doesn't have a product $productnr.") if !defined $product;
    [3.2485]
    [3.2572]
    notFound($c, "Build doesn't have a product #$productnr.") if !defined $product;
  • edit in src/root/product-list.tt at line 5
    [3.3131]
    [3.3131]
    [% # Work around a strange bug: build.buildproducts.size returns 3 when the actual size is 1.
    nrProducts = 0; FOREACH product IN build.buildproducts; nrProducts = nrProducts + 1; END
    %]
  • replacement in src/root/product-list.tt at line 115
    [3.5285][2.1138:1252](),[2.1252][3.1810:1894](),[3.1810][3.1810:1894](),[3.1894][2.1253:1348](),[2.1348][3.2036:2097](),[3.2036][3.2036:2097]()
    [% uri2 = "${c.uri_for(latestRoot.join('/') 'download-by-type' product.type product.subtype)}" %]
    <a href="[% uri2 %]"><tt>[% uri2 %]</tt></a>
    <br />
    [% uri2 = "${c.uri_for(latestRoot.join('/') 'download' product.productnr)}" %]
    <a href="[% uri2 %]"><tt>[% uri2 %]</tt></a>
    [3.5285]
    [3.5498]
    [% IF nrProducts > 1 %]
    [% uri2 = "${c.uri_for(latestRoot.join('/') 'download-by-type' product.type product.subtype)}" %]
    <a href="[% uri2 %]"><tt>[% uri2 %]</tt></a>
    <br />
    [% uri2 = "${c.uri_for(latestRoot.join('/') 'download' product.productnr)}" %]
    <a href="[% uri2 %]"><tt>[% uri2 %]</tt></a>
    [% ELSE %]
    [% uri2 = "${c.uri_for(latestRoot.join('/') 'download')}" %]
    <a href="[% uri2 %]"><tt>[% uri2 %]</tt></a>
    [% END %]