Select to view content in your preferred language

Disclaimer Acceptance on Open Data Site

2410
9
06-11-2019 04:27 PM
KirstenFrost_Andersen
Regular Contributor

Has anyone implemented some kind of display, perhaps a pop-up, on their Open Data site that requires the user to read a disclaimer and Accept it before accessing the rest of the site?  Maybe it would cache a cookie that tracks that acceptance but displays the pop-up on any page of their organization's site if the cookie doesn't exist?  If so, can you provide some guidance on how to implement this?  Our organization's management is implying we have to shut down access to our data until something like this is implemented.  Thanks for any insight!

0 Kudos
9 Replies
NFlourish
Frequent Contributor

Here is a solution - sort of.

No cookies. No tracking. But you can't use the page until you click to close disclaimer.

This is a custom header. The custom header has a fixed position panel of the entire screen that is a Bootstrap collapsible item... and a button inside this collapsible panel will close it. Because it is fixed, and in front of all other content, you can't use the site without closing it.

<div class="collapse in" id="collapseBackground" style="
 position: fixed;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 background-color: rgba(0,0,0,0.5);
 z-index: 999;">
 <div style="
 position: relative;
 margin-left: auto;
 margin-right: auto;
 top: 276px;
 width: 50%;">
 <div class="well" style="box-shadow: 0 0 10px black;">
 <div style="
 font-size: 18pt; 
 font-weight: bold; 
 background-color: #999; 
 margin-bottom: 5px;">
 DISCLAIMER
 </div>
 <div style="font-size: 14pt; margin-bottom: 15px;">
 Information presented here are for demonstration purposes only
 and not for research or any other purposes. No part of these 
 pages, either texts or images may be used for any purpose, 
 other than to demonstrate this product/proof of concept.
 </div>
 <button class="btn btn-primary active" type="button" data-toggle="collapse" data-target="#collapseBackground">
 Close Disclaimer
 </button>
 </div>
 </div>
</div>
<nav class="navbar navbar-inverse navbar-static-top second-tier" 
 role="navigation">
 <div class="container">
 <div class="navbar">
 <img style="
 height: 100px;
 vertical-align: bottom;
 float: left;"
 src="https://stone-env.maps.arcgis.com/sharing/rest/content/items/3abd22ee1b484eb49f9db03a8a5c57d9/data"/>
 <div style="
 height: 26px;
 float: left;
 margin-left: 170px;
 position: absolute;
 font-size: 20pt;
 font-weight: bold;
 font-family: 'Avenir Next', Avenir Next;">
 Green Mountain Care Board: Health Resource Allocation Planning Tool
 </div>
 <ul style="margin-top: 26px;" class="nav navbar-nav"> 
 <li class="active">
 <a href="#top">
 [Top] &gt;&gt;
 </a>
 </li>
 <li>
 <a href="#incidence">
 [Incidence] &gt;&gt;
 </a>
 </li>
 <li>
 <a href="#factors">
 [Factors] &gt;&gt;
 </a>
 </li>
 <li>
 <a href="#prevention">
 [Prevention] &gt;&gt;
 </a>
 </li>
 <li>
 <a href="#gaps">
 [Gaps] &gt;&gt;
 </a>
 </li>
 <li>
 <a href="#trends">
 [Trends] &gt;&gt;
 </a>
 </li>
 <li>
 <a href="#finance">
 [Finance]
 </a>
 </li>
 </ul>
 </div>
 </div>
</nav>
0 Kudos
by Anonymous User
Not applicable

Hello! I am using this code for a disclaimer on a hub site I'm working on. I added the code to a text box card that I inserted at the top of the hub site. There is no text in the text box, just the code for the disclaimer in the html of the text box.

I'm running into the issue of not being about to edit other parts of the hubs site when I include this code. Each time I click on a different part of the site to edit, the disclaimer portion pops up, I close it, and then it scrolls me back to the top, making it so I cannot edit any other part of the site. Is there a solution to this?

0 Kudos
NFlourish
Frequent Contributor

HI @Anonymous User - Sadly this is just sort of the way it is. My suggestion is to keep the code for your disclaimer in a separate file. Remove it from your site when you need to edit your site, then paste it back in. Lame, but until Hub folks give us a better option, that's just the limitation of this particular solution.

0 Kudos
gisgeeknorth
Emerging Contributor

Hi @NFlourish - I'm trying to implement the solution above... it works, but the challenge is the disclaimer is appearing every time you return to the page.  Is there a way to suppress this once the site has been loaded?

0 Kudos
NFlourish
Frequent Contributor

