{% extends g.theme.master %}
{% block title %}{{c.project.name}} / Overview{% endblock %}
{% block header %}Project Admin{% endblock %}
{% block content %}
{% if c.project.deleted %}
<div class="notice">This project has been deleted and is not visible to non-admin users</div>
{% endif %}
{% if not h.has_project_access('update')() %}
<div class="grid-9">
<label>Name:</label>
{{c.project.name}}
</div>
<div class="grid-9">
<label>Category:</label>
{{c.project.category and c.project.category.label or 'Uncategorized'}}
</div>
<div class="grid-9">
<label>Unixname:</label>
{{c.project.shortname}}
</div>
<div class="grid-9">
<label>Labels:</label>
{{c.project.labels and ', '.join(c.project.labels) or "No Labels"}}
</div>
<div class="grid-9">
<label>Summary:</label>
<br>
<pre>{{c.project.short_description}}</pre>
</div>
<div class="grid-9">
<label>Icon:</label>
<br>
{% if c.project.icon %}
<img src="{{c.project.url()}}icon"/>
{% else %}
<span>No icon has been created.</span>
{% endif %}
</div>
{% else %} {# has_project_access('update') #}
<form method="POST" action="update" enctype="multipart/form-data">
<div class="grid-9">
<label for="name">Name:</label>
<br>
<input type="text" name="name" value="{{c.project.name}}"
placeholder="This is the publicly viewable name of the project, and will appear on project listings.
It should be what you want to see as the project title in search listing.">
</div>
<div class="grid-9">
<label for="category">Category:</label>
<br>
<select name="category" placeholder="This will determine which pages you appear under in the SourceForge Directory.">
<option value="">Uncategorized</option>
{% for cat in categories %}
<option value="{{cat._id}}" {% if c.project.category and c.project.category._id == cat._id %}selected="selected"{% endif%}>{{cat.label}}</option>
{% for subcat in cat.subcategories %}
<option value="{{subcat._id}}" {% if c.project.category and c.project.category._id == subcat._id %}selected="selected"{% endif %}>-- {{subcat.label}}</option>
{% endfor %}
{% endfor %}
</select>
</div>
<div style="clear: both"></div>
<div class="grid-9">
<label>Unixname:</label>
<br>
<input type="text" disabled="true" value="{{c.project.shortname}}">
</div>
<div class="grid-9">
<label for="labels">Labels:</label>
<br>
{{c.label_edit.display(name='labels', value=c.project.labels,
placeholder="Free-form labels to describe your project.
These can be used to search for similar projects.")}}
</div>
<div class="grid-9">
<label for="short_description">Summary:</label>
<br>
<textarea name="short_description" id="short_description_textarea" style="height: 100px;"
placeholder="Add a short one or two sentence summary for your project.">{{c.project.short_description}}</textarea>
</div>
<div class="grid-9">
<label for="icon">Icon:</label>
<br>
<div class="editable viewing">
{% if c.project.icon %}
<div class="viewer"><img src="{{c.project.url()}}/icon"/></div>
{% else %}
<div class="viewer">No icon has been created.</div>
{% endif %}
<div class="editor">{{lib.file_field('icon', '')}}</div>
</div>
{% if c.project.icon %}
<div>
<input type="submit" name="delete_icon" value="Delete Icon">
</div>
{% endif %}
</div>
<hr class="grid-19" style="margin-top: 1em; margin-bottom: 1em;">
<div class="grid-15">
<input type="submit" value="Save">
</div>
{% if not c.project.deleted %}
<input type="submit" value="Delete Project" name="delete" class="fright">
{% elif config.get('auth.method', 'local') != 'sfx' %}
<input type="submit" value="Undelete Project" name="undelete" class="fright">
{% endif %}
</form>
{% endif %}
{% endblock %}
{% block extra_js %}
<script type="text/javascript" src="{{g.forge_static('js/jquery.maxlength-min.js')}}"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#short_description_textarea').maxlength({maxCharacters: 250});
});
</script>
{% endblock %}
{% block extra_css %}
<style type="text/css">
.grid-9 input[type=text], .grid-9 select, .grid-9 textarea{
width: 95%
}
</style>
{% endblock %}