Page MenuHomePhabricator

Legal links visible in all pages
Closed, ResolvedPublic

Description

"I'm not a lawyer" (tm), but it is quite a requirement for websites with registered users contributing content to have some links/info like Terms, Privacy, license of the content... Usually these links are visible in all pages, and usually they are located in the footer. However, Phabricator has no footer. It doesn't have a persistent navigation column either. Only the top bar stays always across all apps.

The Wikimedia Legal team is defining some requirements and their implementation is not evident. Namely:

  • license of the content submitted
  • terms of use
  • privacy policy

Then again, we probably are not the first Phabricator users running into this situation, or are we? Any advice or previous discussions to know about? Any improvements to be done in Phabricator?

Event Timeline

qgil raised the priority of this task from to Needs Triage.
qgil updated the task description. (Show Details)
qgil added projects: Legal, Wikimedia.
qgil moved this task from Backlog to Important on the Wikimedia board.
qgil added a subscriber: qgil.

You are the first install to run into this that we've heard from.

Putting stuff in the footer is technically challenging because of "application-like" pages like Workboards and Conpherence, which take over the whole window. We don't have space in these cases to add a footer. We could potentially add a footer on most pages, but this is probably somewhat involved and will interact with other elements (e.g., comment previews), so we'd kind of have to go page-by-page, selectively enabling footers and fixing pages where there's some complicated interaction.

Putting stuff in the header is easy and you can do it by dropping this into src/extensions/:

LegalMenuApplication.php
<?php

final class LegalMenuApplication extends PhabricatorApplication {

  public function getName() {
    return 'Legal Menu';
  }

  public function buildMainMenuItems(
    PhabricatorUser $user,
    PhabricatorController $controller = null) {

    $items = array();
    $items[] = id(new PHUIListItemView())
      ->setName(pht('Legal Stuff'))
      ->setIcon('info-sm')
      ->addClass('core-menu-item')
      ->setHref('http://example.com/legalinfo/')
      ->setAural(pht('Legal Stuff'))
      ->setOrder(200);

    return $items;
  }


}

Erp, jumped the gun on that, continued...

Downsides to the header approach are:

  • You can't choose an icon and there are only 4 available ("info", "plus", "settings", "logout"). The info icon is probably most reasonable, but some pages will have two icons (one linking to application help, one linking to legal stuff).
  • Generally, not obvious that it's a way to get to legal things (except on devices, where the item is labeled and more clear).

We have discussed "Terms of Use" before and plan to let you designate Legalpad documents as mandatory for new accounts (i.e., before you can use Phabricator you have to sign some set of documents). However, this doesn't solve licensing concerns from the perspective of public users wishing to reuse the content. If you don't care about that -- just about making sure that users have agreed to the documents before they create any content -- it might be the most straightforward approach.

It's also easy to add a Settings panel through an extension, but that would be a bit out of the way.

Finally, you can put custom stuff on the home page with a dashboard.

So, overall, stuff we can do in the upstream:

  • We can help you build a menu item or settings panel as an extension.
  • We can walk you through adding stuff to the homepage if you aren't sure how to do that.
  • I'm not sure if we're planning to change the header icons to use FontAwesome (@chad?). If we are, we might be able to fast-track that and that could let you pick a better icon for the menu, at least (although I don't think any of the icons exactly scream "legal information").
  • We can implement a "You must sign this to use Phabricator" flag in Legalpad, if the mandatory agreement for logged-in users is satisfactory.
  • We can evaluate adding a footer, but this is probably a long, involved process (@chad, not sure if you have thoughts on this).

I guess is a bit legal-ish, and maybe .

I wonder if we could allow a footer.html like we allowed welcome.html. Pages then on Phabricator could state whether they show a footer or not (like workboards). From browsing a few major sites, it doesn't seem like this information is on every last page, just most of them. I don't know that an icon in the header is sufficient.

footer.html was the first thing I looked for after feeling pretty pleased with welcome.html fwiw

We're going to remove welcome.html (T5315 / D9672) once dashboards are a little further along.

If you just want footer.html, you can dump it into PhabricatorStandardPageView like this:

diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php
index 6bfa86c..d0bab68 100644
--- a/src/view/page/PhabricatorStandardPageView.php
+++ b/src/view/page/PhabricatorStandardPageView.php
@@ -329,6 +329,23 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
       }
     }
 
+    $footer = null;
+    $request_path = $request->getPath();
+
+    // Enumerate all URIs where something breaks with a footer in this
+    // regexp.
+    $blacklist = '@^/(project/board/\d+/|conpherence/)@';
+
+    if (!preg_match($blacklist, $request_path)) {
+      $footer = phutil_safe_html(<<<EOHTML
+<hr />
+
+Put whatever <strong>arbitrary footer HTML</strong> you want here.
+
+EOHTML
+);
+    }
+
     return
       phutil_tag(
         'div',
@@ -345,6 +362,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
             parent::getBody(),
             phutil_tag('div', array('style' => 'clear: both;')),
           )),
+          $footer,
         ));
   }

Here's an example of it working fine:

Screen_Shot_2014-09-08_at_4.29.38_PM.png (622×1 px, 104 KB)

But here's an example of why this is a complicated mess that I don't want to touch:

Screen_Shot_2014-09-08_at_4.29.40_PM.png (622×1 px, 160 KB)

Probably slap a float: right; and it'd be fine except maybe conpherence, workboards.

In hindsight, welcome.html was a bad move and never saw significant use (at least on our installs). Once dashboards came out, we just installed a dashboard for every user and never went back.

In my opinion, if people need the equivalent to welcome.html they can just upgrade to dashboards now, rather than keeping the option around (i.e. land D9672 sooner rather than later to prevent more people using it). All of the views that appear on the old-style homepage are supported by query panels, so all of the old functionality + welcome.html is supported in dashboards as far as I can see.

footer.html + float: right; sounds like a good enough solution for Wikimedia and other public Phabricator instances. If there is a way not to display the footer where it doesn't look good (workboards etc), I believe that would be fine too. The main spots for these disclaimers are the big bunch of project, task, and diff pages.

From discussion on IRC, there's some legal stuff that we should probably comply with too so I'll just implement this in the upstream and we can ride out the long tail of weird special cases.

epriestley triaged this task as Normal priority.

Let us know if you hit weird cases with this.