After the discussion about multiple sort criteria [1] I decided to
make some modifications I was needing, and also repackage the initial
port Nicolas Cellier did.
The result is the transformation of Nicolas' TAG-SortFunctions [2]
"experiment" to a first class project plainly named 'SortFunctions'
available at:
http://smalltalkhub.com/#!/~emaringolo/SortFunctions/
Nicolas said:
"Since I got absolutely zero feedback after a long thread, I assumed
it was not interesting anybody...
But my personal opinion differs: this should be included in each and
every Smalltalk."
I sorry for not replying before, I also think this kind of features
should be easily discoverable in a default image, and that's why I
built a Metacello config to be included, maybe, in the MetaRepo.
Credits were preserved in the STHub project site both for Travis and Nicolas.
Best regards,
Esteban A. Maringolo
[1] http://forum.world.st/Has-someone-ever-built-a-sort-block-generator-tp47712…
[2] I guess TAG is for Travis A. Griggs
Hi,
Magritte's MAOneToManyComponent uses a hardcoded reference to MAReport,
which shows all the descriptions of the reference, even those in which
#visibleInReport attribute is false.
MAOneToManyComponent>>#buildReport
^ (MAReport rows: self value description: self reference)
sortEnabled: self magritteDescription isOrdered not;
yourself
Can we add a #reportClass attribute to such component?
With its correspondent #defaultReportClass answering MAReport, and maybe
filter the descriptions by #visibleInReport attribute, or simply delegate
such behavior to the #reportClass
I fixed it by subclassing MAOneToManyComponent, but I think this should go
at base level.
Regards!
--
View this message in context: http://forum.world.st/MAOneToManyComponent-s-report-shows-all-descriptions-…
Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.
Hi, i am using QCMagritte and I like it. The problem I found is in using custom components.
For example I have this description
<magritteDescription>
^ MADateDescription new
priority: 200;
beRequired ;
label: 'Vencimiento';
accessor: #vencimiento;
default: ( Date today + 30 ) ;
componentClass: MAJQDateInputComponent ;
comment: 'Fecha de vencimiento de la lista de precios';
yourself
But no MAJDateInputComponent is using by description.
Can anyone help me?
TIA
Ing. Pablo Digonzelli
Software Solutions
IP-Solutiones SRL
Metrotec SRL
25 de Mayo 521
Email: pdigonzelli(a)softsargentina.com
pdigonzelli(a)gmail.com
Cel: 5493815982714
We have been adding more places where it makes sense to have commands than
just the report. It seems to make sense to have a more specific name than
commands (and buildCommands). In the MAOneToManyComponent and the
MAOneToManyScalarComponent we renamed them.
Please let us know if you find this a bad idea.
Since this is an interface change, we'll make these in #'version3.2.0'.
Also we'll add a #'release3.2'. If you do not want this change in your
version, please continue using #'release3.1'.
Diego & Stephan
Name: Magritte-Seaside-StephanEggermont.358
Author: StephanEggermont
Time: 26 August 2014, 12:30:39.781583 pm
UUID: fccb214f-276b-455f-9147-3abca814e725
Ancestors: Magritte-Seaside-DiegoLont.357
Ciao,
i have a Master and slave class based on MADescription definitions.
Now in the master i need to have a description for manage a collection of slave instances (based on my MATimedIvaModel) ,
and control if in this collection there's another slave instance with same Date field based on MADateDescription.
In the Master class i defined MAToManyRelationDescription for manage the collection of slave instance:
descriptionCllTimedIva
<magritteDescription>
^ MAToManyRelationDescription new
classes: (Array with: MATimedIvaModel);
label: 'Gestione Iva';
selectorAccessor: 'cllTimedIva';
comment: 'Gestione aliquota IVA per data validita';
priority: 2200;
yourself
It work fine but don't control if there's another slave instance with the same Date.
How i can add this control ?
Thanks for any considerations,
Dario
I have identified the problem with the failing Pillar CI development
builds, but I'm not sure what action should be taken.
"Pillar-ExporterHTML-EstebanLorenzano.47" which is commented as...
"bugfix: PRHTMLWriter>>#writeEmbeddedPicture: should not add '%' to
width property. That should be responsibility of author."
made the following change...
PRHTMLWriter>>writeEmbeddedPicture:
- anExternalLink parameterAt: 'width' ifPresent: [ :width | img
parameterAt: 'width' put: width greaseString, '%' ].
+ anExternalLink parameterAt: 'width' ifPresent: [ :width | img
parameterAt: 'width' put: width greaseString ].
...which causes PRHTMLWriterTest (PRDocumentWriterTest) >>
testFigureWithWidth
to fail. It can be fixed as follows (plus some debugging instrumentation)...
PRDocumentWriterTest >> testFigureWithWidth
| item width |
- width := '50'.
+ width := '50%'.
item := PRExternalLink new
reference: 'file://picture.png';
embedded: true;
parameterAt: 'width' put: width;
yourself.
+ Transcript crShow: self printString ; crShow: (self write: item).
self assertWriting: item includesText: self widthFor50percents
...but I'm not sure if modifying #testFigureWithWidth is the right thing
to do to fix PRHTMLWriterTest, since this test is inherited by six other
subclasses of PRDocumentWriterTest. None of the other tests complain,
but that doesn't make it right.
====================
With [width := '50'] running all Pillar tests produces the following
Transcript...
PRLaTeXWriterTest>>#testFigureWithWidth
\begin{figure}
\begin{center}
\includegraphics[width=0.5\textwidth]{picture.png}\caption{file:$/$$/$picture.png.\label{picture.png}}\end{center}
\end{figure}
PRHTMLWriterTest>>#testFigureWithWidth
<figure><img src="picture.png" width="50">
</img><figcaption></figcaption></figure>
PRGitHubMarkdownWriterTest>>#testFigureWithWidth
<a name=""></a><figure><img src="picture.png" width="50%">
</img><figcaption>file://picture.png</figcaption></figure>
PRMarkdownStreamWriterTest>>#testFigureWithWidth
<a name=""></a><figure><img src="picture.png" width="50%">
</img><figcaption>file://picture.png</figcaption></figure>
PRPillarWriterTest>>#testFigureWithWidth
+file://picture.png|width=50+
====================
With [width := '50%'] running all Pillar tests produces the following
Transcript...
PRLaTeXWriterTest>>#testFigureWithWidth
\begin{figure}
\begin{center}
\includegraphics[width=0.5\textwidth]{picture.png}\caption{file:$/$$/$picture.png.\label{picture.png}}\end{center}
\end{figure}
PRHTMLWriterTest>>#testFigureWithWidth
<figure><img src="picture.png" width="50%">
</img><figcaption></figcaption></figure>
PRGitHubMarkdownWriterTest>>#testFigureWithWidth
<a name=""></a><figure><img src="picture.png" width="50%%">
</img><figcaption>file://picture.png</figcaption></figure>
PRMarkdownStreamWriterTest>>#testFigureWithWidth
<a name=""></a><figure><img src="picture.png" width="50%%">
</img><figcaption>file://picture.png</figcaption></figure>
PRPillarWriterTest>>#testFigureWithWidth
+file://picture.png|width=50\%+
====================
Now would existing projects be broken by pictures becoming 50 pixels
wide rather 50% wide ? If the goal is to be able to specify pixel
width, maybe it would be better to introduce a Pillar parameter
"pixelWidth" .
Presumably the Pillar documentation
https://github.com/pillar-markup/pillar-documentation
would need updating also.
cheers -ben
ci-pharo-contribution(a)inria.fr wrote:
> See <https://ci.inria.fr/pharo-contribution/job/Pillar/PHARO=40,VERSION=stable,V…>
>
>
>
The Pillar stable 30 build broke because of a mis-named file in PFTE. I
think the Pillar builds should be shielded from such errors, so I'm
having a go at getting it to use the last successful PTFE build.
Apologies in advance for any noise while I'm working on that (I'll look
for how to temporarily turn off notifications)
cheers -ben
Hi,
The Pillar parser does not record the token from the original text. Are
there any plans to change this part :)?
Doru
--
www.tudorgirba.com
"Every thing has its own flow"
Hi all,
Sergio ran into trouble using the bootstrap recipe, so this means the recipe isn’t good enough. I improved some parts (bold and blue)
First we need to load Pier, and since I also want to export my code, I used the following code:
Gofer new
smalltalkhubUser: 'Pier'
project: 'Pier3Addons';
configurationOf: 'Pier3AddOns';
load.
((Smalltalk at: #ConfigurationOfPier3AddOns) project version: #'development') load: #( 'Pier-Exporter-Code' 'Pier-Bootstrap' ).
This gives us a clean Pier-site, that we can modify for our use. Since we need bootstrap loaded, we first need to register pier, using bootstrap, and of course start the web server:
PRKernel reset.
PRPierFrame registerAsBootstrapApplication: 'volkstuinen' kernel: (PRKernel named: 'pier').
ZnZincServerAdaptor startOn: 8088
Before we start, we first open the site, and click on “change owner”. Change the owner to admin and toggle the recursive button. This will allow us to set the site up properly, using rights and such. When you do so, you will see that the menu with commands becomes a lot shorter, and you will have to login using “pier”, “admin” to be able to proceed.
Our template is quite simple: in our site we have a navbar, a main page and a footer. But before we can change our template, we have to make sure that we can still edit, after changing everything. This is how I would do it, if I needed to do it again.
We start by modifying the template. We add the stuff we are going to need in the beginning. Since the footer will be sticky, we want some room at the bottom anyways, so this will work fine.
+Navbar+
+MainPage+
+footer+
…. old pier stuff….
Since there is already a footer, the result of this, is that pier renders 2 missing links: “navbar” and “mainPage” where you can click on.
Now we start by adding the main page, just by clicking on main page. The main page has an alternative look, when we are logged in, because I do not want the pier navigation shown when we are logged out. This is a new component in Pier. I set it up with default (+contents+) and an alternate:
{{{<div class="jumbotron">
<div class="container">}}}
!!!Logged in
{{{</div></div>}}}
+contents+
+Sidebar+
Doing so, will result in a banner showing “logged in”. Try loging out again to test if the banner disappears.
Also Pier might try to match the sidebar, if it does so, first create a new sidebar and then correct it (removing the slash)
Now remember to select the main page, because otherwise everything will be added to the template. Now login and modify the contents and the sidebar. The contents and sidebar, are the “normal” contents and sidebar, displaying the contents and the navigation (Children (dynamic)). Change the navigation and set the level to 1 and recursive to true. This will give us better navigation.
Note that you now have 2 sidebars. The one we have added, and the original one.
Next step will be to edit the footer. Select the footer and click edit and fill out the following:
{{{<div id="footer">
<div class="navbar navbar-default navbar-fixed-bottom" role="navigation">
<div class="container-fluid">}}}
+Collapse+
{{{</div></div></div>}}}
And then the collapse looks like this:
{{{<button type="button" class="navbar-toggle" data-toggle=“.fcollapse" data-target=".footer-collapse">
<span class="se-only">Toggle footer</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>}}}
{{{<div class="footer-collapse fcollapse">}}}
+Menu+
+Commands+
{{{</div>}}}
As you can see, there is still quite a lot of bootstrap code in our pier content, but after we have set up our site, we do not need to bother with this any more. The menu is a component, that displays some static Children. I added here the possibility to add some css class. Fill out:
list class = nav navbar-nav navbar-right)
active class = active.
It needs to point to the node where you add the children you want displayed in your footer. we leave this to default for now.
At this point the footer should be shown in the bottom of the screen. Since there are a lot of commands, it might be a bit cramps down there. I suggest you remove the commands you do not need. Do not remove “edit” “login” and “logout” or you will be stuck.
Now we change our navbar. This looks a lot like our footer.
{{{<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class=“container">}}}
+Title+
+Collapse+
{{{</div></div>}}}
With the collapse:
{{{<div class="navbar-collapse collapse">}}}
+Menu+
{{{</div>}}}
And the title
{{{<div class=“navbar-header”>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="se-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>}}}
{{{<a class="navbar-brand" href="/">}}}Your site{{{</a></div>}}}
The menu is the same as in the footer. It is a static children component with the list class set to "nav navbar-nav navbar-right” and the active class set to “active”, and pointing to the place where we have our content.
Since the next step is crucial, we need to check if everything is working fine. Test your site, by selecting several things. For instance: if you select the title from the navbar, it should display from top to bottom:
- a header
- the banner with “logged in”
- the title (since this is now the current context)
- the sidebar you have added
- the pier logo, the search box, the old side bar and commands
- the heading Pier
- the title (half hidden behind the footer)
- the footer
The site should look like this, when you have selected the menu:
We can now remove the unneeded things from our template and modify it into:
+Navbar+
+MainPage+
+footer+
Finally, for our pages, we still have the jumbotron to add, so here is some bootstrap code as well:
{{{<div class="jumbotron">
<div class="container">}}}
+Heading+
{{{</div></div>}}}
{{{<div class="container"><div class="row">
<div class="col-md-4">}}}+Page1+{{{</div>
<div class="col-md-4">}}}+Page2+{{{</div>
<div class="col-md-4">}}}+Page3+{{{</div>
</div></div>}}}
Note that for our static children you can only select nodes, that have children. You probably want to create them in a separate place, then add 1 child, and then go back to the menu to point it to the right place.
So this is still quite the manual, so maybe we should make some bootstrap specific components. But then I do not know what components we exactly need, so please let me know if you have ideas for this, or have better ways to do this.
As you can see, there are a few new components and options (static children, css options, altdoc page) we added, but basically this is it. If you have any trouble or suggestions for improvements, let me know.
Cheers,
Diego