remove django-markdown and handle preview manually

This commit is contained in:
Élie Bouttier 2014-09-06 00:39:50 -07:00
parent 4995c19560
commit 7e3173c7c0
32 changed files with 335 additions and 16478 deletions

View file

@ -3,11 +3,6 @@
{% load staticfiles %}
{% load humanize %}
{% load bootstrap3 %}
{% load accounts_tags %}
{% block css %}
<link rel="stylesheet" href="{% static 'css/jquery-ui.css' %}">
{% endblock %}
{% block grouptab %} class="active"{% endblock %}
@ -69,14 +64,14 @@
</ul>
</div>
{% delete_modal %}
{% endblock %}
<script src="{% static 'js/jquery-ui.min.js' %}"></script>
{% block js_end %}
{{ block.super }}
<script type="text/javascript">
$('input[name="user"]').autocomplete({
source: "{% url 'add-user-to-group' group.id %}"
});
</script>
<script src="{% static 'js/accounts.js' %}"></script>
{% endblock %}

View file

@ -1,6 +1,5 @@
{% extends 'base.html' %}
{% load django_markdown %}
{% load bootstrap3 %}
{% block profiletab %} class="active"{% endblock %}

View file

@ -1,5 +1,3 @@
{% load staticfiles %}
<div class="modal" id="confirm-delete" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="panel panel-danger">
@ -17,5 +15,3 @@
</div>
</div>
</div>
<script src="{% static 'js/delete_modal.js' %}"></script>

View file

@ -0,0 +1,3 @@
{% load staticfiles %}
<script src="{% static 'js/delete_modal.js' %}"></script>

View file

