bilal | JoseeAntonioR: So, how can I help you? :) | 00:02 |
---|---|---|
JoseeAntonioR | bilal: I'm still struggling with this thing. when I embed the separate file, it didn't work | 00:02 |
bilal | JoseeAntonioR: You had the reverse match exception right? | 00:03 |
bilal | that's still the problem? | 00:03 |
JoseeAntonioR | yeah | 00:03 |
JoseeAntonioR | yep | 00:03 |
bilal | are you including the URL file | 00:03 |
bilal | ? | 00:03 |
JoseeAntonioR | what do you mean by the url file? | 00:03 |
bilal | the file where you define new URLs | 00:03 |
bilal | and you link views to it | 00:03 |
JoseeAntonioR | hmm, not sure, I just edited the code | 00:03 |
bilal | okay | 00:04 |
bilal | so you probably did not add any new views | 00:04 |
JoseeAntonioR | erm | 00:04 |
JoseeAntonioR | :P | 00:04 |
JoseeAntonioR | brb, dad's calling | 00:04 |
bilal | open up the urls.py file, it should be in one of the directories | 00:04 |
bilal | okay, no problem, ping when you're back | 00:04 |
JoseeAntonioR | bilal: back | 00:12 |
bilal | So yes | 00:12 |
bilal | open the urls.py file | 00:12 |
JoseeAntonioR | mhm | 00:12 |
bilal | it must be in some directory within the project | 00:12 |
bilal | and look for the view which you're finding a url for | 00:13 |
bilal | check if it's listed | 00:13 |
bilal | and also | 00:13 |
bilal | {% url app.view.view_name_here arg1 arg2 %} is the format, not {% url 'app.view.view_name_here' arg1 arg2 %} | 00:14 |
bilal | I learnt it the hard way yesterday | 00:14 |
JoseeAntonioR | bilal: you mean, the URL i'm calling? that was already listed as per other features | 00:14 |
bilal | yup | 00:15 |
JoseeAntonioR | yeah, that's been listed forever | 00:15 |
bilal | check the format then | 00:15 |
bilal | can you do a pastbin of that code block again? | 00:15 |
JoseeAntonioR | just of the script? or including the img tag? | 00:15 |
bilal | both preferably | 00:16 |
JoseeAntonioR | http://pastebin.com/atGr2ivX | 00:17 |
JoseeAntonioR | line 4 is the img tag that matters | 00:17 |
bilal | are you sure it's summit.schedule.views.* and not schedule.views.* | 00:19 |
JoseeAntonioR | yep, I copied that from aboce | 00:20 |
JoseeAntonioR | above* | 00:20 |
JoseeAntonioR | that was listed as an href doing what is doing now in summit.u.com | 00:20 |
bilal | what's the exact error message? | 00:21 |
bilal | O dpm | 00:21 |
bilal | *I don't see a problem with it, it should work | 00:21 |
JoseeAntonioR | bilal: http://summit.joseeantonior.com:8000/uds-r/2012-10-29/ has got it | 00:23 |
bilal | JoseeAntonioR: remove the comma between the two arguments | 00:24 |
bilal | and see if it works | 00:24 |
JoseeAntonioR | let's check | 00:24 |
JoseeAntonioR | nope | 00:25 |
JoseeAntonioR | bilal: but the weird thing it's having troubles with the decorators, and not the views I'm calling | 00:25 |
bilal | yeah | 00:26 |
bilal | which version of django is it? | 00:26 |
bilal | 1.4? | 00:26 |
JoseeAntonioR | no idea, /me checks | 00:26 |
JoseeAntonioR | bilal: 1.3.1 | 00:28 |
bilal | should work then | 00:29 |
bilal | weird | 00:29 |
bilal | which decorators are you using for the view that's calling the render_to_response? | 00:29 |
bilal | or render, whatever | 00:30 |
JoseeAntonioR | no idea, cjohnston made that part | 00:30 |
bilal | do you have your code in a branch? | 00:32 |
bilal | I'll test it myself when I have time | 00:32 |
JoseeAntonioR | my code, you mean, the modified one? | 00:32 |
bilal | yup | 00:34 |
JoseeAntonioR | let me push it | 00:34 |
JoseeAntonioR | bilal: https://code.launchpad.net/~joseeantonior/+junk/summit-tests | 00:37 |
bilal | thanks | 00:37 |
JoseeAntonioR | thanks to you | 00:37 |
JoseeAntonioR | oops | 00:38 |
bilal | wait, you didn't commit anything | 00:38 |
bilal | :) | 00:38 |
JoseeAntonioR | yeah | 00:38 |
JoseeAntonioR | done | 00:40 |
bilal | JoseeAntonioR: Try removing the quotes around the {% url %} tag | 00:45 |
JoseeAntonioR | hmm, let's check... | 00:45 |
* bilal made that change, but is too lazy to disrupt his django setup by installing the whole summit project | 00:45 | |
JoseeAntonioR | nope | 00:47 |
JoseeAntonioR | no fix | 00:47 |
bilal | meh, still don't know the fix | 00:49 |
bilal | I'll work on it tonight then see how it foes | 00:49 |
bilal | *goes | 00:49 |
JoseeAntonioR | ok, thanks! | 00:50 |
bilal | right now I have to finish homework _fast_ | 00:50 |
JoseeAntonioR | :P | 00:50 |
mh0 | bilal: Even devs get homework :p | 06:50 |
bilal | JoseeAntonioR: fixed | 23:04 |
bilal | it was very simple | 23:04 |
bilal | JoseeAntonioR: this is how I did it: http://pastebin.com/fpzDLeeu | 23:04 |
JoseeAntonioR | lemme check | 23:04 |
bilal | wait, I forgot to enclose the {% url %} tag with quotes | 23:05 |
bilal | which I guess is needed here | 23:05 |
bilal | so add that, it should still work | 23:05 |
bilal | JoseeAntonioR: ^ | 23:05 |
JoseeAntonioR | yep | 23:05 |
JoseeAntonioR | testing in a sec | 23:05 |
bilal | mh0: :) | 23:06 |
JoseeAntonioR | bilal: the star is now clickable, but nothing happens | 23:11 |
bilal | See your javascript console | 23:11 |
bilal | you have the thing quoted, right? | 23:11 |
bilal | it's another issue most probably | 23:12 |
JoseeAntonioR | it's quoted | 23:12 |
bilal | see the source code from your browser | 23:12 |
bilal | and see if the correct URL is being passed in onClick | 23:12 |
bilal | oh, and there are two functions with the same name | 23:12 |
bilal | make sure the correct one is being called | 23:12 |
JoseeAntonioR | what do you mean bu there are two functions with the same name? | 23:15 |
JoseeAntonioR | there's only one | 23:15 |
JoseeAntonioR | bilal: ^ | 23:16 |
bilal | two javascript functions | 23:16 |
bilal | there are two changeStatus functions | 23:16 |
bilal | change the name of one of them | 23:17 |
JoseeAntonioR | yeah, each one has a different url in () | 23:17 |
bilal | no | 23:17 |
bilal | there are two distinct functions with different code | 23:17 |
bilal | right at the bottom of the daily.html template | 23:17 |
bilal | JS is overriding one with the other | 23:18 |
Darael | Who thought that was a good idea? | 23:18 |
JoseeAntonioR | oh | 23:18 |
philballew | I did Darael | 23:19 |
philballew | my bad | 23:19 |
JoseeAntonioR | oooh, didn't notice that | 23:19 |
JoseeAntonioR | [18:19:49.763] ReferenceError: changeStatus is not defined | 23:20 |
JoseeAntonioR | bilal: ^ | 23:20 |
bilal | you changed the name of the second one right? | 23:20 |
bilal | then change the name in onClick too | 23:21 |
bilal | in the img tag | 23:21 |
JoseeAntonioR | nah, it's the same | 23:21 |
bilal | Also, in the JS function, if data[success]=False: <img class="icon" src="/media/img/attending.png"> should turn into if data[success]=True: <img class="icon" src="/media/img/attending.png"> | 23:21 |
bilal | oh, and btw, wrong syntax | 23:22 |
bilal | it's not Python, so this is the syntax: | 23:22 |
JoseeAntonioR | yeah, that False is already a True | 23:23 |
bilal | if (data[success]=False) {document.getElementbyId("img_tag_id").setAttribute("src","/media/img/attending.png");} | 23:24 |
bilal | and, set an ID for the img tag, preferably img_{{agenda.meeting_id}} or whatever | 23:25 |
bilal | and pass it along to the JS function changeStatus too | 23:25 |
bilal | since right now you aren't doing anything to the star | 23:26 |
JoseeAntonioR | otherwise, it'd change all the non-attendings to attendings? | 23:27 |
bilal | right now it doesn't know which IMG tag to modify | 23:28 |
bilal | plus, you aren't even putting a new IMG tag out there | 23:28 |
JoseeAntonioR | same, changeStatus is not defined | 23:29 |
JoseeAntonioR | urgh | 23:29 |
bilal | change the name of the function which you wrote in the IMG tag | 23:29 |
bilal | onClick="changeStatus(...)" should change | 23:29 |
JoseeAntonioR | to what? | 23:29 |
bilal | keep the other, smaller changeStatus as-is | 23:29 |
bilal | wait, you changed the name of the function, right? | 23:30 |
JoseeAntonioR | no | 23:30 |
JoseeAntonioR | the function name is changeStatus | 23:30 |
JoseeAntonioR | I deleted the other one | 23:30 |
bilal | don't delete it | 23:31 |
bilal | some other tag in some other template still uses it | 23:31 |
JoseeAntonioR | nope, I wrote it | 23:32 |
bilal | oh okay | 23:32 |
JoseeAntonioR | the point is it still says it | 23:32 |
JoseeAntonioR | 's not defined | 23:32 |
bilal | also, what is giving the error? | 23:32 |
bilal | django, or your browser? | 23:32 |
JoseeAntonioR | browser | 23:33 |
JoseeAntonioR | ReferenceError: changeStatus is not defined | 23:33 |
bilal | check your browser source code | 23:33 |
bilal | like, the source code of the page | 23:33 |
bilal | see if changeStatus is coming up | 23:33 |
JoseeAntonioR | yes, it is | 23:35 |
bilal | can you pastebin the source code as shown by your browser? | 23:35 |
JoseeAntonioR | bilal: http://pastebin.com/280kP7C5 | 23:36 |
bilal | set an id for the img tag, like I said | 23:38 |
bilal | <img id="img_{{agenda.meeting_id}}" src="..." ... /> | 23:38 |
bilal | onclick seems okay | 23:39 |
bilal | and in the changeStatus | 23:39 |
bilal | make sure you're using the supplied id rather than "img_tag_id" | 23:39 |
bilal | though none of this explains the reference issue | 23:39 |
bilal | try the error in a different browser | 23:41 |
JoseeAntonioR | let me check | 23:42 |
* JoseeAntonioR is super sleepy | 23:42 | |
tsimpson | if (data[success]=True) looks...wrong | 23:45 |
JoseeAntonioR | -- | 23:46 |
JoseeAntonioR | [18:46:04.934] SyntaxError: missing ; before statement | 23:46 |
JoseeAntonioR | bilal, tsimpson: any idea on what ^ may indicate? | 23:46 |
bilal | ah, that's very helpful | 23:47 |
bilal | see, switching browsers helps! | 23:47 |
JoseeAntonioR | same browser after a refresh :P | 23:47 |
bilal | you're missing a semicolon | 23:47 |
JoseeAntonioR | where? | 23:47 |
tsimpson | is the above paste (the diff) what you're running now? | 23:47 |
JoseeAntonioR | nope | 23:48 |
JoseeAntonioR | give me a sec | 23:48 |
bilal | you don't need to do the if statement | 23:49 |
bilal | data[success] check isn't neeeded | 23:49 |
JoseeAntonioR | tsimpson: http://pastebin.com/sCm0DMdk | 23:50 |
bilal | $.post(attend_url, { participation: "ATTENDING" } , function(data){ document.getElementbyId(img_tag_id).setAttribute("src","/media/img/attending.png"); }); | 23:50 |
JoseeAntonioR | bilal: what do you mean? isn't it checking if the form went through? | 23:50 |
bilal | try that | 23:50 |
JoseeAntonioR | ok | 23:50 |
bilal | JoseeAntonioR: That function is called ONLY when the post succeeds. See jQuery docs | 23:50 |
JoseeAntonioR | bilal: same error, missing ; before statement | 23:51 |
tsimpson | besides "if (data[success]=True) " is wrong | 23:51 |
bilal | JoseeAntonioR: you copied and pasted the exact sentence? | 23:51 |
JoseeAntonioR | yep | 23:51 |
JoseeAntonioR | tsimpson: new code here: http://pastebin.com/s9d7JKZM | 23:51 |
bilal | JoseeAntonioR: BTW, you deleted img_tag_id, don't do that | 23:52 |
bilal | JoseeAntonioR: keep it in both onClick and send it to the JS function changeStatus | 23:53 |
bilal | as well as id="" | 23:53 |
JoseeAntonioR | oh, ok ok | 23:53 |
bilal | but since you're using it as a variable, don't quote it in JS like you did previously | 23:53 |
JoseeAntonioR | ok, not quotes | 23:54 |
JoseeAntonioR | quoted* | 23:54 |
JoseeAntonioR | http://pastebin.com/gQ29F3Jj new version | 23:55 |
bilal | try refreshing | 23:56 |
JoseeAntonioR | missing ; before statement | 23:57 |
JoseeAntonioR | not sure where | 23:57 |
JoseeAntonioR | waaaait a sec | 23:58 |
bilal | <img class="icon" src="/media/img/not_attending.png" alt="Not Attending" onclick="changeStatus('{% url summit.schedule.views.attend_meeting agenda.meeting.summit.name agenda.meeting.id %}', img_{{agenda.meeting_id}}) id="img_{{agenda.meeting_id}}"> | 23:59 |
JoseeAntonioR | bilal: I wasn't closing the onclick tag | 23:59 |
bilal | see, it lacks the closing " | 23:59 |
JoseeAntonioR | yeah | 23:59 |
bilal | JoseeAntonioR: yeah, you got it | 23:59 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!