I have submitted my GSoC application. I will probably add more details and modify some part but it is mostly the finish. I hope to get a feed back when you have looked at it :)
2010-03-30 08948, 2010
navap
aCiD2: Okay now I'm trying to call UserDate.format from within my function how do I do that? I currently have http://gist.github.com/348548
2010-03-30 08924, 2010
navap
The function is sitting inside UserDate.pm so I thought just using format() would work. Guess not.
2010-03-30 08959, 2010
navap
er wait, the error is a syntax error.
2010-03-30 08922, 2010
navap
line 12 near ". format"
2010-03-30 08927, 2010
ruaok hands navap a rubber duck
2010-03-30 08958, 2010
navap
I take it that means it's an obvious mistake?
2010-03-30 08908, 2010
ruaok
I don't see it right off.
2010-03-30 08912, 2010
ruaok
what is format() ?
2010-03-30 08924, 2010
ruaok
is that one of your functions or does it belong to a perl module?
2010-03-30 08936, 2010
navap
That's the function in UserDate.pm
2010-03-30 08948, 2010
navap
s/the/the other/
2010-03-30 08952, 2010
navap
It's not mine.
2010-03-30 08904, 2010
ruaok
ah.
2010-03-30 08915, 2010
navap
It's what uses the user prefs to return a date back in the correct time zone.
2010-03-30 08923, 2010
ruaok looks at the UserDate.pm
2010-03-30 08939, 2010
ruaok
don't you want $self->format($future) ?
2010-03-30 08928, 2010
navap
Yes I did, that worked. Thanks!
2010-03-30 08943, 2010
ruaok
:-)
2010-03-30 08959, 2010
navap
hmm is it bad form to start sticking html into the perl code like how I'm doing there?
2010-03-30 08912, 2010
navap
I'm also not using gettext there for the expiration string.
2010-03-30 08922, 2010
ruaok
navap: yes.
2010-03-30 08933, 2010
ruaok
HTML should be kept in the templates and no where else.
2010-03-30 08955, 2010
ruaok
move that text to the template too.
2010-03-30 08906, 2010
ruaok
only prepare the actual date string in perl.
2010-03-30 08925, 2010
ruaok
and even then we need to respect the date formatting options the user has selected.
2010-03-30 08929, 2010
ruaok
if we still have those. ;)
2010-03-30 08940, 2010
navap
So then I'l have sub countdown return a hash and then use those to create the expiration strings?
2010-03-30 08902, 2010
navap
I don't need date formatting to say that the edit expires in 9 hours 5 min, do I? :)
So I should use something that ends up like UserDate.countdown->delta, UserDate.countdown->diff->hours ?
2010-03-30 08937, 2010
navap
In the templates.
2010-03-30 08902, 2010
ruaok
well, you can return a hash to the controller.
2010-03-30 08925, 2010
ruaok
the controller should then simplify the output into something nice and easy for the template to display.
2010-03-30 08944, 2010
ruaok
the format from above is a little too complex for the templateing engine
2010-03-30 08900, 2010
navap
Well if I want to use gettext in the templates then I can only return the numercial date/time values right?
2010-03-30 08906, 2010
brianfreud
ruaok: I was talking to acid2 earlier; I think I should go ahead and ask for RE after all. I can always ticket for some other RE to do a change if I think there's a potential conflict of interest, or I need help doing it, but there's some proposals coming down which will mean a lot of trivial AR edits - easy to do, but a flood on jira and dev time unless I just do them
2010-03-30 08912, 2010
ruaok
navap: correct.
2010-03-30 08924, 2010
ruaok
like: $c->stash->{hours} = $hours
2010-03-30 08927, 2010
ruaok
same for minutes.
2010-03-30 08931, 2010
ruaok
or whatever else.
2010-03-30 08946, 2010
ruaok
then in the template you can use the hours variable and minutes var.
2010-03-30 08939, 2010
ruaok
brianfreud: hmmm.
2010-03-30 08940, 2010
navap
How would I use that hours variable? edit.hours? Or just [% hours %] ?
2010-03-30 08902, 2010
ruaok
navap: the latter.
2010-03-30 08930, 2010
ruaok
brianfreud: you have a habit of unleashing a torrent of changes.
2010-03-30 08942, 2010
navap
Okie dokie, /me goes to experiment.
2010-03-30 08952, 2010
ruaok
I would very much like you to go through one of the existing editors to help vet your changes if you don't mind.
2010-03-30 08953, 2010
navap
ruaok: Oh and one more thing, should my countdown function be in MB::S::Edit or MB::S::Plugin::UserDate ?
2010-03-30 08910, 2010
brianfreud
ruaok: Sure
2010-03-30 08937, 2010
ruaok
edit, I would think.
2010-03-30 08938, 2010
navap
It's date related so I'm leaning towards the latter, but it could be either..
2010-03-30 08957, 2010
brianfreud
I don't really want it, lol; I just also don't want to hit acid2 w more than I have to :)
2010-03-30 08957, 2010
ruaok
the plugin doesn;'t feel like the right place.
2010-03-30 08907, 2010
ruaok
or maybe in a utils module of sorts.
2010-03-30 08919, 2010
ruaok
brianfreud: you can also hit murdos or luks.
2010-03-30 08939, 2010
navap
brianfreud: Or me
2010-03-30 08952, 2010
brianfreud
well, the tickets are in jira - anyone who wants to do any open AR one, just look under nikki's assigned open
2010-03-30 08957, 2010
navap
I don't get the entire flood that Jira sends out, so you need to point me at specific tickets.
2010-03-30 08911, 2010
brianfreud
:P
2010-03-30 08912, 2010
navap
heh why are they all dumped under her?
2010-03-30 08924, 2010
brianfreud
she was the only one editing ARs for a while
2010-03-30 08930, 2010
brianfreud
I wish I only got the jira emails once :P
2010-03-30 08957, 2010
brianfreud
jira emails me any time anyone does *anything*, then I get it all a second time via bugs
2010-03-30 08913, 2010
navap
I'm not subscribed to mb-bugs, I only get the emails that jira sends directly to me (either because it pertains to my ticket or a ticked I'm watching because I'm interested in it)
2010-03-30 08928, 2010
aCiD2
navap: I'm still not quite clear what you're trying to do. You have a date, and you want display "N days, n hours" left or something?
2010-03-30 08929, 2010
navap
ruaok: I've included MB::S::Plugin::UserDate into MB::S::Edit, but UserDate->format($future) doesn't work because it Can't locate object method "format" via package "UserDate"
2010-03-30 08934, 2010
navap
aCiD2: Yes
2010-03-30 08920, 2010
aCiD2
Right, well this is certainly template specific - but it doesn't matter about the user preferences, because (5 hours is 5 hours anywhere)
2010-03-30 08926, 2010
navap
aCiD2: It works just fine now, except that I'm generating the html within the perl code. So now I just need to move that stuff over to the templnates.
2010-03-30 08940, 2010
navap
aCiD2: Right, but I'm also displaying the exact time using a <dfn> tag.
2010-03-30 08958, 2010
navap
So a user can hover over "5 hours 3 min" and see the exact date/time that the edit expires.
2010-03-30 08901, 2010
aCiD2
So I think this should go in MB::S::Filters and be passed a translation string
2010-03-30 08922, 2010
aCiD2
But I'm not sure TT filters can do that...
2010-03-30 08915, 2010
aCiD2
Ok, you can - but it'll have to be: [% edit.expires FILTER countdown('{days} days, {hours} hours') %] but this is actually a fairly complex problem as that would require 4 translation strings I believe
2010-03-30 08920, 2010
aCiD2
as it has 2 plurals
2010-03-30 08955, 2010
navap
Yeah, hour/hours and minute/minutes
2010-03-30 08909, 2010
aCiD2
Right, so I don't know how our translation system handles that
2010-03-30 08911, 2010
navap
day will always either be days or day depending on how far away the expireation is.
2010-03-30 08936, 2010
aCiD2
I will quickly whip up a commit for you that will add a countdown filter
2010-03-30 08940, 2010
navap
er no nevermind, it will always be days :)
2010-03-30 08943, 2010
navap
Awesome :)
2010-03-30 08908, 2010
aCiD2
But it's not going to be complete - I'm just going to do enough for you to get it working. Then I need to put a thinking cap on and think about how to do it properly :)
2010-03-30 08917, 2010
aCiD2
But it will be a filter - you'll be calling it in the same way regardless
2010-03-30 08952, 2010
ruaok
philip6137: "please list a series of MBIDs as examples" you failed to do that on your application. :)
2010-03-30 08909, 2010
brianfreud
lol, now define a MBID ;)
2010-03-30 08937, 2010
aCiD2
navap: please pull acid2/countdown into your branch (and read the commit message :)
2010-03-30 08900, 2010
aCiD2
now, bed time
2010-03-30 08916, 2010
navap
brianfreud: Oh boy, loaded question :p
2010-03-30 08945, 2010
navap
brianfreud: Although the best answer to that would just be giving musicbrainz.org/doc/MBID as the answer
2010-03-30 08953, 2010
navap
aCiD2: Thanks! I'll pull now.
2010-03-30 08947, 2010
navap
hmm actually, I don't want to screw this up. What process should I use to merge that branch into mine?
2010-03-30 08942, 2010
navap
alastairp: ping; Are you able to help me with some git?
2010-03-30 08941, 2010
alastairp
heh
2010-03-30 08944, 2010
alastairp
doubt it :)
2010-03-30 08945, 2010
alastairp
fire away
2010-03-30 08953, 2010
navap__ joined the channel
2010-03-30 08904, 2010
navap__
I want to merge aCiD2's branch into mine, what's the best process to use?
2010-03-30 08945, 2010
navap__
Do I use git checkout --track acid2/countdown to create a local branch and then merge the two branches together?
The massive IF statement is a beast, but as far as I can tell it's the most efficent way to display what I want and also keep the templates/perl code separate.
2010-03-30 08936, 2010
navap
Of course, if you have a better way...I'm all ears :)
2010-03-30 08947, 2010
navap
Oh, and is it possible to PROCESS a BLOCK like I'm trying to do in line 80 of root/edit/info.tt?
2010-03-30 08918, 2010
warp
time-of-day
2010-03-30 08939, 2010
navap
time-of-day warp
2010-03-30 08937, 2010
warp
perhaps that BLOCK should be a MACRO
2010-03-30 08955, 2010
navap
I tried that, but I kept getting errors when I tried to make it a MACRO.
2010-03-30 08903, 2010
navap
unexpected end of directive [% MACRO expiration_time(edit.expires_time) %]
2010-03-30 08908, 2010
warp
it's never clear to me on github how to see the branch a commit is in
2010-03-30 08923, 2010
navap
Look at the menu, there's a branch menu dropdown.
2010-03-30 08934, 2010
navap
er, "switch branch" dropdown.
2010-03-30 08942, 2010
warp
I see the 'Switch Branches (7)' dropdown
2010-03-30 08904, 2010
warp
but the current branch isn't marked
2010-03-30 08936, 2010
navap
Oh whoops, I was on a different page. Yeah I don't think you can tell what branch a commit is in.
2010-03-30 08936, 2010
warp
I want to know the branch of your commit, so I can do git fetch navap, git checkout navap/branch-goes-here
2010-03-30 08943, 2010
navap
It's the editpage2 branch.
2010-03-30 08907, 2010
navap
Isn't it by design that a commit isn't attached to a specific branch? After all, when you branch the commits get "copied" right?
2010-03-30 08947, 2010
warp
possibly, but that's not terribly useful :)
2010-03-30 08910, 2010
navap
heh
2010-03-30 08908, 2010
warp
[% MACRO expiration_time(edit) BLOCK %]
2010-03-30 08933, 2010
warp
you probably left off BLOCK at the end when turning it into a macro.
2010-03-30 08957, 2010
navap
Nope I tried it with BLOCK as well, I get a similar error as above.
2010-03-30 08938, 2010
warp
I don't get that error now, I did without BLOCK.
2010-03-30 08947, 2010
navap
hmm I'm now getting file error - expiration_time: not found
2010-03-30 08920, 2010
warp
that's the leftover PROCESS expiration_time
2010-03-30 08941, 2010
warp
in the halfway commented bit
2010-03-30 08900, 2010
navap
Oh, crap. I thought both lines would have been commented out.
2010-03-30 08931, 2010
warp
yes, the commenting of template toolkit doesn't work very well.
2010-03-30 08903, 2010
navap
Ah the hash has to right next to the percent sign, [%#- works for multi-line comments.
2010-03-30 08912, 2010
navap
But not [%-#
2010-03-30 08917, 2010
warp
aah
2010-03-30 08959, 2010
navap
pronik`: ping
2010-03-30 08912, 2010
navap
"navap created mb_server and everyone else forked it. This is the family tree."
2010-03-30 08929, 2010
navap
hahaha that should be read nice and sloowly....
2010-03-30 08948, 2010
navap
That is some interesting phrasing by github :p
2010-03-30 08954, 2010
warp
lol
2010-03-30 08924, 2010
navap
I read it quickly just as I clicked a link and the page changed, lol
2010-03-30 08949, 2010
warp
hm, odd.
2010-03-30 08925, 2010
warp
MBS-268 is already fixed in master and next when I run them locally, but not on test.musicbrainz.org even though that is running the same next.
2010-03-30 08916, 2010
navap
Oh yeah? I can beat that. I just got an edit note email and the particular edit note isn't visible on the edit's page.