This repository was archived by the owner on Jan 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b71141
commit aa16cda
Showing
40 changed files
with
2,570 additions
and
491 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
language: python | ||
sudo: false | ||
cache: | ||
pip: true | ||
yarn: true | ||
python: | ||
- "2.6" | ||
- "2.7" | ||
- "3.5" | ||
- "3.6" | ||
env: | ||
- TRAVIS_NODE_VERSION="4" | ||
before_install: | ||
- nvm install $TRAVIS_NODE_VERSION | ||
- curl -o- -L https://yarnpkg.com/install.sh | bash | ||
- export PATH="$HOME/.yarn/bin:$PATH" | ||
install: | ||
- "pip install -r requirements.txt" | ||
- "pip install flake8==2.1.0" | ||
- pip install --upgrade setuptools pip | ||
- pip install -r requirements.txt | ||
- pip freeze | ||
- yarn | ||
script: | ||
- "PYTHONPATH=$PYTHONPATH DJANGO_SETTINGS_MODULE=tests.settings openslides django test" | ||
- "flake8 --max-line-length=150 openslides_protocol tests" | ||
- node_modules/.bin/gulp jshint | ||
- isort --check-only --recursive openslides_protocol tests | ||
- flake8 openslides_protocol tests | ||
- PYTHONPATH=./ DJANGO_SETTINGS_MODULE='tests.settings' openslides test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ contribution: | |
|
||
* Norman Jäckel <[email protected]> | ||
* Emanuel Schütze <[email protected]> | ||
* Finn Stutzenstein <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "openslides-protocol", | ||
"private": true, | ||
"dependencies": { | ||
"angular-gettext": "~2.3.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Run tasks with $ ./node_modules/.bin/gulp | ||
require('es6-promise').polyfill(); | ||
|
||
var gulp = require('gulp'), | ||
gettext = require('gulp-angular-gettext'), | ||
jshint = require('gulp-jshint'), | ||
path = require('path'), | ||
templateCache = require('gulp-angular-templatecache'); | ||
|
||
/** | ||
* Default tasks to be run before start. | ||
*/ | ||
|
||
// Catches all template files concats them to one file js/templates.js. | ||
gulp.task('templates', function () { | ||
return gulp.src(path.join('**', 'static', 'templates', '**', '*.html')) | ||
.pipe(templateCache('templates.js', { | ||
module: 'OpenSlidesApp.openslides_protocol.templates', | ||
standalone: true, | ||
moduleSystem: 'IIFE', | ||
transformUrl: function (url) { | ||
var pathList = url.split(path.sep); | ||
pathList.shift(); | ||
return pathList.join(path.sep); | ||
}, | ||
})) | ||
.pipe(gulp.dest(path.join('static', 'js', 'openslides_protocol'))); | ||
}); | ||
// Compiles translation files (*.po) to *.json and saves them in the directory 'i18n'. | ||
gulp.task('translations', function () { | ||
return gulp.src(path.join('openslides_protocol', 'locale', 'angular-gettext', '*.po')) | ||
.pipe(gettext.compile({ | ||
format: 'json' | ||
})) | ||
.pipe(gulp.dest(path.join('static', 'i18n', 'openslides_protocol'))); | ||
}); | ||
|
||
// Gulp default task. Runs all other tasks before. | ||
gulp.task('default', ['translations', 'templates'], function () {}); | ||
|
||
|
||
/** | ||
* Extra tasks that have to be called manually. Useful for development. | ||
*/ | ||
|
||
// Extracts translatable strings using angular-gettext and saves them in file | ||
// locale/angular-gettext/template-en.pot. | ||
gulp.task('pot', function () { | ||
return gulp.src([ | ||
'openslides_protocol/static/templates/*/*.html', | ||
'openslides_protocol/static/js/*/*.js', | ||
]) | ||
.pipe(gettext.extract('template-en.pot', {})) | ||
.pipe(gulp.dest(path.join('openslides_protocol', 'locale', 'angular-gettext'))); | ||
}); | ||
|
||
// Checks JavaScript using JSHint | ||
gulp.task('jshint', function () { | ||
return gulp.src([ | ||
'gulpfile.js', | ||
path.join('openslides_protocol', 'static', 'js', 'openslides_protocol', '*.js'), | ||
]) | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter('default')) | ||
.pipe(jshint.reporter('fail')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from inspect import stack | ||
|
||
for frame in stack(): | ||
lines = frame[4] | ||
if lines and 'Peikee0iuv7uhikuashotohch6eec6ohseuNg7su' in lines[0]: | ||
break | ||
else: | ||
from . import main_menu, signals # noqa | ||
from .urls import urlpatterns # noqa | ||
|
||
__verbose_name__ = 'OpenSlides Protocol Plugin' | ||
__description__ = 'This plugin for OpenSlides provides a protocol of events managed in OpenSlides.' | ||
__version__ = '1.0-dev' | ||
__version__ = '2.0-dev' | ||
|
||
default_app_config = 'openslides_protocol.apps.ProtocolAppConfig' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from openslides.utils.access_permissions import BaseAccessPermissions | ||
from openslides.utils.auth import has_perm | ||
|
||
|
||
class ItemProtocolAccessPermissions(BaseAccessPermissions): | ||
""" | ||
Access permissions for ItemProtocol and the ViewSet. | ||
""" | ||
def check_permissions(self, user): | ||
return has_perm(user, 'openslides_protocol.can_write_protocol') | ||
|
||
def get_serializer_class(self, user=None): | ||
from .serializers import ItemProtocolSerializer | ||
|
||
return ItemProtocolSerializer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import os | ||
|
||
from django.apps import AppConfig | ||
from openslides.utils.collection import Collection | ||
|
||
from . import __description__, __verbose_name__, __version__ | ||
|
||
|
||
class ProtocolAppConfig(AppConfig): | ||
name = 'openslides_protocol' | ||
verbose_name = __verbose_name__ | ||
description = __description__ | ||
version = __version__ | ||
angular_site_module = True | ||
js_files = [ | ||
'static/js/openslides_protocol/base.js', | ||
'static/js/openslides_protocol/site.js', | ||
'static/js/openslides_protocol/templates.js', # This file has a different basefolder! | ||
] | ||
|
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
|
||
try: | ||
import settings | ||
except ImportError: | ||
# When testing, we cannot import settings here.. | ||
pass | ||
else: | ||
# Add the staticfiles dir to OpenSlides | ||
base_path = os.path.realpath(os.path.dirname(os.path.abspath(__file__))) | ||
# remove the app folder 'openslides_protcol' | ||
base_path = os.path.dirname(base_path) | ||
settings.STATICFILES_DIRS.append(os.path.join(base_path, 'static')) | ||
|
||
def ready(self): | ||
# Load projector elements. | ||
# Do this by just importing all from these files. | ||
from . import projector # noqa | ||
|
||
# Import all required stuff. | ||
from openslides.core.signals import post_permission_creation | ||
from openslides.utils.rest_api import router | ||
from .signals import add_permissions_to_builtin_groups | ||
from .views import ItemProtocolViewSet | ||
|
||
# Connect signals. | ||
post_permission_creation.connect( | ||
add_permissions_to_builtin_groups, | ||
dispatch_uid='protocol_add_permissions_to_builtin_groups' | ||
) | ||
|
||
# Register viewsets. | ||
router.register(self.get_model('ItemProtocol').get_collection_string(), ItemProtocolViewSet) | ||
|
||
def get_startup_elements(self): | ||
yield Collection(self.get_model('ItemProtocol').get_collection_string()) |
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
openslides_protocol/locale/angular-gettext/template-en.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
msgid "" | ||
msgstr "" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Project-Id-Version: \n" | ||
|
||
#: openslides_protocol/item-protocol-form.html:16 | ||
#: openslides_protocol/protocol-list.html:45 | ||
msgid "Are you sure to delete this protocol?" | ||
msgstr "" | ||
|
||
#: openslides_protocol/item-protocol-form.html:13 | ||
msgid "Cancel" | ||
msgstr "" | ||
|
||
#: openslides_protocol/agenda-hook.html:5 | ||
#: openslides_protocol/item-protocol-form.html:2 | ||
msgid "Create protocol" | ||
msgstr "" | ||
|
||
#: openslides_protocol/item-protocol-form.html:18 | ||
#: openslides_protocol/protocol-list.html:45 | ||
msgid "Delete" | ||
msgstr "" | ||
|
||
#: openslides_protocol/protocol-list.html:42 | ||
msgid "Edit" | ||
msgstr "" | ||
|
||
#: openslides_protocol/agenda-hook.html:4 | ||
#: openslides_protocol/item-protocol-form.html:1 | ||
msgid "Edit protocol" | ||
msgstr "" | ||
|
||
#: openslides_protocol/protocol-list.html:25 | ||
msgid "Item" | ||
msgstr "" | ||
|
||
#: openslides_protocol/protocol-list.html:17 | ||
#: openslides_protocol/protocol-list.html:26 | ||
#: openslides_protocol/site.js:14 | ||
#: openslides_protocol/site.js:26 | ||
#: openslides_protocol/site.js:82 | ||
msgid "Protocol" | ||
msgstr "" | ||
|
||
#: openslides_protocol/item-protocol-form.html:10 | ||
msgid "Save" | ||
msgstr "" | ||
|
||
#: openslides_protocol/protocol-list.html:14 | ||
msgid "Select all" | ||
msgstr "" |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.