{% extends "base_html.html" %}
{% load static %}

{% block title %}Mathics Installation Information{% endblock %}

{% block html_head %}
{% endblock %}

{% block html_body %}
	<header>
		<a href="https://mathics.org" style="text-decoration: none">
			<img id="logo" class="load" src="{% static 'img/logo-heptatom.svg' %}" height="32" alt="Logo" />
			<img id="logotext" class="load" src="{% static 'img/logo-text.svg' %}" height="26" alt="Mathics" />
		</a>

		<!-- worksheet controls are not wanted here -->
	</header>

	{% block main %}
		<div id="about">

			<h1>Software Information</h1>

			<h2>Python</h2>
			<ul>
				<li>Python: {{PythonVersion}}</li>
			</ul>

			<h2>Mathics Software</h2>
			<ul>
				<li>Mathics Django: {{mathics_django_version}}</li>
				<li>Mathics: {{mathics_version}}</li>
			</ul>

			<h2>Web Software</h2>
			<ul>
				<li>Django: {{django_version}}</li>
				<li>mathics-threejs-backend: {{mathics_threejs_backend_version}}</li>
				<li>three.js: {{three_js_version}}</li>
				<li>MathJax: {{MathJax_version}}</li>
			</ul>

			<h2>Numeric Software</h2>
			<ul>
				<li>mpmath: {{mpmath_version}}</li>
				<li>Numpy: {{numpy_version}}</li>
				<li>Sympy: {{sympy_version}}</li>
			</ul>


			<h1>Settings</h1>
			<p>
				<ul>
				{% for setting, value in user_settings.items %}
					{% if value.is_boolean %}
						<li>
							<label for="{{setting}}">
								{{setting}}:
								<input
									type="checkbox"
									name="{{setting}}"
									{% if value.boolean_value %}checked{% endif %}
									onclick="submitQuery(this, undefined, `${this.name} = ${this.checked ? 'True' : 'False'}`)"
								/>

								<br />

								{{value.usage}}
							</label>
						</li>
					{% else %}
						<li>
							{{setting}}: {{value.value}}

							<br />

							<span>{{value.usage}}</span>
						</li>
					{% endif %}
				{% endfor %}
				</ul>
			</p>

			<h1>System information</h1>
			<p>
				<ul>
					<li>User Name: {{UserName}}</li>
					<li>Process ID: {{ProcessID}}</li>
					<li>System Time Zone: {{SystemTimeZone}}</li>
				</ul>
			</p>

			<h1>File Paths</h1>
			<p>
				<ul>
					<li>Base Directory: <code>{{BaseDirectory}}</code></li>
					<li>Home Directory: <code>{{HomeDirectory}}</code></li>
					<li>Installation Directory: <code>{{InstallationDirectory}}</code></li>
					<li>Root Directory: <code>{{RootDirectory}}</code></li>
					<li>Temporary Directory: <code>{{TemporaryDirectory}}</code></li>
					<li>Database File: <code>{{DB_PATH}}</code></li>
					<li>Document Data: <code>{{DOC_DATA_PATH}}</code></li>
				</ul>
			</p>

			<h1>Machine information</h1>
			<p>
				<ul>
					<li>Machine Name: {{MachineName}}</li>
					<li>Machine: {{Machine}}</li>
					<li>Processor Type: {{ProcessorType}}</li>
					<li>Memory Available: {{MemoryAvailable}}</li>
					<li>System Memory: {{SystemMemory}}</li>
					<li>Machine Precision: {{MachinePrecision}}</li>
				</ul>
			</p>

			<h1>Connection Information</h1>
			<ul>
				<li>HTTP User Agent: {{HTTP_USER_AGENT}}</li>
				<li>Remote User: {{REMOTE_USER}}</li>
				<li>Remote Address: {{REMOTE_ADDR}}</li>
				<li>Remote Host: {{REMOTE_HOST}}</li>
			</ul>
		</div>

		<!-- FIXME: figure out how to reuse welcome.html. We can't run ajax from here. -->
		<div id="welcomeContainerAbout">
			<div id="welcome">
			  <p><h1>About Mathics in Django!</h1></p>

			  <p>Mathics is a general-purpose computer algebra system.</p>

			  <p>Copyright (C) 2021 The Mathics Team<p><br>
			  This program comes with ABSOLUTELY NO WARRANTY;
			    This is free software, and you are welcome to redistribute it
			    under <a href="doc/license/gnu-general-public-license/">certain conditions</a>.
			  </p>
			  <p>See the <a href="/doc">online documentation in fullscreen</a> for
			    a full list of supported functions, or <a href="/">go
			      back to the main page</a>.
			  </p>
			</div>
		</div>
	{% endblock main %}
{% endblock html_body %}
