improve image manager

This commit is contained in:
Milan
2018-12-10 13:01:51 +01:00
parent 6f6d264c8b
commit c72e56f83b
13 changed files with 241 additions and 184 deletions

View File

@@ -152,55 +152,54 @@
</div>
<!-- header -->
<!--
<TMPL_IF series_id>
<div class="header">
<TMPL_VAR series_name> <TMPL_IF title>- <TMPL_VAR title></TMPL_IF>
</div>
</TMPL_IF>
-->
<div>
<!-- import rerun from old event of series or any event of any project -->
<TMPL_IF .allow.update_event>
<div id="selectRerun" style="display:none;" class="panel">
<TMPL_VAR .loc.label_rerun>
<div id="selectRerun" style="display:none;" class="select panel">
<div onclick="selectOldEventFromSeries('rerunEventId','<TMPL_VAR start_date>'); updateCheckBox($(this).find('input:radio'),true);">
<div class="panel-header">
<b><TMPL_VAR weekday_short_name>, <TMPL_VAR start_date_name>, <TMPL_VAR start_time_name></b>,
<TMPL_VAR .loc.label_overwrite_event> <TMPL_VAR .loc.label_rerun>
</div>
<div class="panel-body">
<div onclick="selectOldEventFromSeries('rerunEventId','<TMPL_VAR start_date>'); updateCheckBox($(this).find('input:radio'),true);"
class="option"
>
<input type="radio" name="group" class="default">
<TMPL_VAR .loc.label_rerun_select_old>
</div>
<div onclick="selectOtherEvent('rerunEventId'); updateCheckBox($(this).find('input:radio'),true);">
<div onclick="selectOtherEvent('rerunEventId'); updateCheckBox($(this).find('input:radio'),true);"
class="option"
>
<input type="radio" name="group">
<TMPL_VAR .loc.label_rerun_select_other>
</div>
<div>
<input id="rerunEventId" value="-1" style="display:none" onchange="copyFromEvent('rerunEventId')">
<div id="import_rerun" class="active" style="display:none;"></div>
<button onclick="hideSelectRerun('rerunEventId')"><TMPL_VAR .loc.button_cancel></button>
</div>
<input id="rerunEventId" value="-1" style="display:none" onchange="copyFromEvent('rerunEventId')">
</div>
<div id="import_rerun_header" style="display:none;">
<b><TMPL_VAR weekday_short_name>, <TMPL_VAR start_date_name>, <TMPL_VAR start_time_name></b>,
<TMPL_VAR .loc.label_overwrite_event>
<div id="import_rerun" class="active" style="display:none;"></div>
</div>
</TMPL_IF>
<!-- move to other series -->
<TMPL_IF .allow.assign_series_events>
<div id="selectChangeSeries" class="active" style="display:none" class="panel">
<div class="panel-header">
<TMPL_VAR .loc.button_assign_series>
</div>
<div class="panel-body">
<div id="changeSeriesContainer"> </div>
<input id="changeSeriesId" value="-1" style="display:none">
<button onclick="hideChangeSeries()"><TMPL_VAR .loc.button_cancel></button>
<button onclick="changeSeries()"><TMPL_VAR .loc.button_assign></button>
</div>
</div>
</TMPL_IF>
@@ -457,14 +456,13 @@
</td>
<td>
<TMPL_IF .allow.update_event_field_image>
<button onclick="selectImage('<TMPL_VAR .project_id>','<TMPL_VAR .studio_id>','image_<TMPL_VAR event_id>','<TMPL_VAR series_name escape=HTML>','<TMPL_VAR image ESCAPE=url>','<TMPL_VAR series_id>');return false;"
style="padding:0;"
<button onclick="selectImage('<TMPL_VAR series_name escape=HTML>', '<TMPL_VAR image ESCAPE=url>', 'event', '<TMPL_VAR .project_id>','<TMPL_VAR .studio_id>','<TMPL_VAR series_id>','<TMPL_VAR event_id>'); return false;"
class="selectImage"
>
<img id="imagePreview" src="showImage.cgi?project_id=<TMPL_VAR project_id>&studioId=<TMPL_VAR studio_id>&filename=<TMPL_VAR image>&type=icon">
</button>
<input id="image_<TMPL_VAR event_id>" name="image" value="<TMPL_VAR image>" class="image" style="float:right" placeholder="<TMPL_VAR .loc.label_image>">
<input id="image_<TMPL_VAR event_id>" name="image" value="<TMPL_VAR image>" class="image" placeholder="<TMPL_VAR .loc.label_image>">
<input type="hidden" name="series_image" value="<TMPL_VAR series_image>" >
<!--(series_image:<TMPL_VAR series_image>,image=<TMPL_VAR image>)-->
</TMPL_IF>
</td>
</tr>
@@ -499,9 +497,8 @@
<!-- buttons -->
<TMPL_UNLESS edit_lock>
<table>
<tr>
<td colspan="2">
<div class="buttons" style="text-align:center">
<TMPL_IF show_new_event_from_schedule>
<TMPL_IF .allow.create_event_from_schedule>
@@ -530,9 +527,7 @@
</TMPL_UNLESS>
</TMPL_IF>
</div>
</td>
</tr>
</table>
</TMPL_UNLESS>
</form>
@@ -550,8 +545,6 @@
<div class="label right"><TMPL_VAR .loc.label_modified_at> <TMPL_VAR modified_at> <TMPL_VAR .loc.label_modified_by> <TMPL_VAR modified_by>.</div>
</TMPL_IF>
<div id="selectImage"></div>
</main>
</body>

View File

@@ -25,7 +25,7 @@
</script>
<style>
#editor div p a img {
#editor button img {
float:right;
}
</style>
@@ -57,9 +57,7 @@
</TMPL_IF>
</div>
<table>
<tr><td colspan="2">
<div class="header">
<div class="panel-header">
<TMPL_IF has_single_events>
<TMPL_VAR .loc.single_events> <TMPL_IF title><TMPL_VAR title></TMPL_IF>
<TMPL_ELSE>
@@ -67,8 +65,6 @@
<TMPL_IF series_name> <TMPL_VAR series_name></TMPL_IF><TMPL_IF title> - <TMPL_VAR title></TMPL_IF>
</TMPL_IF>
</div>
</td></tr>
</table>
</div>
@@ -95,22 +91,13 @@
<!-- edit template-->
<TMPL_IF .allow.update_series_template>
<div id="tabs-template">
<!--
<div class="header">Template</div>
<div class="buttons">
<button onclick="edit_series('<TMPL_VAR .series_id>');return false;">edit</button>
</div>
-->
<div id="edit_<TMPL_VAR .series_id>" class="editor"> <!--style="display:none;"-->
<div id="edit_<TMPL_VAR .series_id>" class="editor">
<form method="post" action="series.cgi?project_id=<TMPL_VAR .project_id>&studio_id=<TMPL_VAR .studio_id>&series_id=<TMPL_VAR .series_id>#tabs-template">
<input type="hidden" name="project_id" value="<TMPL_VAR .project_id>">
<input type="hidden" name="studio_id" value="<TMPL_VAR .studio_id>">
<input type="hidden" name="series_id" value="<TMPL_VAR .series_id>">
<table>
<!--
<tr> <td class="label">program</td> <td><input name="program" value="<TMPL_VAR program>"></td></tr>
-->
<TMPL_UNLESS has_single_events>
<tr> <td class="label"><TMPL_VAR .loc.template_series></td>
<td><input name="series_name" value="<TMPL_VAR series_name>" placeholder="<TMPL_VAR .loc.template_series>"></td></tr>
@@ -133,11 +120,13 @@
<tr> <td class="label"><TMPL_VAR .loc.template_image></td>
<td>
<TMPL_IF .allow.read_image>
<button onclick="selectImage('<TMPL_VAR .project_id>','<TMPL_VAR .studio_id>','image_<TMPL_VAR .series_id>','<TMPL_VAR series_name escape=HTML>','<TMPL_VAR image escape=URL>','<TMPL_VAR series_id>');return false;"
style="padding:0;float:left"
<button class="selectImage"
onclick="selectImage('<TMPL_VAR series_name escape=HTML>', '<TMPL_VAR image ESCAPE=url>', 'series', '<TMPL_VAR .project_id>','<TMPL_VAR .studio_id>','<TMPL_VAR series_id>'); return false;"
>
<img id="imagePreview" src="showImage.cgi?project_id=<TMPL_VAR .project_id>&studioId=<TMPL_VAR .studio_id>&filename=<TMPL_VAR image>&type=icon">
</button>
<input type="hidden" name="series_image" value="<TMPL_VAR series_image>" >
<input id="image_<TMPL_VAR .series_id>" name="image" value="<TMPL_VAR image>" class="image" placeholder="<TMPL_VAR .loc.template_image>" readonly="readonly">
</TMPL_IF>
</td></tr>
@@ -453,7 +442,6 @@
<td class="time"><TMPL_VAR end_time></td>
<td class="title"><TMPL_VAR full_title></td>
<TMPL_IF .allow.update_event>
<td>
<button onclick="edit_event('<TMPL_VAR event_id>','<TMPL_VAR .series_id>','<TMPL_VAR .studio_id>','<TMPL_VAR .project_id>','hide_series')"
><TMPL_VAR .loc.button_edit></button>
@@ -475,10 +463,6 @@
<TMPL_UNLESS has_single_events>
<!-- series members -->
<div id="tabs-members">
<!--
<div class="header">Members</div>
-->
<table>
<!-- add members -->

