Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
hypha
Commits
8e42f780
Commit
8e42f780
authored
6 years ago
by
Dan Braghis
Browse files
Options
Downloads
Patches
Plain Diff
Add determination message settings
parent
43c103b1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
opentech/apply/determinations/migrations/0005_determinationmessagesettings.py
+32
-0
32 additions, 0 deletions
...minations/migrations/0005_determinationmessagesettings.py
opentech/apply/determinations/models.py
+34
-0
34 additions, 0 deletions
opentech/apply/determinations/models.py
with
66 additions
and
0 deletions
opentech/apply/determinations/migrations/0005_determinationmessagesettings.py
0 → 100644
+
32
−
0
View file @
8e42f780
# Generated by Django 2.0.2 on 2018-06-19 08:02
from
django.db
import
migrations
,
models
import
django.db.models.deletion
import
wagtail.core.fields
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
wagtailcore
'
,
'
0040_page_draft_title
'
),
(
'
determinations
'
,
'
0004_determination_tweaks
'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'
DeterminationMessageSettings
'
,
fields
=
[
(
'
id
'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'
ID
'
)),
(
'
concept_accepted
'
,
wagtail
.
core
.
fields
.
RichTextField
(
verbose_name
=
'
Accepted
'
)),
(
'
concept_rejected
'
,
wagtail
.
core
.
fields
.
RichTextField
(
verbose_name
=
'
Rejected
'
)),
(
'
concept_more_info
'
,
wagtail
.
core
.
fields
.
RichTextField
(
verbose_name
=
'
Needs more info
'
)),
(
'
proposal_accepted
'
,
wagtail
.
core
.
fields
.
RichTextField
(
verbose_name
=
'
Accepted
'
)),
(
'
proposal_rejected
'
,
wagtail
.
core
.
fields
.
RichTextField
(
verbose_name
=
'
Rejected
'
)),
(
'
proposal_more_info
'
,
wagtail
.
core
.
fields
.
RichTextField
(
verbose_name
=
'
Needs more info
'
)),
(
'
site
'
,
models
.
OneToOneField
(
editable
=
False
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'
wagtailcore.Site
'
)),
],
options
=
{
'
verbose_name
'
:
'
determination messages
'
,
},
),
]
This diff is collapsed.
Click to expand it.
opentech/apply/determinations/models.py
+
34
−
0
View file @
8e42f780
...
@@ -6,6 +6,10 @@ from django.db.models.signals import post_save
...
@@ -6,6 +6,10 @@ from django.db.models.signals import post_save
from
django.dispatch
import
receiver
from
django.dispatch
import
receiver
from
django.urls
import
reverse
from
django.urls
import
reverse
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
wagtail.admin.edit_handlers
import
TabbedInterface
,
ObjectList
,
FieldPanel
from
wagtail.contrib.settings.models
import
BaseSetting
from
wagtail.contrib.settings.registry
import
register_setting
from
wagtail.core.fields
import
RichTextField
from
opentech.apply.activity.models
import
Activity
from
opentech.apply.activity.models
import
Activity
...
@@ -72,3 +76,33 @@ def log_determination_activity(sender, **kwargs):
...
@@ -72,3 +76,33 @@ def log_determination_activity(sender, **kwargs):
submission
=
submission
,
submission
=
submission
,
message
=
f
"
Sent a
{
outcome
}
determination for
{
submission
.
title
}
:
\r\n
{
message
}
"
message
=
f
"
Sent a
{
outcome
}
determination for
{
submission
.
title
}
:
\r\n
{
message
}
"
)
)
@register_setting
class
DeterminationMessageSettings
(
BaseSetting
):
class
Meta
:
verbose_name
=
'
determination messages
'
concept_accepted
=
RichTextField
(
"
Accepted
"
)
concept_rejected
=
RichTextField
(
"
Rejected
"
)
concept_more_info
=
RichTextField
(
"
Needs more info
"
)
proposal_accepted
=
RichTextField
(
"
Accepted
"
)
proposal_rejected
=
RichTextField
(
"
Rejected
"
)
proposal_more_info
=
RichTextField
(
"
Needs more info
"
)
concept_tab_panels
=
[
FieldPanel
(
'
concept_accepted
'
),
FieldPanel
(
'
concept_rejected
'
),
FieldPanel
(
'
concept_more_info
'
),
]
proposal_tab_panels
=
[
FieldPanel
(
'
proposal_accepted
'
),
FieldPanel
(
'
proposal_rejected
'
),
FieldPanel
(
'
proposal_more_info
'
),
]
edit_handler
=
TabbedInterface
([
ObjectList
(
concept_tab_panels
,
heading
=
'
Concept note
'
),
ObjectList
(
proposal_tab_panels
,
heading
=
'
Proposal
'
),
])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment