rewrite image editor, make images editable at projects and studios

This commit is contained in:
Milan
2018-05-14 23:11:32 +02:00
parent b97fe15f7a
commit 41d209f05a
47 changed files with 1152 additions and 393 deletions

View File

@@ -1,9 +1,10 @@
<html>
<head>
<link type="text/css" href="css/admin.css" rel="stylesheet"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script>
<link type="text/css" href="css/admin.css" rel="stylesheet"/>
<link type="text/css" href="css/image_manager.css" rel="stylesheet"/>
</head>
<script>
function updateCheckBox(selector, value){
$(selector).attr('value', value)
if (value==1){
@@ -40,66 +41,51 @@ $(document).ready(
);
</script>
</head>
<body>
<TMPL_LOOP images>
<form id="save_img_<TMPL_VAR id>"
method="post"
action="image.cgi"
onsubmit="saveImage('<TMPL_VAR id>','<TMPL_VAR filename>');return false;"
style="float:left"
>
<input type="hidden" name="project_id" value="<TMPL_VAR .project_id>">
<input type="hidden" name="studio_id" value="<TMPL_VAR .studio_id>">
<TMPL_IF filename>
<div id="imageEditor">
<button onclick="selectThisImage('<TMPL_VAR filename escape=0>'); return false"><TMPL_VAR .loc.select_image></button/>
<hr>
<table>
<tr>
<td><TMPL_VAR .loc.label_name></td>
<td><input value="<TMPL_VAR name escape=0>" name="update_name" class="field"></td>
<td rowspan="99"><a href="<TMPL_VAR image_url>" onclick="showImage('<TMPL_VAR image_url>');return false;"
><img src="showImage.cgi?project_id=<TMPL_VAR project_id>&studioId=<TMPL_VAR .studio_id>&type=icon&filename=<TMPL_VAR filename>" /></a></td>
</tr>
<tr>
<td><TMPL_VAR .loc.label_description></td>
<td><textarea name="update_description" cols="50" rows=5><TMPL_VAR description escape=0></textarea></td>
</tr>
<tr>
<td><TMPL_VAR .loc.label_created_at></td>
<td><TMPL_VAR created_at> <TMPL_VAR .loc.label_created_by> <TMPL_VAR created_by></td>
</tr>
<tr>
<td><TMPL_VAR .loc.label_modified_at></td>
<td><TMPL_VAR modified_at> <TMPL_VAR .loc.label_modified_by> <TMPL_VAR modified_by></td>
</tr>
<tr>
<td><TMPL_VAR .loc.label_editor_link></td>
<td><input value="{{<TMPL_VAR filename escape=0>|<TMPL_VAR name>}}" class="field" /></td>
</tr>
<tr>
<td><TMPL_VAR .loc.label_author>/<TMPL_VAR .loc.label_licence></td>
<td><input name="licence" value="<TMPL_VAR licence>" class="field<TMPL_IF missing_licence> error</TMPL_IF>" placeholder="<TMPL_VAR .loc.label_licence_missing>"/></td>
</tr>
<tr>
<td><TMPL_VAR .loc.label_public></td>
<td><input type="checkbox" name="public" <TMPL_IF public>checked="checked" value="1"<TMPL_ELSE>value="0"</TMPL_IF> /></td>
</tr>
<tr>
<td />
<td>
<TMPL_IF name="update_image">
<input type="hidden" name="save_image" value="<TMPL_VAR filename escape=0>" />
<button onclick="this.submit"><TMPL_VAR .loc.button_save></button/>
</TMPL_IF>
<form id="save_img_<TMPL_VAR id>"
method="post"
action="image.cgi"
onsubmit="saveImage('<TMPL_VAR id>','<TMPL_VAR filename>');return false;"
>
<TMPL_IF name="delete_image">
<button onclick="askDeleteImage('img_<TMPL_VAR id escape=0>','<TMPL_VAR filename escape=0>');return false;"><TMPL_VAR .loc.button_delete></button>
</TMPL_IF>
</td>
</tr>
</table>
<input type="hidden" name="project_id" value="<TMPL_VAR .project_id>">
<input type="hidden" name="studio_id" value="<TMPL_VAR .studio_id>">
</form>
<label><TMPL_VAR .loc.label_name></label><br>
<input value="<TMPL_VAR name escape=0>" name="update_name" class="field" placeholder="<TMPL_VAR .loc.label_name>"><br>
<label><TMPL_VAR .loc.label_description></label><br>
<textarea class="field" name="update_description" cols="50" rows=5 placeholder="<TMPL_VAR .loc.label_description>"><TMPL_VAR description escape=0></textarea><br>
<label><TMPL_VAR .loc.label_author>/<TMPL_VAR .loc.label_licence></label><br>
<input name="licence" value="<TMPL_VAR licence>" class="field<TMPL_IF missing_licence> error</TMPL_IF>" placeholder="<TMPL_VAR .loc.label_licence_missing>"/><br>
<label><TMPL_VAR .loc.label_public></label>
<input type="checkbox" name="public" <TMPL_IF public>checked="checked" value="1"<TMPL_ELSE>value="0"</TMPL_IF> /><br>
<TMPL_IF name="update_image">
<input type="hidden" name="save_image" value="<TMPL_VAR filename escape=0>" />
<button onclick="this.submit"><TMPL_VAR .loc.button_save></button/>
</TMPL_IF>
<TMPL_IF name="delete_image">
<button onclick="askDeleteImage('img_<TMPL_VAR id escape=0>','<TMPL_VAR filename escape=0>');return false;"><TMPL_VAR .loc.button_delete></button>
</TMPL_IF>
<div id="status" ></div>
<TMPL_VAR .loc.label_created_at> <TMPL_VAR created_at> <TMPL_VAR .loc.label_created_by> <TMPL_VAR created_by><br>
<TMPL_VAR .loc.label_modified_at> <TMPL_VAR modified_at> <TMPL_VAR .loc.label_modified_by> <TMPL_VAR modified_by><br>
<TMPL_VAR .loc.label_link>: {{<TMPL_VAR filename escape=0>|<TMPL_VAR name>}}<br>
</form>
</div>
</TMPL_IF>
</TMPL_LOOP>
</body>