View File

@@ -1,17 +1,3 @@
<!--
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jquery-ui.min.js" type="text/javascript"></script>
<script src="js/admin.js" type="text/javascript"></script>
<script src="js/history.js" type="text/javascript"></script>
<script src="js/localization.js" type="text/javascript"></script>
<script src="js/localization-datetime.js" type="text/javascript"></script>
<script src="js/event.js" type="text/javascript"></script>
<script src="js/datetime.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/admin.css" type="text/css" />
<link rel="stylesheet" href="css/jquery-ui.min.css" type="text/css" />
<link rel="stylesheet" href="css/series.css" type="text/css" />
-->
<link type="text/css" href="css/image_manager.css" rel="stylesheet"/>
<link type="text/css" href="css/fileUploader.css" rel="stylesheet"/>
@@ -104,21 +90,19 @@
<form id="image_manager" action="image.cgi">
<input name="search" value="<TMPL_VAR search escape=0>" style="width:20em;">
<input type="hidden" name="filename" value="<TMPL_VAR filename escape=0>">
<input type="hidden" name="project_id" value="<TMPL_VAR .project_id>">
<input type="hidden" name="studio_id" value="<TMPL_VAR .studio_id>">
<button onclick="searchImage();return false;"><TMPL_VAR .loc.button_search></button>
<button onclick="searchImage('<TMPL_VAR target>', '<TMPL_VAR .project_id>', '<TMPL_VAR .studio_id>', '<TMPL_VAR .series_id>', '<TMPL_VAR .event_id>', '<TMPL_VAR .pid>'); return false;"><TMPL_VAR .loc.button_search></button>
</form>
<TMPL_VAR count> <TMPL_VAR .loc.label_search_hits><br />
<div style="clear:both;display: flex; flex-direction: row;">
<div class="images" style="height:1000px;overflow-y:scroll">
<div class="images" style="overflow-y:scroll">
<TMPL_LOOP images>
<div class="image"
id="img_<TMPL_VAR id>"
style="background-image:url('showImage.cgi?project_id=<TMPL_VAR project_id>&studioId=<TMPL_VAR .studio_id>&type=icon&filename=<TMPL_VAR filename>')"
title="<TMPL_VAR description>"
onclick="updateImageEditor('<TMPL_VAR filename>', this);return false;"
onclick="updateImageEditor(this, '<TMPL_VAR filename>', '<TMPL_VAR .target>', '<TMPL_VAR .project_id>', '<TMPL_VAR .studio_id>', '<TMPL_VAR .series_id>', '<TMPL_VAR .event_id>', '<TMPL_VAR .pid>'); return false;"
>
<div class="label"><TMPL_VAR name></div>
</div>

View File

