Permalink
Browse files

fix #63

  • Loading branch information...
1 parent 1264c85 commit c2970e1803e4afd5f1463a60a634ddaf24078dd1 @brunosardinepi committed Dec 28, 2016
@@ -1,26 +0,0 @@
-{% extends 'layout.html' %}
-{% load bootstrap3 %}
-
-{% block title %} Delete Campaign | {{ block.super }}{% endblock %}
-
-{% block body_content %}
- <div class="col-md-4 col-md-offset-4">
- <div class="panel panel-default panel-campaign">
- <div class="panel-heading">
- <h3 class="panel-title"><strong>DELETE CAMPAIGN</strong></h3>
- </div>
- <div class="panel-body">
- <form method="POST" action="">
- {% csrf_token %}
- <p>Please confirm that you want to delete the following campaign:</p>
- <p style="font-size: 18px; font-weight: bold;" class="text-center">{{ campaign.title }}</p>
- <p class="margin-bottom-zero">This campaign will be permanently deleted.</p>
- </div>
- <div class="panel-footer clearfix">
- <a href="{% url 'campaign:campaign_detail' campaign_pk=campaign.pk %}" class="btn btn-default">Cancel</a>
- <input type="submit" class="btn btn-primary pull-right" value="Delete Campaign">
- </form>
- </div>
- </div>
- </div>
-{% endblock %}
@@ -1,26 +0,0 @@
-{% extends 'layout.html' %}
-{% load bootstrap3 %}
-
-{% block title %}Delete Chapter | {{ block.super }}{% endblock %}
-
-{% block body_content %}
- <div class="col-md-6 col-md-offset-3">
- <div class="panel panel-default panel-campaign">
- <div class="panel-heading">
- <h3 class="panel-title"><strong>DELETE CHAPTER</strong></h3>
- </div>
- <div class="panel-body">
- <form method="POST" action="" class="margin-bottom-zero">
- {% csrf_token %}
- <p>Please confirm that you want to delete the following chapter:</p>
- <p style="font-size: 18px; font-weight: bold;" class="text-center">{{ chapter.title }}</p>
- <p class="margin-bottom-zero">This chapter will be permanently deleted.</p>
- </div>
- <div class="panel-footer clearfix">
- <a href="{% url 'campaign:campaign_detail' campaign_pk=chapter.campaign.pk chapter_pk=chapter.pk %}" class="btn btn-default">Cancel</a>
- <input type="submit" class="btn btn-primary pull-right" value="Delete Chapter">
- </form>
- </div>
- </div>
- </div>
-{% endblock %}
@@ -1,26 +0,0 @@
-{% extends 'layout.html' %}
-{% load bootstrap3 %}
-
-{% block title %} Delete Section | {{ block.super }}{% endblock %}
-
-{% block body_content %}
- <div class="col-md-4 col-md-offset-4">
- <div class="panel panel-default panel-campaign">
- <div class="panel-heading">
- <h3 class="panel-title"><strong>DELETE SECTION</strong></h3>
- </div>
- <div class="panel-body">
- <form method="POST" action="">
- {% csrf_token %}
- <p>Please confirm that you want to delete the following section:</p>
- <p style="font-size: 18px; font-weight: bold;" class="text-center">{{ section.title }}</p>
- <p class="margin-bottom-zero">This section will be permanently deleted.</p>
- </div>
- <div class="panel-footer clearfix">
- <a href="{% url 'campaign:campaign_detail' campaign_pk=section.chapter.campaign.pk chapter_pk=section.chapter.pk section_pk=section.pk %}" class="btn btn-default">Cancel</a>
- <input type="submit" class="btn btn-primary pull-right" value="Delete Section">
- </form>
- </div>
- </div>
- </div>
-{% endblock %}
@@ -61,7 +61,7 @@
format: {title: 'Format', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
table: {title: 'Table', items: 'inserttable tableprops deletetable | cell row column'}
},
- toolbar: 'print | fontsizeselect bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | forecolor backcolor',
+ toolbar: 'print | restoredraft | fontsizeselect bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | forecolor backcolor',
browser_spellcheck: true,
paste_as_text: true,
fontsize_formats: "8pt 10pt 12pt 14pt 18pt 24pt 36pt",
View
@@ -114,50 +114,6 @@ def get_object(self, queryset=None):
section = super(SectionDelete, self).get_object()
return section
-# @staff_member_required
-# def section_delete(request, section_pk):
-# section = get_object_or_404(models.Section, pk=section_pk)
-# form = forms.SectionForm(instance=section)
-# if request.method == 'POST':
-# form = forms.SectionForm(request.POST, instance=section)
-# if form.is_valid():
-# section.delete()
-# messages.add_message(request, messages.SUCCESS, "Deleted section: {}".format(form.cleaned_data['title']))
-# return HttpResponseRedirect('wiki:home')
-# else:
-# raise Http404
-# return render(request, 'wiki/section_confirm_delete.html', {'form': form, 'section': section})
-
-
-# class ChapterDelete(LoginRequiredMixin, DeleteView):
-# model = models.Chapter
-# success_url = reverse_lazy('home')
-# slug_field = "pk"
-# slug_url_kwarg = "chapter_pk"
-
-# def delete(self, request, *args, **kwargs):
-# messages.add_message(self.request, messages.SUCCESS, "Chapter deleted!")
-# return super(ChapterDelete, self).delete(request, *args, **kwargs)
-
-# def get_object(self, queryset=None):
-# chapter = super(ChapterDelete, self).get_object()
-# if not chapter.user == self.request.user:
-# raise Http404
-# else:
-# return chapter
-
-# @staff_member_required
-# def subsection_delete(request, section_pk, subsection_pk):
-# subsection = get_object_or_404(models.Subsection, pk=subsection_pk, section_id=section_pk)
-# form = forms.SubsectionForm(instance=subsection)
-# if request.method == 'POST':
-# form = forms.SubsectionForm(request.POST, instance=subsection)
-# if form.is_valid():
-# subsection.delete()
-# messages.add_message(request, messages.SUCCESS, "Deleted subsection: {}".format(form.cleaned_data['title']))
-# return HttpResponseRedirect('wiki:home')
-# return render(request, 'wiki/subsection_confirm_delete.html', {'form': form, 'section': subsection.section, 'subsection': subsection})
-
class SubsectionDelete(LoginRequiredMixin, DeleteView):
model = models.Subsection
success_url = reverse_lazy('wiki:home')

0 comments on commit c2970e1

Please sign in to comment.