Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
211b08aa
Commit
211b08aa
authored
Nov 13, 2018
by
Sébastiaan Versteeg
Committed by
Luko van der Maas
Nov 14, 2018
Browse files
Fix events javascript to be compressed again
parent
851ee4f4
Changes
5
Hide whitespace changes
Inline
Side-by-side
website/events/locale/nl/LC_MESSAGES/django.po
View file @
211b08aa
...
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-11-
08 13:43
+0100\n"
"POT-Creation-Date: 2018-11-
13 20:58
+0100\n"
"PO-Revision-Date: 2018-11-08 13:45+0100\n"
"Last-Translator: Thom Wiggers <thom@thomwiggers.nl>\n"
"Language-Team: \n"
...
...
@@ -700,8 +700,8 @@ msgid ""
"Searching for another event? <a href=\"%(events_index)s\">Take a look at the "
"entire agenda.</a>"
msgstr ""
"Op zoek naar een andere evenement? <a href=\"%(events_index)s\">Bekijk de
hele
"
"agenda.</a>"
"Op zoek naar een andere evenement? <a href=\"%(events_index)s\">Bekijk de "
"
hele
agenda.</a>"
#: templates/events/index.html
msgid "iCal feed (all events)"
...
...
@@ -711,18 +711,6 @@ msgstr "iCal feed (alle evenementen)"
msgid "iCal feed (personal)"
msgstr "iCal feed (persoonlijk)"
#: templates/events/index.html
msgid "list"
msgstr "lijst"
#: templates/events/index.html
msgid "hide birthdays"
msgstr "verberg verjaardagen"
#: templates/events/index.html
msgid "show birthdays"
msgstr "toon verjaardagen"
#: templates/events/member_email.txt
#, python-format
msgid ""
...
...
website/events/locale/nl/LC_MESSAGES/djangojs.mo
View file @
211b08aa
No preview for this file type
website/events/locale/nl/LC_MESSAGES/djangojs.po
View file @
211b08aa
...
...
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-1
0
-1
8 14:35
+0
2
00\n"
"PO-Revision-Date: 2018-1
0
-1
8 14:36
+0
2
00\n"
"POT-Creation-Date: 2018-1
1
-1
3 20:59
+0
1
00\n"
"PO-Revision-Date: 2018-1
1
-1
3 20:59
+0
1
00\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Language-Team: \n"
"Language: nl\n"
...
...
@@ -25,3 +25,15 @@ msgstr "Er zijn geen evenementen gepland in de geselecteerde periode."
#: static/events/js/calendarlistview.js
msgid "Go to event"
msgstr "Naar de evenementpagina"
#: static/events/js/main.js
msgid "list"
msgstr "lijst"
#: static/events/js/main.js
msgid "hide birthdays"
msgstr "verberg verjaardagen"
#: static/events/js/main.js
msgid "show birthdays"
msgstr "toon verjaardagen"
website/events/static/events/js/main.js
0 → 100644
View file @
211b08aa
function
checkResponsiveState
(
calendarElement
,
windowWidth
,
view
)
{
if
(
windowWidth
<=
768
)
{
calendarElement
.
fullCalendar
(
'
option
'
,
'
header
'
,
{
right
:
'
prev,next today
'
});
}
else
{
if
(
view
.
name
===
'
list
'
)
{
calendarElement
.
fullCalendar
(
'
option
'
,
'
header
'
,
{
right
:
'
list,agendaWeek,month prev,next today
'
});
}
else
{
calendarElement
.
fullCalendar
(
'
option
'
,
'
header
'
,
{
right
:
'
showBirthdays, list,agendaWeek,month prev,next today
'
});
}
}
}
$
(
function
()
{
var
calendarElement
=
$
(
'
#calendar
'
);
var
sources
=
{
events
:
"
/api/v1/events/calendarjs
"
,
birthdays
:
"
/api/v1/members/birthdays
"
,
partners
:
"
/api/v1/partners/calendarjs
"
,
unpublishedEvents
:
"
/api/v1/events/unpublished
"
};
var
showUnpublished
=
calendarElement
.
data
(
'
show-unpublished
'
);
var
defaultDate
=
calendarElement
.
data
(
'
default-date
'
);
var
isAuthenticated
=
calendarElement
.
data
(
'
authenticated
'
);
var
language
=
calendarElement
.
data
(
'
language
'
);
var
eventSources
=
[
sources
.
events
,
sources
.
partners
];
if
(
showUnpublished
)
{
eventSources
.
push
(
sources
.
unpublishedEvents
);
}
if
(
Cookies
.
get
(
'
showbirthdays
'
))
{
eventSources
.
push
(
sources
.
birthdays
);
}
var
tmpView
=
(
$
(
window
).
width
()
<
979
)
?
'
list
'
:
'
agendaWeek
'
;
if
(
Cookies
.
get
(
'
agendaview
'
)
!==
undefined
)
{
tmpView
=
Cookies
.
get
(
'
agendaview
'
);
}
// History idea and code parts from
// https://github.com/fullcalendar/fullcalendar/issues/659#issuecomment-132535804
// and https://github.com/fullcalendar/fullcalendar/issues/659#issuecomment-245544401
var
startDate
=
new
Date
(
defaultDate
);
var
tmpYear
=
startDate
.
getFullYear
();
var
tmpMonth
=
startDate
.
getMonth
();
var
tmpDay
=
startDate
.
getDate
();
var
vars
=
window
.
location
.
hash
.
split
(
"
&
"
);
for
(
var
i
=
0
;
i
<
vars
.
length
;
i
++
)
{
if
(
vars
[
i
].
match
(
"
^#year
"
))
tmpYear
=
vars
[
i
].
substring
(
6
);
if
(
vars
[
i
].
match
(
"
^month
"
))
tmpMonth
=
vars
[
i
].
substring
(
6
)
-
1
;
if
(
vars
[
i
].
match
(
"
^day
"
))
tmpDay
=
vars
[
i
].
substring
(
4
);
if
(
vars
[
i
].
match
(
"
^view
"
))
tmpView
=
vars
[
i
].
substring
(
5
);
}
calendarElement
.
fullCalendar
({
aspectRatio
:
1.8
,
theme
:
'
bootstrap4
'
,
eventSources
:
eventSources
,
defaultView
:
tmpView
,
firstDay
:
1
,
scrollTime
:
'
14:00:00
'
,
timeFormat
:
'
HH:mm
'
,
eventLimit
:
true
,
locale
:
language
,
views
:
{
list
:
{
buttonText
:
gettext
(
'
list
'
),
duration
:
{
weeks
:
1
}
}
},
defaultDate
:
defaultDate
,
customButtons
:
isAuthenticated
?
{
showBirthdays
:
{
text
:
Cookies
.
get
(
'
showbirthdays
'
)
?
gettext
(
'
hide birthdays
'
)
:
gettext
(
'
show birthdays
'
),
click
:
function
(
e
)
{
if
(
e
.
target
.
innerHTML
==
gettext
(
'
hide birthdays
'
))
{
e
.
target
.
innerHTML
=
gettext
(
'
show birthdays
'
);
Cookies
.
remove
(
'
showbirthdays
'
);
calendarElement
.
fullCalendar
(
'
removeEventSource
'
,
sources
.
birthdays
);
}
else
{
e
.
target
.
innerHTML
=
gettext
(
'
hide birthdays
'
);
Cookies
.
set
(
'
showbirthdays
'
,
1
);
calendarElement
.
fullCalendar
(
'
addEventSource
'
,
sources
.
birthdays
);
}
}
}
}
:
{}
,
header
:
{
right
:
'
showBirthdays, list,agendaWeek,month prev,next today
'
},
eventClick
:
function
(
event
)
{
if
(
event
.
url
&&
event
.
blank
)
{
window
.
open
(
event
.
url
,
'
_blank
'
);
return
false
;
}
else
if
(
event
.
url
)
{
window
.
replace
(
event
.
url
);
return
false
;
}
},
eventRender
:
function
(
event
,
element
)
{
element
.
attr
(
'
title
'
,
event
.
description
);
},
viewRender
:
function
(
view
)
{
var
prevView
=
Cookies
.
get
(
'
agendaview
'
);
var
moment
=
calendarElement
.
fullCalendar
(
'
getDate
'
);
if
(
moment
&&
moment
.
isValid
())
{
window
.
location
.
hash
=
'
year=
'
+
moment
.
format
(
'
YYYY
'
)
+
'
&month=
'
+
(
moment
.
format
(
'
M
'
))
+
'
&day=
'
+
moment
.
format
(
'
DD
'
)
+
'
&view=
'
+
view
.
name
;
}
if
(
view
.
name
!==
prevView
)
{
var
windowWidth
=
$
(
window
).
width
();
Cookies
.
set
(
'
agendaview
'
,
view
.
name
);
checkResponsiveState
(
calendarElement
,
windowWidth
,
view
.
name
);
}
}
,
windowResize
:
function
()
{
var
windowWidth
=
$
(
window
).
width
();
var
view
=
(
windowWidth
<=
768
)
?
'
list
'
:
Cookies
.
get
(
'
agendaview
'
);
var
currentView
=
$
(
'
#calendar
'
).
fullCalendar
(
'
getView
'
);
if
(
view
!==
currentView
.
name
)
{
calendarElement
.
fullCalendar
(
'
changeView
'
,
view
);
}
else
{
checkResponsiveState
(
calendarElement
,
windowWidth
,
currentView
.
name
);
}
}
})
;
var
date
=
new
Date
(
tmpYear
,
tmpMonth
,
tmpDay
,
0
,
0
,
0
);
var
moment
=
calendarElement
.
fullCalendar
(
'
getDate
'
);
var
view
=
calendarElement
.
fullCalendar
(
'
getView
'
);
if
(
date
.
getFullYear
()
!==
moment
.
format
(
'
YYYY
'
)
||
date
.
getMonth
()
!==
moment
.
format
(
'
M
'
)
||
date
.
getDate
()
!==
moment
.
format
(
'
DD
'
))
{
calendarElement
.
fullCalendar
(
'
gotoDate
'
,
date
);
}
if
(
view
.
name
!==
tmpView
)
{
calendarElement
.
fullCalendar
(
'
changeView
'
,
tmpView
);
}
else
{
var
windowWidth
=
$
(
window
).
width
();
checkResponsiveState
(
calendarElement
,
windowWidth
,
view
);
}
});
website/events/templates/events/index.html
View file @
211b08aa
...
...
@@ -2,13 +2,16 @@
{% load i18n static compress personal_feed %}}
{% get_current_language as LANGUAGE_CODE %}
{% block title %}{% trans "Calendar"|capfirst %} — {{ block.super }}{% endblock %}
{% block opengraph_title %}{% trans "Calendar"|capfirst %} — {{ block.super }}{% endblock %}
{% block title %}{% trans "Calendar"|capfirst %} —
{{ block.super }}{% endblock %}
{% block opengraph_title %}{% trans "Calendar"|capfirst %} —
{{ block.super }}{% endblock %}
{% block css_head %}
{{ block.super }}
{% compress css %}
<link
href=
"{% static "
events
/
css
/
fullcalendar.css
"
%}"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"{% static "
events
/
css
/
fullcalendar.css
"
%}"
rel=
"stylesheet"
type=
"text/css"
>
{% endcompress %}
{% endblock %}
...
...
@@ -40,199 +43,33 @@
{% endif %}
</h1>
<div
id=
"calendar"
></div>
<div
id=
"calendar"
data-default-date=
"{% spaceless %}
{% if upcoming_activity %}
{{ upcoming_activity.start|date:'Y-m-d' }}
{% else %}
{% now 'Y-m-d' %}
{% endif %}
{% endspaceless %}"
data-authenticated=
"{{ request.user.is_authenticated|yesno:'true,false' }}"
data-show-unpublished=
"{{ perms.events.change_event|yesno:'true,false' }}"
data-language=
"{{ LANGUAGE_CODE }}"
></div>
</div>
</section>
{% endblock body %}
{% block js_body %}
{{ block.super }}
<script
type=
"text/javascript"
>
$
(
function
()
{
var
calendarElement
=
$
(
'
#calendar
'
);
var
sources
=
{
events
:
"
/api/v1/events/calendarjs
"
,
birthdays
:
"
/api/v1/members/birthdays
"
,
partners
:
"
/api/v1/partners/calendarjs
"
,
unpublishedEvents
:
"
/api/v1/events/unpublished
"
};
var
eventSources
=
[
sources
.
events
,
sources
.
partners
];
{
%
if
perms
.
events
.
change_event
%
}
eventSources
.
push
(
sources
.
unpublishedEvents
);
{
%
endif
%
}
if
(
Cookies
.
get
(
'
showbirthdays
'
))
{
eventSources
.
push
(
sources
.
birthdays
);
}
var
tmpView
=
(
$
(
window
).
width
()
<
979
)
?
'
list
'
:
'
agendaWeek
'
;
if
(
Cookies
.
get
(
'
agendaview
'
)
!==
undefined
)
{
tmpView
=
Cookies
.
get
(
'
agendaview
'
);
}
// History idea and code parts from
// https://github.com/fullcalendar/fullcalendar/issues/659#issuecomment-132535804
// and https://github.com/fullcalendar/fullcalendar/issues/659#issuecomment-245544401
{
%
if
upcoming_activity
%
}
var
startDate
=
new
Date
(
'
{{ upcoming_activity.start|date:
'
Y
-
m
-
d
'
}}
'
);
{
%
else
%
}
var
startDate
=
new
Date
();
{
%
endif
%
}
var
tmpYear
=
startDate
.
getFullYear
();
var
tmpMonth
=
startDate
.
getMonth
();
var
tmpDay
=
startDate
.
getDate
();
var
vars
=
window
.
location
.
hash
.
split
(
"
&
"
);
for
(
var
i
=
0
;
i
<
vars
.
length
;
i
++
)
{
if
(
vars
[
i
].
match
(
"
^#year
"
))
tmpYear
=
vars
[
i
].
substring
(
6
);
if
(
vars
[
i
].
match
(
"
^month
"
))
tmpMonth
=
vars
[
i
].
substring
(
6
)
-
1
;
if
(
vars
[
i
].
match
(
"
^day
"
))
tmpDay
=
vars
[
i
].
substring
(
4
);
if
(
vars
[
i
].
match
(
"
^view
"
))
tmpView
=
vars
[
i
].
substring
(
5
);
}
calendarElement
.
fullCalendar
({
aspectRatio
:
1.8
,
theme
:
'
bootstrap4
'
,
eventSources
:
eventSources
,
defaultView
:
tmpView
,
firstDay
:
1
,
scrollTime
:
'
14:00:00
'
,
timeFormat
:
'
HH:mm
'
,
eventLimit
:
true
,
locale
:
'
{{ LANGUAGE_CODE }}
'
,
views
:
{
list
:
{
buttonText
:
'
{% trans "list" %}
'
,
duration
:
{
weeks
:
1
}
}
},
defaultDate
:
{
%
spaceless
%
}
{
%
if
upcoming_activity
%
}
"
{{ upcoming_activity.start|date:'Y-m-d' }}
"
{
%
else
%
}
"
{% now 'Y-m-d' %}
"
{
%
endif
%
}
{
%
endspaceless
%
},
customButtons
:
{
{
%
if
request
.
user
.
is_authenticated
%
}
showBirthdays
:
{
text
:
Cookies
.
get
(
'
showbirthdays
'
)
?
'
{% trans "hide birthdays" %}
'
:
'
{% trans "show birthdays" %}
'
,
click
:
function
(
e
)
{
if
(
e
.
target
.
innerHTML
==
'
{% trans "hide birthdays" %}
'
)
{
e
.
target
.
innerHTML
=
'
{% trans
'
show
birthdays
'
%}
'
;
Cookies
.
remove
(
'
showbirthdays
'
);
calendarElement
.
fullCalendar
(
'
removeEventSource
'
,
sources
.
birthdays
);
}
else
{
e
.
target
.
innerHTML
=
'
{% trans "hide birthdays" %}
'
;
Cookies
.
set
(
'
showbirthdays
'
,
1
);
calendarElement
.
fullCalendar
(
'
addEventSource
'
,
sources
.
birthdays
);
}
}
}
{
%
endif
%
}
},
header
:
{
right
:
'
showBirthdays, list,agendaWeek,month prev,next today
'
},
eventClick
:
function
(
event
)
{
if
(
event
.
url
&&
event
.
blank
)
{
window
.
open
(
event
.
url
,
'
_blank
'
);
return
false
;
}
else
if
(
event
.
url
)
{
window
.
replace
(
event
.
url
);
return
false
;
}
},
eventRender
:
function
(
event
,
element
)
{
element
.
attr
(
'
title
'
,
event
.
description
);
},
viewRender
:
function
(
view
)
{
var
prevView
=
Cookies
.
get
(
'
agendaview
'
);
var
moment
=
calendarElement
.
fullCalendar
(
'
getDate
'
);
if
(
moment
&&
moment
.
isValid
())
{
window
.
location
.
hash
=
'
year=
'
+
moment
.
format
(
'
YYYY
'
)
+
'
&month=
'
+
(
moment
.
format
(
'
M
'
))
+
'
&day=
'
+
moment
.
format
(
'
DD
'
)
+
'
&view=
'
+
view
.
name
;
}
if
(
view
.
name
!==
prevView
)
{
var
windowWidth
=
$
(
window
).
width
();
Cookies
.
set
(
'
agendaview
'
,
view
.
name
);
if
(
windowWidth
<=
768
)
{
calendarElement
.
fullCalendar
(
'
option
'
,
'
header
'
,
{
right
:
'
prev,next today
'
});
}
else
{
if
(
view
.
name
===
'
list
'
)
{
calendarElement
.
fullCalendar
(
'
option
'
,
'
header
'
,
{
right
:
'
list,agendaWeek,month prev,next today
'
});
}
else
{
calendarElement
.
fullCalendar
(
'
option
'
,
'
header
'
,
{
right
:
'
showBirthdays, list,agendaWeek,month prev,next today
'
});
}
}
}
},
windowResize
:
function
()
{
var
windowWidth
=
$
(
window
).
width
();
var
view
=
(
windowWidth
<=
768
)
?
'
list
'
:
Cookies
.
get
(
'
agendaview
'
);
var
currentView
=
$
(
'
#calendar
'
).
fullCalendar
(
'
getView
'
);
if
(
view
!==
currentView
.
name
)
{
calendarElement
.
fullCalendar
(
'
changeView
'
,
view
);
}
else
if
(
windowWidth
<=
768
)
{
calendarElement
.
fullCalendar
(
'
option
'
,
'
header
'
,
{
right
:
'
prev,next today
'
});
}
else
{
if
(
currentView
.
name
===
'
list
'
)
{
calendarElement
.
fullCalendar
(
'
option
'
,
'
header
'
,
{
right
:
'
list,agendaWeek,month prev,next today
'
});
}
else
{
calendarElement
.
fullCalendar
(
'
option
'
,
'
header
'
,
{
right
:
'
showBirthdays, list,agendaWeek,month prev,next today
'
});
}
}
}
});
var
date
=
new
Date
(
tmpYear
,
tmpMonth
,
tmpDay
,
0
,
0
,
0
);
var
moment
=
calendarElement
.
fullCalendar
(
'
getDate
'
);
var
view
=
calendarElement
.
fullCalendar
(
'
getView
'
);
if
(
date
.
getFullYear
()
!==
moment
.
format
(
'
YYYY
'
)
||
date
.
getMonth
()
!==
moment
.
format
(
'
M
'
)
||
date
.
getDate
()
!==
moment
.
format
(
'
DD
'
))
{
calendarElement
.
fullCalendar
(
'
gotoDate
'
,
date
);
}
if
(
view
.
name
!==
tmpView
)
{
calendarElement
.
fullCalendar
(
'
changeView
'
,
tmpView
);
}
var
windowWidth
=
$
(
window
).
width
();
if
(
windowWidth
<=
768
)
{
calendarElement
.
fullCalendar
(
'
option
'
,
'
header
'
,
{
right
:
'
prev,next today
'
});
}
else
{
if
(
view
.
name
===
'
list
'
)
{
calendarElement
.
fullCalendar
(
'
option
'
,
'
header
'
,
{
right
:
'
list,agendaWeek,month prev,next today
'
});
}
else
{
calendarElement
.
fullCalendar
(
'
option
'
,
'
header
'
,
{
right
:
'
showBirthdays, list,agendaWeek,month prev,next today
'
});
}
}
});
</script>
{% compress js %}
<script
type=
"text/javascript"
src=
"{% static "
events
/
js
/
moment.js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
events
/
js
/
fullcalendar.min.js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
events
/
js
/
fullcalendar-nl.js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
events
/
js
/
calendarlistview.js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
events
/
js
/
moment.js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
events
/
js
/
fullcalendar.min.js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
events
/
js
/
fullcalendar-nl.js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
events
/
js
/
calendarlistview.js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
events
/
js
/
main.js
"
%}"
></script>
{% endcompress %}
{% endblock js_body %}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment