- {{ render_bootstrap_field(form.title, field_description="Gist of your issue") }}
+ {% else %}
+
+ {% if not type or type == 'new' %}
+
New Issue
+ {% elif type and type == 'edit' %}
+
Edit Issue
+ {% endif %}
+ {% endif %}
+
{% if type == 'edit' %}
- {{ render_bootstrap_field(form.status, field_description="bug status") }}
+ {{ form.status(class_="hidden") }}
+
+
+
#{{issue.id}}
{% endif %}
- {% if types %}
-
{% endif %}
- {{ render_bootstrap_field(form.private, field_description="Do you want to keep the issue private?") }}
-
- Attach file
+
+
+
+
+ {% if form.issue_content.errors %}
+
+
+ {% for error in form.issue_content.errors %}
+ {{ error }}
+ {% endfor %}
+
+
+ {% endif %}
+
+
+
+
+
+
-
{% if g.repo_user and not type or type == 'new' %}
-
-
+
+ {% if repo.milestones %}
+
+ {% endif %}
{% endif %}
-
- {% if g.authenticated and g.repo_committer and type and type == 'edit' %}
-
- {% endif %}
{% endblock %}
{% block jscripts %}
@@ -221,7 +264,7 @@ $(document).ready(function() {
var json_url = '{{ url_for("static", filename="vendor/emojione/emoji_strategy.json") }}';
emoji_complete(json_url, folder);
- $("#type").on("change", function() {
+ $(".issue-template").on("click", function() {
if ( !confirm('Do you want to load the new template?')){
return false;
}
@@ -278,9 +321,9 @@ $(document).ready(function() {
$(function() {
$( "#preview" ).hide();
+
$( "#previewinmarkdown" ).click(
function(event, ui) {
- if ($( "#previewinmarkdown" ).hasClass("inactive")){
var _text = $( "#issue_content" ).val();
var _url = "{{ url_for('ui_ns.markdown_preview',
repo=repo.name,
@@ -297,8 +340,8 @@ $(function() {
success: function(res) {
var preview = emojione.toImage(res);
$( "#preview" ).html(preview);
- $( "#previewinmarkdown" ).removeClass("inactive");
- $( "#previewinmarkdown" ).addClass("active");
+ $( "#previewinmarkdown" ).toggleClass("active");
+ $( "#editinmarkdown" ).toggleClass("active");
$( "#issue_content" ).hide();
$( "#preview" ).show();
},
@@ -307,12 +350,15 @@ $(function() {
}
});
return false;
- } else if ($( "#previewinmarkdown" ).hasClass("active")){
- $( "#previewinmarkdown" ).addClass("inactive");
- $( "#previewinmarkdown" ).removeClass("active");
- $( "#issue_content" ).show();
- $( "#preview" ).hide();
- }
+ }
+ );
+
+ $( "#editinmarkdown" ).click(
+ function(event, ui) {
+ $( "#editinmarkdown" ).toggleClass("active");
+ $( "#previewinmarkdown" ).toggleClass("active");
+ $( "#issue_content" ).show();
+ $( "#preview" ).hide();
}
);
});
diff --git a/tests/test_pagure_flask_ui_issues.py b/tests/test_pagure_flask_ui_issues.py
index 83c6855..3274747 100644
--- a/tests/test_pagure_flask_ui_issues.py
+++ b/tests/test_pagure_flask_ui_issues.py
@@ -67,7 +67,7 @@ class PagureFlaskIssuestests(tests.Modeltests):
output = self.app.get('/test/new_issue')
self.assertEqual(output.status_code, 200)
self.assertIn(
- '