Add getting started self guided help system for missing user setup
This commit is contained in:
@@ -15,6 +15,26 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
{% if missing_list %}
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{% trans 'Getting started' %}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{% trans 'Before you can fully use Mayan EDMS you need the following:' %}
|
||||
|
||||
<div class="list-group">
|
||||
{% for missing in missing_list %}
|
||||
<a href="{% url missing.view %}" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">{{ missing.label }}</h4>
|
||||
<p class="list-group-item-text">{{ missing.description }}</p>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="well center-block">
|
||||
<div class="row">
|
||||
{% with 'navigation/large_button_link.html' as link_template %}
|
||||
@@ -34,7 +54,7 @@
|
||||
<input class="form-control" name="q" placeholder="{% trans 'Space separated terms' %}" type="text">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="submit">{% trans 'Search' %}</button>
|
||||
<a class="btn btn-primary" href="{% url 'search:search_advanced' %}">{% trans 'Advanced search' %}</a>
|
||||
<a class="btn btn-primary" href="{% url 'search:search_advanced' %}">{% trans 'Advanced' %}</a>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -12,7 +12,7 @@ from common.classes import ModelAttribute
|
||||
from common.utils import encapsulate, validate_path
|
||||
from dynamic_search.classes import SearchModel
|
||||
from events.permissions import PERMISSION_EVENTS_VIEW
|
||||
from main import FrontPageButton
|
||||
from main import FrontPageButton, MissingItem
|
||||
from main.api import register_maintenance_links
|
||||
from navigation.api import register_links, register_model_list_columns
|
||||
from navigation.links import link_spacer
|
||||
@@ -149,3 +149,5 @@ class DocumentsApp(apps.AppConfig):
|
||||
registry.register(Document)
|
||||
|
||||
DocumentPage.add_to_class('get_transformation_list', lambda document_page: DocumentPageTransformation.objects.get_for_document_page_as_list(document_page))
|
||||
|
||||
MissingItem(label=_('Create a document type'), description=_('Every uploaded document must be assigned a document type, it is the basic way Mayan EDMS categorizes documents.'), condition=lambda: not DocumentType.objects.exists(), view='documents:document_type_list')
|
||||
|
||||
@@ -1 +1 @@
|
||||
from .classes import FrontPageButton # NOQA
|
||||
from .classes import FrontPageButton, MissingItem # NOQA
|
||||
|
||||
@@ -8,3 +8,19 @@ class FrontPageButton(object):
|
||||
def __init__(self, link):
|
||||
self.link = link
|
||||
self.__class__._registry.append(link)
|
||||
|
||||
|
||||
class MissingItem(object):
|
||||
_registry = []
|
||||
|
||||
@classmethod
|
||||
def get_all(cls):
|
||||
return cls._registry
|
||||
|
||||
def __init__(self, label, condition, description, view):
|
||||
self.label = label
|
||||
self.condition = condition
|
||||
self.description = description
|
||||
self.view = view
|
||||
self.__class__._registry.append(self)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from dynamic_search.classes import SearchModel
|
||||
from permissions.models import Permission
|
||||
|
||||
from .api import diagnostics, tools
|
||||
from .classes import FrontPageButton
|
||||
from .classes import FrontPageButton, MissingItem
|
||||
|
||||
|
||||
def home(request):
|
||||
@@ -20,6 +20,7 @@ def home(request):
|
||||
'query_string': request.GET,
|
||||
'hide_links': True,
|
||||
'search_results_limit': 100,
|
||||
'missing_list': [item for item in MissingItem.get_all() if item.condition()],
|
||||
}
|
||||
|
||||
if request.GET:
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from common.utils import encapsulate
|
||||
from documents.links import document_list_recent, document_list
|
||||
from documents.models import Document
|
||||
from main import FrontPageButton
|
||||
from main import FrontPageButton, MissingItem
|
||||
from navigation.api import register_links, register_model_list_columns
|
||||
from project_setup.api import register_setup
|
||||
from rest_api.classes import APIEndPoint
|
||||
@@ -50,3 +50,5 @@ class SourcesApp(apps.AppConfig):
|
||||
APIEndPoint('sources')
|
||||
|
||||
FrontPageButton(link=document_create_multiple)
|
||||
|
||||
MissingItem(label=_('Create a document source'), description=_('Document sources are the way in which new documents are feed to Mayan EDMS, create at least a web form source to be able to upload documents from a browser.'), condition=lambda: not Source.objects.exists(), view='sources:setup_source_list')
|
||||
|
||||
@@ -37,6 +37,8 @@ ALLOWED_HOSTS = []
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = (
|
||||
# Placed at the top so it can override any template
|
||||
'appearance.apps.AppearanceApp',
|
||||
# 3rd party
|
||||
'suit',
|
||||
# Django
|
||||
@@ -75,7 +77,6 @@ INSTALLED_APPS = (
|
||||
'smart_settings.apps.SmartSettingsApp',
|
||||
'user_management.apps.UserManagementApp',
|
||||
# Mayan EDMS
|
||||
'appearance.apps.AppearanceApp',
|
||||
'checkouts.apps.CheckoutsApp',
|
||||
'document_acls.apps.DocumentACLsApp',
|
||||
'document_comments.apps.DocumentCommentsApp',
|
||||
|
||||
Reference in New Issue
Block a user