Fakultas Ilmu Komputer UI

Commit 205fcde8 authored by Samuel Dimas Partogi's avatar Samuel Dimas Partogi
Browse files

Merge branch 'Coldfix-PBI-3-Unggah_Materi-Restriksi' into 'staging'

Coldfix pbi 3 unggah materi restriksi

See merge request ppl-fasilkom-ui/2020/ppl-c/diskominfo-depok-digipus/marjinal-digipus!65
parents cef3365b a4735e4f
from django import forms
from app.models import Materi
from app.models import Materi,Category
from authentication.models import User
class UploadMateriForm(forms.ModelForm):
categories = forms.ModelMultipleChoiceField(queryset=Category.objects.all(),widget=forms.CheckboxSelectMultiple(attrs={'style' : 'column-count:2'}),required=True)
#categories.widget.attrs["style"] = "column-count:2"
class Meta:
model = Materi
fields = ["title", "author", "publisher",
......@@ -13,7 +17,11 @@ class UploadMateriForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(UploadMateriForm, self).__init__(*args, **kwargs)
for field_name, field in self.fields.items():
if (field_name == "categories"):
field.widget.attrs["class"] = "form-control"
self.fields['categories'].widget.attrs.update({'class' : "native"})
class SuntingProfilForm(forms.ModelForm):
......@@ -3,6 +3,23 @@
<!DOCTYPE html>
<html lang="en">
ul{margin:0; padding:0;}
.native {
-webkit-column-width: 200px;
-moz-column-width: 200px;
-o-column-width: 200px;
-ms-column-width: 200px;
column-width: 200px;
-webkit-column-rule-style: solid;
-moz-column-rule-style: solid;
-o-column-rule-style: solid;
-ms-column-rule-style: solid;
column-rule-style: solid;
<meta charset="utf-8">
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment