Discussion:
[jifty-devel] [Jifty-commit] r7674 - jifty/trunk/lib/Jifty/View/Declare
Jesse Vincent
2009-11-25 17:19:24 UTC
Permalink
Yves, can you tell me a bit more about this? It seems like it could
break the display of immutable columns, though I may be
misunderstanding.

Best,
Jesse
Author: yves
Date: Wed Nov 25 06:40:31 2009
New Revision: 7674
jifty/trunk/lib/Jifty/View/Declare/CRUD.pm
use update fields in Crud view,
we have the same sort order than in create fragment and no more double columns for refers_to fields
Modified: jifty/trunk/lib/Jifty/View/Declare/CRUD.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/CRUD.pm (original)
+++ jifty/trunk/lib/Jifty/View/Declare/CRUD.pm Wed Nov 25 06:40:31 2009
@@ -443,7 +443,7 @@
moniker => "update-" . Jifty->web->serial,
);
div { { class is 'crud-field view-argument-'.$field};
$self->render_field(
@@ -640,10 +640,11 @@
my $sort_by = shift;
my $order = shift;
my $record_class = $self->record_class;
+ my $update = $record_class->as_update_action();
div {
{ class is "crud-column-headers" };
- for my $argument ($self->display_columns) {
+ for my $argument ($self->display_columns($update)) {
div {
{ class is 'crud-column-header' };
ul { attr { class => 'crud-sort-menu', style => 'display:none;' };
_______________________________________________
Jifty-commit mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-commit
--
Yves Agostini
2009-11-25 20:03:33 UTC
Permalink
Post by Jesse Vincent
Yves, can you tell me a bit more about this? It seems like it could
break the display of immutable columns, though I may be
misunderstanding.
The original use of display_columns in crud view show two columns when the
column contains a refers_to (certainly id and name) and was alphabeticaly
sorted. In bottom of the crud list, create fragment does not sort fields.

I didn't want to change the behaviour of display_columns and
readable_attribute so the use of update fields to show the crud view looks
better. Immutable columns like email address in User plugin are always showed.

I tried to touch only the crud view, does it break somethink else?
Post by Jesse Vincent
Best,
Jesse
Author: yves
Date: Wed Nov 25 06:40:31 2009
New Revision: 7674
jifty/trunk/lib/Jifty/View/Declare/CRUD.pm
use update fields in Crud view,
we have the same sort order than in create fragment and no more double columns for refers_to fields
Modified: jifty/trunk/lib/Jifty/View/Declare/CRUD.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/CRUD.pm (original)
+++ jifty/trunk/lib/Jifty/View/Declare/CRUD.pm Wed Nov 25 06:40:31 2009
@@ -443,7 +443,7 @@
moniker => "update-" . Jifty->web->serial,
);
div { { class is 'crud-field view-argument-'.$field};
$self->render_field(
@@ -640,10 +640,11 @@
my $sort_by = shift;
my $order = shift;
my $record_class = $self->record_class;
+ my $update = $record_class->as_update_action();
div {
{ class is "crud-column-headers" };
- for my $argument ($self->display_columns) {
+ for my $argument ($self->display_columns($update)) {
div {
{ class is 'crud-column-header' };
ul { attr { class => 'crud-sort-menu', style => 'display:none;' };
_______________________________________________
Jifty-commit mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-commit
--
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
--
---------------------------------------------------------------
Yves Agostini CRI - Université Paul Verlaine -Metz
***@univ-metz.fr http://www.crium.univ-metz.fr
tel: 03 87 31 52 63 fax: 03 87 31 53 33 PGP: 842CC261
Jesse Vincent
2009-12-01 18:34:14 UTC
Permalink
Post by Yves Agostini
Post by Jesse Vincent
Yves, can you tell me a bit more about this? It seems like it could
break the display of immutable columns, though I may be
misunderstanding.
The original use of display_columns in crud view show two columns when the
column contains a refers_to (certainly id and name) and was alphabeticaly
sorted. In bottom of the crud list, create fragment does not sort fields.
I didn't want to change the behaviour of display_columns and
readable_attribute so the use of update fields to show the crud view looks
better. Immutable columns like email address in User plugin are always showed.
I tried to touch only the crud view, does it break somethink else?
The problem was that apps will generally customize the display_columns
to configure what columns should be displayed in listings. switching it
to showing a different list meant that users' existing widgets would
change.

At one point, at least, we'd had CRUD view glue to "do the right thing"
with columns with a refers_to/references. Showing both the column name
and the referenced object sounds like a bug to me ;)

Loading...