{% 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')() %}
<form>
<ol>
<li>
<label>Name:</label>
{{c.project.name}}
</li>
<hr class="clear clearfix" />
<li>
<label>Shortname:</label>
{{c.project.shortname}}
</li>
<hr class="clear clearfix" />
<li>
<label>Category:</label>
{{c.project.category and c.project.category.label or 'Uncategorized'}}
</li>
<hr class="clear clearfix" />
<li>
<label>Icon:</label>
{% if c.project.icon %}
<img src="{{c.project.url()}}icon"/>
{% else %}
<span> </span>
{% endif %}
</li>
<hr class="clear clearfix" />
<li>
<label>Summary:</label>
<pre>{{c.project.short_description}}</pre>
</li>
<hr class="clear clearfix" />
<li>
<label>Description:</label>
{{c.project.description_html|safe}}
</li>
<hr class="clear clearfix" />
<li>
<label>Screenshots:</label>
{% for ss in c.project.get_screenshots() %}
<a href="{{c.project.url()}}screenshot/{{ss.filename}}"><img src="{{c.project.url()}}screenshot/{{ss.filename}}/thumb" style="margin-right: 1em"/></a>
{% else %}
No screenshots have been created.
{% endfor %}
</li>
</ol>
</form>
{% else %} {# has_project_access('update') #}
<form method="POST" action="update" enctype="multipart/form-data">
<ol>
<li>
<div class="row dual">
<div class="column" style="margin-right:0">
<label for="name"
title="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.">Name:</label>
</div>
<div class="column grid_10" style="margin-left:0">
<div class="editable viewing">
<div class="viewer">{{c.project.name}}</div>
<div class="editor"><input type="text" name="name" value="{{c.project.name}}"/></div>
</div>
</div>
</div>
</li>
<hr class="clear clearfix" />
<li>
<label>Shortname:</label>
{{c.project.shortname}}
</li>
<hr class="clear clearfix" />
<li>
<div class="row dual">
<div class="column" style="margin-right:0">
<label for="category" title="This will determine which pages you appear under in the SourceForge Directory.">Category:</label>
</div>
<div class="column grid_10" style="margin-left:0">
<div class="editable viewing">
<div class="viewer">{{c.project.category and c.project.category.label or 'Uncategorized'}}</div>
<div class="editor">
<select name="category">
<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>
</div>
</div>
</li>
<hr class="clear clearfix" />
<li>
<div class="row dual">
<div class="column" style="margin-right:0">
<label for="icon"
title="This is the icon that will appear on your project header and search results.
For best appearance, use a square image with a transparent background.">Icon:</label>
</div>
<div class="column grid_10" style="margin-left:0">
<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"
class="ui-state-default ui-button ui-button-text clear clearfix"/>
</div>
{% endif %}
</div>
</div>
</li>
<hr class="clear clearfix" />
<li>
<div class="row dual">
<div class="column" style="margin-right:0">
<label for="short_description"
title="This is a text only project summary which will be included on search results and project listings.
Typically this is one or two sentences describing the project, and is plain text.">Summary:</label>
</div>
<div class="column grid_10" style="margin-left:0">
<div class="editable viewing">
<div class="viewer"><div data-prompt="Write a brief summary of your project">{{c.project.short_description}}</div></div>
<div class="editor multiline"><textarea name="short_description" id="short_description_textarea" style="width: 95%; height: 100px;">{{c.project.short_description}}</textarea></div>
</div>
</div>
</div>
</li>
<hr class="clear clearfix" />
<li>
<div class="row dual">
<div class="column" style="margin-right:0">
<label for="description"
title='This is the contents of the front page, and uses the markdown/HTML syntax similar to the wiki.
This can be as long as you need it to be.'>Home Page:</label>
</div>
<div class="column grid_10" style="margin-left:0">
{{c.markdown_editor.display(name='description', value=c.project.description)}}
</div>
</div>
</li>
<hr class="clear clearfix" />
<li>
<div class="row dual">
<div class="column" style="margin-right:0">
<label for="labels"
title="Free-form labels to describe your project.
These can be used to search for similar projects.">Labels:</label>
</div>
<div class="column grid_10" style="margin-left:0">
<div class="editable viewing">
<div class="viewer">{{c.project.labels and ', '.join(c.project.labels) or "No Labels"}}</div>
<div class="editor">{{c.label_edit.display(name='labels', value=c.project.labels)}}</div>
</div>
</div>
</div>
</li>
<hr class="clear clearfix" />
<!-- <li>
<label for="screenshot">Screenshots:</label>
<div class="editable viewing">
<div class="viewer">
{% for ss in c.project.get_screenshots() %}
<a href="{{c.project.url()}}screenshot/{{ss.filename}}"><img src="{{c.project.url()}}screenshot/{{ss.filename}}/thumb" style="margin-right: 1em"/></a>
{% else %}
No screenshots have been created.
{% endfor %}
</div>
<div class="editor multiline">{{lib.file_field('screenshot', 'File')}}</div>
</div>
</li>
<hr class="clear clearfix" /> -->
<li>
<label> </label>
<input type="submit" value="Save"
/>
{% if not c.project.deleted %}
<input type="submit" value="Delete Project" name="delete" />
{% elif config.get('auth.method', 'local') != 'sfx' %}
<input type="submit" value="Undelete Project" name="undelete" />
{% endif %}
</li>
</ol>
</form>
{% endif %}
{% endblock %}
{% block extra_js %}
<script type="text/javascript" src="{{g.forge_static('js/jquery.maxlength-min.js')}}"/>
<script type="text/javascript">
$(document).ready(function(){
$('#short_description_textarea').maxlength({maxCharacters: 250});
});
</script>
{% endblock %}