Hi,

Before a longer answer, what is��TBSMagritteReport ? Is it yours or is it some magritte extension for Bootstrap?��

Thanks,

On Fri, Mar 17, 2017 at 3:54 AM, Asbath Sama biyalou <asamabiyalou@yahoo.com> wrote:
Hello.

I am using Magritte to generate reports for a pharo class. I want to
customize generated components in order to have a better design.

My class is Match

Object subclass: #Match
�� �� instanceVariableNames: 'date_match hour_match status actions stadium
comments teams goals1 goals2 competition'
�� �� classVariableNames: ''
�� �� category: MyProject-Entity'


Descriptions for some variables.

Stadium is also a Class.

Match>>descriptionStadium
<magritteDescription>
^ MASingleOptionDescription new
�� �� label: 'Stadium';
�� �� priority: 305;
�� �� accessor: #stadium;
�� �� options: Team allStadiumsName;
�� �� componentClass: TBSMagritteSelectListComponent;
�� �� beRequired;
�� �� yourself


Match>>descriptionTeams
<magritteDescription>
^ MAMultipleOptionDescription new
�� �� label: 'Teams';
�� �� priority: 805;
�� �� accessor: #teams;
�� �� options: Team allTeamsName;
�� �� componentClass: MAMultiselectListComponent;
�� �� yourself


The generated component in the form is not very pretty. I want to have
multiple checkbox.


Match>>descriptionStatus
<magritteDescription>
^ MASingleOptionDescription new
�� �� label: 'Status';
�� �� priority: 505;
�� �� accessor: #status;
�� �� options: #('Pas en cours' 'En Cours' 'Mi-temps' 'Termin��');
�� �� componentClass: TBSMagritteSelectListComponent;
�� �� yourself


For the report I use the class SEMatchReport

TBSMagritteReport subclass: #SEMatchReport
�� �� instanceVariableNames: 'report'
�� �� classVariableNames: ''
�� �� category: 'MyProject-Components'


SEMatchReport class>>from
�� �� | report matchs commandColumn |
�� �� matchs := Match selectAll.
�� �� report:= self rows: matchs description: (self
�� �� �� �� filteredDescriptionsFrom: matchs anyOne).

�� �� commandColumn := MACommandColumn new.

�� �� (SEMatchReport new session isSimpleAdmin)
�� �� ifTrue: [
�� �� �� �� report addColumn: (commandColumn
�� �� �� �� �� �� addCommandOn: report selector: #editMatch: text: 'Modifier';
yourself;
�� �� �� �� �� �� addCommandOn: report selector: #addAction: text: 'Ajouter
une action'; yourself ) ]
�� �� ifFalse: [
�� �� �� �� report addColumn: (commandColumn
�� �� �� �� �� �� addCommandOn: report selector: #editMatch: text: 'Modifier';
yourself;
�� �� �� �� �� �� addCommandOn: report selector: #deleteMatch: text:
'Supprimer'; yourself;
�� �� �� �� �� �� addCommandOn: report selector: #addAction: text: 'Ajouter
une action'; yourself ) ].

�� �� ^ report

I want to put some bootstrapp icons near commandColumn actions. like
pencil or delete on 'Supprimer'.


SEMatchReport class>>filteredDescriptionsFrom: aMatch
�� �� ^ aMatch magritteDescription select: [ :each | #(date_match
hour_match stadium goals1 goals2 teams)
�� �� �� �� includes: each accessor selector ]

I notice that on the generated report on column stadium we have
aStadium. We don't have the value (the name). I don't know how to
mention it in the filtered descriptions.

Change the color of lines in the report, etc. All that things.

Sorry for the bad english.

Thanks.

Asbath




--
Mariano
http://marianopeck.wordpress.com