From ddf55f2a5229f72a7bebb340451c0129a87d2495 Mon Sep 17 00:00:00 2001 From: Brandon Clayton <bclayton@usgs.gov> Date: Thu, 7 Dec 2023 16:20:06 -0700 Subject: [PATCH] add drupal and uswds template --- src/main/resources/swagger/index.css | 102 +------- src/main/resources/swagger/index.html | 326 ++++++++++++++++++++++++-- 2 files changed, 311 insertions(+), 117 deletions(-) diff --git a/src/main/resources/swagger/index.css b/src/main/resources/swagger/index.css index b514b9355..e4d2ac3c1 100644 --- a/src/main/resources/swagger/index.css +++ b/src/main/resources/swagger/index.css @@ -1,79 +1,14 @@ html, body { height: 100%; - overflow: hidden; } body { - color: #333; - font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif; margin: 0; - overflow: scroll; + font-family: Roboto, 'Helvetica Neue', sans-serif; } -#swagger-ui { - padding-top: 2em; - padding-bottom: 50px; -} - -.nshmp-template-header, -.nshmp-template-footer { - background-color: #3d5e80; - box-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); - height: 30px; - padding: 10px; - position: fixed; - width: 100vw; - z-index: 4; -} - -/* ---- Header ---- */ - -.nshmp-template-header { - top: 0; -} - -.nshmp-template-header .nshmp-template-header--logo { - height: 28px; - overflow: hidden; - -} - -.nshmp-template-header--logo .usgs-logo { - display: inline-block; - height: 100%; - position: relative; - -} - -.nshmp-template-header--logo .usgs-logo img { - border: none; - height: 140%; - max-width: 100%; -} - -/* ---- Footer ---- */ - -.nshmp-template-footer { - bottom: 0; - font-size: large; - text-align: center; -} - -.nshmp-template-footer a { - color: white; - cursor: pointer; - line-height: 30px; - padding: 0 1em; - text-decoration: none; -} - -.nshmp-template-footer a:visited { - color: white; -} - -/* ---- Disclaimer ---- */ - +/* Match Swagger UI wrapper */ .wrapper { box-sizing: border-box; margin: 0 auto; @@ -82,39 +17,22 @@ body { width: 100%; } -@media only screen and (max-width: 1000px) { - .alert { - line-height: 1.1 !important; - font-size: 10px !important; - } +.logo-header { + margin-right: 8px; } -.alert { - background-color: #fff3cd; - border-color: #ffecb5; - box-shadow: 0 3px 1px -2px #0003, 0 2px 2px #00000024, 0 1px 5px #0000001f; - line-height: 1.5; - margin: 1em 1em 0 1em; - overflow: hidden; - padding: 1.5em 2em; - position: relative; - top: 50px; +.logo-header img { + height: 50px; } -.alert:before { - content: '\0e002'; - font-family: 'Material Icons'; - font-size: 4.5em; - left: -.2em; - line-height: 1; - opacity: .075; - position: absolute; - top: -.2em; +.header-search button[type=submit] { + margin-top: 14px; } details { - cursor: pointer; + background-color: white; box-shadow: 0 3px 1px -2px #0003, 0 2px 2px #00000024, 0 1px 5px #0000001f; + cursor: pointer; } details:hover { diff --git a/src/main/resources/swagger/index.html b/src/main/resources/swagger/index.html index 168a70570..f513a90ba 100644 --- a/src/main/resources/swagger/index.html +++ b/src/main/resources/swagger/index.html @@ -8,57 +8,333 @@ type="image/x-icon" href="favicon.ico" /> - <script src="https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"></script> - <script src="https://unpkg.com/swagger-ui-dist/swagger-ui-standalone-preset.js"></script> <link rel="stylesheet" type="text/css" - href="https://unpkg.com/swagger-ui-dist/swagger-ui.css" + href="drupal/stylesheets/common.css" + /> + <link + rel="stylesheet" + type="text/css" + href="drupal/stylesheets/custom.css" + /> + <link + rel="stylesheet" + type="text/css" + href="uswds/css/uswds.min.css" /> <link rel="stylesheet" type="text/css" href="index.css" /> + <script src="uswds/js/uswds-init.min.js"></script> + <script src="https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"></script> + <script src="https://unpkg.com/swagger-ui-dist/swagger-ui-standalone-preset.js"></script> + <link + rel="stylesheet" + type="text/css" + href="https://unpkg.com/swagger-ui-dist/swagger-ui.css" + /> <link rel="stylesheet" - href="https://fonts.googleapis.com/icon?family=Material+Icons%7cMerriweather:400,400italic,700%7cSource+Sans+Pro:400,300,700" + href=" + https://fonts.googleapis.com/icon?family=Material+Icons%7cMerriweather: + 400,400italic,700%7cSource+Sans+Pro:400,300,700 + " /> + + <!-- Google Tag Manager --> + <script> + ( + function(w, d, s, l, i) { + w[l] = w[l] || []; + + w[l].push({ + 'gtm.start': new Date().getTime(), + event: 'gtm.js' + }); + + var f = d.getElementsByTagName(s)[0], + j = d.createElement(s), + dl = l != 'dataLayer' ? '&l='+l : ''; + + j.async=true; + + j.src= + 'https://www.googletagmanager.com/gtm.js?id='+i+dl; + + f.parentNode.insertBefore(j,f); + } + )(window,document,'script','dataLayer','GTM-TKQR8KP'); + </script> + <!-- End Google Tag Manager --> </head> <body> - <header class="nshmp-template-header"> - <div class="nshmp-template-header--logo"> - <a href="" class="usgs-logo"> - <img alt="USGS" src="usgs-logo.svg" /> - </a> + <script src="uswds/js/uswds.min.js"></script> + + <!-- Google Tag Manager (noscript) --> + <noscript> + <iframe + sandbox + src="https://www.googletagmanager.com/ns.html?id=GTM-TKQR8KP" + height="0" + width="0" + style="display:none;visibility:hidden" + ></iframe> + </noscript> + <!-- End Google Tag Manager (noscript) --> + + <!-- Gov banner --> + <!-- https://designsystem.digital.gov/components/banner/ --> + <section + class="usa-banner" + aria-label="Official website of the United States government" + > + <div class="usa-accordion"> + <header class="usa-banner__header"> + <div class="usa-banner__inner"> + <div class="grid-col-auto"> + <img + aria-hidden="true" + class="usa-banner__header-flag" + src="uswds/img/us_flag_small.png" + alt="" + /> + </div> + <div class="grid-col-fill tablet:grid-col-auto" aria-hidden="true"> + <p class="usa-banner__header-text"> + An official website of the United States government + </p> + <p class="usa-banner__header-action">Here’s how you know</p> + </div> + <button + type="button" + class="usa-accordion__button usa-banner__button" + aria-expanded="false" + aria-controls="gov-banner-default-default" + > + <span class="usa-banner__button-text">Here’s how you know</span> + </button> + </div> + </header> + + <div + class="usa-banner__content usa-accordion__content" + id="gov-banner-default-default" + > + <div class="grid-row grid-gap-lg"> + <div class="usa-banner__guidance tablet:grid-col-6"> + <img + class="usa-banner__icon usa-media-block__img" + src="uswds/img/icon-dot-gov.svg" + role="img" + alt="" + aria-hidden="true" + /> + <div class="usa-media-block__body"> + <p> + <strong>Official websites use .gov</strong><br/> + A <strong>.gov</strong> website belongs to an official government + organization in the United States. + </p> + </div> + </div> + + <div class="usa-banner__guidance tablet:grid-col-6"> + <img + class="usa-banner__icon usa-media-block__img" + src="uswds/img/icon-https.svg" + role="img" + alt="" + aria-hidden="true" + /> + <div class="usa-media-block__body"> + <p> + <strong>Secure .gov websites use HTTPS</strong><br /> + A<strong>lock</strong> ( + <span class="icon-lock"> + <svg + xmlns="http://www.w3.org/2000/svg" + width="52" + height="64" + viewBox="0 0 52 64" + class="usa-banner__lock-image" + role="img" + aria-labelledby="banner-lock-description-default" + focusable="false" + > + <title id="banner-lock-title-default">Lock</title> + <desc id="banner-lock-description-default"> + Locked padlock icon + </desc> + <path + fill="#000000" + fill-rule="evenodd" + d=" + M26 0c10.493 0 19 8.507 19 19v9h3a4 4 0 0 1 4 4v28a4 + 4 0 0 1-4 4H4a4 4 0 0 1-4-4V32a4 4 0 0 1 4-4h3v-9C7 + 8.507 15.507 0 26 0zm0 8c-5.979 0-10.843 4.77-10.996 + 10.712L15 19v9h22v-9c0-6.075-4.925-11-11-11z + " + /> + </svg> + </span> + ) or <strong>https://</strong> means you’ve safely connected to + the .gov website. Share sensitive information only on official, + secure websites. + </p> + </div> + </div> + </div> + </div> + </div> + </section> + <!-- End Gov banner--> + + <!-- Header --> + <header id="navbar" class="header-nav" role="banner"> + <div class="tmp-container"> + <div class="header-search"> + <a class="logo-header" href="https://earthquake.usgs.gov/nshmp/" title="Home"> + <img class="img" src="drupal/images/logo.png" alt="Home" /> + </a> + </div> </div> </header> + <!-- End header --> + <!-- Software alert --> <div class="wrapper"> - <div class="alert" role="alert"> - This software is preliminary or provisional and is subject to revision. - It is being provided to meet the need for timely best science. - The software has not received final approval by the U.S. Geological Survey (USGS). - No warranty, expressed or implied, is made by the USGS or the U.S. Government as to - the functionality of the software and related material nor shall the fact of release - constitute any such warranty. The software is provided on the condition that neither - the USGS nor the U.S. Government shall be held liable for any damages resulting from - the authorized or unauthorized use of the software. + <div class="usa-alert usa-alert--warning margin-top-2"> + <div class="usa-alert__body"> + This software is preliminary or provisional and is subject to revision. + It is being provided to meet the need for timely best science. + The software has not received final approval by the U.S. Geological Survey (USGS). + No warranty, expressed or implied, is made by the USGS or the U.S. Government as to + the functionality of the software and related material nor shall the fact of release + constitute any such warranty. The software is provided on the condition that neither + the USGS nor the U.S. Government shall be held liable for any damages resulting from + the authorized or unauthorized use of the software. + </div> </div> </div> + <!-- End software alert --> + <!-- Swagger components --> <div id="swagger-ui"></div> - <footer class="nshmp-template-footer"> - <a href="https://code.usgs.gov/ghsc/nshmp/nshmp-ws-static/-/blob/main/LICENSE.md"> - License - </a> + <!-- BEGIN USGS Footer Template --> + <footer class="footer"> + <div class="tmp-container"> + <!-- .footer-doi --> + <div class="footer-doi"> + <!-- footer nav links --> + <ul class="menu nav"> + <li class="first leaf menu-links menu-level-1"> + <a href="https://www.doi.gov/privacy">DOI Privacy Policy</a> + </li> + + <li class="leaf menu-links menu-level-1"> + <a href="https://www.usgs.gov/policies-and-notices">Legal</a> + </li> + + <li class="leaf menu-links menu-level-1"> + <a href="https://www.usgs.gov/accessibility-and-us-geological-survey"> + Accessibility + </a> + </li> + + <li class="leaf menu-links menu-level-1"> + <a href="https://www.usgs.gov/sitemap">Site Map</a> + </li> + + <li class="last leaf menu-links menu-level-1"> + <a href="https://answers.usgs.gov/">Contact USGS</a> + </li> + </ul> + <!--/ footer nav links --> + </div> + <!-- /.footer-doi --> + + <hr> + + <!-- .footer-utl-links --> + <div class="footer-doi"> + <ul class="menu nav"> + <li class="first leaf menu-links menu-level-1"> + <a href="https://www.doi.gov/">U.S. Department of the Interior</a> + </li> - <a href="https://code.usgs.gov/ghsc/nshmp/nshmp-ws-static/-/blob/main/DISCLAIMER.md"> - Disclaimer - </a> + <li class="leaf menu-links menu-level-1"> + <a href="https://www.doioig.gov/">DOI Inspector General</a> + </li> + + <li class="leaf menu-links menu-level-1"> + <a href="https://www.whitehouse.gov/">White House</a> + </li> + + <li class="leaf menu-links menu-level-1"> + <a href="https://www.whitehouse.gov/omb/management/egov/">E-gov</a> + </li> + + <li class="leaf menu-links menu-level-1"> + <a href="https://www.doi.gov/pmb/eeo/no-fear-act">No Fear Act</a> + </li> + + <li class="last leaf menu-links menu-level-1"> + <a href="https://www.usgs.gov/about/organization/science-support/foia">FOIA</a> + </li> + </ul> + </div> + <!-- /.footer-utl-links --> + + <!-- .footer-social-links --> + <div class="footer-social-links"> + <ul class="social"> + <li class="follow">Follow</li> + <li class="twitter"> + <a href="https://twitter.com/usgs" target="_blank"> + <i class="fa fa-twitter-square"><span class="only">Twitter</span></i> + </a> + </li> + + <li class="facebook"> + <a href="https://facebook.com/usgeologicalsurvey" target="_blank"> + <i class="fa fa-facebook-square"><span class="only">Facebook</span></i> + </a> + </li> + + <li class="github"> + <a href="https://github.com/usgs" target="_blank"> + <i class="fa fa-github"><span class="only">GitHub</span></i> + </a> + </li> + + <li class="flickr"> + <a href="https://flickr.com/usgeologicalsurvey" target="_blank"> + <i class="fa fa-flickr"><span class="only">Flickr</span></i> + </a> + </li> + + <li class="youtube"> + <a href="http://youtube.com/usgs" target="_blank"> + <i class="fa fa-youtube-play"><span class="only">YouTube</span></i> + </a> + </li> + + <li class="instagram"> + <a href="https://instagram.com/usgs" target="_blank"> + <i class="fa fa-instagram"><span class="only">Instagram</span></i> + </a> + </li> + </ul> + </div> + <!-- /.footer-social-links --> + </div> </footer> + <!-- END USGS Footer Template- --> <script src="index.js"></script> </body> -- GitLab