Revision c3a905e7 snf-astakos-app/astakos/im/forms.py

b/snf-astakos-app/astakos/im/forms.py
532 532
        label="",
533 533
        widget=forms.HiddenInput()
534 534
    )
535
    name = forms.URLField()
535
    name = forms.URLField(widget=forms.TextInput(attrs={'placeholder': 'eg. foo.ece.ntua.gr'}))
536 536
    moderation_enabled = forms.BooleanField(
537 537
        help_text="Check if you want to approve members participation manually",
538 538
        required=False,
......
562 562
                                'issue_date', 'expiration_date',
563 563
                                'moderation_enabled', 'max_participants']
564 564
        def add_fields((k, v)):
565
            print '####', k, v
566 565
            k = k.partition('_proxy')[0]
567 566
            self.fields[k] = forms.IntegerField(
568 567
                required=False,
569
                #widget=forms.HiddenInput(),
568
                widget=forms.HiddenInput(),
570 569
                min_value=1
571 570
            )
572 571
        map(add_fields,
......
587 586
        policies = []
588 587
        append = policies.append
589 588
        for name, uplimit in self.cleaned_data.iteritems():
589
            
590 590
            subs = name.split('_uplimit')
591 591
            if len(subs) == 2:
592 592
                prefix, suffix = subs
593 593
                s, sep, r = prefix.partition(RESOURCE_SEPARATOR)
594 594
                resource = Resource.objects.get(service__name=s, name=r)
595
                
595
 
596 596
                # keep only resource limits for selected resource groups
597
                print '###', resource.group, s, r, uplimit, self.cleaned_data
597 598
                if self.cleaned_data.get(
598
                    'is_selected_%s' % resource.group, True
599
                    'is_selected_%s' % resource.group, False
599 600
                ):
600 601
                    append(dict(service=s, resource=r, uplimit=uplimit))
601 602
        return policies
......
638 639
        def add_fields((k, v)):
639 640
            self.fields[k] = forms.IntegerField(
640 641
                required=False,
641
                #widget=forms.TextInput(),
642
                widget=forms.TextInput(),
642 643
                min_value=1
643 644
            )
644 645
        map(add_fields,
......
648 649
        def add_fields((k, v)):
649 650
            self.fields[k] = forms.BooleanField(
650 651
                required=False,
651
                #widget=forms.HiddenInput()
652
                widget=forms.HiddenInput()
652 653
            )
653 654
        map(add_fields,
654 655
            ((k, v) for k,v in qd.iteritems() if k.startswith('is_selected_'))
......
660 661
        super(AstakosGroupCreationSummaryForm, self).clean()
661 662
        self.cleaned_data['policies'] = []
662 663
        append = self.cleaned_data['policies'].append
664
        #tbd = [f for f in self.fields if (f.startswith('is_selected_') and (not f.endswith('_proxy')))]
663 665
        tbd = [f for f in self.fields if f.startswith('is_selected_')]
664 666
        for name, uplimit in self.cleaned_data.iteritems():
665 667
            subs = name.split('_uplimit')
......
686 688

  
687 689
class AddGroupMembersForm(forms.Form):
688 690
    q = forms.CharField(
689
        max_length=800, widget=forms.Textarea, label=_('Add users'),
691
        max_length=800, widget=forms.Textarea, label=_('Add members'),
690 692
        help_text=_(astakos_messages.ADD_GROUP_MEMBERS_Q_HELP),
691 693
        required=True)
692 694

  

Also available in: Unified diff