From b606fea4063625cbcf1a73ee0d7c04c2937dfdbd Mon Sep 17 00:00:00 2001
From: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date: Thu, 13 Nov 2014 16:46:59 +0100
Subject: [PATCH 3/5] Move all idp templates to authentic2 templates (refs
 #5925)

---
 .../idp/templates/idp/account_management.html      |   43 ----------------
 authentic2/idp/templates/idp/homepage.html         |   53 --------------------
 authentic2/idp/templates/idp/logout.html           |   41 ---------------
 .../templates/interaction/consent_attributes.html  |   39 --------------
 .../templates/interaction/consent_federation.html  |   28 -----------
 authentic2/templates/idp/account_management.html   |   43 ++++++++++++++++
 authentic2/templates/idp/homepage.html             |   53 ++++++++++++++++++++
 authentic2/templates/idp/logout.html               |   41 +++++++++++++++
 .../templates/interaction/consent_attributes.html  |   39 ++++++++++++++
 .../templates/interaction/consent_federation.html  |   28 +++++++++++
 10 files changed, 204 insertions(+), 204 deletions(-)
 delete mode 100644 authentic2/idp/templates/idp/account_management.html
 delete mode 100644 authentic2/idp/templates/idp/homepage.html
 delete mode 100644 authentic2/idp/templates/idp/logout.html
 delete mode 100644 authentic2/idp/templates/interaction/consent_attributes.html
 delete mode 100644 authentic2/idp/templates/interaction/consent_federation.html
 create mode 100644 authentic2/templates/idp/account_management.html
 create mode 100644 authentic2/templates/idp/homepage.html
 create mode 100644 authentic2/templates/idp/logout.html
 create mode 100644 authentic2/templates/interaction/consent_attributes.html
 create mode 100644 authentic2/templates/interaction/consent_federation.html

diff --git a/authentic2/idp/templates/idp/account_management.html b/authentic2/idp/templates/idp/account_management.html
deleted file mode 100644
index 6369a32..0000000
--- a/authentic2/idp/templates/idp/account_management.html
+++ /dev/null
@@ -1,43 +0,0 @@
-{% extends "base.html" %}
-{% load i18n %}
-
-{% block title %}
-{% trans "Authentic - Account Management" %}
-{% endblock %}
-
-
-{% block content %}
-<h2>{% trans "Account Management" %}</h2>
-<h3>{% trans "Profile" %}</h3>
-<div id="profile">
-{% if profile %}
-<dl>
-{% for key, values in profile %}
-<dt>{{ key|capfirst }}</dt>
-<dd>{% if values|length == 1 %}{{ values.0 }}{% else %}
-<ul>
-  {% for value in values %}
-    <li>{{ value }}</li>
-  {% endfor %}
-</ul>
-{% endif %}
-</dd>
-{% endfor %}
-</dl>
-{% endif %}
-{% if allow_email_change %}
-<p><a href="{% url 'email-change' %}">{% trans "Change email" %}</a></p>
-{% endif %}
-{% if allow_profile_edit %}
-<p><a href="{% url 'profile_edit' %}">{% trans "Edit profile" %}</a></p>
-{% endif %}
-{% if allow_account_deletion %}
-<p><a href="{% url 'delete_account' %}">{% trans "Delete profile" %}</a></p>
-{% endif %}
-</div>
-<h3>{% trans "Credentials" %}</h3>
-  {% for html_block in frontends_block %}
-    {{ html_block|safe }}
-  {% endfor %}
-<p><a href="/">{% trans "Back" %}</a></p>
-{% endblock %}
diff --git a/authentic2/idp/templates/idp/homepage.html b/authentic2/idp/templates/idp/homepage.html
deleted file mode 100644
index 9973c95..0000000
--- a/authentic2/idp/templates/idp/homepage.html
+++ /dev/null
@@ -1,53 +0,0 @@
-{% extends "base.html" %}
-{% load i18n %}
-
-{% block title %}
-{% trans "Authentic" %}
-{% endblock %}
-
-
-{% block content %}
-
-{% if account_management %}
-<p>
-  <a href="{% url 'account_management' %}">{% trans "Account Management" %}</a>
-</p>
-{% endif %}
-
-
-{% if authorized_services %}
-  <div id="login-actions">
-  <h2>{% trans "Services" %}</h2>
-  <ul>
-    {% for service in authorized_services %}
-    {% if service.actions %}
-    <li>{% if service.url %}<a href="{{ service.url }}">{% endif %}{{ service.name }}{% if service.url %}</a>{% endif %}
-    <div class="actions">
-    {% for action in service.actions %}
-      {% if action.0 == "template" %}
-      {% include action.1 %}
-      {% else %}
-      <form action="{{ action.2 }}" method="{{ action.1 }}">
-        {% if action.3 %}
-        {% for key, value in action.3 %}
-          <input type="hidden" name="{{ key }}" value="{{ value }}" />
-        {% endfor %}
-        {% endif %}
-        <input type="hidden" name="next" value="/"/>
-        <input type="submit" class="submit-link" value="{{ action.0 }}">
-      </form>
-      {% endif %}
-    {% endfor %}
-    </div>
-    </li>
-    {% endif %}
-  {% endfor %}
-  </ul>
-  </div>
-{% endif %}
-
-{% if user.is_staff %}
-<p id="administration-link"><a href="/admin">{% trans "Administration" %}</a></p>
-{% endif %}
-
-{% endblock %}
diff --git a/authentic2/idp/templates/idp/logout.html b/authentic2/idp/templates/idp/logout.html
deleted file mode 100644
index 7707615..0000000
--- a/authentic2/idp/templates/idp/logout.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{% extends "base.html" %}
-{% load i18n %}
-
-{% block title %}
-{% trans "Logout" %}
-{% endblock %}
-{% block bodyargs %}
-onload="window.iframe_count -= 1"
-{% endblock %}
-
-{% comment %}Initialize iframe coutndown {% endcomment %}
-{% block extra_scripts %}
-<script>
-  window.iframe_count = 1;
-</script>
-{% endblock %}
-
-{% block content %}
-<h1>{% trans message %}</h1>
-<ul class="logout-list">
-    {% for fragment in logout_list %}
-        {{ fragment|safe }}
-    {% endfor %}
-</ul>
-<!-- Hack alert !!! block loading indefinitely by loading an inacessible IP -->
-<script>
-  window.iframe_count += document.getElementsByTagName("iframe").length;
-  var refresh_launched = 0;
-  setInterval(function () {
-    if (iframe_count == 0) {
-      if (refresh_launched == 0) {
-        refresh_launched = 1;
-        setTimeout(function () { window.location = '{{ next_page }}' }, 300);
-      }
-    }
-  }, {{ redir_timeout }})
-</script>
-
-<div id="continue-link"><a href="{{ next_page }}">{% trans "Continue logout" %}</div>
-
-{% endblock %}
diff --git a/authentic2/idp/templates/interaction/consent_attributes.html b/authentic2/idp/templates/interaction/consent_attributes.html
deleted file mode 100644
index 4a47942..0000000
--- a/authentic2/idp/templates/interaction/consent_attributes.html
+++ /dev/null
@@ -1,39 +0,0 @@
-{% extends "base.html" %}
-{% load i18n %}
-
-{% block title %} {% trans "Consent page for attribute propagation" %} {% endblock %}
-
-{% block content %}
-
-
-{% load i18n %}
-<div id="consent">
-<form method="post" action="">
-  {% csrf_token %}
-<p>
-{% trans "Choose attributes to send to " %} <strong>{{ provider_id }}</strong> ?
-
-<ul>
-{% for i, name, values in attributes %}
-<li>
-{% if allow_selection %}
-<input type="checkbox" name="attribute_nb_{{ i }}" value="{{ i }}" checked="checked"/>
-{% endif %}
-{{ name }} : <strong>{% for v in values %}{{ v }} {% endfor %}</strong></li>
-{% endfor %}
-</ul>
-
-</p>
-
-<input type="hidden" name="next" value="{{ next }}" />
-<input type="hidden" name="nonce" value="{{ nonce }}" />
-{% if allow_selection %}
-<input type="submit" name="accept" value="{% trans 'Send selected' %}"/>
-{% else %}
-<input type="submit" name="accept" value="{% trans 'Send all' %}"/>
-{% endif %}
-<input type="submit" name="refuse" value="{% trans 'Refuse all' %}"/>
-</form>
-</div>
-
-{% endblock %}
diff --git a/authentic2/idp/templates/interaction/consent_federation.html b/authentic2/idp/templates/interaction/consent_federation.html
deleted file mode 100644
index c75d011..0000000
--- a/authentic2/idp/templates/interaction/consent_federation.html
+++ /dev/null
@@ -1,28 +0,0 @@
-{% extends "base.html" %}
-{% load i18n %}
-
-{% block title %} {% trans "Consent page for federation" %} {% endblock %}
-
-{% block content %}
-
-
-{% load i18n %}
-<div id="consent">
-<p>
-{% if provider_id %}
-{% trans "Do you accept to federate your account with " %} <strong>{{ provider_id }}</strong> ?
-{% else %}
-{% trans "Do you accept to federate your account ?" %}
-{% endif %}
-{{ provider_id2 }}
-</p>
-<form method="post" action="">
-{% csrf_token %}
-<input type="hidden" name="next" value="{{ next }}" />
-<input type="hidden" name="nonce" value="{{ nonce }}" />
-<input type="submit" name="accept" value="{% trans 'Accept' %}"/>
-<input type="submit" name="refuse" value="{% trans 'Refuse' %}"/>
-</form>
-</div>
-
-{% endblock %}
diff --git a/authentic2/templates/idp/account_management.html b/authentic2/templates/idp/account_management.html
new file mode 100644
index 0000000..6369a32
--- /dev/null
+++ b/authentic2/templates/idp/account_management.html
@@ -0,0 +1,43 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}
+{% trans "Authentic - Account Management" %}
+{% endblock %}
+
+
+{% block content %}
+<h2>{% trans "Account Management" %}</h2>
+<h3>{% trans "Profile" %}</h3>
+<div id="profile">
+{% if profile %}
+<dl>
+{% for key, values in profile %}
+<dt>{{ key|capfirst }}</dt>
+<dd>{% if values|length == 1 %}{{ values.0 }}{% else %}
+<ul>
+  {% for value in values %}
+    <li>{{ value }}</li>
+  {% endfor %}
+</ul>
+{% endif %}
+</dd>
+{% endfor %}
+</dl>
+{% endif %}
+{% if allow_email_change %}
+<p><a href="{% url 'email-change' %}">{% trans "Change email" %}</a></p>
+{% endif %}
+{% if allow_profile_edit %}
+<p><a href="{% url 'profile_edit' %}">{% trans "Edit profile" %}</a></p>
+{% endif %}
+{% if allow_account_deletion %}
+<p><a href="{% url 'delete_account' %}">{% trans "Delete profile" %}</a></p>
+{% endif %}
+</div>
+<h3>{% trans "Credentials" %}</h3>
+  {% for html_block in frontends_block %}
+    {{ html_block|safe }}
+  {% endfor %}
+<p><a href="/">{% trans "Back" %}</a></p>
+{% endblock %}
diff --git a/authentic2/templates/idp/homepage.html b/authentic2/templates/idp/homepage.html
new file mode 100644
index 0000000..9973c95
--- /dev/null
+++ b/authentic2/templates/idp/homepage.html
@@ -0,0 +1,53 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}
+{% trans "Authentic" %}
+{% endblock %}
+
+
+{% block content %}
+
+{% if account_management %}
+<p>
+  <a href="{% url 'account_management' %}">{% trans "Account Management" %}</a>
+</p>
+{% endif %}
+
+
+{% if authorized_services %}
+  <div id="login-actions">
+  <h2>{% trans "Services" %}</h2>
+  <ul>
+    {% for service in authorized_services %}
+    {% if service.actions %}
+    <li>{% if service.url %}<a href="{{ service.url }}">{% endif %}{{ service.name }}{% if service.url %}</a>{% endif %}
+    <div class="actions">
+    {% for action in service.actions %}
+      {% if action.0 == "template" %}
+      {% include action.1 %}
+      {% else %}
+      <form action="{{ action.2 }}" method="{{ action.1 }}">
+        {% if action.3 %}
+        {% for key, value in action.3 %}
+          <input type="hidden" name="{{ key }}" value="{{ value }}" />
+        {% endfor %}
+        {% endif %}
+        <input type="hidden" name="next" value="/"/>
+        <input type="submit" class="submit-link" value="{{ action.0 }}">
+      </form>
+      {% endif %}
+    {% endfor %}
+    </div>
+    </li>
+    {% endif %}
+  {% endfor %}
+  </ul>
+  </div>
+{% endif %}
+
+{% if user.is_staff %}
+<p id="administration-link"><a href="/admin">{% trans "Administration" %}</a></p>
+{% endif %}
+
+{% endblock %}
diff --git a/authentic2/templates/idp/logout.html b/authentic2/templates/idp/logout.html
new file mode 100644
index 0000000..7707615
--- /dev/null
+++ b/authentic2/templates/idp/logout.html
@@ -0,0 +1,41 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}
+{% trans "Logout" %}
+{% endblock %}
+{% block bodyargs %}
+onload="window.iframe_count -= 1"
+{% endblock %}
+
+{% comment %}Initialize iframe coutndown {% endcomment %}
+{% block extra_scripts %}
+<script>
+  window.iframe_count = 1;
+</script>
+{% endblock %}
+
+{% block content %}
+<h1>{% trans message %}</h1>
+<ul class="logout-list">
+    {% for fragment in logout_list %}
+        {{ fragment|safe }}
+    {% endfor %}
+</ul>
+<!-- Hack alert !!! block loading indefinitely by loading an inacessible IP -->
+<script>
+  window.iframe_count += document.getElementsByTagName("iframe").length;
+  var refresh_launched = 0;
+  setInterval(function () {
+    if (iframe_count == 0) {
+      if (refresh_launched == 0) {
+        refresh_launched = 1;
+        setTimeout(function () { window.location = '{{ next_page }}' }, 300);
+      }
+    }
+  }, {{ redir_timeout }})
+</script>
+
+<div id="continue-link"><a href="{{ next_page }}">{% trans "Continue logout" %}</div>
+
+{% endblock %}
diff --git a/authentic2/templates/interaction/consent_attributes.html b/authentic2/templates/interaction/consent_attributes.html
new file mode 100644
index 0000000..4a47942
--- /dev/null
+++ b/authentic2/templates/interaction/consent_attributes.html
@@ -0,0 +1,39 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %} {% trans "Consent page for attribute propagation" %} {% endblock %}
+
+{% block content %}
+
+
+{% load i18n %}
+<div id="consent">
+<form method="post" action="">
+  {% csrf_token %}
+<p>
+{% trans "Choose attributes to send to " %} <strong>{{ provider_id }}</strong> ?
+
+<ul>
+{% for i, name, values in attributes %}
+<li>
+{% if allow_selection %}
+<input type="checkbox" name="attribute_nb_{{ i }}" value="{{ i }}" checked="checked"/>
+{% endif %}
+{{ name }} : <strong>{% for v in values %}{{ v }} {% endfor %}</strong></li>
+{% endfor %}
+</ul>
+
+</p>
+
+<input type="hidden" name="next" value="{{ next }}" />
+<input type="hidden" name="nonce" value="{{ nonce }}" />
+{% if allow_selection %}
+<input type="submit" name="accept" value="{% trans 'Send selected' %}"/>
+{% else %}
+<input type="submit" name="accept" value="{% trans 'Send all' %}"/>
+{% endif %}
+<input type="submit" name="refuse" value="{% trans 'Refuse all' %}"/>
+</form>
+</div>
+
+{% endblock %}
diff --git a/authentic2/templates/interaction/consent_federation.html b/authentic2/templates/interaction/consent_federation.html
new file mode 100644
index 0000000..c75d011
--- /dev/null
+++ b/authentic2/templates/interaction/consent_federation.html
@@ -0,0 +1,28 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %} {% trans "Consent page for federation" %} {% endblock %}
+
+{% block content %}
+
+
+{% load i18n %}
+<div id="consent">
+<p>
+{% if provider_id %}
+{% trans "Do you accept to federate your account with " %} <strong>{{ provider_id }}</strong> ?
+{% else %}
+{% trans "Do you accept to federate your account ?" %}
+{% endif %}
+{{ provider_id2 }}
+</p>
+<form method="post" action="">
+{% csrf_token %}
+<input type="hidden" name="next" value="{{ next }}" />
+<input type="hidden" name="nonce" value="{{ nonce }}" />
+<input type="submit" name="accept" value="{% trans 'Accept' %}"/>
+<input type="submit" name="refuse" value="{% trans 'Refuse' %}"/>
+</form>
+</div>
+
+{% endblock %}
-- 
1.7.10.4

