Skip to content

Commit

Permalink
Update to use DataTables (devopsdays#8218)
Browse files Browse the repository at this point in the history
* Update to use DataTables

This replaces the deprecated `bootstrap-sortable` with an updated library called `DataTables`.

Fixes devopsdays#8214

Signed-off-by: Matt Stratton <[email protected]>

* Fix random typo

Signed-off-by: Matt Stratton <[email protected]>
  • Loading branch information
mattstratton authored Sep 9, 2019
1 parent 6b796df commit 4fc3517
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 24 deletions.
3 changes: 0 additions & 3 deletions gulp/tasks/dev/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ var gulp = require('gulp'),

var scripts = [
'node_modules/jquery/dist/jquery.js',
'node_modules/tether/dist/js/tether.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'themes/devopsdays-theme/static/components/jquery-oembed-all/jquery.oembed.js',
'themes/devopsdays-theme/static/components/bootstrap-sortable/Scripts/bootstrap-sortable.js',
'node_modules/moment/moment.js',
'node_modules/jssocials/dist/jssocials.js',
'themes/devopsdays-theme/static/js/devopsdays.js'
]
Expand Down
10 changes: 0 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
"font-awesome": "^4.7.0",
"jquery": "^3.4.1",
"jssocials": "^1.5.0",
"moment": "^2.24.0",
"popper.js": "^1.15.0",
"tether": "^1.4.7"
"popper.js": "^1.15.0"
}
}
2 changes: 1 addition & 1 deletion themes/devopsdays-theme/layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h2 class="footer-heading">{{ dateFormat "02 January, 2006" .Date }}</h2>
{{- end -}}
<p class="footer-content">
{{- if isset .Params "description" -}}
{{- if ne .Params.descripton "" -}}
{{- if ne .Params.description "" -}}
{{ .Params.description | markdownify }}
{{- end -}}
{{- else -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
{{- end -}}

<!-- end metadata -->
<script src={{"/js/devopsdays-min.js"}}></script>
{{- if .IsPage -}}

{{ if eq (index (split (.Permalink | relURL) "/") 1) "events" }}
Expand Down
22 changes: 22 additions & 0 deletions themes/devopsdays-theme/layouts/partials/head_includes.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<link href="{{ "/css/site.css" }}" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700" rel="stylesheet">
<link href="{{ "/css/googlemaps.css" }}" rel="stylesheet">
{{- if eq .Type "speaking" -}}
<link href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" rel="stylesheet">
{{- end -}}

<link rel="apple-touch-icon" sizes="57x57" href="{{"/apple-icon-57x57.png" }}">
<link rel="apple-touch-icon" sizes="60x60" href="{{"/apple-icon-60x60.png" }}">
Expand Down Expand Up @@ -38,3 +41,22 @@
<link href="{{ "/events/index.xml" }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
<link href="{{ "/events/index.xml" }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}

<script src={{"/js/devopsdays-min.js"}}></script>

{{- if eq .Type "speaking" -}}
<script src={{"https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"}}></script>

<script>
$(document).ready(function () {

$('#cfp-list').DataTable( {
"paging": false,
"searching": false,
"info": false,
"autoWidth": false,
"order": [[ 1, "asc" ]]
} );
});
</script>
{{- end -}}
6 changes: 3 additions & 3 deletions themes/devopsdays-theme/layouts/partials/speaking.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{{- $.Scratch.Add "events" "<table class = 'table sortable table-condensed'><thead><tr><th>City</th><th>&nbsp;&nbsp;CFP Closes</th><th>&nbsp;&nbsp;&nbsp;&nbsp;Event Starts</th></tr></thead><tbody>" -}}
{{- $.Scratch.Add "events" "<table id = 'cfp-list' class = 'table table-condensed'><thead><tr><th>City</th><th>&nbsp;&nbsp;CFP Closes</th><th>&nbsp;&nbsp;&nbsp;&nbsp;Event Starts</th></tr></thead><tbody>" -}}
{{- range sort $.Site.Data.events "startdate" -}}
{{- if (and .cfp_date_end .startdate) -}}
{{- if and (ge now (time .cfp_date_start)) (ge (time .cfp_date_end) now) -}}
{{- $.Scratch.Add "events" "<tr><td><a href = '/events/" -}}
{{- $.Scratch.Add "events" .name -}}
{{- $.Scratch.Add "events" "/' class = 'speaking'>" -}}
{{- $.Scratch.Add "events" .city -}}
{{- $.Scratch.Add "events" "</a></td><td data-dateformat='YYYY-MM-DD'>&nbsp;&nbsp;" -}}
{{- $.Scratch.Add "events" "</a></td><td>&nbsp;&nbsp;" -}}
{{- $.Scratch.Add "events" (dateFormat "2006-01-02" .cfp_date_end) -}}
{{- $.Scratch.Add "events" "</td><td data-dateformat='YYYY-MM-DD'>&nbsp;&nbsp;&nbsp;&nbsp;" -}}
{{- $.Scratch.Add "events" "</td><td>&nbsp;&nbsp;&nbsp;&nbsp;" -}}
{{- $.Scratch.Add "events" (dateFormat "2006-01-02" .startdate) -}}
{{- $.Scratch.Add "events" "</td></tr>" -}}
{{- end }} {{/* end: date is now or afterwards */}}
Expand Down
2 changes: 1 addition & 1 deletion themes/devopsdays-theme/static/js/devopsdays-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion themes/devopsdays-theme/static/js/devopsdays-min.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion themes/devopsdays-theme/static/js/devopsdays.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// $( "#accordion" ).accordion();
// } );


var acc = document.getElementsByClassName("accordion");
var i;

Expand Down

0 comments on commit 4fc3517

Please sign in to comment.