diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/reading/Books.scala | 1201 | ||||
| -rw-r--r-- | src/main/scala/reading/Main.scala | 6 | ||||
| -rw-r--r-- | src/main/scala/reading/Route.scala | 4 | ||||
| -rw-r--r-- | src/main/scala/reading/component/Index.scala | 8 | ||||
| -rw-r--r-- | src/main/scala/reading/component/index/Books.scala | 4 | ||||
| -rw-r--r-- | src/main/scala/reading/component/index/Filters.scala | 6 | ||||
| -rw-r--r-- | src/main/scala/reading/component/index/FiltersMenu.scala | 30 | ||||
| -rw-r--r-- | src/main/scala/reading/component/style/Color.scala | 8 | ||||
| -rw-r--r-- | src/main/scala/reading/component/style/Global.scala | 2 | ||||
| -rw-r--r-- | src/main/scala/reading/component/style/Index.scala | 2 | ||||
| -rw-r--r-- | src/main/scala/reading/component/widget/Cross.scala | 2 | ||||
| -rw-r--r-- | src/main/scala/reading/models/Book.scala | 20 | ||||
| -rw-r--r-- | src/main/scala/reading/models/Grade.scala | 8 | ||||
| -rw-r--r-- | src/main/scala/reading/models/Program.scala | 38 | ||||
| -rw-r--r-- | src/main/scala/reading/utils/Rx.scala | 2 | 
15 files changed, 670 insertions, 671 deletions
| diff --git a/src/main/scala/reading/Books.scala b/src/main/scala/reading/Books.scala index ebcb562..7695b19 100644 --- a/src/main/scala/reading/Books.scala +++ b/src/main/scala/reading/Books.scala @@ -1,6 +1,6 @@  package reading -import reading.models.{Book, Period, Theme, Genre, Program, Level} +import reading.models.{ Book, Period, Theme, Genre, Program, Level }  import Period._  import Theme._  import Genre._ @@ -10,928 +10,925 @@ import Level._  object Books {    def apply(): Seq[Book] = Seq(      Book( -      title    = "Sweet Sixteen", -      author   = "Annelise HEURTIER", -      year     = "2012", -      period   = Some(Annees50), -      genres   = Seq(RomanHistorique), -      themes   = Seq(Ecole, SegregationRaciale), +      title = "Sweet Sixteen", +      author = "Annelise HEURTIER", +      year = "2012", +      period = Some(Annees50), +      genres = Seq(RomanHistorique), +      themes = Seq(Ecole, SegregationRaciale),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Le Carnet d'Allie", -      author   = "Meg CABOT", -      year     = "2012-2016", -      parts    = 7, -      period   = Some(Contemporain), -      genres   = Seq(JournalIntime), -      themes   = Seq(Amitie, Famille), +      title = "Le Carnet d'Allie", +      author = "Meg CABOT", +      year = "2012-2016", +      parts = 7, +      period = Some(Contemporain), +      genres = Seq(JournalIntime), +      themes = Seq(Amitie, Famille),        programs = Seq(Autrui), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Une (irrésistible) envie de…", -      author   = "Meg CABOT", -      year     = "2007-2014", -      parts    = 5, -      period   = Some(Contemporain), -      genres   = Seq(Policier), -      themes   = Seq(VieNocturne), +      title = "Une (irrésistible) envie de…", +      author = "Meg CABOT", +      year = "2007-2014", +      parts = 5, +      period = Some(Contemporain), +      genres = Seq(Policier), +      themes = Seq(VieNocturne),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Les Filles au chocolat", -      author   = "Cathy CASSIDY", -      year     = "2011-2016", -      parts    = 9, -      period   = Some(Contemporain), -      genres   = Seq(), -      themes   = Seq(Amitie, Fratrie), +      title = "Les Filles au chocolat", +      author = "Cathy CASSIDY", +      year = "2011-2016", +      parts = 9, +      period = Some(Contemporain), +      genres = Seq(), +      themes = Seq(Amitie, Fratrie),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Le Monde de Charlie", -      author   = "Stephen CHBOSKY", -      year     = "2012", -      period   = Some(Contemporain), -      genres   = Seq(), -      themes   = Seq(Amitie, Rivalite), +      title = "Le Monde de Charlie", +      author = "Stephen CHBOSKY", +      year = "2012", +      period = Some(Contemporain), +      genres = Seq(), +      themes = Seq(Amitie, Rivalite),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Je veux vivre", -      author   = "Jenny DOWNHAM", -      year     = "2011", -      period   = Some(Contemporain), -      genres   = Seq(), -      themes   = Seq(Amour, Adolescence, Maladie), +      title = "Je veux vivre", +      author = "Jenny DOWNHAM", +      year = "2011", +      period = Some(Contemporain), +      genres = Seq(), +      themes = Seq(Amour, Adolescence, Maladie),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Nos Etoiles contraires", -      author   = "John GREEN", -      year     = "2013", -      period   = Some(Contemporain), -      genres   = Seq(), -      themes   = Seq(Amour, Adolescence, Maladie), +      title = "Nos Etoiles contraires", +      author = "John GREEN", +      year = "2013", +      period = Some(Contemporain), +      genres = Seq(), +      themes = Seq(Amour, Adolescence, Maladie),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Lou !", -      author   = "Julien NEEL", -      year     = "2004-2016", -      parts    = 7, -      period   = Some(Contemporain), -      genres   = Seq(BD), -      themes   = Seq(College, Famille, Amitie), +      title = "Lou !", +      author = "Julien NEEL", +      year = "2004-2016", +      parts = 7, +      period = Some(Contemporain), +      genres = Seq(BD), +      themes = Seq(College, Famille, Amitie),        programs = Seq(Autrui), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Trois filles et…", -      author   = "Jacqueline WILSON", -      year     = "2000-2003", -      parts    = 4, -      period   = Some(Contemporain), -      genres   = Seq(), -      themes   = Seq(Amitie, Amour, Famille, Adolescence), +      title = "Trois filles et…", +      author = "Jacqueline WILSON", +      year = "2000-2003", +      parts = 4, +      period = Some(Contemporain), +      genres = Seq(), +      themes = Seq(Amitie, Amour, Famille, Adolescence),        programs = Seq(Autrui), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Kiss", -      author   = "Jacqueline WILSON", -      year     = "2009", -      period   = None, -      genres   = Seq(), -      themes   = Seq(Amitie, Famille, Amour), +      title = "Kiss", +      author = "Jacqueline WILSON", +      year = "2009", +      period = None, +      genres = Seq(), +      themes = Seq(Amitie, Famille, Amour),        programs = Seq(Autrui), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Tintin", -      author   = "HERGE", -      year     = "20e siècle", -      parts    = 24, -      period   = Some(Siecle20), -      genres   = Seq(BD), -      themes   = Seq(Aventure, Amitie, College), +      title = "Tintin", +      author = "HERGE", +      year = "20e siècle", +      parts = 24, +      period = Some(Siecle20), +      genres = Seq(BD), +      themes = Seq(Aventure, Amitie, College),        programs = Seq(RecitAventure, VoyageEtAventure), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Le Royaume de Kensuké", -      author   = "Michael MORPURGO et François PLACE", -      year     = "2007", -      period   = None, -      genres   = Seq(RomanAventure), -      themes   = Seq(Aventure, Voyage), +      title = "Le Royaume de Kensuké", +      author = "Michael MORPURGO et François PLACE", +      year = "2007", +      period = None, +      genres = Seq(RomanAventure), +      themes = Seq(Aventure, Voyage),        programs = Seq(RecitAventure, VoyageEtAventure), -      level    = Facile +      level = Facile      ),      Book( -      title    = "L’Enfant Océan", -      author   = "J-C MOURLEVAT et Vincent DUTRAIT", -      year     = "2010", -      period   = None, -      genres   = Seq(), -      themes   = Seq(Aventure, Fratrie), +      title = "L’Enfant Océan", +      author = "J-C MOURLEVAT et Vincent DUTRAIT", +      year = "2010", +      period = None, +      genres = Seq(), +      themes = Seq(Aventure, Fratrie),        programs = Seq(RecitAventure), -      level    = Facile +      level = Facile      ),      Book( -      title    = "L’oeil du loup", -      author   = "Daniel PENNAC", -      year     = "1984", -      period   = None, -      genres   = Seq(RomanAventure), -      themes   = Seq(Nature, Aventure), +      title = "L’oeil du loup", +      author = "Daniel PENNAC", +      year = "1984", +      period = None, +      genres = Seq(RomanAventure), +      themes = Seq(Nature, Aventure),        programs = Seq(RecitAventure), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Les Aventures de Tom Sawyer", -      author   = "Mark TWAIN", -      year     = "1876", -      period   = Some(Siecle19), -      genres   = Seq(RomanAventure), -      themes   = Seq(Amitie, Aventure), +      title = "Les Aventures de Tom Sawyer", +      author = "Mark TWAIN", +      year = "1876", +      period = Some(Siecle19), +      genres = Seq(RomanAventure), +      themes = Seq(Amitie, Aventure),        programs = Seq(VoyageEtAventure), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Carnets de Cerise", -      author   = "Joris CHAMBLAIN et Aurélie NEYRET", -      year     = "2012-2016", -      parts    = 4, -      period   = Some(Contemporain), -      genres   = Seq(JournalIntime), -      themes   = Seq(Enquete), +      title = "Carnets de Cerise", +      author = "Joris CHAMBLAIN et Aurélie NEYRET", +      year = "2012-2016", +      parts = 4, +      period = Some(Contemporain), +      genres = Seq(JournalIntime), +      themes = Seq(Enquete),        programs = Seq(), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Lady Grace", -      author   = "Patricia FINNEY", -      year     = "2005-2013", -      parts    = 12, -      period   = None, -      genres   = Seq(JournalIntime, RomanHistorique, Policier), -      themes   = Seq(), +      title = "Lady Grace", +      author = "Patricia FINNEY", +      year = "2005-2013", +      parts = 12, +      period = None, +      genres = Seq(JournalIntime, RomanHistorique, Policier), +      themes = Seq(),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Le Journal intime de Georgia NICOLSON", -      author   = "Louise RENNISON", -      year     = "2000-2014", -      parts    = 10, -      period   = Some(Contemporain), -      genres   = Seq(JournalIntime), -      themes   = Seq(Humour, Amitie, Amour, Famille, Adolescence), +      title = "Le Journal intime de Georgia NICOLSON", +      author = "Louise RENNISON", +      year = "2000-2014", +      parts = 10, +      period = Some(Contemporain), +      genres = Seq(JournalIntime), +      themes = Seq(Humour, Amitie, Amour, Famille, Adolescence),        programs = Seq(Autrui), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Journal d’une grosse nouille", -      author   = "RR RUSSELL", -      year     = "2012-2016", -      parts    = 10, -      period   = Some(Contemporain), -      genres   = Seq(JournalIntime), -      themes   = Seq(Ecole, Amitie, Amour, Humour), +      title = "Journal d’une grosse nouille", +      author = "RR RUSSELL", +      year = "2012-2016", +      parts = 10, +      period = Some(Contemporain), +      genres = Seq(JournalIntime), +      themes = Seq(Ecole, Amitie, Amour, Humour),        programs = Seq(TraversSociete), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Les Colombes du Roi Soleil", -      author   = "Anne-Marie DESPLAT-DUC", -      year     = "", -      period   = Some(Louis14), -      genres   = Seq(RomanHistorique), -      themes   = Seq(Litterature), +      title = "Les Colombes du Roi Soleil", +      author = "Anne-Marie DESPLAT-DUC", +      year = "", +      period = Some(Louis14), +      genres = Seq(RomanHistorique), +      themes = Seq(Litterature),        programs = Seq(), -      level    = Facile +      level = Facile      ),      Book( -      title    = "A la Poursuite d’Olympe", -      author   = "Annie JAY", -      year     = "1995", -      period   = Some(Louis14), -      genres   = Seq(RomanHistorique), -      themes   = Seq(Emancipation), +      title = "A la Poursuite d’Olympe", +      author = "Annie JAY", +      year = "1995", +      period = Some(Louis14), +      genres = Seq(RomanHistorique), +      themes = Seq(Emancipation),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Cheval de guerre", -      author   = "Michael MORPURGO", -      year     = "1986", -      period   = Some(Siecle20), -      genres   = Seq(RomanHistorique), -      themes   = Seq(Animal, Guerre, Amitie), +      title = "Cheval de guerre", +      author = "Michael MORPURGO", +      year = "1986", +      period = Some(Siecle20), +      genres = Seq(RomanHistorique), +      themes = Seq(Animal, Guerre, Amitie),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Soldat Peaceful", -      author   = "Michael MORPURGO", -      year     = "2004", -      period   = Some(Siecle20), -      genres   = Seq(RomanHistorique), -      themes   = Seq(Guerre, Fratrie), +      title = "Soldat Peaceful", +      author = "Michael MORPURGO", +      year = "2004", +      period = Some(Siecle20), +      genres = Seq(RomanHistorique), +      themes = Seq(Guerre, Fratrie),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Les Orangers de Versailles", -      author   = "Annie PIETRI", -      year     = "2000", -      period   = Some(Louis14), -      genres   = Seq(RomanHistorique), -      themes   = Seq(Enquete, Cour), +      title = "Les Orangers de Versailles", +      author = "Annie PIETRI", +      year = "2000", +      period = Some(Louis14), +      genres = Seq(RomanHistorique), +      themes = Seq(Enquete, Cour),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "L’Espionne du Roi-Soleil", -      author   = "Annie PIETRI", -      year     = "2002", -      period   = Some(Louis14), -      genres   = Seq(RomanHistorique), -      themes   = Seq(Famille, Enquete, Cour), +      title = "L’Espionne du Roi-Soleil", +      author = "Annie PIETRI", +      year = "2002", +      period = Some(Louis14), +      genres = Seq(RomanHistorique), +      themes = Seq(Famille, Enquete, Cour),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "L’Omelette au sucre", -      author   = "JP ARROU-VIGNOD", -      year     = "1999", -      period   = Some(Contemporain), -      genres   = Seq(Comique), -      themes   = Seq(Humour, Famille), +      title = "L’Omelette au sucre", +      author = "JP ARROU-VIGNOD", +      year = "1999", +      period = Some(Contemporain), +      genres = Seq(Comique), +      themes = Seq(Humour, Famille),        programs = Seq(), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Matilda", -      author   = "Roald DAHL", -      year     = "1988", -      period   = None, -      genres   = Seq(Comique), -      themes   = Seq(Humour, Famille, Ecole), +      title = "Matilda", +      author = "Roald DAHL", +      year = "1988", +      period = None, +      genres = Seq(Comique), +      themes = Seq(Humour, Famille, Ecole),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Le Bon Gros Géant", -      author   = "Roald DAHL", -      year     = "1984", -      period   = None, -      genres   = Seq(Comique), -      themes   = Seq(Humour, Amitie, Aventure), +      title = "Le Bon Gros Géant", +      author = "Roald DAHL", +      year = "1984", +      period = None, +      genres = Seq(Comique), +      themes = Seq(Humour, Amitie, Aventure),        programs = Seq(Monstre, Autrui, Heros), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Fantastique Maître Renard", -      author   = "Roald DAHL", -      year     = "1977", -      period   = None, -      genres   = Seq(Comique), -      themes   = Seq(Humour, Famille, Animaux), +      title = "Fantastique Maître Renard", +      author = "Roald DAHL", +      year = "1977", +      period = None, +      genres = Seq(Comique), +      themes = Seq(Humour, Famille, Animaux),        programs = Seq(Resister), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Mortelle Adèle", -      author   = "Mr TAN", -      year     = "2013-2016", -      parts    = 11, -      period   = Some(Contemporain), -      genres   = Seq(BD), -      themes   = Seq(Humour, Amitie, Famille), +      title = "Mortelle Adèle", +      author = "Mr TAN", +      year = "2013-2016", +      parts = 11, +      period = Some(Contemporain), +      genres = Seq(BD), +      themes = Seq(Humour, Amitie, Famille),        programs = Seq(), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Les Plus belles histoires du Prince de Motordu", -      author   = "PEF", -      year     = "2014", -      period   = None, -      genres   = Seq(Comique), -      themes   = Seq(Famille), +      title = "Les Plus belles histoires du Prince de Motordu", +      author = "PEF", +      year = "2014", +      period = None, +      genres = Seq(Comique), +      themes = Seq(Famille),        programs = Seq(), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Les Dix petits nègres", -      author   = "Agatha Christie", -      year     = "1939", -      period   = Some(Siecle20), -      genres   = Seq(Policier), -      themes   = Seq(Enquete), +      title = "Les Dix petits nègres", +      author = "Agatha Christie", +      year = "1939", +      period = Some(Siecle20), +      genres = Seq(Policier), +      themes = Seq(Enquete),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Le Crime de l’Orient-Express", -      author   = "Agatha Christie", -      year     = "1934", -      period   = Some(Siecle20), -      genres   = Seq(Policier), -      themes   = Seq(Enquete, Voyage), +      title = "Le Crime de l’Orient-Express", +      author = "Agatha Christie", +      year = "1934", +      period = Some(Siecle20), +      genres = Seq(Policier), +      themes = Seq(Enquete, Voyage),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Cinq petits cochons", -      author   = "Agatha Christie", -      year     = "1942", -      period   = Some(Siecle20), -      genres   = Seq(Policier), -      themes   = Seq(Famille, Enquete), +      title = "Cinq petits cochons", +      author = "Agatha Christie", +      year = "1942", +      period = Some(Siecle20), +      genres = Seq(Policier), +      themes = Seq(Famille, Enquete),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Un Cadavre dans la bibliothèque", -      author   = "Agatha Christie", -      year     = "1942", -      period   = Some(Siecle20), -      genres   = Seq(Policier), -      themes   = Seq(Enquete), +      title = "Un Cadavre dans la bibliothèque", +      author = "Agatha Christie", +      year = "1942", +      period = Some(Siecle20), +      genres = Seq(Policier), +      themes = Seq(Enquete),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Le Meurtre de Roger Ackroyd", -      author   = "Agatha Christie", -      year     = "1926", -      period   = Some(Siecle20), -      genres   = Seq(Policier), -      themes   = Seq(Amour, Enquete), +      title = "Le Meurtre de Roger Ackroyd", +      author = "Agatha Christie", +      year = "1926", +      period = Some(Siecle20), +      genres = Seq(Policier), +      themes = Seq(Amour, Enquete),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Le Chien des Baskerville", -      author   = "Arthur CONAN DOYLE", -      year     = "1902", -      period   = Some(Siecle20), -      genres   = Seq(Policier, Fantastique), -      themes   = Seq(Malediction, Enquete), +      title = "Le Chien des Baskerville", +      author = "Arthur CONAN DOYLE", +      year = "1902", +      period = Some(Siecle20), +      genres = Seq(Policier, Fantastique), +      themes = Seq(Malediction, Enquete),        programs = Seq(), -      level    = Moyen +      level = Moyen      ), - - -      Book( -      title    = "EverWorld", -      author   = "K.A APPLEGATE", -      year     = "2000-2002", -      parts    = 4, -      period   = None, -      genres   = Seq(Fantasy, SF), -      themes   = Seq(Amitie, Amour, Aventure), +      title = "EverWorld", +      author = "K.A APPLEGATE", +      year = "2000-2002", +      parts = 4, +      period = None, +      genres = Seq(Fantasy, SF), +      themes = Seq(Amitie, Amour, Aventure),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "La Quête d’Ewilan", -      author   = "Pierre BOTTERO", -      year     = "2005-2016", -      parts    = 4, -      period   = None, -      genres   = Seq(Fantasy), -      themes   = Seq(Amitie, Aventure), +      title = "La Quête d’Ewilan", +      author = "Pierre BOTTERO", +      year = "2005-2016", +      parts = 4, +      period = None, +      genres = Seq(Fantasy), +      themes = Seq(Amitie, Aventure),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Les Mondes d’Ewilan", -      author   = "Pierre BOTTERO et Jean-Louis THOUARD", -      year     = "2005-2006", -      parts    = 3, -      period   = None, -      genres   = Seq(Fantasy), -      themes   = Seq(Aventure), +      title = "Les Mondes d’Ewilan", +      author = "Pierre BOTTERO et Jean-Louis THOUARD", +      year = "2005-2006", +      parts = 3, +      period = None, +      genres = Seq(Fantasy), +      themes = Seq(Aventure),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Ellana", -      author   = "Pierre BOTTERO", -      year     = "2006-2010", -      parts    = 3, -      period   = None, -      genres   = Seq(Policier, Fantasy), -      themes   = Seq(Aventure), +      title = "Ellana", +      author = "Pierre BOTTERO", +      year = "2006-2010", +      parts = 3, +      period = None, +      genres = Seq(Policier, Fantasy), +      themes = Seq(Aventure),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "The Mortal instruments", -      author   = "Cassandra CLARE", -      year     = "2013-2015", -      parts    = 6, -      period   = None, -      genres   = Seq(Fantastique), -      themes   = Seq(Aventure, Famille), +      title = "The Mortal instruments", +      author = "Cassandra CLARE", +      year = "2013-2015", +      parts = 6, +      period = None, +      genres = Seq(Fantastique), +      themes = Seq(Aventure, Famille),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Le Monde de Narnia", -      author   = "C.S LEWIS", -      year     = "2002-2008", -      period   = None, -      genres   = Seq(), -      themes   = Seq(Aventure, Famille), +      title = "Le Monde de Narnia", +      author = "C.S LEWIS", +      year = "2002-2008", +      period = None, +      genres = Seq(), +      themes = Seq(Aventure, Famille),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Eragon", -      author   = "Christopher PAOLINI", -      year     = "2003-2006", -      period   = None, -      genres   = Seq(Fantasy), -      themes   = Seq(Amitie, Aventure, Dragon), +      title = "Eragon", +      author = "Christopher PAOLINI", +      year = "2003-2006", +      period = None, +      genres = Seq(Fantasy), +      themes = Seq(Amitie, Aventure, Dragon),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Harry POTTER", -      author   = "J.K ROWLING", -      year     = "1999-2007", -      period   = None, -      genres   = Seq(Fantastique), -      themes   = Seq(Amitie, Ecole, Aventure, Magie), +      title = "Harry POTTER", +      author = "J.K ROWLING", +      year = "1999-2007", +      period = None, +      genres = Seq(Fantastique), +      themes = Seq(Amitie, Ecole, Aventure, Magie),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Les Royaumes de feu", -      author   = "T.T SUTHERLAND", -      year     = "2012-2016", -      parts    = 5, -      period   = None, -      genres   = Seq(Fantastique), -      themes   = Seq(Aventure, Dragon), +      title = "Les Royaumes de feu", +      author = "T.T SUTHERLAND", +      year = "2012-2016", +      parts = 5, +      period = None, +      genres = Seq(Fantastique), +      themes = Seq(Aventure, Dragon),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Le Hobbit", -      author   = "J.R.R TOLKIEN", -      year     = "1937", -      period   = None, -      genres   = Seq(Fantasy), -      themes   = Seq(Aventure), +      title = "Le Hobbit", +      author = "J.R.R TOLKIEN", +      year = "1937", +      period = None, +      genres = Seq(Fantasy), +      themes = Seq(Aventure),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Le Seigneur des anneaux", -      author   = "J.R.R TOLKIEN", -      year     = "1954-1955", -      period   = None, -      genres   = Seq(Fantasy), -      themes   = Seq(Aventure, Combat), +      title = "Le Seigneur des anneaux", +      author = "J.R.R TOLKIEN", +      year = "1954-1955", +      period = None, +      genres = Seq(Fantasy), +      themes = Seq(Aventure, Combat),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Le Silmarillion", -      author   = "J.R.R TOLKIEN", -      year     = "1977", -      period   = None, -      genres   = Seq(Fantasy), -      themes   = Seq(Aventure, Combat), +      title = "Le Silmarillion", +      author = "J.R.R TOLKIEN", +      year = "1977", +      period = None, +      genres = Seq(Fantasy), +      themes = Seq(Aventure, Combat),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "A la Croisée des mondes", -      author   = "Philip PULLMAN", -      year     = "1998-2001", -      period   = None, -      genres   = Seq(Fantastique), -      themes   = Seq(Aventure, Amitie, Enquete, Nature), +      title = "A la Croisée des mondes", +      author = "Philip PULLMAN", +      year = "1998-2001", +      period = None, +      genres = Seq(Fantastique), +      themes = Seq(Aventure, Amitie, Enquete, Nature),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Uglies", -      author   = "Scott WESTERFELD", -      year     = "2007-2008", -      period   = None, -      genres   = Seq(SF, Dystopie), -      themes   = Seq(Beaute, Laideur, Americain), +      title = "Uglies", +      author = "Scott WESTERFELD", +      year = "2007-2008", +      period = None, +      genres = Seq(SF, Dystopie), +      themes = Seq(Beaute, Laideur, Americain),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Percy JACKSON", -      author   = "Rick RIORDAN", -      year     = "2005-2010", -      parts    = 5, -      period   = None, -      genres   = Seq(Fantastique), -      themes   = Seq(Mythologie, Aventure), +      title = "Percy JACKSON", +      author = "Rick RIORDAN", +      year = "2005-2010", +      parts = 5, +      period = None, +      genres = Seq(Fantastique), +      themes = Seq(Mythologie, Aventure),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Les Héros de l’Olympe", -      author   = "Rick RIORDAN", -      year     = "2010-2014", -      period   = None, -      genres   = Seq(Fantastique), -      themes   = Seq(Amitie, Aventure, Mythologie), +      title = "Les Héros de l’Olympe", +      author = "Rick RIORDAN", +      year = "2010-2014", +      period = None, +      genres = Seq(Fantastique), +      themes = Seq(Amitie, Aventure, Mythologie),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "La Rivière à l’envers", -      author   = "J-C MOURLEVAT", -      year     = "2000-2002", -      parts    = 2, -      period   = None, -      genres   = Seq(RomanAventure, Merveilleux), -      themes   = Seq(Amitie), +      title = "La Rivière à l’envers", +      author = "J-C MOURLEVAT", +      year = "2000-2002", +      parts = 2, +      period = None, +      genres = Seq(RomanAventure, Merveilleux), +      themes = Seq(Amitie),        programs = Seq(), -      level    = Facile +      level = Facile      ),      Book( -      title    = "La Guerre des clans", -      author   = "Erin HUNTER", -      year     = "2007-2016", -      parts    = 5, -      period   = None, -      genres   = Seq(Fantastique), -      themes   = Seq(Animaux, Nature), +      title = "La Guerre des clans", +      author = "Erin HUNTER", +      year = "2007-2016", +      parts = 5, +      period = None, +      genres = Seq(Fantastique), +      themes = Seq(Animaux, Nature),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Journal d’un noob", -      author   = "Cube Kid", -      year     = "2016-2017", -      parts    = 4, -      period   = None, -      genres   = Seq(Fantastique), -      themes   = Seq(JeuVideo), +      title = "Journal d’un noob", +      author = "Cube Kid", +      year = "2016-2017", +      parts = 4, +      period = None, +      genres = Seq(Fantastique), +      themes = Seq(JeuVideo),        programs = Seq(), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Journal d’un dégonflé", -      author   = "Jeff KINNEY", -      year     = "2009-2016", -      parts    = 10, -      period   = Some(Contemporain), -      genres   = Seq(JournalIntime), -      themes   = Seq(Humour, Amitie, Famille, Adolescence), +      title = "Journal d’un dégonflé", +      author = "Jeff KINNEY", +      year = "2009-2016", +      parts = 10, +      period = Some(Contemporain), +      genres = Seq(JournalIntime), +      themes = Seq(Humour, Amitie, Famille, Adolescence),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Frankenstein", -      author   = "Mary SHELLEY", -      year     = "1818", -      period   = None, -      genres   = Seq(Fantastique), -      themes   = Seq(Peur), +      title = "Frankenstein", +      author = "Mary SHELLEY", +      year = "1818", +      period = None, +      genres = Seq(Fantastique), +      themes = Seq(Peur),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Frigiel et Fluffy", -      author   = "FRIGIEL et Nicolas DIGARD", -      year     = "2016", -      period   = None, -      genres   = Seq(), -      themes   = Seq(Amitie, Magie, Famille, Aventure), +      title = "Frigiel et Fluffy", +      author = "FRIGIEL et Nicolas DIGARD", +      year = "2016", +      period = None, +      genres = Seq(), +      themes = Seq(Amitie, Magie, Famille, Aventure),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Cherub", -      author   = "Robert MUCHAMORE", -      year     = "2009-2016", -      period   = None, -      genres   = Seq(), -      themes   = Seq(Adolescence, Espionnage, Americain), +      title = "Cherub", +      author = "Robert MUCHAMORE", +      year = "2009-2016", +      period = None, +      genres = Seq(), +      themes = Seq(Adolescence, Espionnage, Americain),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "DIMILY", -      author   = "Estelle MASKAME", -      year     = "2016", -      period   = Some(Contemporain), -      genres   = Seq(), -      themes   = Seq(Amour, Famille, Adolescence), +      title = "DIMILY", +      author = "Estelle MASKAME", +      year = "2016", +      period = Some(Contemporain), +      genres = Seq(), +      themes = Seq(Amour, Famille, Adolescence),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Les Héritiers d’Enkidiev", -      author   = "Anne ROBILLARD", -      year     = "2011-2016", -      period   = None, -      genres   = Seq(Fantasy), -      themes   = Seq(Combat), +      title = "Les Héritiers d’Enkidiev", +      author = "Anne ROBILLARD", +      year = "2011-2016", +      period = None, +      genres = Seq(Fantasy), +      themes = Seq(Combat),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "La Sélection", -      author   = "Kiera CASS", -      year     = "2011-2016", -      parts    = 5, -      period   = None, -      genres   = Seq(SF), -      themes   = Seq(Famille, Amour), +      title = "La Sélection", +      author = "Kiera CASS", +      year = "2011-2016", +      parts = 5, +      period = None, +      genres = Seq(SF), +      themes = Seq(Famille, Amour),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Hunger Games", -      author   = "Suzanne COLLINS", -      year     = "2009-2011", -      period   = None, -      genres   = Seq(Dystopie, Fantastique), -      themes   = Seq(Combat), +      title = "Hunger Games", +      author = "Suzanne COLLINS", +      year = "2009-2011", +      period = None, +      genres = Seq(Dystopie, Fantastique), +      themes = Seq(Combat),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Le Passeur", -      author   = "Lois LOWRY", -      year     = "1996", -      period   = None, -      genres   = Seq(Dystopie), -      themes   = Seq(Initiation), +      title = "Le Passeur", +      author = "Lois LOWRY", +      year = "1996", +      period = None, +      genres = Seq(Dystopie), +      themes = Seq(Initiation),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Cinder", -      author   = "Marissa MEYER", -      year     = "2013-2016", -      period   = None, -      genres   = Seq(SF), -      themes   = Seq(Robot, Famille, Aventure), +      title = "Cinder", +      author = "Marissa MEYER", +      year = "2013-2016", +      period = None, +      genres = Seq(SF), +      themes = Seq(Robot, Famille, Aventure),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Les Âmes vagabondes", -      author   = "Stephenie MEYER", -      year     = "2010", -      period   = None, -      genres   = Seq(Fantasy, SF), -      themes   = Seq(Adolescence, Aventure), +      title = "Les Âmes vagabondes", +      author = "Stephenie MEYER", +      year = "2010", +      period = None, +      genres = Seq(Fantasy, SF), +      themes = Seq(Adolescence, Aventure),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Divergente", -      author   = "Veronica ROTH", -      year     = "2011-2014", -      parts    = 3, -      period   = None, -      genres   = Seq(Fantasy, SF), -      themes   = Seq(Adolescence, Aventure), +      title = "Divergente", +      author = "Veronica ROTH", +      year = "2011-2014", +      parts = 3, +      period = None, +      genres = Seq(Fantasy, SF), +      themes = Seq(Adolescence, Aventure),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "L’Etrange cas du Dr JEKYLL et M. HYDE", -      author   = "R.L STEVENSON", -      year     = "1886", -      period   = None, -      genres   = Seq(Fantastique), -      themes   = Seq(Folie), +      title = "L’Etrange cas du Dr JEKYLL et M. HYDE", +      author = "R.L STEVENSON", +      year = "1886", +      period = None, +      genres = Seq(Fantastique), +      themes = Seq(Folie),        programs = Seq(Monstre), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Persépolis", -      author   = "Marjane SATRAPI", -      year     = "2007", -      period   = Some(Siecle20), -      genres   = Seq(BD), -      themes   = Seq(Famille, Amitie), +      title = "Persépolis", +      author = "Marjane SATRAPI", +      year = "2007", +      period = Some(Siecle20), +      genres = Seq(BD), +      themes = Seq(Famille, Amitie),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Le Petit Nicolas", -      author   = "GOSCINNY et SEMPE", -      year     = "1973", -      period   = Some(Siecle20), -      genres   = Seq(), -      themes   = Seq(Amitie, Ecole, Famille), +      title = "Le Petit Nicolas", +      author = "GOSCINNY et SEMPE", +      year = "1973", +      period = Some(Siecle20), +      genres = Seq(), +      themes = Seq(Amitie, Ecole, Famille),        programs = Seq(), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Les Sisters", -      author   = "William CAZENOVE", -      year     = "2008-2016", -      period   = Some(Contemporain), -      genres   = Seq(BD), -      themes   = Seq(Fratrie, College), +      title = "Les Sisters", +      author = "William CAZENOVE", +      year = "2008-2016", +      period = Some(Contemporain), +      genres = Seq(BD), +      themes = Seq(Fratrie, College),        programs = Seq(), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Le Journal d’Aurélie Laflamme", -      author   = "India DESJARDINS", -      year     = "2013-2015", -      period   = Some(Contemporain), -      genres   = Seq(JournalIntime), -      themes   = Seq(Famille, Amitie, Amour, Ecole), +      title = "Le Journal d’Aurélie Laflamme", +      author = "India DESJARDINS", +      year = "2013-2015", +      period = Some(Contemporain), +      genres = Seq(JournalIntime), +      themes = Seq(Famille, Amitie, Amour, Ecole),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "L’Ordre Terne", -      author   = "I.M NANCY", -      year     = "2015-2016", -      parts   = 2, -      period   = None, -      genres   = Seq(Fantasy), -      themes   = Seq(Magie), +      title = "L’Ordre Terne", +      author = "I.M NANCY", +      year = "2015-2016", +      parts = 2, +      period = None, +      genres = Seq(Fantasy), +      themes = Seq(Magie),        programs = Seq(), -      level    = Moyen +      level = Moyen      ),      Book( -      title    = "Tobie Lolness", -      author   = "Timothée DE FOMBELLE", -      year     = "2010", -      parts   = 2, -      period   = None, -      genres   = Seq(), -      themes   = Seq(Famille, Nature, Aventure, Amour), +      title = "Tobie Lolness", +      author = "Timothée DE FOMBELLE", +      year = "2010", +      parts = 2, +      period = None, +      genres = Seq(), +      themes = Seq(Famille, Nature, Aventure, Amour),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Question de temps", -      author   = "E.R LINK", -      year     = "2016", -      period   = None, -      genres   = Seq(), -      themes   = Seq(Aventure, Pirate, Amour, Amitie), +      title = "Question de temps", +      author = "E.R LINK", +      year = "2016", +      period = None, +      genres = Seq(), +      themes = Seq(Aventure, Pirate, Amour, Amitie),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Maliki", -      author   = "MALIKI", -      year     = "2007-2015", -      parts   = 7, -      period   = None, -      genres   = Seq(BD), -      themes   = Seq(Enfants, Humour, Animaux), +      title = "Maliki", +      author = "MALIKI", +      year = "2007-2015", +      parts = 7, +      period = None, +      genres = Seq(BD), +      themes = Seq(Enfants, Humour, Animaux),        programs = Seq(), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Gardiens des cites perdues", -      author   = "Shannon MESSENGER", -      year     = "2014-2016", -      parts   = 4, -      period   = None, -      genres   = Seq(Fantasy), -      themes   = Seq(Ecole), +      title = "Gardiens des cites perdues", +      author = "Shannon MESSENGER", +      year = "2014-2016", +      parts = 4, +      period = None, +      genres = Seq(Fantasy), +      themes = Seq(Ecole),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Le Maître des clés", -      author   = "Benoît GRELAUD", -      year     = "2012-2014", -      parts   = 5, -      period   = None, -      genres   = Seq(), -      themes   = Seq(Famille, Nature, Aventure, Poetique), +      title = "Le Maître des clés", +      author = "Benoît GRELAUD", +      year = "2012-2014", +      parts = 5, +      period = None, +      genres = Seq(), +      themes = Seq(Famille, Nature, Aventure, Poetique),        programs = Seq(RecitAventure), -      level    = Facile +      level = Facile      ),      Book( -      title    = "Le Passe-miroir", -      author   = "Christelle DABOS", -      year     = "2013-2015", -      parts   = 2, -      period   = None, -      genres   = Seq(Fantastique), -      themes   = Seq(Complot, Cour, Enquete), +      title = "Le Passe-miroir", +      author = "Christelle DABOS", +      year = "2013-2015", +      parts = 2, +      period = None, +      genres = Seq(Fantastique), +      themes = Seq(Complot, Cour, Enquete),        programs = Seq(), -      level    = Difficile +      level = Difficile      ),      Book( -      title    = "Oniria", -      author   = "P.F PARRY", -      year     = "2012-2016", -      parts   = 4, -      period   = None, -      genres   = Seq(Fantastique), -      themes   = Seq(Famille, Amitie, Aventure), +      title = "Oniria", +      author = "P.F PARRY", +      year = "2012-2016", +      parts = 4, +      period = None, +      genres = Seq(Fantastique), +      themes = Seq(Famille, Amitie, Aventure),        programs = Seq(), -      level    = Moyen +      level = Moyen      )    )  } diff --git a/src/main/scala/reading/Main.scala b/src/main/scala/reading/Main.scala index 41057fd..6104891 100644 --- a/src/main/scala/reading/Main.scala +++ b/src/main/scala/reading/Main.scala @@ -6,7 +6,7 @@ import org.scalajs.dom  import scalacss.Defaults._ -import reading.component.style.{Global => GlobalStyle} +import reading.component.style.{ Global => GlobalStyle }  import reading.utils.RxTag  object Main extends JSApp { @@ -15,12 +15,12 @@ object Main extends JSApp {      style.appendChild(dom.document.createTextNode(GlobalStyle.render))      dom.document.head.appendChild(style) -    val _ = dom.document.body.appendChild( +    val _ = dom.document.body.appendChild {        RxTag { implicit context =>          Route.current() match {            case Route.Books(filters) => component.Index(filters)          }        }.render -    ) +    }    }  } diff --git a/src/main/scala/reading/Route.scala b/src/main/scala/reading/Route.scala index 85d1d6b..c1f993e 100644 --- a/src/main/scala/reading/Route.scala +++ b/src/main/scala/reading/Route.scala @@ -5,7 +5,7 @@ import scala.scalajs.js.URIUtils  import rx.Var -import reading.models.{Filter, FilterKind} +import reading.models.{ Filter, FilterKind }  sealed trait Route @@ -47,7 +47,7 @@ object Route {    def url(route: Route): String = {      val hash = route match { -      case Books(filters) => "/books" ++ (if(filters.nonEmpty) filters.map(filter => s"${filter.kind}=${filter.nonFormattedName}").mkString("?", "&", "") else "") +      case Books(filters) => "/books" ++ (if (filters.nonEmpty) filters.map(filter => s"${filter.kind}=${filter.nonFormattedName}").mkString("?", "&", "") else "")        case _ => "/books"      }      dom.window.location.origin + dom.window.location.pathname + "#" + URIUtils.encodeURI(hash) diff --git a/src/main/scala/reading/component/Index.scala b/src/main/scala/reading/component/Index.scala index 41139cc..6061956 100644 --- a/src/main/scala/reading/component/Index.scala +++ b/src/main/scala/reading/component/Index.scala @@ -8,16 +8,16 @@ import scalacss.Defaults._  import scalacss.ScalatagsCss._  import reading.Books -import reading.component.style.{Index => IndexStyle} -import reading.component.index.{FiltersMenu, Filters, Books => BooksComponent} -import reading.models.{Book, Filter} +import reading.component.style.{ Index => IndexStyle } +import reading.component.index.{ FiltersMenu, Filters, Books => BooksComponent } +import reading.models.{ Book, Filter }  import reading.utils.RxAttr  object Index {    def apply(initialFilters: Seq[Filter]): HtmlTag = {      val filters: Var[Seq[Filter]] = Var(initialFilters)      val books: Rx[Seq[Book]] = Rx { -      if(filters().isEmpty) Books() else Book.filter(Books(), filters()) +      if (filters().isEmpty) Books() else Book.filter(Books(), filters())      }      div( diff --git a/src/main/scala/reading/component/index/Books.scala b/src/main/scala/reading/component/index/Books.scala index 4e42823..19c1f99 100644 --- a/src/main/scala/reading/component/index/Books.scala +++ b/src/main/scala/reading/component/index/Books.scala @@ -6,8 +6,8 @@ import scalatags.JsDom.all._  import scalacss.Defaults._  import scalacss.ScalatagsCss._ -import reading.component.index.style.{Books => BooksStyle} -import reading.models.{Book, Program} +import reading.component.index.style.{ Books => BooksStyle } +import reading.models.{ Book, Program }  import reading.utils.RxTag  object Books { diff --git a/src/main/scala/reading/component/index/Filters.scala b/src/main/scala/reading/component/index/Filters.scala index a5ea3f6..08ec835 100644 --- a/src/main/scala/reading/component/index/Filters.scala +++ b/src/main/scala/reading/component/index/Filters.scala @@ -7,17 +7,17 @@ import scalatags.JsDom.all._  import scalacss.Defaults._  import scalacss.ScalatagsCss._ -import reading.component.index.style.{Filters => FiltersStyle} +import reading.component.index.style.{ Filters => FiltersStyle }  import reading.component.widget.Cross  import reading.component.style.Col  import reading.models.Filter  import reading.Route -import reading.utils.{RxTag, RxAttr} +import reading.utils.{ RxTag, RxAttr }  object Filters {    def apply(filters: Var[Seq[Filter]]): Frag =      RxTag { implicit context => -      if(filters().isEmpty) +      if (filters().isEmpty)          span("")        else          div( diff --git a/src/main/scala/reading/component/index/FiltersMenu.scala b/src/main/scala/reading/component/index/FiltersMenu.scala index 1015df1..f3f9ca2 100644 --- a/src/main/scala/reading/component/index/FiltersMenu.scala +++ b/src/main/scala/reading/component/index/FiltersMenu.scala @@ -7,9 +7,9 @@ import scalatags.JsDom.all._  import scalacss.Defaults._  import scalacss.ScalatagsCss._ -import reading.component.index.style.{FiltersMenu => FiltersMenuStyle} +import reading.component.index.style.{ FiltersMenu => FiltersMenuStyle }  import reading.models._ -import reading.utils.{RxTag, RxAttr} +import reading.utils.{ RxTag, RxAttr }  import reading.Route  object FiltersMenu { @@ -37,7 +37,8 @@ object FiltersMenu {      name: String,      groupFilters: Seq[Filter]    )( -    implicit context: Ctx.Data +    implicit +    context: Ctx.Data    ): Frag = {      val filtersWithCount = Rx {        groupFilters @@ -46,23 +47,24 @@ object FiltersMenu {          .filter(_._2 > 0)      } -    if(filtersWithCount().isEmpty) +    if (filtersWithCount().isEmpty)        span("")      else        div(          FiltersMenuStyle.group,          div(FiltersMenuStyle.groupTitle, name),          div( -          filtersWithCount().map { case (filter, count) => -            button( -              FiltersMenuStyle.filter, -              RxAttr(onclick, Rx(() => { -                val newFilters = filter +: filters() -                filters() = newFilters -                Route.push(Route.Books(newFilters)) -              })), -              span(s"${filter.name.capitalize} ($count)") -            ) +          filtersWithCount().map { +            case (filter, count) => +              button( +                FiltersMenuStyle.filter, +                RxAttr(onclick, Rx(() => { +                  val newFilters = filter +: filters() +                  filters() = newFilters +                  Route.push(Route.Books(newFilters)) +                })), +                span(s"${filter.name.capitalize} ($count)") +              )            }          )        ) diff --git a/src/main/scala/reading/component/style/Color.scala b/src/main/scala/reading/component/style/Color.scala index 0d13158..13fd5f2 100644 --- a/src/main/scala/reading/component/style/Color.scala +++ b/src/main/scala/reading/component/style/Color.scala @@ -6,9 +6,9 @@ import scalacss.Defaults._  object Col extends StyleSheet.Inline {    import dsl._ -  val black      = c"#000000" -  val white      = c"#FFFFFF" -  val gray       = c"#7E7E7E" -  val eastBay    = c"#505080" +  val black = c"#000000" +  val white = c"#FFFFFF" +  val gray = c"#7E7E7E" +  val eastBay = c"#505080"    val congoBrown = c"#57363E"  } diff --git a/src/main/scala/reading/component/style/Global.scala b/src/main/scala/reading/component/style/Global.scala index 276a30d..861b78a 100644 --- a/src/main/scala/reading/component/style/Global.scala +++ b/src/main/scala/reading/component/style/Global.scala @@ -10,7 +10,7 @@ object Global extends StyleSheet.Standalone {    "a" - (      color(Col.eastBay), -    &.hover ( +    &.hover(        textDecoration := "underline"      )    ) diff --git a/src/main/scala/reading/component/style/Index.scala b/src/main/scala/reading/component/style/Index.scala index 78e0630..355acb0 100644 --- a/src/main/scala/reading/component/style/Index.scala +++ b/src/main/scala/reading/component/style/Index.scala @@ -11,7 +11,7 @@ object Index extends StyleSheet.Inline {      textAlign.center,      margin(10.px, auto),      padding(20.px), -    &.hover ( +    &.hover(        textDecoration := "none"      )    ) diff --git a/src/main/scala/reading/component/widget/Cross.scala b/src/main/scala/reading/component/widget/Cross.scala index 8692aeb..cfbb29d 100644 --- a/src/main/scala/reading/component/widget/Cross.scala +++ b/src/main/scala/reading/component/widget/Cross.scala @@ -5,7 +5,7 @@ import scalacss.Defaults._  import scalacss.ScalatagsCss._  import scalacss.internal.ValueT, ValueT.Color -import reading.component.widget.style.{Cross => CrossStyle} +import reading.component.widget.style.{ Cross => CrossStyle }  object Cross {    def apply(size: String, color: ValueT[Color]): HtmlTag = diff --git a/src/main/scala/reading/models/Book.scala b/src/main/scala/reading/models/Book.scala index 1ee7eb6..7930a63 100644 --- a/src/main/scala/reading/models/Book.scala +++ b/src/main/scala/reading/models/Book.scala @@ -1,15 +1,15 @@  package reading.models -case class Book ( -  title: String, -  author: String, -  year: String, -  parts: Int = 1, -  period: Option[Period], -  genres: Seq[Genre], -  themes: Seq[Theme], -  programs: Seq[Program], -  level: Level +case class Book( +    title: String, +    author: String, +    year: String, +    parts: Int = 1, +    period: Option[Period], +    genres: Seq[Genre], +    themes: Seq[Theme], +    programs: Seq[Program], +    level: Level  ) extends Ordered[Book] {    def compare(that: Book) = {      def formatTitle(title: String) = diff --git a/src/main/scala/reading/models/Grade.scala b/src/main/scala/reading/models/Grade.scala index c48234b..32c5b72 100644 --- a/src/main/scala/reading/models/Grade.scala +++ b/src/main/scala/reading/models/Grade.scala @@ -10,10 +10,10 @@ sealed trait Grade extends EnumEntry with Ordered[Grade] {    }    def prettyPrint(): String = this match { -    case Sixieme  => "6ème" -    case Cinquieme  => "5ème" -    case Quatrieme  => "4ème" -    case Troisieme  => "3ème" +    case Sixieme => "6ème" +    case Cinquieme => "5ème" +    case Quatrieme => "4ème" +    case Troisieme => "3ème"    }  } diff --git a/src/main/scala/reading/models/Program.scala b/src/main/scala/reading/models/Program.scala index da07653..17385b4 100644 --- a/src/main/scala/reading/models/Program.scala +++ b/src/main/scala/reading/models/Program.scala @@ -10,28 +10,28 @@ sealed trait Program extends EnumEntry with Ordered[Program] {    }    def prettyPrint(): String = this match { -    case Monstre  => "Le monstre, aux limites de l'humain" -    case RecitAventure  => "Récits d'aventures" -    case CreationPoetique  => "Récit de création, création poétique" -    case Resister  => "Résister au plus fort : ruses, mensonges et masques" +    case Monstre => "Le monstre, aux limites de l'humain" +    case RecitAventure => "Récits d'aventures" +    case CreationPoetique => "Récit de création, création poétique" +    case Resister => "Résister au plus fort : ruses, mensonges et masques" -    case VoyageEtAventure  => "Le voyage et l'aventure" -    case Autrui  => "Avec autrui : familles, amis, réseaux" -    case UniversNouveaux  => "Imaginer des univers nouveaux" -    case Heros  => "Héros, héroïnes et héroïsmes" -    case HommeEtNature  => "L'être humain est-il maître de la nature ?" +    case VoyageEtAventure => "Le voyage et l'aventure" +    case Autrui => "Avec autrui : familles, amis, réseaux" +    case UniversNouveaux => "Imaginer des univers nouveaux" +    case Heros => "Héros, héroïnes et héroïsmes" +    case HommeEtNature => "L'être humain est-il maître de la nature ?" -    case DireAmour  => "Dire l'amour" -    case IndividuEtSociete  => "Individu et société : confrontations de valeur ?" -    case FictionEtReel  => "La fiction pour interroger le réel" -    case Informer  => "Informer, s'informer, déformer ?" -    case Ville  => "La ville, lieu de tous les possibles ?" +    case DireAmour => "Dire l'amour" +    case IndividuEtSociete => "Individu et société : confrontations de valeur ?" +    case FictionEtReel => "La fiction pour interroger le réel" +    case Informer => "Informer, s'informer, déformer ?" +    case Ville => "La ville, lieu de tous les possibles ?" -    case RaconterRepresenter  => "Se raconter, se représenter" -    case TraversSociete  => "Dénoncer les travers de la société" -    case VisionsPoetiques  => "Visions poétiques du monde" -    case AgirCite  => "Agir dans la cité : individu et pouvoir" -    case ProgresReveScientifique  => "Progrès et rêves scientifiques" +    case RaconterRepresenter => "Se raconter, se représenter" +    case TraversSociete => "Dénoncer les travers de la société" +    case VisionsPoetiques => "Visions poétiques du monde" +    case AgirCite => "Agir dans la cité : individu et pouvoir" +    case ProgresReveScientifique => "Progrès et rêves scientifiques"    }  } diff --git a/src/main/scala/reading/utils/Rx.scala b/src/main/scala/reading/utils/Rx.scala index 83de617..76d05eb 100644 --- a/src/main/scala/reading/utils/Rx.scala +++ b/src/main/scala/reading/utils/Rx.scala @@ -1,6 +1,6 @@  package reading.utils -import scala.util.{Failure, Success} +import scala.util.{ Failure, Success }  import org.scalajs.dom.Element | 