@ -3,11 +3,6 @@
{% load staticfiles %}
{% load humanize %}
{% load bootstrap3 %}
{% load accounts_tags %}
{% block css %}
<link rel="stylesheet" href="{% static 'css/jquery-ui.css' %}">
{% endblock %}
{% block teamtab %} class="active"{% endblock %}
@ -94,9 +89,10 @@
</div>
</div>
{% delete_modal %}
{% endblock %}
<script src="{% static 'js/jquery-ui.min.js' %}"></script>
{% block js_end %}
{{ block.super }}
<script type="text/javascript">
$('input[name="user"]').autocomplete({
source: "{% url 'add-user-to-team' team.id %}"
@ -107,5 +103,4 @@ $('input[name="group"]').autocomplete({
</script>
<script src="{% static 'js/accounts.js' %}"></script>
<script src="{% static 'js/tabswitch.js' %}"></script>
{% endblock %}

View file

@ -3,11 +3,6 @@
{% load staticfiles %}
{% load humanize %}
{% load bootstrap3 %}
{% load accounts_tags %}
{% block css %}
<link rel="stylesheet" href="{% static 'css/jquery-ui.css' %}">
{% endblock %}
{% block usertab %} class="active"{% endblock %}
@ -109,9 +104,10 @@
</div>
</div>
{% delete_modal %}
{% endblock %}
<script src="{% static 'js/jquery-ui.min.js' %}"></script>
{% block js_end %}
{{ block.super }}
<script type="text/javascript">
$('input[name="group"]').autocomplete({
source: "{% url 'add-group-to-user' user.id %}"
@ -122,5 +118,4 @@ $('input[name="team"]').autocomplete({
</script>
<script src="{% static 'js/accounts.js' %}"></script>
<script src="{% static 'js/tabswitch.js' %}"></script>
{% endblock %}

View file

@ -2,7 +2,6 @@
{% load staticfiles %}
{% load humanize %}
{% load accounts_tags %}
{% load bootstrap3 %}
{% block usertab %} class="active"{% endblock %}
@ -38,6 +37,4 @@
{% endfor %}
</ul>
{% delete_modal %}
{% endblock %}

View file

@ -23,8 +23,6 @@
<link href="{% static 'css/ponytracker.css' %}" rel="stylesheet">
{% block css %}{% endblock %}
<script src="{% bootstrap_jquery_url %}"></script>
{% bootstrap_javascript %}
{% block js %}{% endblock %}
{% block media %}{% endblock %}
@ -100,6 +98,8 @@
</div> <!-- /container -->
<script src="{% bootstrap_jquery_url %}"></script>
{% bootstrap_javascript %}
<script src="{% static 'js/ponytracker.js' %}"></script>
{% block js_end %}{% endblock %}
</body>

View file

@ -1,6 +1,6 @@
{% extends 'base.html' %}
{% load django_markdown %}
{% load accounts_tags %}
{% block admintab %} class="active"{% endblock %}
@ -24,4 +24,11 @@
{% block tabcontent %}{% endblock %}
{% delete_modal %}
{% endblock %}
{% block js_end %}
{{ block.super }}
{% delete_modal_js %}
{% endblock %}

View file

@ -61,3 +61,8 @@
{% delete_modal %}
{% endblock %}
{% block js_end %}
{{ block.super }}
{% delete_modal_js %}
{% endblock %}

View file

@ -1,6 +1,5 @@
{% extends 'base_admin.html' %}
{% load django_markdown %}
{% load permissions_filters %}
{% load bootstrap3 %}
{% load staticfiles %}
@ -50,5 +49,6 @@
{% endblock %}
{% block js_end %}
{{ block.super }}
<script src="{% static 'js/perm.js' %}"></script>
{% endblock %}

View file

@ -1,7 +1,5 @@
{% extends 'base_admin.html' %}
{% load django_markdown %}
{% load accounts_tags %}
{% load permissions_filters %}
{% load staticfiles %}
@ -67,10 +65,9 @@
</div>
{% endif %}
{% delete_modal %}
{% endblock %}
{% block js_end %}
{{ block.super }}
<script src="{% static 'js/perm.js' %}"></script>
{% endblock %}

View file

@ -1,6 +1,5 @@
{% extends 'base_project.html' %}
{% load django_markdown %}
{% load permissions_filters %}
{% load bootstrap3 %}
{% load staticfiles %}
@ -50,5 +49,6 @@
{% endblock %}
{% block js_end %}
{{ block.super }}
<script src="{% static 'js/perm.js' %}"></script>
{% endblock %}

View file

@ -1,7 +1,5 @@
{% extends 'base_project.html' %}
{% load django_markdown %}
{% load accounts_tags %}
{% load permissions_filters %}
{% load staticfiles %}
@ -53,5 +51,6 @@
{% endblock %}
{% block js_end %}
{{ block.super }}
<script src="{% static 'js/perm.js' %}"></script>
{% endblock %}

View file

@ -1,10 +1,6 @@
{% extends 'tracker/issue_base.html' %}
{% load bootstrap3 %}
{% block media %}
{{ form.media }}
{% endblock media %}
{% load staticfiles %}
{% block tabcontent %}
@ -19,15 +15,37 @@
{% endif %}
</h1>
</div>
<form action="" method="post" role="form">
{% bootstrap_form form %}
<form method="post" role="form">
{% csrf_token %}
{% buttons %}
<button type="submit" class="btn btn-primary">Submit</button>
<a href="{% url 'show-issue' project.name issue.id %}" class="btn btn-default">Cancel</a>
{% endbuttons %}
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#editor" role="tab" data-toggle="tab">Editor</a></li>
<li><a href="#preview" role="tab" data-toggle="tab">Preview</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="editor" style="max-height: 220px;">
<div class="form-group">
<textarea style="width: 100%; height: 220px;" id="markdown-content" name="comment" required>{{ form.comment.value }}</textarea>
</div>
</div>
<div class="tab-pane well" id="preview" style="min-height: 200px; magin: 0;">
<div id="preview-content"></div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-pencil"></span> Submit</button>
<a href="{% url 'show-issue' project.name issue.id %}" class="btn btn-default">Cancel</a>
</div>
</div>
</form>
</div>
</div>
{% endblock %}
{% block js_end %}
{{ block.super }}
<script type="text/javascript">
var markdown_preview_url = "{% url 'markdown' %}";
</script>
<script src="{% static 'js/jquery.cookie.js' %}"></script>
<script src="{% static 'js/markdown-preview.js' %}"></script>
{% endblock %}

View file

@ -1,8 +1,9 @@
{% extends 'tracker/issue_base.html' %}
{% load humanize %}
{% load django_markdown %}
{% load tracker_tags %}
{% load tracker_filters %}
{% load staticfiles %}
{% block media %}
{{ form.media }}
@ -76,20 +77,31 @@
{% if perm.create_comment %}
<form action="{% url 'add-comment' project.name issue.id %}" method="post" role="form">
{% csrf_token %}
<div class="form-group">
{{ form.comment }}
</div>
<div class="text-center">
{% if perm.manage_issue %}
{% if issue.closed %}
<a href="{% url 'reopen-issue' project.name issue.id %}" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> Reopen this issue</a>
{% else %}
<a href="{% url 'close-issue' project.name issue.id %}" class="btn btn-default"><span class="glyphicon glyphicon-ok-circle"></span> Close this issue</a>
{% endif %}
{% endif %}
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-pencil"></span> Add a comment</button>
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#editor" role="tab" data-toggle="tab">Editor</a></li>
<li><a href="#preview" role="tab" data-toggle="tab">Preview</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="editor" style="max-height: 220px;">
<div class="form-group">
<textarea style="width: 100%; height: 220px;" id="markdown-content" name="comment" required></textarea>
</div>
</div>
<div class="tab-pane well" id="preview" style="min-height: 200px; magin: 0;">
<div id="preview-content"></div>
</div>
<div class="text-center">
{% if perm.manage_issue %}
{% if issue.closed %}
<a href="{% url 'reopen-issue' project.name issue.id %}" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> Reopen this issue</a>
{% else %}
<a href="{% url 'close-issue' project.name issue.id %}" class="btn btn-default"><span class="glyphicon glyphicon-ok-circle"></span> Close this issue</a>
{% endif %}
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-pencil"></span> Add a comment</button>
</div>
</div>
</form>
{% endif %}
{% elif request.user.is_authenticated %}
Sorry, you are not allowed to comment this issue.
{% else %}
@ -207,3 +219,12 @@
</div>
{% endblock %}
{% block js_end %}
{{ block.super }}
<script type="text/javascript">
var markdown_preview_url = "{% url 'markdown' %}";
</script>
<script src="{% static 'js/jquery.cookie.js' %}"></script>
<script src="{% static 'js/markdown-preview.js' %}"></script>
{% endblock %}

View file

@ -1,10 +1,7 @@
{% extends 'tracker/issue_base.html' %}
{% load bootstrap3 %}
{% block media %}
{{ form.media }}
{% endblock media %}
{% load staticfiles %}
{% block tabcontent %}
@ -19,19 +16,42 @@
{% endif %}
</h1>
</div>
<form action="" method="post" role="form">
{% bootstrap_form form %}
<form method="post" role="form">
{% csrf_token %}
{% buttons %}
<button type="submit" class="btn btn-primary">Submit</button>
{% if issue %}
<a href="{% url 'show-issue' project.name issue.id %}" class="btn btn-default">Cancel</a>
{% else %}
<a href="{% url 'list-issue' project.name %}" class="btn btn-default">Cancel</a>
{% endif %}
{% endbuttons %}
{% bootstrap_field form.title %}
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#editor" role="tab" data-toggle="tab">Editor</a></li>
<li><a href="#preview" role="tab" data-toggle="tab">Preview</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="editor" style="max-height: 220px;">
<div class="form-group">
<textarea style="width: 100%; height: 220px;" id="markdown-content" name="description">{{ form.description.value }}</textarea>
</div>
</div>
<div class="tab-pane well" id="preview" style="min-height: 200px; magin: 0;">
<div id="preview-content"></div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Submit</button>
{% if issue %}
<a href="{% url 'show-issue' project.name issue.id %}" class="btn btn-default">Cancel</a>
{% else %}
<a href="{% url 'list-issue' project.name %}" class="btn btn-default">Cancel</a>
{% endif %}
</div>
</div>
</form>
</div>
</div>
{% endblock %}
{% block js_end %}
{{ block.super }}
<script type="text/javascript">
var markdown_preview_url = "{% url 'markdown' %}";
</script>
<script src="{% static 'js/jquery.cookie.js' %}"></script>
<script src="{% static 'js/markdown-preview.js' %}"></script>
{% endblock %}

View file

@ -1,7 +1,5 @@
{% extends 'base.html' %}
{% load django_markdown %}
{% block content %}
<div class="page-header">

View file

@ -0,0 +1,26 @@
<form action="{% url 'add-comment' project.name issue.id %}" method="post" role="form">
{% csrf_token %}
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#editor" role="tab" data-toggle="tab">Editor</a></li>
<li><a href="#preview" role="tab" data-toggle="tab">Preview</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="editor" style="max-height: 220px;">
<div class="form-group">
<textarea style="width: 100%; height: 220px;" id="id_comment" name="comment" required></textarea>
</div>
</div>
<div class="tab-pane well" id="preview" style="min-height: 200px; magin: 0;">
<div id="preview-content"></div>
</div>
<div class="text-center">
{% if perm.manage_issue %}
{% if issue.closed %}
<a href="{% url 'reopen-issue' project.name issue.id %}" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> Reopen this issue</a>
{% else %}
<a href="{% url 'close-issue' project.name issue.id %}" class="btn btn-default"><span class="glyphicon glyphicon-ok-circle"></span> Close this issue</a>
{% endif %}
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-pencil"></span> Add a comment</button>
</div>
</div>
</form>