Skip to content

Commit

Permalink
Org: Surveys
Browse files Browse the repository at this point in the history
Add option to create and view results of surveys

TYPE: Feature
LINK: OGC-1612
  • Loading branch information
BreathingFlesh committed Jul 11, 2024
1 parent dbf8a6a commit 15b0142
Show file tree
Hide file tree
Showing 64 changed files with 3,439 additions and 229 deletions.
1 change: 1 addition & 0 deletions src/onegov/event/collections/occurrences.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from collections import defaultdict
from datetime import date, timedelta, datetime


import sqlalchemy
from dateutil.relativedelta import relativedelta
from enum import Enum
Expand Down
6 changes: 6 additions & 0 deletions src/onegov/form/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@
from onegov.form.integration import FormApp
from onegov.form.models import (
FormDefinition,
SurveyDefinition,
FormFile,
FormSubmission,
SurveySubmission,
FormRegistrationWindow,
SurveySubmissionWindow,
PendingFormSubmission,
CompleteFormSubmission
)
Expand Down Expand Up @@ -58,6 +61,9 @@
'parse_form',
'parse_formcode',
'PendingFormSubmission',
'SurveyDefinition',
'SurveySubmissionWindow',
'SurveySubmission',
'render_field',
'WTFormsClassBuilder',
)
8 changes: 5 additions & 3 deletions src/onegov/form/assets/js/snippets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var FormSnippets = React.createClass({
<ToggleButton icon="fa-plus-circle">
<div className="formcode-snippets">
{this.props.snippets.map(function(snippet, ix) {
var id = 'formcode-snippet-' + snippet[2].toLowerCase().replace(/[^a-z0-9]/g, '-');
return snippet[1] !== null && (
<FormSnippet
key={ix}
Expand All @@ -23,7 +24,7 @@ var FormSnippets = React.createClass({
target={self.props.target}
/>
) || (
<div key={ix} className="formcode-snippet-title">
<div key={ix} className="formcode-snippet-title" id={id}>
{snippet[0]}
</div>
);
Expand All @@ -33,7 +34,7 @@ var FormSnippets = React.createClass({
</div>
);
}
});
});

// Renders a single formsnippet and handles the insertion logic
var FormSnippet = React.createClass({
Expand Down Expand Up @@ -61,9 +62,10 @@ var FormSnippet = React.createClass({
},
render: function() {
var name = this.props.snippet[0];
var id = 'formcode-snippet-' + this.props.snippet[2].toLowerCase().replace(/[^a-z0-9]/g, '-');

return (
<div className="formcode-snippet">
<div className="formcode-snippet" id={id}>
<div className="formcode-snippet-name" onClick={this.handleOptional}>{name}</div>
{
(this.props.snippet[1] !== '#' && this.props.snippet[1] !== '<< >>') &&
Expand Down
Loading

0 comments on commit 15b0142

Please sign in to comment.