<html>
	<head>
		<meta content="text/html; charset={{ charset }}" http-equiv="Content-Type" />
		<title>{{ servicename }}</title>
		<link href="{{ client_path }}/../skins/bluebox/css/service.css" rel="stylesheet">
		<link href="{{ client_path }}/../skins/bluebox/css/service-ui.css" rel="stylesheet">
		<script src="{{ client_path }}/../skins/bluebox/js/jsonwspclient.js"></script>
		<script src="{{ client_path }}/../skins/bluebox/js/jquery.min.js"></script>
		<script src="{{ client_path }}/../skins/bluebox/js/service-ui.js"></script>
		<script>
			$( function() {
				init_service_ui("{{ servicename }}");
			});
		</script>
	</head>
	<body>
		<div class="service-header">
			<div class="service-title">{{ servicename }}</div>
			<form method="get" class="skin-selector">
				<label for="skin-select">skins:</label>
				<select id="skin-select" name="skin" onchange="document.forms[0].submit()">
					<option value="">Default</option>
					{% for skin in skins %}
					<option value="{{skin}}"{% if skin == current_skin %} selected{% endif %}>{{ skin|title }}</option>
					{% endfor %}
				</select>
			</form>
		</div>
		<div class="service-description">
			<p class="title">Description</p>
			<div class="doc-lines">
				{{ doc }}
			</div>
		</div>
		<div class="service-interfaces">
			<p class="title">Interfaces</p>
			<ul class="list">
{% for interface in interfaces %}
				<li>{{ interface }} [ <a href="{{ client_path }}/{{ interface }}">url</a> <a href="{{ client_path }}/{{ interface }}/description">description</a> ]</li>
{% endfor %}
			</ul>
		</div>
		<div class="service-api">
			<div class="overview">
				<p class="title">Overview</p>
				<p class="subtitle">Methods</p>
				<ul class="list">
	{% for method in methods %}
					<li>
						<a href="#{{ method.methodname }}"><span class="name">{{ method.methodname }}</span></a>
						( )
					</li>
	{% endfor %}
				</ul>
				<p class="subtitle">Types</p>
				<ul class="list">
	{% for type in types %}
					<li>
						<a href="#{{ type.name }}"><span class="name">{{ type.name }}</span></a>
					</li>
	{% endfor %}
				</ul>
			</div>
			<div class="methods">
				<p class="title">Methods</p>
				<ul class="list">
	{% for method in methods %}
					<li class="entry">
						<div class="declaration">
							<a name="{{ method.methodname }}"></a><span class="name invokable" name="{{ method.methodname }}">{{ method.methodname }}</span>
							(
		{% set sep = '' %}
		{% for param in method.params %}
							{{ sep }} 
							<span class="param-type">
			{% if param.ladontype %}
								<a href="#{{ param.ladontype }}">{{ param.type }}</a>
			{% else %}
								{{ param.type }}
			{% endif %}
							</span> 
							<span class="param-name">{{ param.name }}</span>
			{% set sep = ',' %}
		{% endfor %}
							)
						</div>
						<div class="doc-lines">
							{{ method.doc }}
						</div>
		{% for param in method.params %}
			{% if loop.first %}
						<div class="params-title">Parameters</div>
						<ul class="params">
			{% endif %}
							<li>
								<span class="param-name">{{ param.name }}</span>: <span class="param-type">
			{% if param.ladontype %}
									<a href="#{{ param.ladontype }}">{{ param.type }}</a>
			{% else %}
									{{ param.type }}
			{% endif %}
								</span>
			{% if param.optional %}
									[ default: {{ param.default }} ]
			{% endif %}
								<br/>
								<div class="doc-lines">
									{{ param.doc }}
								</div>
							</li> 
			{% if loop.last %}
						</ul>
			{% endif %}
		{% endfor %}
						<div class="return-type-title">Return value</div>
						<div class="return-type">
							<span class="param-type">
		{% if method.returns.ladontype %}
								<a href="#{{ method.returns.ladontype }}">{{ method.returns.type }}</a>
		{% else %}
								{{ method.returns.type }}
		{% endif %}
							</span>
							<div class="doc-lines">
								{{ method.returns.doc }}
							</div>
						</div>
					</li>
	{% endfor %}
				</ul>
			</div>
			<div class="types">
				<p class="title">Types</p>
				<ul class="list">
	{% for type in types %}
					<li class="entry">
						<div class="definition">
							<a name="{{ type.name }}"></a><span class="name">{{ type.name }}</span>
						</div>
						<div class="attributes-title">Attributes</div>
						<ul class="attributes">
		{% for k,v in type.attributes.items() %}
							<li>
								<span class="param-name">{{ k }}</span>:
								<span class="param-type">
			{% if v.ladontype %}
								<a href="#{{v.ladontype}}">{{ v.type }}</a>
			{% else %}
									{{ v.type }}
			{% endif %}
								</span>
							</li>
		{% endfor %}
						</ul>
					</li>
	{% endfor %}
				</ul>
			</div>
		</div>
		<div class="service-footer">Powered by Ladon for Python</div>
		<div id="service-call" style="display:none">
			<div id="title"></div>
			<div id="arguments">
				<div class="header">Parameters</div>
				<div id="method-args-outerdiv">
					<div id="method-args-form">
					</div>
				</div>
			</div>
			<div id="response">
				<div class="header">Response</div>
				<div id="response-outerdiv">
					<div id="response-status">
					</div>
					<pre id="response-data">
					</pre>
				</div>
			</div>
		</div>
		<div id="dialog-error" title="Create new user" style="display:none">
		</div>
	</body>
</html>

