Merge remote-tracking branch 'calcms/master'
492bc44(calcms/master) lib/calcms/user_sessions.pm: always write session80cbaf7fixup! templates: fix javascript escaping4689deenotify-events: show resultsb7ff85fcreate-events.cgi: remove comments0c7cf10website/agenda/.htaccess: add route for running id61405a2install/create.sql: new index for events6744123calcms.css: use woff2 fonts onlyf71d6e9mail.pm: convert to ascii642e739fixup! lib/calcms: remove comments and shorten expressions
This commit is contained in:
@@ -1,7 +1,49 @@
|
||||
/*
|
||||
include in your web page:
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="/agenda_files/css/calcms.css" />
|
||||
*/
|
||||
* {
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Roboto'), local('Roboto-Regular'),
|
||||
url('../fonts/roboto-v18-latin_latin-ext-regular.woff2') format('woff2'),
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Regular'), local('OpenSans-Regular'),
|
||||
url('../fonts/open-sans-v15-latin_latin-ext-regular.woff2') format('woff2'),
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html,
|
||||
*,
|
||||
.entry-title a,
|
||||
#calcms_calendar table thead a:hover,
|
||||
#calcms_calendar table thead a:link,
|
||||
.main-navigation a:hover,
|
||||
.main-navigation a:focus
|
||||
{
|
||||
color:white !important;
|
||||
background:black !important;
|
||||
}
|
||||
|
||||
#calcms_list h1.summary{
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
a.load-prev, a.load-next{
|
||||
color:#999 !important;
|
||||
background:#333 !important;
|
||||
}
|
||||
|
||||
img.custom-logo{
|
||||
filter: invert(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* fix drupal */
|
||||
input{
|
||||
@@ -676,23 +718,3 @@ ul.mobileMenu li a:hover{
|
||||
line-height:2em;
|
||||
}
|
||||
|
||||
/*
|
||||
pre{
|
||||
text-align:left;
|
||||
font-family:Courier;
|
||||
padding:1em;
|
||||
margin:1em;
|
||||
border:1px solid black;
|
||||
}
|
||||
|
||||
div.update{
|
||||
position:absolute;
|
||||
bottom:0px;
|
||||
}
|
||||
|
||||
div.update, div.update a{
|
||||
text-align:left;
|
||||
font-size:6px;
|
||||
color:#bbb;
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -29,7 +29,6 @@ my $config = config::get('../config/config.cgi');
|
||||
my ( $user, $expires ) = auth::get_user( $config, $params, $cgi );
|
||||
return if ( ( !defined $user ) || ( $user eq '' ) );
|
||||
|
||||
#print STDERR $params->{project_id}."\n";
|
||||
my $user_presets = uac::get_user_presets(
|
||||
$config,
|
||||
{
|
||||
@@ -42,7 +41,6 @@ $params->{default_studio_id} = $user_presets->{studio_id};
|
||||
$params = uac::setDefaultStudio( $params, $user_presets );
|
||||
$params = uac::setDefaultProject( $params, $user_presets );
|
||||
|
||||
#print STDERR $params->{project_id}."\n";
|
||||
my $request = {
|
||||
url => $ENV{QUERY_STRING} || '',
|
||||
params => {
|
||||
@@ -80,7 +78,6 @@ sub show_events {
|
||||
uac::permissions_denied('read_events');
|
||||
return;
|
||||
}
|
||||
|
||||
my $events = getDates( $config, $request );
|
||||
$params->{events} = $events;
|
||||
$params->{total} = scalar(@$events);
|
||||
@@ -107,8 +104,6 @@ sub create_events {
|
||||
print STDERR "<pre>found " . ( scalar @$dates ) . " dates\n";
|
||||
my $events = [];
|
||||
for my $date (@$dates) {
|
||||
|
||||
#print STDERR $date->{start}."\n";
|
||||
push @$events, createEvent( $config, $request, $date );
|
||||
}
|
||||
$params->{events} = $events;
|
||||
|
||||
@@ -2,8 +2,19 @@ table#events{
|
||||
transition:all 2s;
|
||||
}
|
||||
|
||||
table#events.done{
|
||||
background:#cfc;
|
||||
table#events div.error{
|
||||
background: #f33;
|
||||
color:white;
|
||||
padding:1rem;
|
||||
width: 30rem;
|
||||
}
|
||||
|
||||
|
||||
table#events div.done{
|
||||
background: #3f3;
|
||||
color:white;
|
||||
padding:1rem;
|
||||
width: 30rem;
|
||||
}
|
||||
|
||||
table#events td:nth-of-type(1){
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
function register_buttons() {
|
||||
$("#forms form").on('click', 'button', function( event ) {
|
||||
event.preventDefault();
|
||||
var form = $(this).closest('form');
|
||||
let form = $(this).closest('form');
|
||||
let formId = form.attr('id');
|
||||
let table = $('#' + formId+" table");
|
||||
let status = table.find("td.result div");
|
||||
status.text('').removeClass("error").removeClass("done");
|
||||
|
||||
$.post("notify-events.cgi", form.serialize())
|
||||
.done( function(data) {
|
||||
var content = $(data).find("#content");
|
||||
$('#result').html(content);
|
||||
var formId = form.attr('id');
|
||||
$('#' + formId+" table").addClass("done");
|
||||
.always( function(data) {
|
||||
if (data.includes("done")){
|
||||
status.text("ok").removeClass("error").addClass("done");
|
||||
} else {
|
||||
status.text(data).removeClass("ok").addClass("error");
|
||||
}
|
||||
table.find("tr.result").show();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ no warnings 'redefine';
|
||||
use utf8;
|
||||
|
||||
use Data::Dumper;
|
||||
use Try::Tiny;
|
||||
|
||||
use params();
|
||||
use config();
|
||||
@@ -53,11 +54,10 @@ my $request = {
|
||||
|
||||
#set user at params->presets->user
|
||||
$request = uac::prepare_request( $request, $user_presets );
|
||||
|
||||
$params = $request->{params}->{checked};
|
||||
|
||||
#show header
|
||||
unless ( params::isJson() || ( $params->{template} =~ /\.txt/ ) ) {
|
||||
unless ( params::isJson() || ( $params->{template} =~ /\.txt/ ) || $params->{action}eq'send' ) {
|
||||
my $headerParams = uac::set_template_permissions( $request->{permissions}, $params );
|
||||
$headerParams->{loc} = localization::get( $config, { user => $user, file => 'menu' } );
|
||||
template::process( $config, 'print', template::check( $config, 'default.html' ), $headerParams );
|
||||
@@ -162,8 +162,13 @@ sub sendMail {
|
||||
$mail->{Cc} = $params->{cc} if defined $params->{cc};
|
||||
$mail->{Subject} = $params->{subject} if defined $params->{subject};
|
||||
$mail->{Data} = $params->{content} if defined $params->{content};
|
||||
my $result = mail::send($mail);
|
||||
print "Content-type:text/plain\n\nresult:".Dumper($result);
|
||||
|
||||
try {
|
||||
my $result = mail::send($mail);
|
||||
print "Content-type:text/plain\n\ndone:$result\n";
|
||||
} catch {
|
||||
printf "Content-type:text/plain\n\nresult:%s\n", $_->{message} // $_;
|
||||
}
|
||||
}
|
||||
|
||||
sub getMail {
|
||||
@@ -214,8 +219,6 @@ sub eventToText {
|
||||
$s .= $event->{user_excerpt} . "\n";
|
||||
$s .= $event->{topic} . "\n";
|
||||
$s .= $event->{content} . "\n";
|
||||
|
||||
#print STDERR "DUMP\n$s";
|
||||
return $s;
|
||||
|
||||
}
|
||||
|
||||
@@ -28,3 +28,5 @@ msgstr "Inhalt"
|
||||
msgid "show_details"
|
||||
msgstr "Zeige Details"
|
||||
|
||||
msgid "result"
|
||||
msgstr "Ergebnis"
|
||||
|
||||
@@ -28,3 +28,5 @@ msgstr "Content"
|
||||
msgid "show_details"
|
||||
msgstr "Show Details"
|
||||
|
||||
msgid "result"
|
||||
msgstr "Result"
|
||||
|
||||
@@ -43,15 +43,15 @@
|
||||
<TMPL_IF playout><img src="image/play.svg" title="playout"></TMPL_IF>
|
||||
</td>
|
||||
|
||||
<TMPL_IF noRecipient>
|
||||
<TMPL_IF noRecipient>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Warning</td>
|
||||
<td><div class="error">no recipient configured at series!</div></td>
|
||||
</tr>
|
||||
<TMPL_ELSE>
|
||||
<tr>
|
||||
<td>Warning</td>
|
||||
<td><div class="error">no recipient configured at series!</div></td>
|
||||
</tr>
|
||||
<TMPL_ELSE>
|
||||
<td class="action"><button type="submit"><TMPL_VAR .loc.button_send></button></td>
|
||||
</tr>
|
||||
|
||||
@@ -63,12 +63,18 @@
|
||||
</tr>
|
||||
</TMPL_IF>
|
||||
|
||||
<tr class="result" style="display:none">
|
||||
<td><TMPL_VAR .loc.result></td>
|
||||
<td class="result"><div></div></td>
|
||||
</tr>
|
||||
|
||||
<TMPL_IF mail.Subject>
|
||||
<tr class="subject details">
|
||||
<td><TMPL_VAR .loc.subject></td>
|
||||
<td class="mailSubject"><input name="subject" value="<TMPL_VAR mail.Subject>"></td>
|
||||
</tr>
|
||||
</TMPL_IF>
|
||||
|
||||
<TMPL_IF mail.From>
|
||||
<tr class="details">
|
||||
<td><TMPL_VAR .loc.from></td>
|
||||
@@ -97,7 +103,7 @@
|
||||
</tr>
|
||||
</TMPL_IF>
|
||||
|
||||
</TMPL_IF>
|
||||
</TMPL_IF>
|
||||
</table>
|
||||
</form>
|
||||
</TMPL_LOOP>
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<td>
|
||||
<button
|
||||
class="selectImage"
|
||||
onclick="selectImage('<TMPL_VAR name escape=javascript>', '<TMPL_VAR image escape=javascript>', 'studio', '<TMPL_VAR .project_id escape=js>','<TMPL_VAR .studio_id escape=js>'); return false;"
|
||||
onclick="selectImage('<TMPL_VAR name escape=javascript>', '<TMPL_VAR image escape=javascript>', 'studios', '<TMPL_VAR .project_id escape=js>','<TMPL_VAR .studio_id escape=js>'); return false;"
|
||||
>
|
||||
<img id="imagePreview" src="show-image.cgi?project_id=<TMPL_VAR .project_id escape=js>&studio_id=<TMPL_VAR .studio_id escape=js>&filename=<TMPL_VAR image escape=js>&type=icon">
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user