<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
	{% block head %}
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />

        <title>SlapOS Buildout web runner</title>

        <meta name="keywords" content="" />

        <meta name="description" content="" />

        <link href="{{ url_for('static', filename='css/styles.css', _external=False) }}" rel="stylesheet" type="text/css" media="screen" />
        <script src="{{ url_for('static', filename='js/jquery/jquery-1.6.2.min.js') }}" type="text/javascript" charset="utf-8"></script>
	<script src="{{ url_for('static', filename='js/jquery/popup.js') }}" type="text/javascript" charset="utf-8"></script>
	<script src="{{ url_for('static', filename='js/jquery/jqueryToolTip.js') }}" type="text/javascript" charset="utf-8"></script>
        <script type=text/javascript>
          $SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
        </script>
	<script src="{{ url_for('static', filename='js/scripts/process.js') }}" type="text/javascript" charset="utf-8"></script>
	<script src="{{ url_for('static', filename='js/scripts/cookies.js') }}" type="text/javascript" charset="utf-8"></script>
	<script src="{{ url_for('static', filename='js/scripts/common.js') }}" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript">
		$(document).ready(function() {
  		if($("input#fmsg").val() != ""){
  		   $("#error").Popup($("input#fmsg").val(), {type:'info', duration:5000, load:true});
  		}
  		bindRun();
  		if(!checkSavedCmd()){
  		    getRunningState();
  		}
		});
	</script>
	{% endblock %}
    </head>
    <body>
	<div id="error"></div>
        <div id="page">
	    <input type="hidden" name="fmsg" value="{{ get_flashed_messages()[0] }}" id="fmsg" />
            <!--<div id="logo">-->
                <!--<a href="{{ url_for('home') }}"><img src="{{ url_for('static', filename='images/logo.png') }}" alt="" /></a>-->
            <!--</div>-->
            <div id="header">
                <div class="block_header">
                    <a href="{{ url_for('home') }}" style="float:left;" id="home" {% if request.path != '/' %}rel="tooltip"{% endif %} title="Home"><img alt="" src="{{ url_for('static', filename='images/home.png') }}" /></a>
		    <div class="line"></div>
		    <a href="{{ url_for('editCurrentProject') }}" style="float:left" title="Edit your current project"><img alt="" src="{{ url_for('static', filename='images/project.png') }}" /></a>
		    <div class="line"></div>
                    <h2 class="info">{% block title %}{% endblock %} - {{session.title}}</h2>
		    <div class="run"><span id="running" style="display:none"><img alt="" src="{{ url_for('static', filename='images/ajax_roller.gif') }}"
			height='26' title="slapgrid is currently running"/></span></div>
                </div>
                <div class="wmenu">
                    <ul>
                        <li><span class="title_software">Software</span></li>
                        <li><a href="{{ url_for('editSoftwareProfile') }}">Edit</a></li>
                        <li><a href="{{ url_for('runSoftwareProfile') }}" id="softrun">Run</a></li>
                        <li><a href="{{ url_for('viewSoftwareLog') }}">Build log</a></li>
                        <li><a href="{{ url_for('inspectSoftware') }}">Inspect</a></li>
                        <li><a href="{{ url_for('removeSoftware') }}">Remove all</a></li>

                        <li class="space"><span class="title_instance">Instance</span></li>
                        <li><a href="{{ url_for('editInstanceProfile') }}">Edit</a></li>
                        <li><a href="{{ url_for('runInstanceProfile') }}" id="instrun">Run</a></li>
                        <li><a href="{{ url_for('viewInstanceLog') }}">Build log</a></li>
                        <li><a href="{{ url_for('inspectInstance') }}">Inspect</a></li>
                        <li><a href="{{ url_for('removeInstance') }}">Remove all</a></li>
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
            <div id="main">
                <div {% if request.path == '/' %} class="home_content" {%else%} id="content" {% endif %}>
                    {% if request.path != '/' %}
                        <div class="main_head">
                        </div>
                        <div class="content">
                    {% endif %}
                    {% block body %}{% endblock %}
                    {% if request.path != '/' %}
                        </div>
                        <div class="main_foot">
                        </div>
                    {% endif %}
                </div>
            </div>
            <div id="footer">
                SlapOs web runner &copy; Vifib SARL 2011 - All right reserved - Creative Commons Shared Alike Non Commercial
            </div>
        </div>
        <div class="popup">
        <table id="dpop" cellpadding="0" border="0">
        <tbody><tr>
          <td id="topleft" class="corner"></td>
          <td class="top"><img width="30" height="29" alt="" src="{{ url_for('static', filename='images/bubble-tail2.png') }}"/></td>
          <td id="topright" class="corner"></td>
        </tr><tr>
          <td class="left"></td>
          <td><div class="popup-contents" id="jqtooltip"></div></td>
          <td class="right"></td>
        </tr><tr>
          <td class="corner" id="bottomleft"></td>
          <td class="bottom" valign="left"></td>
          <td id="bottomright" class="corner"></td>
        </tr>
        </tbody></table>
      </div>
      <div id="tooltip-home" style="display:none">
        <span style="font-weight:bold">QUICK ACCESS TO MENU</span><br/><br/>
          <div style="margin-top:3px;border-bottom: 1px dashed #666666; heigth:1px"></div>
          <ul>          
            <li><a href="{{ url_for('manageProject')}}">Manage Repositories</a></li>
            <li><a href="{{ url_for('configRepo')}}" >Clone your Repository</a></li>            
            <li><a href="{{ url_for('openProject', method='open')}}">Open Software Release</a></li>
            <li><a href="{{ url_for('openProject', method='new')}}">Create Software Release</a></li>            
          </ul>
      </div>
    </body>
</html>
