aboutsummaryrefslogtreecommitdiffstats
path: root/lib/srtgui/templates/base.html
blob: 623dfdd82ed10703760882050ba4953b46273d31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!DOCTYPE html>
{% load static %}
{% load projecttags %}
{% load project_url_tag %}
<html lang="en">
  <head>
    <title>
      {% block title %} SRTool {% endblock %}
    </title>
    <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}" type="text/css"/>
    <!--link rel="stylesheet" href="{% static 'css/bootstrap-theme.css' %}" type="text/css"/-->
    <link rel="stylesheet" href="{% static 'css/font-awesome.min.css' %}" type='text/css'/>
    <link rel="stylesheet" href="{% static 'css/default.css' %}" type='text/css'/>

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <script src="{% static 'js/jquery-2.0.3.min.js' %}">
    </script>
    <script src="{% static 'js/jquery.cookie.js' %}">
    </script>
    <script src="{% static 'js/bootstrap.min.js' %}">
    </script>
    <script src="{% static 'js/typeahead.jquery.js' %}">
    </script>
    <script src="{% static 'js/jsrender.min.js' %}">
    </script>
    <script src="{% static 'js/highlight.pack.js' %}">
    </script>
    <script src="{% static 'js/libtoaster.js' %}">
    </script>
    {% if DEBUG %}
    <script>
      libtoaster.debug = true;
    </script>
    {% endif %}
    <script>
      $.views.settings.delimiters("<%", "%>");

      libtoaster.ctx = {
        jsUrl : "{% static 'js/' %}",
        htmlUrl : "{% static 'html/' %}",
      };
    </script>
    {% block extraheadcontent %}
    {% endblock %}

<style>
.dropbtn {
    background-color: white;
    color: black;
    font-size: 14px;
    cursor: pointer;

    border: 2px solid grey;
    border-radius: 5px;

    padding: 5px 12px !important;
    margin: 10px 10px 10px 10px;
}

