From 8d9d480b866838947786d879b27da635e8ca1941 Mon Sep 17 00:00:00 2001 From: badetitou Date: Thu, 13 Jun 2019 18:48:50 +0200 Subject: [PATCH] update size of the cell --- src/EMM-Importer/EMMLibraryImporter.class.st | 1 + .../EMMFoldersModule.class.st | 1 - src/EMM-WebApplication/EMMListModule.class.st | 23 +++++++++++++------ src/EMM-WebApplication/EMMModule.class.st | 5 ++++ .../EMMOverviewPage.class.st | 3 ++- src/EMM/EMMMSong.class.st | 13 ++++++++++- 6 files changed, 36 insertions(+), 10 deletions(-) diff --git a/src/EMM-Importer/EMMLibraryImporter.class.st b/src/EMM-Importer/EMMLibraryImporter.class.st index 7b24c4b..63969ea 100644 --- a/src/EMM-Importer/EMMLibraryImporter.class.st +++ b/src/EMM-Importer/EMMLibraryImporter.class.st @@ -26,6 +26,7 @@ EMMLibraryImporter >> createSongFromFile: file [ folder := (self ensureFolderFromFileReference: file parent). folder addSong: song. song folder: folder. + song title: id3parser id3v2Tag title. song path: file. ^ song ] diff --git a/src/EMM-WebApplication/EMMFoldersModule.class.st b/src/EMM-WebApplication/EMMFoldersModule.class.st index 01b0d9c..27b409c 100644 --- a/src/EMM-WebApplication/EMMFoldersModule.class.st +++ b/src/EMM-WebApplication/EMMFoldersModule.class.st @@ -18,7 +18,6 @@ EMMFoldersModule >> renderContentOn: html [ mdlTextColorAccent; with: 'Selected element: ' , (selectedElement ifNil: [ 'No element selected' ] ifNotNil: [ selectedElement name ]). html div - style: 'height: 400px'; with: ((MDLNestedList elements: self session model directories values children: [ :child | #() ]) format: [ :emmmDirectory | emmmDirectory name ]; diff --git a/src/EMM-WebApplication/EMMListModule.class.st b/src/EMM-WebApplication/EMMListModule.class.st index c718cc5..c114ff9 100644 --- a/src/EMM-WebApplication/EMMListModule.class.st +++ b/src/EMM-WebApplication/EMMListModule.class.st @@ -28,32 +28,41 @@ EMMListModule >> initialize [ { #category : #rendering } EMMListModule >> renderContentOn: html [ html mdlTable + attributeAt: 'width' put: '100%'; with: [ html tableHead: [ html tableRow: [ html mdlTableHeading nonNumerical; with: 'Title'. + html mdlTableHeading + nonNumerical; + with: 'Author'. html mdlTableHeading: 'Lenght'. - html mdlTableHeading: 'Author'. - html mdlTableHeading: 'Play' ] ]. + + html mdlTableHeading + nonNumerical; + with: 'Play' ] ]. html tableBody: [ datas do: [ :song | html tableRow: [ html mdlTableCell nonNumerical; - with: song name. - html mdlTableCell - nonNumerical; - with: 'le'. + with: song title. html mdlTableCell nonNumerical; with: song artists asOrderedCollection first name. + html mdlTableCell with: 'le'. html mdlTableCell nonNumerical; with: [ html mdlAnchorButton - callback: [ (EMMMusicPlayer new playSong: song) play. ]; + callback: [ (EMMMusicPlayer new playSong: song) play ]; colored; icon; with: [ html mdlIcon: 'play_arrow' ] ] ] ] ] ] ] + +{ #category : #accessing } +EMMListModule >> size [ + ^ 8 +] diff --git a/src/EMM-WebApplication/EMMModule.class.st b/src/EMM-WebApplication/EMMModule.class.st index ca90068..66b2653 100644 --- a/src/EMM-WebApplication/EMMModule.class.st +++ b/src/EMM-WebApplication/EMMModule.class.st @@ -18,3 +18,8 @@ EMMModule class >> modulesToDisplay [ EMMModule class >> priority [ ^ self subclassResponsibility ] + +{ #category : #accessing } +EMMModule >> size [ + ^ 4 +] diff --git a/src/EMM-WebApplication/EMMOverviewPage.class.st b/src/EMM-WebApplication/EMMOverviewPage.class.st index d832d83..25751fd 100644 --- a/src/EMM-WebApplication/EMMOverviewPage.class.st +++ b/src/EMM-WebApplication/EMMOverviewPage.class.st @@ -46,7 +46,8 @@ EMMOverviewPage >> renderContentOn: html [ with: [ EMMModule modulesToDisplay do: [ :module | html mdlCell - size: 4; + style: 'height: 400px; overflow: auto'; + size: (self moduleInstanceOf: module) size; shadow: 2; with: [ html render: (self moduleInstanceOf: module) ] ] ] ] diff --git a/src/EMM/EMMMSong.class.st b/src/EMM/EMMMSong.class.st index fd8ddcf..e2dc62f 100644 --- a/src/EMM/EMMMSong.class.st +++ b/src/EMM/EMMMSong.class.st @@ -5,7 +5,8 @@ Class { 'folder', 'name', 'artists', - 'path' + 'path', + 'title' ], #category : #EMM } @@ -60,3 +61,13 @@ EMMMSong >> path: anObject [ EMMMSong >> printOn: aStream [ aStream nextPutAll: self name ] + +{ #category : #accessing } +EMMMSong >> title [ + ^ title +] + +{ #category : #accessing } +EMMMSong >> title: anObject [ + title := anObject +]