Jump to content

WiP - Who has completed my form? widget


Graham Quince

Recommended Posts

Just something I'm working on, a new widget which you can link to a form and display a list of people from the group and a tick and time / date of submission.

wip - who has completed my form widget.PNG

I think it needs more work with formatting - I've used the group selector from the Random Name Selector (included here because I know @pconkie was also talking about group selectors and I bet others are interested too)

 

        'widget.live': function(el, ev, data) {
            this.element.html(
                this.view(
                    'main.ejs',
                    {widgettitle: this.prefs.widgettitle.value}      
                )
            );
            this.element.find('.memberlist').hide();

            var warn = this.element.find('.warning');
            if (JSON.parse(this.prefs.preselected_form.value).formUuid=="") {
                warn.html('<h4>No Form selected</h4>');
                warn.addClass('alert-danger');
            } else {
                warn.hide();
            }
            
            steal.import('frogui/modules/selectusers/selectusers!frog-component').then(function() {

                var groupName = this.element.find("div.group-select input.groupName"),
                    groupSelect = this.element.find("div.group-select");

                groupSelect.frogui_modules_selectusers({
                    show_label: false,
                    show_permission: false,
                    show_submit: true,
                    submit_label: 'Check submissions',
                    allow_convert: false,
                    search_users: false,
                    max_selections: 1,
                    profiles: ['admin','staff','parent','governor','student','external admin','external staff']
                });
                
            }.bind(this));
        },
        
        'selectusers.submitted': function() {
            var groupSelect = this.element.find("div.group-select");
            groupSelect.trigger('selectusers.getSelected', function(data) {
                if (!data.groups.length) {
                    return;
                }

            var selectedGroup = data.groups[0].uuid,
                formData = JSON.parse(this.prefs.preselected_form.value),
                formEntries = [],
                timeEntries = [];
....
  • Like 1
Link to comment
Share on other sites

On 21/07/2019 at 09:47, pconkie said:

Great @Graham Quince 

What other frogui modules are there and is there any documentation? For example is there a user selector or a subject selector? Maybe a date picker?

There are tonnes of them. Pretty much everything in Frog is either a component or a module (at least, we always try to do that). Unfortunately they were for internal use, so we don't have any documentation as such. All of the things you mentioned have either a component or a module associated with them (for easy reuse and consistency throughout the platform).

However, we shall need to call upon the front-end guru's of Frog in order to unlock this mystical power.

To get started though, I can see that we have:

frogui_components_date_time_picker //date time picker

frogui_components_curriculumbrowser_subject //subject picker (I think)

frogui._modules_selectusers  //users select

A quick check shows we have around ~60 modules and 100 components - so if you're trying to do anything in particular, it might be worth asking if we have a component available for it first (pretty much if you can see some functionality in the front end, there's a good chance we have something already)

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...