From afbcc4e0adcd621dd52b6ef3cc9327d766c72bd6 Mon Sep 17 00:00:00 2001
From: Ryan Cross <rcross@amsl.com>
Date: Mon, 5 Nov 2018 10:01:05 +0000
Subject: [PATCH] Removed resources field from secr/meetings/../rooms.

Tweaked CSS for this page to eliminate horizontal scrolling.
Includes new base templates to facilitate transition to bootstrap.
Fixes #2628.  Commit ready for merge.
 - Legacy-Id: 15719
---
 ietf/secr/meetings/forms.py                   |  2 +-
 ietf/secr/static/secr/css/custom.css          |  4 +
 ietf/secr/templates/base_secr_bootstrap.html  | 89 +++++++++++++++++++
 ietf/secr/templates/base_site_bootstrap.html  | 39 ++++++++
 .../templates/meetings/base_rooms_times.html  |  2 +-
 ietf/secr/templates/meetings/rooms.html       |  2 +
 6 files changed, 136 insertions(+), 2 deletions(-)
 create mode 100644 ietf/secr/templates/base_secr_bootstrap.html
 create mode 100644 ietf/secr/templates/base_site_bootstrap.html

diff --git a/ietf/secr/meetings/forms.py b/ietf/secr/meetings/forms.py
index ab27acf38..6942cce34 100644
--- a/ietf/secr/meetings/forms.py
+++ b/ietf/secr/meetings/forms.py
@@ -128,7 +128,7 @@ class MeetingModelForm(forms.ModelForm):
 class MeetingRoomForm(forms.ModelForm):
     class Meta:
         model = Room
-        fields = '__all__'
+        exclude = ['resources']
 
 class NewSessionForm(forms.Form):
     day = forms.ChoiceField(choices=SESSION_DAYS)
diff --git a/ietf/secr/static/secr/css/custom.css b/ietf/secr/static/secr/css/custom.css
index fd9f8727a..0825f1b7e 100644
--- a/ietf/secr/static/secr/css/custom.css
+++ b/ietf/secr/static/secr/css/custom.css
@@ -499,6 +499,10 @@ tr.cancelled {
     display: inline;
 }
 
+#id_rooms_table input[type="number"] {
+    width: 4em;
+}
+
 /* ==========================================================================
    Proceedings Tool
    ========================================================================== */
