[GMG-Devel] Regarding bug #868 : don't reload media page, use more ajax

Vijeth T Aradhya vijthaaa at gmail.com
Sat Jan 21 00:22:10 EST 2017


Hi,

I feel this is actually a major bug because it would be very disturbing if
the media stops and the page reloads when you post a comment :/ But, this
had been marked minor for reasons I don't seem to understand!

Anyways, I have attached a patch file and a drive link (
https://drive.google.com/open?id=0B3fdAW29sV-LMUg5VHJGZG5BUWc ) to a video
which verifies the fixes.

I did not elaborate much on tracker because I thought I'd do it on the
mailing list.

I have employed the following methods to achieve it -

1. Design : I have removed the usage of *messages *views.py which was used
to post error or success message regarding the comment posted after the
page reloaded.
   Reason : Since, this is an AJAX call, we don't really have to post
messages after the page reloads, but rather post it just after it gets the
response. I have added the same error/success messages which appear after
the AJAX call is made, and fade out after 1 second (position is fixed at
the top so the user can see it). I thought this was a good way of handling
them :) Any suggestions would be great.

2. post_comment.html and post_comment.js : The HTML template here is the
response we get from the server, and the .js file is where the AJAX
function is defined.

3. Design : Whenever the comment is successful, the window scrolls down to
the comment; also success message is shown on the top(green). The comment
text box and preview is hidden now, like before.
    Reason : This actually happens in most social networking sites as well,
and I thought the user would want to see the comment as well, other than
the success message on the top. (We could also allow the user to
edit/delete the comment - that is another bug, another story -
https://issues.mediagoblin.org/ticket/869 - which I will work on once this
gets fixed!).

4. Design : If the comment is unsuccessful, then the error message(red) is
shown on the top, and the comment box and preview is still there (shown).
    Reason : Well, this is quite obvious I guess.

I think this would be my first non-trivial bug in GNU MediaGoblin, and
would love to work on more issues after we finish doing this! :) It'd be
great if you guys could get back to me as soon as possible, and I'll do any
remaining small changes if required.

Thank you,
Vijeth Aradhya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mediagoblin.org/pipermail/devel/attachments/20170121/b555ee20/attachment.html>


More information about the devel mailing list