freehg / templates / frontpage.html

{% extends "base.html" %}

{% block title %}Mercurial Hosting{% endblock %}

{% block content %}

<div class="span-14 border">

<form action='.' method='post'>

    <fieldset>
    <legend>Create a repository:</legend>
    {% for field in repo_form %}
            <div class="form-row {%if field.field.required %}required{%endif%} {%if field.errors%}errors{%endif%}">
                {% if field.errors %}{{field.errors}}{% endif %}
                <p>
                    {{field.label_tag}}<br />
                    {% if field.help_text %}
                        <span class="help-text">({{field.help_text}})</span><br />
                    {%endif%}
                    {{field}}
                    {% ifequal field.name "reponame" %}
                        <br />Repository url will be: <code>http://freehg.org/u/{% if user.username %}{{user.username}}{%else%}<span id="url-user" class="notgiven">&lt;username&gt;</span>{%endif%}/<span id="url-repo" class="notgiven">&lt;reponame&gt;</span></code>
                    {%endifequal%}
                </p>
            </div>
    {% endfor %}

    {% if user.is_authenticated %}
        <input type='submit' name='createrepo' value='Create repository for {{user.username}}' />
    {% endif %}
    </fieldset>

    {% if not user.is_authenticated %}
    <div class="span-7 border">
        <fieldset>
        <legend>Login:</legend>
        {% for field in login_form %}
            <div class="form-row {%if field.field.required %}required{%endif%} {%if field.errors%}errors{%endif%}">
                {% if field.errors %}{{field.errors}}{% endif %}
                <p>
                {{field.label_tag}}<br />
                {{field}}</p>
            </div>
        {% endfor %}
        <input type='submit' name='login' value='Login' />
        </fieldset>
    </div>
    <div class="span-7 last">
        <fieldset>
        <legend>... or create an account:</legend>
        {% for field in new_account_form %}
            {% ifnotequal field.name "tos" %}
                <div class="form-row {%if field.field.required %}required{%endif%} {%if field.errors%}errors{%endif%}">
                    {% if field.errors %}{{field.errors}}{% endif %}
                    <p>
                    {{field.label_tag}}<br />
                    {{field}}</p>
                </div>
            {% endifnotequal %}
        {% endfor %}
        <div class="form-row required">
            {% if new_account_form.tos.errors %}{{new_account_form.tos.errors}}{% endif %}
            <p>{{new_account_form.tos}} I agree to the <a href="/tos/">Terms of Service</a>.</p>
        </div>
        <input type='submit' name='newaccount'  value='Create new account' />
        </fieldset>
    </div>
{% endif %}
</form>
</div>

<div class="span-4 last about">
<h5>What is this site?</h5>
<p>
<a href="http://selenic.com/mercurial/">Mercurial</a> [Hg for short] is a Distributed Version Control System.  Instead of using a single repository per project, each developer can have their own repository.
</p>

<p>
<strong>freeHg.org</strong> makes it quick and easy to share your repositories.
</p>
</div>

<script type="text/javascript">
$(document).ready(function (){
    $('fieldset').each(function(){
        if ($(this).children('.form-row:not(.required, .errors)')
                .hide().length) {
            $(this).append(
                $('<a href="#" class="showmore">Show more options</'+'a>').click(function(){
                $(this).hide();
                $(this).siblings('.form-row:hidden').show();
            }));
        }
    });

    var update_repo = function(){
        if (this.value)
            $('#url-repo').text(this.value.toLowerCase()).removeClass('notgiven');
        else
            $('#url-repo').text("<reponame>").addClass('notgiven');
    }
    $('#id_reponame').change(update_repo).keyup(update_repo).trigger('change');

    var update_username = function(){
        if (this.value)
            $('#url-user').text(this.value).removeClass('notgiven');
        else
            $('#url-user').text("<username>").addClass('notgiven');
    }
    $('#id_username, #id_new-username')
            .change(update_username)
            .keyup(update_username).trigger('change');
});
</script>

{% endblock %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.