diff --git a/ietf/secr/templates/base_secr_bootstrap.html b/ietf/secr/templates/base_secr_bootstrap.html
new file mode 100644
index 000000000..36841aed1
--- /dev/null
+++ b/ietf/secr/templates/base_secr_bootstrap.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+{% load staticfiles %}
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>{% block title %}{% endblock %}</title>
+<link rel="stylesheet" href="{% static 'font-awesome/css/font-awesome.min.css' %}">
+<link rel="stylesheet" href="{% static 'ietf/bootstrap/css/bootstrap.min.css' %}">
+<link rel="stylesheet" href="{% static 'ietf/bootstrap/css/bootstrap-theme.min.css' %}">
+<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static 'secr/css/base.css' %}{% endblock %}" />
+<link rel="stylesheet" type="text/css" href="{% static 'secr/css/forms.css' %}" />
+<link rel="stylesheet" type="text/css" href="{% static 'secr/css/custom.css' %}" />
+{% if not server_mode == "production" %}
+<link rel="stylesheet" type="text/css" href="{% static 'secr/css/test.css' %}" />
+{% endif %}
+{% block extrastyle %}{% endblock %}
+
+{% block extrahead %}
+<script type="text/javascript" src="{% static 'jquery/jquery.min.js' %}"></script>
+{% endblock %}
+
+{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
+<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
+</head>
+
+<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}">
+
+<!-- Container -->
+<div class="container">
+
+    {% if not is_popup %}
+    <!-- Header -->
+    <div id="header">
+        <div id="branding">
+        {% block branding %}{% endblock %}
+        </div>
+        {% block nav-global %}{% endblock %}
+    </div>
+    <!-- END Header -->
+
+    <!-- Breadcrumbs -->
+    <div class="breadcrumbs">
+      <table width="100%">
+        <tr>
+          <td align="left">
+            {% block breadcrumbs %}<a href="/secr/">Home</a>{% endblock %}
+          </td>
+          <td align="right">
+            {% block instructions %}{% endblock %}
+          </td>
+        </tr>
+      </table>
+    </div>
+    <!-- END Breadcrumbs -->
+    {% endif %}
+
+    {% comment %}
+    <!-- Removed per Glen 08-04-2010 -->
+    <!-- Javascript Warning -->
+    <noscript class="errornote"> You have Javascript disabled.  Javascript is required for this application.</noscript>
+    {% endcomment %}
+
+    <!-- Django Messages -->
+    {% if messages %}
+    <ul class="messages">
+      {% for message in messages %}
+      <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
+      {% endfor %}
+    </ul>
+    {% endif %}
+
+    <!-- Content -->
+    <div id="content" class="{% block coltype %}colM{% endblock %}">
+        {% block pretitle %}{% endblock %}
+        {% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
+        {% block content %}
+        {% block object-tools %}{% endblock %}
+        {{ content }}
+        {% endblock %}
+        {% block sidebar %}{% endblock %}
+        <br class="clear" />
+    </div>
+    <!-- END Content -->
+
+    {% block footer %}<div id="footer"></div>{% endblock %}
+</div>
+<!-- END Container -->
+
+</body>
+</html>
diff --git a/ietf/secr/templates/base_site_bootstrap.html b/ietf/secr/templates/base_site_bootstrap.html
new file mode 100644
index 000000000..786cdb02f
--- /dev/null
+++ b/ietf/secr/templates/base_site_bootstrap.html
@@ -0,0 +1,39 @@
+{% extends "base_secr_bootstrap.html" %}
+{% load i18n %}
+{% load ietf_filters %}
+{% load staticfiles %}
+
+{% block title %}{{ title }}{% if user|has_role:"Secretariat" %} Secretariat Dashboard {% else %} WG Chair Dashboard {% endif %}{% endblock %}
+
+{% block branding %}
+<table width="100%">
+  <tr>
+    <td align="left">
+      <h1 id="site-name">{% if user|has_role:"Secretariat" %} Secretariat Dashboard {% else %} WG Chair Dashboard {% endif %}</h1>
+    </td>
+    <td align="right">
+      <br>
+      <span class="login">{% if user|has_role:"Secretariat" %}Secretariat {% endif %}Logged in: <a href="/accounts/profile/">{{ user }}</a>  | <a rel="nofollow" href="/accounts/logout/">Log out</a></span>
+    </td>
+  </tr>
+</table>
+{% endblock %}
+
+{% block nav-global %}{% endblock %}
+
+{% block footer %}
+  <div id="footer">
+    <div id="footer-extras">
+        <ul>
+          {% block footer-extras %}{% endblock %}
+        </ul>
+    </div>
+    <div id="footer-version">
+      <p>IETF Secretariat Tools v. {{ secr_version_num }}</p>
+        
+    </div>
+    <div id="footer-logo">
+      <a href="https://www.amsl.com/"><img src="{% static 'secr/img/ams_logo.png' %}" alt="AMS" align="right" border="0" hspace="5" /></a>
+    </div>
+</div>
+{% endblock %}
diff --git a/ietf/secr/templates/meetings/base_rooms_times.html b/ietf/secr/templates/meetings/base_rooms_times.html
index 388530bcd..aee4b6986 100644
--- a/ietf/secr/templates/meetings/base_rooms_times.html
+++ b/ietf/secr/templates/meetings/base_rooms_times.html
@@ -1,4 +1,4 @@
-{% extends "base_site.html" %}
+{% extends "base_site_bootstrap.html" %}
 {% load staticfiles %}
 
 {% block title %}Meetings{% endblock %}
diff --git a/ietf/secr/templates/meetings/rooms.html b/ietf/secr/templates/meetings/rooms.html
index a5de03056..643be358c 100644
--- a/ietf/secr/templates/meetings/rooms.html
+++ b/ietf/secr/templates/meetings/rooms.html
@@ -1,4 +1,5 @@
 {% extends "meetings/base_rooms_times.html" %}
+{% load bootstrap3 %}
 
 {% block subsection %}
 
@@ -10,6 +11,7 @@
             <form id="meetings-meta-rooms" action="" method="post">{% csrf_token %}
               {{ formset.management_form }}
               {{ formset.non_form_errors }}
+              
               <table id="id_rooms_table" class="full-width">
                 <thead>
                  <tr>