Giter VIP home page Giter VIP logo

pinax-announcements's Introduction

Pinax

Table of Contents

About Pinax

Pinax is an open-source platform built on the Django Web Framework. It is an ecosystem of reusable Django apps, themes, and starter project templates. This collection can be found at http://pinaxproject.com.

Overview

This repository contains documentation for the Pinax project.

Documentation

Updating Online Documentation

The docs live online at http://pinaxproject.com/pinax/.

After a pull request is merged, checkout your local master branch:

git checkout master

Pull the update into your local master branch:

git pull origin master

Push the update live to gh-pages:

mkdocs gh-deploy

Publishing a Distribution

projects.json

distribution.json

Change Log

Contribute

For an overview on how contributing to Pinax works read this blog post and watch the included video, or read our How to Contribute section. For concrete contribution ideas, please see our Ways to Contribute/What We Need Help With section.

In case of any questions we recommend you join our Pinax Slack team and ping us there instead of creating an issue on GitHub. Creating issues on GitHub is of course also valid but we are usually able to help you faster if you ping us in Slack.

We also highly recommend reading our blog post on Open Source and Self-Care.

Code of Conduct

In order to foster a kind, inclusive, and harassment-free community, the Pinax Project has a code of conduct. We ask you to treat everyone as a smart human programmer that shares an interest in Python, Django, and Pinax with you.

Connect with Pinax

For updates and news regarding the Pinax Project, please follow us on Twitter @pinaxproject and check out our Pinax Project blog.

License

Copyright (c) 2012-2018 James Tauber and contributors under the MIT license.

pinax-announcements's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pinax-announcements's Issues

Do there any blockers to bump new release?

We are looking forward to using pinax-announcements with Django 3.2 on edX.

Required PR - #68 is already merged into the master branch.
Do there any chance a new version will be bumped soon?

If any blockers with the release I would be happy to help.

Thank you in advance.

@paltman

Support Django 4.0

django.conf.urls.url() got removed in Django 4.0, as seen here:

from django.conf.urls import url

Also, the providing_args argument for django.dispatch.Signal is removed as seen here:

announcement_created = django.dispatch.Signal(providing_args=["announcement", "request"])
announcement_updated = django.dispatch.Signal(providing_args=["announcement", "request"])
announcement_deleted = django.dispatch.Signal(providing_args=["announcement", "request"])

Docs are out of date

{% load announcments_tags %}

should be

{% load announcment_tags %}

and

{% announcements as whatever %}

should be

{% fetch_announcements as whatever %}

Update PyPI

With the latest pull request added to support Django 1.5+, can you update PyPI so the latest package can be downloaded?

Thanks!

How to disable absolute url in Django admin?

I have an error TemplateDoesNotExist, after checking out the root cause is the models has get_absolute_url, meanwhile that view doesn't have any templates found.

def get_absolute_url(self):
    return reverse("pinax_announcements:announcement_detail", args=[self.pk])

As docs said https://github.com/pinax/pinax-announcements#templates:

Default templates are provided by the pinax-templates app in the announcements section of that project.

Meanwhile, in my case I don't really need this template, because I'm just using default Django admin to reach out the announcements.

So, what I'm thinking is, probably we can just disable the View on site button or maybe can also disable/remove the get_absolute_url in admin page. But, how I can achieve this?

Let say, not just focus on pinax-announcements, this probably happens in another case.

announcements.views.dismiss is unusable without Javascript

Currently opening dismiss_url with GET results in 405 HTTP response. So it is usable only with Javascript+XMLHttpRequest and accessibility suffers greatly. To make it work without Javascript it is required to write a lot of dumb code like

<form action={{...dismiss_url}} method=POST>
<input type=submit>
...

There is no reason why it shouldn't be possible to dismiss with GET. When called with GET it could return HttpResponseRedirect to HTTP_REFERER instead of useless {} JSON response.

Document how to find templates

When installing this app I get these cryptic errors:

django.template.exceptions.TemplateDoesNotExist: pinax/announcements/announcement_list.html, announcements/announcement_list.html

Looks like #48 removed all the templates, and AFAICT the documentation has no advice on where to find them.

django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.

When installing django-announcements my project stops running due to

django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.

and it's originating from User = get_user_model() in announcements/models.py

From my findings get_user_model() has to be run during runtime after but not sure..

Any ideas how to fix this?

KeyError "request" when load or send the JSON data via ajax.

Screenshots

image

Desktop

  • OS: MacOSX, Windows, Linux
  • Browser Chrome
  • Version 92.0.4515

Solution:

I think we can just check whether request is filled.

def render(self, context):
    request = context.get('request', None)
    if request:
        qs = Announcement.objects.filter(
            publish_start__lte=timezone.now()
        ).filter(
            Q(publish_end__isnull=True) | Q(publish_end__gt=timezone.now())
        ).filter(
            site_wide=True
        )
        exclusions = request.session.get("excluded_announcements", [])
        exclusions = set(exclusions)
        if request.user.is_authenticated:
            for dismissal in request.user.announcement_dismissals.all():
                exclusions.add(dismissal.announcement.pk)
        else:
            qs = qs.exclude(members_only=True)
        context[self.as_var] = qs.exclude(pk__in=exclusions)
    return ""

Call for Maintainers

Looking for maintainers!

There is a lot of pull requests and open issues that the current maintainers, myself included, are just not finding the time to properly get to.

Maybe you've submitted some PRs and are frustrated with the lack of attention. Maybe you use this project in one or more of your projects and want to see that it is properly carried forward.

Whatever you reasons may be, let me know if you have interest and I'll add you to the repo and to PyPI (will need your PyPI name).

Preference will go to those who have commits on this repo and/or have shown an active interest in the issues.

Thanks!
Patrick

Update documentation for namespace

Documentation (docs/index.md) should point out pinax-announcements URL names are namespaced.

Incorrect:

url(r"^announcements/", include("pinax.announcements.urls")),

Correct:

url(r"^announcements/", include("pinax.announcements.urls", namespace="pinax_announcements")),

Use new pinax URL namespace convention

In urls.py:
app_name = "pinax_announcements"
url(r"^$", views.AnnouncementListView.as_view(), name="announcement_list")

and in views.py, models.py, etc.

reverse("pinax_announcements:announcement_list")

No LICENSE file in repository.

While previous Google Code site indicates this was MIT licensed, there's nothing in this repo to tell users what license it is being provided under.

Update Usage documentation

Usage documentation is not up-to-date with latest eldarion-ajax.

Use something like this:

<a class="btn ajax" data-method="post" data-replace-closest=".announcement" href="/announcements/2/hide/">
    Clear
    </a>

Mistake in snippet in Readme

Hi

in the following code snippet in the readme you have announcement_list and announcementS_list, which results in no announcements displayed.
``

Announcements

{% announcements as announcement_list %}

{% if announcements_list %}
    <div class="announcements">
        {% for announcement in announcement_list %}
            <div class="announcement">
                <strong>{{ announcement.title }}</strong><br />
                {{ announcement.content }}
            </div>
        {% endfor %}
    </div>
{% endif %}``

remove templates

No longer needed since templates exist in pinax-theme-bootstrap.

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.