<!--
Dorrie - Web interface for building Fedora Spins/Remixes. 
Copyright (C) 2009 Red Hat Inc.
Author: Shreyank Gupta <sgupta@redhat.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

-->
{% extends "base.html" %}

{% block content %}
<script type="text/javascript">
$(document).ready(function() {
  var max = 0;
  $("label").each(function(){
    if ($(this).width() > max)
    max = $(this).width();    
  });
  
  $("label").each(function(){
    x = max - $(this).width();
    $(this).css('margin-right', (max - $(this).width()));
  });

  $('#id_uploaded_kickstart').hide();
  $("label[for='id_uploaded_kickstart']").hide();
  $(".forminputdropdown").css('width', 312);
  
  // Show the "upload file" portion if the user decides to use their own kickstart file
  $("#id_based_on").change(
    function() {
      if( $('#id_based_on option:selected').text() == 'Use your own!' ) {
        $("label[for='id_uploaded_kickstart']").show('fast');
        $('#id_uploaded_kickstart').show('fast');
        //This is where we unhide the upload file selection portion
      } else {
        $("label[for='id_uploaded_kickstart']").hide('fast');
        $('#id_uploaded_kickstart').hide('fast');
      }
    }
  );
  $(".forminputtext").css('width', 300);
});
</script>
<div id="steps"> 
<h1>Welcome to the RIT Fedora Remixerator</h1>
<p>(Brought to you by Dorrie)</p>
<p>Create your own RIT Fedora <a class="helptip" title="A remix is a livecd of fedora with your own selection of applications and settings.">Remix</a> in three easy steps!<br>
1) Choose a <a class="helptip" title="The base spin is a base build of Fedora made for a particular purpose, or around a particular theme. This ranges from a certain desktop environment, to a suite of tools that come packaged in with the spin. Spins are approved by Fedora.">base spin</a>. <br>
2) Select your applications.<br>
3) Create!</p>
<br />
</div>

<form method="POST" action="/packages/" enctype="multipart/form-data">
    <input type="hidden" name="spin_id" value="{{ spin.id }}"
    {{ form.as_p }}
    <input type="submit" value="Next" id="nextButton"/>

</form>
{% endblock %}