Hi @gisgeeknorth - I do not believe there is a way to do this. Hub strips out any javascript you would use to create or update persisted settings such as with cookies. So the only way that I made the disclaimer work was by using pure CSS, which does not get stripped out. But CSS has no way that I know of to persist knowledge of whether a user has clicked on it or not. This is why the Hub team needs to create a disclaimer option for the product 🙂

0 Kudos
gisgeeknorth
Emerging Contributor

Hi Nick.  Well, there's no simple way to do this, but I did figure out a hack that works.  I took advantage of the new "visibility" property of the rows in hub.  I put a "Sign in" text button (card) with some CSS. 

In the text card that has the “Sign In” button, the HTML includes the disclaimer, and looks like this…

<div class="collapse in" id="collapseBackground" style="position: fixed;  left: 0;  right: 0;  top: 0;  bottom: 0;  background-color: rgba(0,0,0,0.5);  z-index: 999;">
<div style="position: relative;  margin-left: auto;  margin-right: auto;  top: 276px;  width: 50%;">
   <div class="well" style="box-shadow: 0 0 10px black;">
     <div style="font-size: 18pt;   font-weight: bold;   background-color: #999;   margin-bottom: 5px;">
       DISCLAIMER
     </div>
     <div style="font-size: 14pt; margin-bottom: 15px;">
      By Using this GeoHub, and the online content and tools provided, you agree to the Terms and Conditions of use found <a href="https://geohub-chima.hub.arcgis.com/pages/terms-and-conditions">here</a>.
     </div>
     <button class="btn btn-primary active" data-toggle="collapse" data-target="#collapseBackground">
      I Agree
     </button>
    </div>
  </div>
</div>
<div id="signinbutton">
  <div class="col-xs-12">
    <div class="calcite-web">
      <div class="card-base card-wide">
        <div class="card-content">
          <h4 style="text-align: center;">
            <a href="https://www.arcgis.com/sharing/rest/oauth2/authorize?client_id=TxCNMHEw2F5IGP2x&amp;response_type=to...">Sign In</a>
          </h4>
        </div>
      </div>
    </div>
  </div>
</div>

Notice the two “id” tags. They’re key. I also put a CSS tag on the row that has the sign in button.

Next, in the text card that starts with “Welcome Back!” (on the row) The HTML looks like this.

<div class="mt-6 mb-6" style="text-align: center;">
  <h1>Welcome Back!</h1>
  <p>What would you like to do?</p>
  <p>
    <a href="https://chima-geohub.maps.arcgis.com/home/content.html" class="btn btn-lg btn-primary" target="_blank">Go to my GIS Content</a>
    <a href="https://geohub-chima.hub.arcgis.com/pages/tutorials" class="btn btn-lg btn-primary">Launch The Tutorials</a>
    <a href="https://geohub-chima.hub.arcgis.com/pages/recordings" class="btn btn-lg btn-primary">Watch The Recordings</a>
  </p>
  <p><a href="https://chima-geohub.maps.arcgis.com/sharing/rest/oauth2/signout?redirect_uri=https%3A%2F%2Fgeohub-c...">Sign Out</a></p>
</div>
<style>
  .signinrow .markdown-card [id='signinbutton']  {visibility: hidden;}
  .signinrow .markdown-card [id='collapseBackground']  {visibility: hidden;}
</style>



The trick is the <style>. Basically, when the “Welcome Back” text card is visible, the CSS makes both the Disclaimer and the Sign In button item “hidden”. Now, since the row that the “Welcome Back” text card is on is only visible when the user is signed in… voila! When you’re signed in, no disclaimer, no button.

As I said, a hack, but it works.

Thanks for your suggestion!

 

0 Kudos
MilesGabriel
New Contributor

What would the disclaimer have to say?

I suspect Open Data purists would state that having to accept a disclaimer to access your data negates it being truly open.  I remember a lady presenting her excellent Open Data portal at an EU INSPIRE Directive conference some years ago.  She had a similar disclaimer and was heavily criticised by some in the audience, depsite having created an excellent site with lots of freely available data. 

Might just be worth raising that perspective to your management team as it's not normal practice for an Open Data site. 

0 Kudos
NFlourish
Frequent Contributor

I think that if what it takes for your municipality or whatever to share data is to have a disclaimer... then having a disclaimer and sharing is better than not sharing at all. 

But it more importantly... Hub is not used only for OpenData purposes. It may be built on top of OpenData but Hub is fundamentally a CMS for ArcGIS. So people may be using it for all sorts of thins that are not public or open like OpenData is intended to be. 

MilesGabriel
New Contributor

Agreed Nicholas Floersch

0 Kudos