@@ -46,8 +46,9 @@ found no image
<TMPL_LOOP images>
<TMPL_IF filename>
<div id="imageEditor">
<button onclick="selectThisImage('<TMPL_VAR filename escape=0>'); return false"><TMPL_VAR .loc.select_image></button/>
<hr>
<button onclick="assignImage('<TMPL_VAR filename escape=0>', '<TMPL_VAR .target>', '<TMPL_VAR .project_id>', '<TMPL_VAR .studio_id>', '<TMPL_VAR .series_id>', '<TMPL_VAR .event_id>', '<TMPL_VAR .pid>'); return false"><TMPL_VAR .loc.select_image></button/>
<div class="panel-body">
<form id="save_img_<TMPL_VAR id>"
method="post"
@@ -85,6 +86,8 @@ found no image
<TMPL_VAR .loc.label_link>: {{<TMPL_VAR filename escape=0>|<TMPL_VAR name>}}<br>
</form>
</div>
</div>
</TMPL_IF>
</TMPL_LOOP>

View File

@@ -1,7 +1,6 @@
<link href="css/jquery-ui-timepicker.css" type="text/css" rel="stylesheet" />
<script src="js/jquery-ui-timepicker.js" type="text/javascript"></script>
<script src="js/image.js" type="text/javascript"></script>
<link href="css/image-manager.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">
var region='<TMPL_VAR loc.region>';
@@ -13,7 +12,7 @@
<div style="clear:both" class="newproject">
<button onclick="add_project('<TMPL_VAR name>')"><TMPL_VAR .loc.button_add_project></button><br/>
<div id="edit_new" class="card project editor" style="clear:both;display:none">
<div id="edit_new" class="panel project editor" style="clear:both;display:none">
<form method="post">
<input type="hidden" name="project_id" value="<TMPL_VAR .project_id>">
<input type="hidden" name="studio_id" value="<TMPL_VAR .studio_id>">
@@ -40,9 +39,9 @@
<div style="clear:both" class="flex">
<TMPL_LOOP projects>
<div class="card project">
<div class="panel project">
<!-- buttons -->
<div>
<div class="panel-header">
<div class="title"><TMPL_VAR title></div>
<TMPL_IF .allow.update_project>
<button onclick="edit_project('<TMPL_VAR project_id>')"
@@ -51,7 +50,7 @@
</div>
<!-- view project -->
<div id="view_<TMPL_VAR project_id>" class="view">
<div id="view_<TMPL_VAR project_id>" class="panel-body">
<table>
<tr><td class="label"><TMPL_VAR .loc.label_image></td> <td colspan="2"><img src="showImage.cgi?project_id=<TMPL_VAR .project_id>&studioId=<TMPL_VAR .studio_id>&filename=<TMPL_VAR image>&type=thumbs"> &nbsp;</td></tr>
<tr><td class="label"><TMPL_VAR .loc.label_name></td> <td colspan="2"><TMPL_VAR name> &nbsp;</td></tr>
@@ -79,7 +78,7 @@
<TMPL_IF .allow.update_project>
<!-- update project -->
<div id="edit_<TMPL_VAR project_id>" class="editor" style="display:none">
<div id="edit_<TMPL_VAR project_id>" class="panel-body" style="display:none">
<form method="post" action="projects.cgi?project_id=<TMPL_VAR .project_id>&studio_id=<TMPL_VAR .studio_id>"
id="project_<TMPL_VAR project_id>"
>
@@ -96,12 +95,12 @@
<tr><td class="label">
<TMPL_VAR .loc.label_image></td>
<td>
<button onclick="selectImage('<TMPL_VAR .project_id>','<TMPL_VAR .studio_id>','image_<TMPL_VAR pid>','<TMPL_VAR series_name escape=HTML>','<TMPL_VAR image escape=URL>','<TMPL_VAR series_id>');return false;"
style="padding:0;float:left"
<button
class="selectImage"
onclick="selectImage('<TMPL_VAR name escape=HTML>', '<TMPL_VAR image ESCAPE=url>', 'projects', '<TMPL_VAR .project_id>','<TMPL_VAR .studio_id>', null, null, '<TMPL_VAR pid>'); return false;"
>
<img id="imagePreview" src="showImage.cgi?project_id=<TMPL_VAR .project_id>&studioId=<TMPL_VAR .studio_id>&filename=<TMPL_VAR image>&type=thumbs">
<img id="imagePreview" src="showImage.cgi?project_id=<TMPL_VAR .project_id>&studioId=<TMPL_VAR .studio_id>&filename=<TMPL_VAR image>&type=icon">
</button>
<!-- <input name="image">-->
<input id="image_<TMPL_VAR pid>" name="image" value="<TMPL_VAR image>" class="image" placeholder="<TMPL_VAR .loc.template_image>">
</td>
</tr>
@@ -177,8 +176,6 @@
</TMPL_LOOP>
</div>
<div id="selectImage"> </div>
</main>
</body>
</html>

