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

@@ -282,9 +282,15 @@ sub show_login_form{
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
*{
font-family:Roboto,sans-serif;
margin:0;
padding:0;
border:0;
}
html,body{
height: 100%;
font-family:helvetica,arial,sans-serif;
}
body{
@@ -293,7 +299,7 @@ sub show_login_form{
}
input, .row, .field{
padding:0.5em;
padding:0.5rem;
}
.container{
@@ -302,27 +308,42 @@ sub show_login_form{
vertical-align: middle;
}
input{
border:0;
border-bottom: 1px solid #39a1f4;
margin-right:1rem;
}
#login_form{
background:#ddd;
box-shadow: 1em 1em 1em #888;
margin:1em;
padding:1em;
box-shadow: 6px 6px 6px #ccc;
margin:1rem;
padding:1rem;
text-align:center;
}
#login_form .field{
width:8em;
width:8rem;
float:left;
}
#login_form .message{
background:#ccc;
color:white;
background:#666;
text-align:left;
font-weight:bold;
padding:1em;
margin:-1em;
padding:1rem;
margin:-1rem;
margin-bottom:0;
}
input.button{
padding:1rem;
color:#fff;
background:#39a1f4;
border:0;
font-weight:bold;
}
</style>
</head>
<body>
@@ -340,8 +361,8 @@ sub show_login_form{
<input type="password" name="password"><br/>
</div>
<div class="row">
<input type="submit" name="action" value="login">
<input type="submit" name="action" value="logout">
<input class="button" type="submit" name="action" value="login">
<input class="button" type="submit" name="action" value="logout">
</div>
<input type="hidden" name="uri" value="$uri">
</form>

View File

@@ -632,7 +632,7 @@ sub get_query {
$bind_values = [ $params->{event_id} ];
#filter by published, default=1 to see published only, set published='all' to see all
my $published = $params->{published} || 1;
my $published = $params->{published} || '1';
if ( ( $published eq '0' ) || ( $published eq '1' ) ) {
push @$where_cond, 'published=?';
push @$bind_values, $published;
@@ -945,7 +945,7 @@ sub get_query {
#filter by published, default =1, set to 'all' to see all
my $published_cond = '';
my $published = $params->{published} || 1;
my $published = $params->{published} || '1';
if ( ( $published eq '0' ) || ( $published eq '1' ) ) {
$published_cond = 'published=?';
push @$bind_values, $published;

View File

@@ -21,8 +21,8 @@ sub get{
#get the Apache2::RequestRec
my $r=shift;
my $tmp_dir ='/var/tmp/';
my $upload_limit=1000*1024;
my $tmp_dir = '/var/tmp/';
my $upload_limit = 1000*1024;
my $cgi = undef;
my $status = undef;

View File

@@ -133,6 +133,7 @@ sub update{
};
my $dbh=db::connect($config);
#print STDERR Dumper($query)." ".Dumper(\@bind_values);
db::put($dbh, $query, \@bind_values);
}

View File

@@ -339,9 +339,27 @@ sub get_duration_seconds{
my $start = shift;
my $end = shift;
my $timezone= shift||'UTC';
$start=time::get_datetime($start, $timezone);
$end =time::get_datetime($end, $timezone);
my $duration=$end->epoch()-$start->epoch();
unless (defined $start){
print STDERR "time::get_duration_seconds(): start is missing\n";
return 0;
}
unless (defined $end){
print STDERR "time::get_duration_seconds(): end is missing\n";
return 0;
}
$start= time::get_datetime($start, $timezone);
$end = time::get_datetime($end, $timezone);
unless (defined $start){
print STDERR "time::get_duration_seconds(): invalid start\n";
return 0;
}
unless (defined $end){
print STDERR "time::get_duration_seconds(): invalid end\n";
return 0;
}
my $duration=$end->epoch() - $start->epoch();
return $duration;
}