Comments (3)
That's a good idea... as well as RSS feeds would be great for updates and to monitor when new pages arrive.
Both cases have to account for permissions, though.
from django-wiki.
That's a good idea... as well as RSS feeds would be great for updates and to monitor when new pages arrive.
Both cases have to account for permissions, though.
Will django's sitemap framework be useful? I'm not sure in this case... but a sitemap config would be nice to have too.
from django-wiki.
Hello, I have one dirty solution I've been using during debug to get the index for a user and (almost) respecting permissions . Thanks to Ben for the excellent architecture !
I am not sure about all drawbacks of my implementation.
I create a view as follows:
from wiki import models
def wiki_index(request,template='wiki_index.html'):
#hope this line circumvents any site issues
nodes = models.URLPath.root().get_descendants(include_self=True).can_read(request.user)
if not request.user.has_perm('wiki.moderate'):
nodes = nodes.exclude(article__current_revision__deleted=True)
return render_to_response(template,{'nodes':nodes},context_instance=RequestContext(request))
and then using mptt tags is straightforward (wiki_index.html)
{% load mptt_tags %}
{% load url from future %}
<ul>
{% recursetree nodes %}
<li>
<a href="{% url 'wiki:get' path=node.path %}"> {{node.article.current_revision.title|default_if_none:"No Title"}}</a>
{% if not node.is_leaf_node %}
<ul class="children">
{{ children }}
</ul>
{% endif %}
</li>
{% endrecursetree %}
</ul>
urls.py add
url('^index/$', 'your_app.views.wiki_index', name='wiki_index'),
This code "almost" respects permissions, since taking into account the current implementation (not architecture) of can_moderate it is wiki wide and not per article.
Any advise on how to fully implement it correctly ? I dont want to test each article for can_moderate, and since the manager doesn't implement it I dont see any better.
from django-wiki.
Related Issues (20)
- SOME cards for default templates HOT 5
- SHOW_MAX_CHILDREN setting is ignored HOT 1
- Python 3.11 support: global flags not at the start of the expression at position 9 HOT 5
- Unable to login
- Unable to login HOT 1
- Bug: Edit section fails when fenced code block contains comments HOT 1
- Error Due To Bleach Updating
- Release final 0.10 with Django 4.2 support HOT 8
- Broken Django-Wiki demo HOT 4
- Grant more permissions in demo HOT 2
- [Bug]:X-Frame-Options Cross-Domain Issue HOT 3
- [Bug]: Search result with broken HTML for matches inside links HOT 5
- [Feature]: Switch to Ruff from black & flake8 HOT 1
- Reorganize SCSS sources HOT 19
- Django 5 support HOT 4
- [article_list depth:2] requires newline
- 404 Errors on static resources from the https://demo.django-wiki.org demo site
- Docs: Explain the existing plugins
- Update fenced_code markdown extention to support attr_list
- Upgrade to Bootstrap 5 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-wiki.