Coder Social home page Coder Social logo

ella-comments's Introduction

ella-comments's People

Contributors

aleszoulek avatar andymccurdy avatar honzakral avatar kvbik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ella-comments's Issues

Create and send a "comment_removed" signal

django.contrib.comments sends a comment_was_posted signal when a new comment is created. Marking a comment as removed (is_removed=True) should send a comment_removed signal for third party apps that need to take into account a comment being removed from the system.

get_comment_options tag breaks include/with tag behavior

The get_comment_options tag calls .update() on the context, but never pops the context off. The leads to problems if the get_comment_options tag is called within a template that has been included or that is wrapped in a {% with %} tag. For example:

{% with foo as bar %}            # adds a new dictionary to the context with "bar" as a key.
    {% get_comment_options %}    # adds a new dictionary to the context
{% endwith %}                    # pops the dictionary that get_comment_options added, but not the one that the with added

listing_hander comment_pre_save signal doesn't work with fixtures

If an primary key is explicitly set on a comment instance that isn't already saved, the comment_pre_save signal in listing_handlers will raise an error. This is most noticeable when loading comment data from fixtures as you must supply a primary key.

Wrapping https://github.com/ella/ella-comments/blob/master/ella_comments/listing_handlers.py#L35 in a try/except fixes the issue:

try:
    old_instance = instance.__class__._default_manager.get(pk=instance.pk)
except instance.__class__.DoesNotExist:
    return

Create an Absolute Url for Comments

Create an absolute url for comments so we can provide a more contextual environment for how a single comment is displayed.

Without this, the default pattern has been to link back to the absolute_url of the content_object that the comment is associated to. This isn't ideal as it could take the user a number of clicks to try to find the corresponding comment via pagination.

Proposed Solution:

  1. Create a view/url that takes a comment_id and gets the comment as well as the page on which it can be found; then redirects the user to that comment's content_object.get_absolute_url() passing both the comment_id and p as GET params.
  2. Optionally modify the comment detail template(s) to add <a name='{{ comment.id }} /> tags next to each comment so that the user can be directed to the comment requested without having to scroll. Optionally highlight the specified comment to make it easy for them to spot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.