summaryrefslogtreecommitdiff
path: root/src/meetingtools/apps/room/forms.py
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2012-10-04 15:39:08 +0200
committerLeif Johansson <leifj@sunet.se>2012-10-04 15:39:08 +0200
commit2bdad0ae7a3a6e4ec5116becd39910388b679ed2 (patch)
tree5afdfba0a93c1af50d53bdc245d57cc4053e109a /src/meetingtools/apps/room/forms.py
parent873e7823970352d591deee5f67f47c5436ee0e84 (diff)
restructure
Diffstat (limited to 'src/meetingtools/apps/room/forms.py')
-rw-r--r--src/meetingtools/apps/room/forms.py82
1 files changed, 0 insertions, 82 deletions
diff --git a/src/meetingtools/apps/room/forms.py b/src/meetingtools/apps/room/forms.py
deleted file mode 100644
index 62b515b..0000000
--- a/src/meetingtools/apps/room/forms.py
+++ /dev/null
@@ -1,82 +0,0 @@
-'''
-Created on Feb 1, 2011
-
-@author: leifj
-'''
-
-from meetingtools.apps.room.models import Room
-from django.forms.widgets import Select, TextInput, RadioSelect, Textarea
-from django.forms.fields import BooleanField, ChoiceField, CharField
-from django.forms.forms import Form
-from form_utils.forms import BetterModelForm
-from django.utils.safestring import mark_safe
-from django.forms.models import ModelForm
-
-PUBLIC = 0
-PROTECTED = 1
-PRIVATE = 2
-
-class PrefixTextInput(TextInput):
- def __init__(self, attrs=None, prefix=None):
- super(PrefixTextInput, self).__init__(attrs)
- self.prefix = prefix
-
- def render(self, name, value, attrs=None):
- return mark_safe("<div class=\"input-prepend\"><span class=\"add-on\">"+self.prefix+"</span>"+
- super(PrefixTextInput, self).render(name, value, attrs)+"</span></div>")
-
-class ModifyRoomForm(ModelForm):
- class Meta:
- model = Room
- fields = ['name','description','source_sco_id','self_cleaning','allow_host']
- widgets = {'source_sco_id': Select(),
- 'description': Textarea(attrs={'rows': 4, 'cols': 50}),
- 'name': TextInput(attrs={'size': '40'})}
-
-
-class CreateRoomForm(BetterModelForm):
-
- access = ChoiceField(choices=(('public','Public'),('private','Private')))
-
- class Meta:
- model = Room
- fields = ['name','description','urlpath','access','self_cleaning','allow_host']
- fieldsets = [('name',{'fields': ['name'],
- 'classes': ['step'],
- 'legend': 'Step 1: Room name',
- 'description': 'The room name should be short and descriptive.'
- }),
- ('description',{'fields': ['description'],
- 'classes': ['step'],
- 'legend': 'Step 2: Room description',
- 'description': 'Please provide a short summary of this room.'
- }),
- ('properties',{'fields': ['self_cleaning','allow_host','urlpath','access'],
- 'classes': ['step'],
- 'legend': 'Step 3: Room properties',
- 'description': '''
- <p>These are basic properties for your room. If you set your room to cleaned up after
- use it will be reset every time the last participant leaves the room. If you create a public room it
- will be open to anyone who has the room URL. If you create a private room then guests will have to be
- approved by an active meeting host before being able to join the room.</p>
-
- <div class="ui-widget">
- <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
- <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
- <strong>Warning</strong> Setting a room to be cleaned up when empty will cause all existing content
- associated with the to be destroyed each time the room is reset.</p>
- </div>
- </div>
- '''
- }),
- ]
- widgets = {'access': RadioSelect(),
- 'urlpath': PrefixTextInput(attrs={'size': '10'}),
- 'description': Textarea(attrs={'rows': 4, 'cols': 50}),
- 'name': TextInput(attrs={'size': '40'})}
-
-class DeleteRoomForm(Form):
- confirm = BooleanField(label="Confirm remove room")
-
-class TagRoomForm(Form):
- tag = CharField(max_length=256) \ No newline at end of file