View File

@@ -1,12 +1,11 @@
<script src="js/image.js" type="text/javascript"></script>
<link href="css/image-manager.css" type="text/css" rel="stylesheet" />
<h2><TMPL_VAR .loc.title></h2>
<TMPL_IF .allow.update_studio>
<div style="clear:both" class="newstudio">
<button onclick="add_studio('<TMPL_VAR name>')"><TMPL_VAR .loc.button_add_studio></button><br/>
<div id="edit_new" class="studio editor" style="clear:both;display:none">
<div id="edit_new" class="panel" style="clear:both;display:none">
<form method="post">
<input type="hidden" name="project_id" value="<TMPL_VAR .project_id>">
<input type="hidden" name="studio_id" value="<TMPL_VAR .studio_id>">
@@ -30,22 +29,24 @@
<div style="clear:both" class="flex">
<TMPL_LOOP studios>
<div class="card studio">
<div>
<div class="title"><TMPL_VAR name></div>
<TMPL_IF .allow.update_studio>
<button onclick="edit_studio('<TMPL_VAR id>')"><TMPL_VAR .loc.button_edit></button>
</TMPL_IF>
<div class="panel studio">
<div class="panel-header">
<TMPL_VAR name>
</div>
<div class="panel-body">
<TMPL_IF .allow.update_studio>
<button onclick="edit_studio('<TMPL_VAR id>')"><TMPL_VAR .loc.button_edit></button>
</TMPL_IF>
<TMPL_IF .allow.read_event>
<button target="_blank"
onclick="load('event_history.cgi?project_id=<TMPL_VAR .project_id>&studio_id=<TMPL_VAR id>');"
><TMPL_VAR .loc.button_show_changes></button>
</TMPL_IF>
</div>
</div>
<!-- view studio -->
<div id="view_<TMPL_VAR id>" class="view">
<div id="view_<TMPL_VAR id>" class="panel-body">
<table>
<tr><td class="label"><TMPL_VAR .loc.label_image></td> <td><img src="showImage.cgi?project_id=<TMPL_VAR .project_id>&studioId=<TMPL_VAR .studio_id>&filename=<TMPL_VAR image>&type=thumbs"> &nbsp;</td></tr>
<tr><td class="label"><TMPL_VAR .loc.label_name></td> <td><TMPL_VAR name> &nbsp;</td></tr>
@@ -57,7 +58,7 @@
<TMPL_IF .allow.update_studio>
<!-- update studio -->
<div id="edit_<TMPL_VAR id>" class="editor" style="display:none">
<div id="edit_<TMPL_VAR id>" class="editor" style="display:none">
<form method="post" id="studio_<TMPL_VAR id>">
<input type="hidden" name="id" value="<TMPL_VAR id>">
<input type="hidden" name="project_id" value="<TMPL_VAR .project_id>">
@@ -70,10 +71,11 @@
<tr><td class="label">
<TMPL_VAR .loc.label_image></td>
<td>
<button onclick="selectImage('<TMPL_VAR .project_id>','<TMPL_VAR .studio_id>','image_<TMPL_VAR id>','<TMPL_VAR series_name escape=HTML>','<TMPL_VAR image escape=URL>','<TMPL_VAR series_id>');return false;"
style="padding:0;float:left"
<button
class="selectImage"
onclick="selectImage('<TMPL_VAR name escape=HTML>', '<TMPL_VAR image ESCAPE=url>', 'studios', '<TMPL_VAR .project_id>','<TMPL_VAR .studio_id>'); return false;"
>
<img id="imagePreview" src="showImage.cgi?project_id=<TMPL_VAR .project_id>&studioId=<TMPL_VAR .studio_id>&filename=<TMPL_VAR image>&type=thumbs">
<img id="imagePreview" src="showImage.cgi?project_id=<TMPL_VAR .project_id>&studioId=<TMPL_VAR .studio_id>&filename=<TMPL_VAR image>&type=icon">
</button>
<input id="image_<TMPL_VAR id>" name="image" value="<TMPL_VAR image>" class="image" placeholder="<TMPL_VAR .loc.template_image>">
</td>