Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v4' into v4
Browse files Browse the repository at this point in the history
  • Loading branch information
UmSenhorQualquer committed Sep 4, 2019
2 parents 950edce + 67ee52d commit f475424
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 17 deletions.
9 changes: 8 additions & 1 deletion docs/source/getting-started/formset.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ On this page it is shown examples of Widgets formsets configurations.
'_list',
'_label'
]
}
},
'notifications-area'
]
Configuration options
Expand Down Expand Up @@ -132,6 +133,12 @@ Use the prefixes [h1:,h2:,h3:,h4:,h5:,h1-right:,h2-right:,h3-right:,h4-right:,h5
]
Notifications area
**********************
By default the application's messages are shown on the top of each application, but it is possible to define
a new position to these messages by including the code 'notifications-area' on the formset.


2 segments side by side
########################

Expand Down
30 changes: 27 additions & 3 deletions docs/source/getting-started/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,38 @@ django-allauth is a reusable Django app that allows for both local and social au
To make it work with Orquestra follow the instructions described `@django-allauth documentation
<http://django-allauth.readthedocs.io/en/latest/installation.html>`_.

Typical django-allauth configuration
______________________________________

.. code:: shell
pip install django-allauth
Add the next configuration to your Django project setttings.

.. code:: python
...
...
INSTALLED_APPS = [
...
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.google',
'allauth.socialaccount.providers.facebook',
'django.contrib.sites',
...
]
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
]
LOGIN_URL = '/accounts/login/'
LOGIN_REDIRECT_URL = '/'
LOGIN_URL = '/accounts/login/'
LOGIN_REDIRECT_URL = '/'
Add the next configuration to the **local_settings.py** file to configure **orquestra** to require always authentication before accessing the applications.

Expand Down
2 changes: 1 addition & 1 deletion orquestra
2 changes: 1 addition & 1 deletion pyforms_web/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__author__ = "Ricardo Ribeiro"
__credits__ = ["Ricardo Ribeiro"]
__license__ = 'GNU GPLv3'
__version__ = "4.1.3"
__version__ = "4.1.5"
__maintainer__ = "Ricardo Ribeiro"
__email__ = "ricardojvr@gmail.com"
__status__ = "Development"
Expand Down
6 changes: 6 additions & 0 deletions pyforms_web/basewidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class BaseWidget(object):
#: str: Css classes to add to the form.
CSS = ''

#: str: Static files to include in the page
STATIC_FILES = []

def __init__(self, *args, **kwargs):
"""
:param str title: Title of the app. By default will assume the value in the class variable TITLE.
Expand Down Expand Up @@ -299,6 +302,9 @@ def generate_panel(self, formset):
"""
if formset is None:
return ''
elif 'notifications-area' == formset:
return "<div class='notifications-area field'></div>"

elif '=' in formset:
index = list( formset ).index('=')
return "<div id='{splitter_id}' class='horizontalSplitter' ><div>{top}</div><div>{bottom}</div></div>".format(
Expand Down
13 changes: 8 additions & 5 deletions pyforms_web/web/static/pyforms.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion pyforms_web/web/static/pyformsjs/BaseWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,12 @@ class BaseWidget{
for(var i=0; i<msg.messages.length; i++) html += '<li>'+msg.messages[i]+'</li>';
html += '</ul>';
};
$(html).prependTo(this.jquery()).find('.close').on('click', function(){

var destination = this.jquery().find('.notifications-area');
if( destination.length==0 )
destination = this.jquery()

$(html).prependTo(destination).find('.close').on('click', function(){
$(this).closest('.message').transition({animation:'fade',onComplete:function(){$(this).remove();} });
});
};
Expand Down
17 changes: 17 additions & 0 deletions pyforms_web/web/static/pyformsjs/ControlTextArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,22 @@ class ControlTextArea extends ControlBase {

////////////////////////////////////////////////////////////////////////////////

/**
Enable the control.
*/
enable(){
this.jquery().removeAttr('readonly');
this.jquery().removeClass('disabled');
}

////////////////////////////////////////////////////////////////////////////////

/**
Disable the control.
*/
disable(){
this.jquery().attr('readonly', 'readonly');
this.jquery().addClass('disabled');
}
}

0 comments on commit f475424

Please sign in to comment.