From 91519e8b439d7e503d993f59ab2001ec796544ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Sun, 6 May 2018 22:09:19 +0200 Subject: [PATCH 1/2] Remove speaker pictures from schedule. --- schedule/src/Decoders.elm | 2 -- schedule/src/Models.elm | 2 -- schedule/src/Views/SpeakerDetail.elm | 25 +++++-------------------- src/program/models.py | 4 ---- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/schedule/src/Decoders.elm b/schedule/src/Decoders.elm index b574794c..c96eda13 100644 --- a/schedule/src/Decoders.elm +++ b/schedule/src/Decoders.elm @@ -46,8 +46,6 @@ speakerDecoder = |> required "name" string |> required "slug" string |> required "biography" string - |> optional "large_picture_url" (nullable string) Nothing - |> optional "small_picture_url" (nullable string) Nothing eventDecoder : Decoder Event diff --git a/schedule/src/Models.elm b/schedule/src/Models.elm index 9f60f394..1381dca3 100644 --- a/schedule/src/Models.elm +++ b/schedule/src/Models.elm @@ -69,8 +69,6 @@ type alias Speaker = { name : String , slug : SpeakerSlug , biography : String - , largePictureUrl : Maybe String - , smallPictureUrl : Maybe String } diff --git a/schedule/src/Views/SpeakerDetail.elm b/schedule/src/Views/SpeakerDetail.elm index 4c13f2b7..c54248d9 100644 --- a/schedule/src/Views/SpeakerDetail.elm +++ b/schedule/src/Views/SpeakerDetail.elm @@ -22,33 +22,18 @@ speakerDetailView speakerSlug model = model.speakers |> List.filter (\speaker -> speaker.slug == speakerSlug) |> List.head - - image = - case speaker of - Just speaker -> - case speaker.smallPictureUrl of - Just smallPictureUrl -> - [ img [ src smallPictureUrl ] [] ] - - Nothing -> - [] - - Nothing -> - [] in case speaker of Just speaker -> div [] - ([ a [ onClick BackInHistory, classList [ ( "btn", True ), ( "btn-default", True ) ] ] + [ a [ onClick BackInHistory, classList [ ( "btn", True ), ( "btn-default", True ) ] ] [ i [ classList [ ( "fa", True ), ( "fa-chevron-left", True ) ] ] [] , text " Back" ] - , h3 [] [ text speaker.name ] - , div [] [ Markdown.toHtml [] speaker.biography ] - , speakerEvents speaker model - ] - ++ image - ) + , h3 [] [ text speaker.name ] + , div [] [ Markdown.toHtml [] speaker.biography ] + , speakerEvents speaker model + ] Nothing -> div [] [ text "Unknown speaker..." ] diff --git a/src/program/models.py b/src/program/models.py index 04503f5b..6118345c 100644 --- a/src/program/models.py +++ b/src/program/models.py @@ -659,10 +659,6 @@ class Speaker(CampRelatedModel): 'biography': self.biography, } - if self.picture_small and self.picture_large: - data['large_picture_url'] = self.get_large_picture_url() - data['small_picture_url'] = self.get_small_picture_url() - return data From 280dd5785fde7c4ed7e4223415db755b58fc6462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Sun, 6 May 2018 22:10:20 +0200 Subject: [PATCH 2/2] Adding the compiled version of the schedule without speaker pictures. --- src/program/static/js/elm_based_schedule.js | 173 ++++++++------------ 1 file changed, 68 insertions(+), 105 deletions(-) diff --git a/src/program/static/js/elm_based_schedule.js b/src/program/static/js/elm_based_schedule.js index 5e27d676..ce2b5f6b 100644 --- a/src/program/static/js/elm_based_schedule.js +++ b/src/program/static/js/elm_based_schedule.js @@ -13921,9 +13921,9 @@ var _user$project$Models$Day = F3( function (a, b, c) { return {day_name: a, date: b, repr: c}; }); -var _user$project$Models$Speaker = F5( - function (a, b, c, d, e) { - return {name: a, slug: b, biography: c, largePictureUrl: d, smallPictureUrl: e}; +var _user$project$Models$Speaker = F3( + function (a, b, c) { + return {name: a, slug: b, biography: c}; }); var _user$project$Models$EventInstance = function (a) { return function (b) { @@ -14133,29 +14133,19 @@ var _user$project$Decoders$eventDecoder = A3( 'title', _elm_lang$core$Json_Decode$string, _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$decode(_user$project$Models$Event)))))))); -var _user$project$Decoders$speakerDecoder = A4( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$optional, - 'small_picture_url', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), - _elm_lang$core$Maybe$Nothing, - A4( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$optional, - 'large_picture_url', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), - _elm_lang$core$Maybe$Nothing, +var _user$project$Decoders$speakerDecoder = A3( + _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, + 'biography', + _elm_lang$core$Json_Decode$string, + A3( + _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, + 'slug', + _elm_lang$core$Json_Decode$string, A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'biography', + 'name', _elm_lang$core$Json_Decode$string, - A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'slug', - _elm_lang$core$Json_Decode$string, - A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'name', - _elm_lang$core$Json_Decode$string, - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$decode(_user$project$Models$Speaker)))))); + _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$decode(_user$project$Models$Speaker)))); var _user$project$Decoders$dayDecoder = A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, 'repr', @@ -16224,117 +16214,90 @@ var _user$project$Views_SpeakerDetail$speakerDetailView = F2( return _elm_lang$core$Native_Utils.eq(speaker.slug, speakerSlug); }, model.speakers)); - var image = function () { - var _p1 = speaker; - if (_p1.ctor === 'Just') { - var _p2 = _p1._0.smallPictureUrl; - if (_p2.ctor === 'Just') { - return { - ctor: '::', - _0: A2( - _elm_lang$html$Html$img, - { - ctor: '::', - _0: _elm_lang$html$Html_Attributes$src(_p2._0), - _1: {ctor: '[]'} - }, - {ctor: '[]'}), - _1: {ctor: '[]'} - }; - } else { - return {ctor: '[]'}; - } - } else { - return {ctor: '[]'}; - } - }(); - var _p3 = speaker; - if (_p3.ctor === 'Just') { - var _p4 = _p3._0; + var _p1 = speaker; + if (_p1.ctor === 'Just') { + var _p2 = _p1._0; return A2( _elm_lang$html$Html$div, {ctor: '[]'}, - A2( - _elm_lang$core$Basics_ops['++'], - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$a, - { + { + ctor: '::', + _0: A2( + _elm_lang$html$Html$a, + { + ctor: '::', + _0: _elm_lang$html$Html_Events$onClick(_user$project$Messages$BackInHistory), + _1: { ctor: '::', - _0: _elm_lang$html$Html_Events$onClick(_user$project$Messages$BackInHistory), - _1: { + _0: _elm_lang$html$Html_Attributes$classList( + { + ctor: '::', + _0: {ctor: '_Tuple2', _0: 'btn', _1: true}, + _1: { + ctor: '::', + _0: {ctor: '_Tuple2', _0: 'btn-default', _1: true}, + _1: {ctor: '[]'} + } + }), + _1: {ctor: '[]'} + } + }, + { + ctor: '::', + _0: A2( + _elm_lang$html$Html$i, + { ctor: '::', _0: _elm_lang$html$Html_Attributes$classList( { ctor: '::', - _0: {ctor: '_Tuple2', _0: 'btn', _1: true}, + _0: {ctor: '_Tuple2', _0: 'fa', _1: true}, _1: { ctor: '::', - _0: {ctor: '_Tuple2', _0: 'btn-default', _1: true}, + _0: {ctor: '_Tuple2', _0: 'fa-chevron-left', _1: true}, _1: {ctor: '[]'} } }), _1: {ctor: '[]'} - } - }, + }, + {ctor: '[]'}), + _1: { + ctor: '::', + _0: _elm_lang$html$Html$text(' Back'), + _1: {ctor: '[]'} + } + }), + _1: { + ctor: '::', + _0: A2( + _elm_lang$html$Html$h3, + {ctor: '[]'}, { ctor: '::', - _0: A2( - _elm_lang$html$Html$i, - { - ctor: '::', - _0: _elm_lang$html$Html_Attributes$classList( - { - ctor: '::', - _0: {ctor: '_Tuple2', _0: 'fa', _1: true}, - _1: { - ctor: '::', - _0: {ctor: '_Tuple2', _0: 'fa-chevron-left', _1: true}, - _1: {ctor: '[]'} - } - }), - _1: {ctor: '[]'} - }, - {ctor: '[]'}), - _1: { - ctor: '::', - _0: _elm_lang$html$Html$text(' Back'), - _1: {ctor: '[]'} - } + _0: _elm_lang$html$Html$text(_p2.name), + _1: {ctor: '[]'} }), _1: { ctor: '::', _0: A2( - _elm_lang$html$Html$h3, + _elm_lang$html$Html$div, {ctor: '[]'}, { ctor: '::', - _0: _elm_lang$html$Html$text(_p4.name), + _0: A2( + _evancz$elm_markdown$Markdown$toHtml, + {ctor: '[]'}, + _p2.biography), _1: {ctor: '[]'} }), _1: { ctor: '::', - _0: A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - { - ctor: '::', - _0: A2( - _evancz$elm_markdown$Markdown$toHtml, - {ctor: '[]'}, - _p4.biography), - _1: {ctor: '[]'} - }), - _1: { - ctor: '::', - _0: A2(_user$project$Views_SpeakerDetail$speakerEvents, _p4, model), - _1: {ctor: '[]'} - } + _0: A2(_user$project$Views_SpeakerDetail$speakerEvents, _p2, model), + _1: {ctor: '[]'} } } - }, - image)); + } + }); } else { return A2( _elm_lang$html$Html$div,