from django.forms import ModelForm,Textarea,TextInput


from .models import Post


class PostForm(ModelForm):
    class Meta:
        model = Post
        fields = ('subject','body')
        widgets = {
                'subject': TextInput(attrs={'autofocus':'autofocus'}),
                'body': Textarea(
                    attrs={
                        'data-provide':'markdown',
                        'data-hidden-buttons':'cmdHeading',
                        'data-iconlibrary':'octicons',
                        }),
                }


from django.forms import ModelForm,Textarea,TextInput


from .models import Post


class PostForm(ModelForm):
    class Meta:
        model = Post
        fields = ('subject','body')
        widgets = {
                'subject': TextInput(attrs={'autofocus':'autofocus'}),
                'body': Textarea(
                    attrs={
                        'data-provide':'markdown',
                        'data-hidden-buttons':'cmdHeading',
                        'data-iconlibrary':'octicons',
                        'data-resize': 'vertical',
                        }),
                }


Allow Markdown editor to be resized
Allow Markdown editor to be resized

  from django.forms import ModelForm,Textarea,TextInput
  
  
  from .models import Post
  
  
  class PostForm(ModelForm):
      class Meta:
          model = Post
          fields = ('subject','body')
          widgets = {
                  'subject': TextInput(attrs={'autofocus':'autofocus'}),
                  'body': Textarea(
                      attrs={
                          'data-provide':'markdown',
                          'data-hidden-buttons':'cmdHeading',
                          'data-iconlibrary':'octicons',
+                         'data-resize': 'vertical',
                          }),
                  }
  
  
Allow Markdown editor to be resized
## Code Before:
from django.forms import ModelForm,Textarea,TextInput


from .models import Post


class PostForm(ModelForm):
    class Meta:
        model = Post
        fields = ('subject','body')
        widgets = {
                'subject': TextInput(attrs={'autofocus':'autofocus'}),
                'body': Textarea(
                    attrs={
                        'data-provide':'markdown',
                        'data-hidden-buttons':'cmdHeading',
                        'data-iconlibrary':'octicons',
                        }),
                }


## Instruction:
Allow Markdown editor to be resized
## Code After:
from django.forms import ModelForm,Textarea,TextInput


from .models import Post


class PostForm(ModelForm):
    class Meta:
        model = Post
        fields = ('subject','body')
        widgets = {
                'subject': TextInput(attrs={'autofocus':'autofocus'}),
                'body': Textarea(
                    attrs={
                        'data-provide':'markdown',
                        'data-hidden-buttons':'cmdHeading',
                        'data-iconlibrary':'octicons',
                        'data-resize': 'vertical',
                        }),
                }

