Skip to content

Commit

Permalink
Update CI config
Browse files Browse the repository at this point in the history
Update MANIFEST.in
Add sorting guidance for 3rd-party app imports
Improve documentation markup
Remove pinax-theme-bootstrap from test requirements
  • Loading branch information
grahamu committed Jan 17, 2018
1 parent d5e9301 commit b23fd06
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 28 deletions.
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include AUTHORS
include LICENSE
include README.md
recursive-include pinax/messages/static *
recursive-include pinax/messages/templates *
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ Django \ Python | 2.7 | 3.4 | 3.5 | 3.6

To install pinax-messages:

```
```commandline
$ pip install pinax-messages
```

Add `"pinax.messages"` to your `INSTALLED_APPS` setting:

```python
INSTALLED_APPS = (
# other apps
"pinax.messages",
)
INSTALLED_APPS = [
# other apps
"pinax.messages",
]
```

Run Django migrations to create `pinax-messages` database tables:

```
```commandline
$ python manage.py migrate
```

Expand All @@ -93,23 +93,23 @@ These snippets fall into three categories: view message inbox (all threads), vie

Place this snippet wherever a "Message Inbox" link is needed for viewing user message inbox:

```html
```djangotemplate
<a href="{% url 'pinax_messages:inbox' %}"><i class="fa fa-envelope"></i> {% trans "Message Inbox" %}</a>
```

#### View Message Thread

Place this snippet wherever you have need to view a specific message thread:

```html
```djangotemplate
<a href="{% url 'pinax_messages:thread_detail' thread.pk %}"><i class="fa fa-envelope"></i> {% trans "View Message Thread" %}</a>
```

#### Create Message - Template

Add the following line to an object template in order to provide a button for messaging a user associated with `object`:

```html
```djangotemplate
<a href="{% url "pinax_messages:message_user_create" user_id=object.user.id %}" class="btn btn-default">Message this user</a>
```

Expand All @@ -132,9 +132,9 @@ TEMPLATES = [
{
# ...
"OPTIONS": {
# ...
# other options
"context_processors": [
# ...
# other processors
"pinax.messages.context_processors.user_messages"
],
},
Expand Down Expand Up @@ -162,7 +162,7 @@ Determines if a message thread has unread messages for a user.

For instance if there are unread messages in a thread, change the CSS class accordingly:

```html
```djangotemplate
{% load pinax_messages_tags %}
<div class="thread {% if thread|unread:user %}unread{% endif %}">
Expand All @@ -178,7 +178,7 @@ Returns the number of unread threads for the user. Use for notifying a user of n

For instance if there are unread messages in a thread, change the CSS class accordingly:

```html
```djangotemplate
{% load pinax_messages_tags %}
{% with user|unread_thread_count as user_unread %}
Expand Down Expand Up @@ -251,6 +251,14 @@ These URL names are available when using pinax-messages urls.py:

## Change Log

### 2.0.2

* Update CI config
* Update MANIFEST.in
* Add sorting guidance for 3rd-party app imports
* Improve documentation markup
* Remove pinax-theme-bootstrap from test requirements

### 2.0.1

* Update test config
Expand Down
7 changes: 3 additions & 4 deletions pinax/messages/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def test_ordered(self):
"debug": True,
"context_processors": [
"django.contrib.auth.context_processors.auth",
"pinax_theme_bootstrap.context_processors.theme",
"pinax.messages.context_processors.user_messages",
]
}
Expand Down Expand Up @@ -243,7 +242,7 @@ def test_unread_thread_count_one_unread(self):
Message.new_message(
self.brosner,
[self.jtauber],
"Why did you break the internet?", "I demand to know.").thread
"Why did you break the internet?", "I demand to know.")

tmpl = """
{% load pinax_messages_tags %}
Expand All @@ -270,7 +269,7 @@ def test_unread_thread_count_two_messages_incl_reply(self):
Message.new_message(
self.brosner,
[self.jtauber],
"Second message", "So there are two.").thread
"Second message", "So there are two.")
tmpl = """
{% load pinax_messages_tags %}
{% if user|unread_thread_count %}{{ user|unread_thread_count }}{% endif %}
Expand Down Expand Up @@ -310,7 +309,7 @@ def test_unread_thread_count_within_with_assignment(self):
Message.new_message(
self.brosner,
[self.jtauber],
"Why did you break the internet?", "I demand to know.").thread
"Why did you break the internet?", "I demand to know.")

tmpl = """
{% load pinax_messages_tags %}
Expand Down
3 changes: 0 additions & 3 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"django.contrib.contenttypes",
"django.contrib.sites",
"django.contrib.sessions",
"pinax_theme_bootstrap",
"bootstrapform",
"pinax.messages",
"pinax.messages.tests"
],
Expand All @@ -39,7 +37,6 @@
"debug": True,
"context_processors": [
"django.contrib.auth.context_processors.auth",
"pinax_theme_bootstrap.context_processors.theme",
"pinax.messages.context_processors.user_messages",
]
}
Expand Down
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import find_packages, setup

VERSION = "2.0.1"
VERSION = "2.0.2"
LONG_DESCRIPTION = """
.. image:: http://pinaxproject.com/pinax-design/patches/pinax-messages.svg
:target: https://pypi.python.org/pypi/pinax-messages/
Expand Down Expand Up @@ -81,12 +81,11 @@
"Topic :: Software Development :: Libraries :: Python Modules",
],
install_requires=[
"django>=1.8",
"django-appconf>=1.0.1",
"django>=1.11",
"django-appconf>=1.0.2",
],
tests_require=[
"django-test-plus>=1.0.11",
"pinax-theme-bootstrap>=7.10.1",
"django-test-plus>=1.0.22",
],
test_suite="runtests.runtests",
zip_safe=False
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inline-quotes = double
[isort]
multi_line_output=3
known_django=django
known_third_party=mock,pinax
known_third_party=appconf,pinax
sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
skip_glob=**/*/migrations/*

Expand Down

0 comments on commit b23fd06

Please sign in to comment.