{% load i18n %}
<h1 class="title">{% trans "Data directory changes" %}</h1>
<div class="main">
 <p>
{% blocktrans %}
  Your site's data directory isn't properly set up. This directory is where
  Review Board will store various state and configuration needed to access
  repositories.
{% endblocktrans %}
 </p>
{% if data_dir == "" %}
 <p>
{% blocktrans %}
  The current data directory wasn't able to be found. Please ensure you
  have a <tt>data</tt> directory inside your site's directory, and that it
  is writable by the web server. Then ensure that your web server's
  configuration has the <tt>HOME</tt> environment variable set to the
  data directory.
{% endblocktrans %}
 </p>
{% else %}
 <p>
{% blocktrans %}
  Your data directory is currently at: <tt>{{data_dir}}</tt>
{% endblocktrans %}
 </p>
{%  if expected_data_dir != data_dir %}
 <h3>{% trans "Non-standard directory name used" %}</h3>
 <p>
  The data directory is not where we expect it. Unless you have a very
  custom setup, it should probably be at <tt>{{expected_data_dir}}</tt>.
  You may need to set the <tt>$HOME</tt> environment variable in the data
  directory.
 </p>
{%  endif %}
{% endif %}

{# This should handle the empty $HOME and non-standard name cases from above. #}
{% if expected_data_dir != data_dir %}
 <h3>{% trans "Configuring $HOME" %}</h3>
 <p>
{% blocktrans %}
  If you're using mod_python and Apache, you may need to add this line
  to your Apache configuration:
{% endblocktrans %}
 </p>
<pre>
    SetEnv HOME "{{expected_data_dir}}"
</pre>
 <p>
  If using fastcgi or wsgi, you want to check the <tt>reviewboard.fcgi</tt> or
  <tt>reviewboard.wsgi</tt> file in your site's <tt>htdocs</tt> directory
  and add the following if missing:
 </p>
<pre>
    os.environ['HOME'] = '{{expected_data_dir}}'
</pre>
{% endif %}

{% if not writable and data_dir != "" %}
 <h3>{% trans "Permission problems" %}</h3>
 <p>
{% blocktrans %}
  The data directory must be writable by the web server. On Linux/Unix/Mac,
  you can fix this by typing:
{% endblocktrans %}
 </p>
<pre>
    $ sudo chown -R {{server_user}} "{{expected_data_dir}}"
</pre>
 <p>
{% blocktrans %}
  On Windows, right-click the data directory and change the ownership to
  <tt>{{server_user}}</tt>.
{% endblocktrans %}
 </p>
{% endif %}
</div>