.dropbtn:hover, .dropbtn:focus {
    background-color: grey;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    overflow: auto;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown a:hover {background-color: #f1f1f1}

.show {display:block;}

.localblue {
    color: blue;
}

.blueborder {
    border: 2px solid blue;
}

.fieldset-auto-width {
	 display: inline-block;
}

</style>

  </head>

  <body>

<script>
/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
function myFunction() {
    document.getElementById("myDropdown").classList.toggle("show");
}

// Close the dropdown if the user clicks outside of it
window.onclick = function(event) {
  if (!event.target.matches('.dropbtn')) {

    var dropdowns = document.getElementsByClassName("dropdown-content");
    var i;
    for (i = 0; i < dropdowns.length; i++) {
      var openDropdown = dropdowns[i];
      if (openDropdown.classList.contains('show')) {
        openDropdown.classList.remove('show');
      }
    }
  }
}
</script>


    {% csrf_token %}
    <div id="loading-notification" class="alert alert-warning lead text-center" style="display:none">
      Loading <i class="fa-pulse icon-spinner"></i>
    </div>

    <div id="change-notification" class="alert alert-info alert-dismissible change-notification" style="display:none">
      <button type="button" class="close" id="hide-alert" data-toggle="alert">&times;</button>
      <span id="change-notification-msg"></span>
    </div>

    <nav class="navbar navbar-default navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#global-nav" aria-expanded="false">
            <span class="sr-only">Toggle navigation</span>
          </button>
          <div class="toaster-navbar-brand">

            {% if srt_local_logo.0 %}
              <a href="{{ srt_local_logo.2 }}">
                <img class="logo" src="{{ srt_local_logo.1 }}" alt="{{srt_local_logo.0}}"/>
              </a>
            {% endif %}
            {% if srt_logo.0 %}
              <a href="{{ srt_logo.2 }}">
                <img class="logo" src="{{ srt_logo.1 }}" alt="{{srt_logo.0}}"/>
              </a>
            {% endif %}
            <a class="brand" href="/">SRTool:Security Response Tool</a>
            {% if DEBUG %}
            <span class="glyphicon glyphicon-info-sign" title="<strong>SRTool version information</strong>" data-content="<dl><dt>Git branch</dt><dd>{{TOASTER_BRANCH}}</dd><dt>Git revision</dt><dd>{{TOASTER_REVISION}}</dd></dl>"></i>
            {% endif %}
          </div>
        </div>
        <div class="collapse navbar-collapse" id="global-nav">
          <ul class="nav navbar-nav">

			<li id="navbar-home" {% if request.resolver_match.url_name == 'landing' %}class="active"{% endif %}>
			<a href="{% url 'landing' %}">
			  <i class="glyphicon glyphicon-tasks"></i>
			  Home
			</a>
			</li>

          {% if user.is_authenticated %}
			{% if request.user.is_contributor %} <!-- greater than a Reader -->
                <li id="navbar-manage"  {% if request.resolver_match.url_name == 'manage' %}class="active"{% endif %}>
                <a href="{% url 'manage' %}">
                  <i class="glyphicon glyphicon-tasks"></i>
                  Management
                </a>
                </li>
            {% endif %}

			{% if request.user.is_contributor %} <!-- greater than a Reader -->
              {% if request.resolver_match.url_name == 'cve' or request.resolver_match.url_name == 'cves' %}
                <li id="navbar-cve">
				  <a href="{% url 'cve_create' %}">
				    <i class="glyphicon glyphicon-tasks"></i>
				    New Cve
                    <!-- <span class="glyphicon glyphicon-question-sign get-help" title="Create a new Cve"></span> -->
				  </a>
                </li>
              {% endif %}
              {% if request.resolver_match.url_name == 'vulnerability' or request.resolver_match.url_name == 'vulnerabilities' %}
                <li id="navbar-vulnerability">
				  <a href="{% url 'vulnerability_create' %}">
				    <i class="glyphicon glyphicon-tasks"></i>
				    New vunerability
                    <!-- <span class="glyphicon glyphicon-question-sign get-help" title="Create a new Vulnerability"></span> -->
				  </a>
                </li>
              {% endif %}
              {# FYI: investigation must be created from vulnerabilities and also attached to products #}
            {% endif %}

          {% endif %} <!-- user.is_authenticated -->

	        {% if request.resolver_match.url_name == 'cve' %}
              <li id="navbar-altcves">
                <a id="alternate_cve_link" href="{% url 'cve_alternates' 1 %}">
                  <i class="glyphicon glyphicon-tasks"></i>
                  Fetch alt data
                  <!-- <span class="glyphicon glyphicon-question-sign get-help" title="Fetch the alternate CVE data sources"></span> -->
                </a>
              </li>
            {% endif %}

            <li id="navbar-docs">
              {% if srt_documentation_link %}
                <a target="_blank" href="{{srt_documentation_link}}"><i class="glyphicon glyphicon-book"></i> Documentation</a>
              {% endif %}
            </li>

            <li id="navbar-export">
              {% if request.resolver_match.url_name == 'landing' %}
                <a href="{% url 'report' request.resolver_match.url_name %}" target="_blank"><i class="glyphicon glyphicon-tasks"></i> Export</a>
              {% else %}
                <a id="report_link" href="{% url 'report' request.resolver_match.url_name %}" target="_blank"><i class="glyphicon glyphicon-tasks"></i> Export</a>
              {% endif %}
            </li>

			<div class="dropdown navbar-right">
          	  {% if user.is_authenticated %}
			    <button onclick="myFunction()" class="dropbtn ">Hello '{{user.username}}'</button>
			  {% else %}
			    <button onclick="myFunction()" class="dropbtn ">Hello 'Guest' (Login here)</button>
			  {% endif %}
			  <div id="myDropdown" class="dropdown-content navbar-right">
          		{% if user.is_authenticated %}
					<a href="{% url 'logout' %}">Logout</a>
					<a href="{% url 'password_change' %}">Change password</a>
					<a href="{% url 'edit_user' user.pk %}">Edit user settings</a>
<!--
					<a href="{% url 'password_reset' %}">Reset password</a>
					<a href="{% url 'tbd' %}">Request permissions</a>
-->
	            {% else %}
					<a href="{% url 'login' %}">Login</a>
					<a href="{% url 'signup' %}">Request account</a>
	            {% endif %}
			  </div>
			</div>

        </ul>
        </div>
      </div>
    </nav>

    <div class="container-fluid">
      {% block pagecontent %}
      {% endblock %}
    </div>
  </body>
</html>