Separate template files for modals
This commit is contained in:
parent
0338aeaef1
commit
231c794717
|
@ -81,7 +81,7 @@
|
|||
</div><!--/.fluid-container-->
|
||||
<script src="/static/js/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
{% block script %}
|
||||
{% block postscript %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -21,10 +21,10 @@
|
|||
</div><!--/span-->
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block script %}
|
||||
{% block postscript %}
|
||||
<script type="text/javascript">
|
||||
$("#tab-tasks").addClass('active');
|
||||
{% block moarscript %}
|
||||
{% endblock %}
|
||||
</script>
|
||||
{% block modals %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
<form method="POST" action="/story/{{story.id}}/addtask">{% csrf_token %}
|
||||
<div id="addtask" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="addtaskLabel" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="addtaskLabel">Add new task</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>Title <small>(optional)</small></label>
|
||||
<input class="input-block-level" name="title"
|
||||
type="text" placeholder="Optional task description" value="">
|
||||
<label>Project</label>
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-cog"></i></span>
|
||||
<input class="input-block-level" name="project" id="prependedInput"
|
||||
type="text" value="">
|
||||
</div>
|
||||
<label>Series</label>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
{% for series in active_series %}
|
||||
{% if series.status == 2 %}
|
||||
<button type="button" data-value="{{ series.name }}"
|
||||
class="addtask_series btn btn-small active">Current ({{series.name}})</button>
|
||||
{% else %}
|
||||
<button type="button" data-value="{{ series.name }}"
|
||||
class="addtask_series btn btn-small
|
||||
{% if series.status == 1 %}btn-success{% endif %}">{{ series.name }}</button>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<label class="after-buttongroup">Comment</label>
|
||||
<textarea class="input-block-level" rows="6" name="comment"
|
||||
placeholder="Add a comment"></textarea>
|
||||
<input type="hidden" id="addtask_series" name="series" value="">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<input class="btn btn-primary" type="submit" value="Add task">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
$(".addtask_series").click(function() {
|
||||
$("#addtask_series").val($(this).data("value"));
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,19 @@
|
|||
<form method="POST" action="/story/task/{{ task.id }}/delete">
|
||||
<div id="deltask{{ task.id }}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="deltaskLabel" aria-hidden="true">
|
||||
{% csrf_token %}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="deltaskLabel">Delete
|
||||
{{task.project.name}}/{{task.series.name}} task ?</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>Comment</label>
|
||||
<textarea class="input-block-level" name="comment" rows="3"
|
||||
placeholder="Add a comment"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<input class="btn btn-primary" type="submit" value="Delete task">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,32 @@
|
|||
{% load storyviewfilters %}
|
||||
<form method="POST" action="/story/{{ story.id }}/priority">
|
||||
<div id="editprio" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="editpriolLabel" aria-hidden="true">
|
||||
{% csrf_token %}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="editprioLabel">Change priority</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>Priority</label>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
{% for code, prio in priorities %}
|
||||
<button type="button" data-value="{{code}}"
|
||||
class="editprio_prio btn btn-small{{code|priobutton}}{% if story.priority == code %} active{% endif %}">{{ prio }}</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<label class="after-buttongroup">Comment</label>
|
||||
<textarea class="input-block-level" rows="6" name="comment"
|
||||
placeholder="Add a comment"></textarea>
|
||||
<input type="hidden" id="editprio_prio" name="priority" value="{{ story.priority }}">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<input class="btn btn-primary" type="submit" value="Save changes">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script language="text/javascript">
|
||||
$(".editprio_prio").click(function() {
|
||||
$("#editprio_prio").val($(this).data("value"));
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,26 @@
|
|||
<form method="POST" action="/story/{{story.id}}/edit">{% csrf_token %}
|
||||
<div id="editstory" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="editstoryLabel" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="editstoryLabel">Modify story</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>Title</label>
|
||||
<input class="input-block-level" name="title"
|
||||
type="text" value="{{ story.title }}">
|
||||
<label>Description <small>(can use Markdown)</small></label>
|
||||
<textarea class="input-block-level" name="description" rows="9">{{ story.description }}</textarea>
|
||||
<label>Tags</label>
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-tags"></i></span>
|
||||
<input class="input-block-level" name="tags" id="prependedInput" type="text"
|
||||
value="{% for tag in story.storytag_set.all %}{{ tag.name }} {% endfor %}">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<input class="btn btn-primary" type="submit" value="Save changes">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,65 @@
|
|||
{% load storyviewfilters %}
|
||||
<form method="POST" action="/story/task/{{ task.id }}">
|
||||
<div id="edittask{{ task.id }}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="edittaskLabel" aria-hidden="true">
|
||||
{% csrf_token %}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="edittaskLabel">Edit
|
||||
{{task.project.name}}/{{task.series.name}} task</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>Title <small>(optional)</small></label>
|
||||
<input type="text" name="title" value="{{ task.title }}">
|
||||
<label>Assignee</label>
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-user"></i></span>
|
||||
<input id="prependedInput" type="text" name="assignee"
|
||||
value="{{task.assignee.username}}">
|
||||
</div>
|
||||
<label>Milestone</label>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<button type="button" data-value=""
|
||||
class="btn btn-small edittask_ms{{task.id}}
|
||||
{% if not task.milestone %}active{% endif %}">
|
||||
None</button>
|
||||
{% for milestone in milestones %}
|
||||
{% if milestone.series == task.series %}}
|
||||
<button type="button" data-value="{{milestone.id}}"
|
||||
class="btn btn-small
|
||||
{% if task.milestone == milestone %}active{% endif %}
|
||||
{% if milestone.active or task.milestone == milestone %}edittask_ms{{task.id}}{%endif%}
|
||||
{% if not milestone.active %}btn-success
|
||||
{% if task.milestone != milestone %}disabled{%endif%}
|
||||
{% endif %}"
|
||||
{% if task.milestone != milestone and not milestone.active %}disabled="disabled"{%endif%}>
|
||||
{{ milestone.name }}</button>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<label class="after-buttongroup">Status</label>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
{% for code, status in taskstatuses %}
|
||||
<button type="button" data-value="{{code}}"
|
||||
class="edittask_status{{ task.id }} btn btn-small btn-{{code|taskcolor}}{% if task.status == code %} active{% endif %}">{{ status }}</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<label class="after-buttongroup">Comment</label>
|
||||
<textarea class="input-block-level" name="comment" rows="3"
|
||||
placeholder="Add a comment"></textarea>
|
||||
<input type="hidden" id="edittask_ms{{task.id}}" name="milestone" value="{{ task.milestone.id }}">
|
||||
<input type="hidden" id="edittask_status{{task.id}}" name="status" value="{{ task.status }}">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<input class="btn btn-primary" type="submit" value="Save changes">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script language="text/javascript">
|
||||
$(".edittask_status{{task.id}}").click(function() {
|
||||
$("#edittask_status{{task.id}}").val($(this).data("value"));
|
||||
});
|
||||
$(".edittask_ms{{task.id}}").click(function() {
|
||||
$("#edittask_ms{{task.id}}").val($(this).data("value"));
|
||||
});
|
||||
</script>
|
|
@ -49,7 +49,7 @@
|
|||
<td>{{ task.milestone.name }}</td>
|
||||
<td>
|
||||
<a href="#edittask{{ task.id }}" class="btn btn-micro" data-toggle="modal"><i class="icon-edit"></i></a>
|
||||
<a href="#deletetask{{ task.id }}" class="btn btn-micro" data-toggle="modal"><i class="icon-remove"></i></a>
|
||||
<a href="#deltask{{ task.id }}" class="btn btn-micro" data-toggle="modal"><i class="icon-remove"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@ -88,196 +88,13 @@
|
|||
<button class="btn btn-mini" type="submit">Add comment</button>
|
||||
</form>
|
||||
</div>
|
||||
<!-- Modify Story modal -->
|
||||
<form method="POST" action="/story/{{story.id}}/edit">{% csrf_token %}
|
||||
<div id="editstory" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="editStoryLabel" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="editStoryLabel">Modify story</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>Title</label>
|
||||
<input class="input-block-level" name="title"
|
||||
type="text" value="{{ story.title }}">
|
||||
<label>Description <small>(can use Markdown)</small></label>
|
||||
<textarea class="input-block-level" name="description" rows="9">{{ story.description }}</textarea>
|
||||
<label>Tags</label>
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-tags"></i></span>
|
||||
<input class="input-block-level" name="tags" id="prependedInput" type="text"
|
||||
value="{% for tag in story.storytag_set.all %}{{ tag.name }} {% endfor %}">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<input class="btn btn-primary" type="submit" value="Save changes">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- Add task modal -->
|
||||
<form method="POST" action="/story/{{story.id}}/addtask">{% csrf_token %}
|
||||
<div id="addtask" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="addTaskLabel" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="addTaskLabel">Add new task</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>Title <small>(optional)</small></label>
|
||||
<input class="input-block-level" name="title"
|
||||
type="text" placeholder="Optional task description" value="">
|
||||
<label>Project</label>
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-cog"></i></span>
|
||||
<input class="input-block-level" name="project" id="prependedInput"
|
||||
type="text" value="">
|
||||
</div>
|
||||
<label>Series</label>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
{% for series in active_series %}
|
||||
{% if series.status == 2 %}
|
||||
<button type="button" data-value="{{ series.name }}"
|
||||
class="series btn btn-small active">Current ({{series.name}})</button>
|
||||
{% else %}
|
||||
<button type="button" data-value="{{ series.name }}"
|
||||
class="series btn btn-small
|
||||
{% if series.status == 1 %}btn-success{% endif %}">{{ series.name }}</button>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<label class="after-buttongroup">Comment</label>
|
||||
<textarea class="input-block-level" rows="6" name="comment"
|
||||
placeholder="Add a comment"></textarea>
|
||||
<input type="hidden" id="series" name="series" value="">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<input class="btn btn-primary" type="submit" value="Add task">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- Set priority Modal -->
|
||||
<form method="POST" action="/story/{{ story.id }}/priority">
|
||||
<div id="editprio" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="editPriolLabel" aria-hidden="true">
|
||||
{% csrf_token %}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="editPrioLabel">Change priority</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>Priority</label>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
{% for code, prio in priorities %}
|
||||
<button type="button" data-value="{{code}}"
|
||||
class="prio btn btn-small{{code|priobutton}}{% if story.priority == code %} active{% endif %}">{{ prio }}</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<label class="after-buttongroup">Comment</label>
|
||||
<textarea class="input-block-level" rows="6" name="comment"
|
||||
placeholder="Add a comment"></textarea>
|
||||
<input type="hidden" id="priority" name="priority" value="{{ story.priority }}">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<input class="btn btn-primary" type="submit" value="Save changes">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- Edittask Modals -->
|
||||
{% endblock %}
|
||||
{% block modals %}
|
||||
{% include "stories.modal_editstory.html" %}
|
||||
{% include "stories.modal_addtask.html" %}
|
||||
{% include "stories.modal_editprio.html" %}
|
||||
{% for task in story.task_set.all %}
|
||||
<form method="POST" action="/story/task/{{ task.id }}">
|
||||
<div id="edittask{{ task.id }}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="editTaskLabel" aria-hidden="true">
|
||||
{% csrf_token %}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="editTaskLabel">Edit
|
||||
{{task.project.name}}/{{task.series.name}} task</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>Title <small>(optional)</small></label>
|
||||
<input type="text" name="title" value="{{ task.title }}">
|
||||
<label>Assignee</label>
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-user"></i></span>
|
||||
<input id="prependedInput" type="text" name="assignee"
|
||||
value="{{task.assignee.username}}">
|
||||
</div>
|
||||
<label>Milestone</label>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<button type="button" data-value=""
|
||||
class="btn btn-small ms{{task.id}}
|
||||
{% if not task.milestone %}active{% endif %}">
|
||||
None</button>
|
||||
{% for milestone in milestones %}
|
||||
{% if milestone.series == task.series %}}
|
||||
<button type="button" data-value="{{milestone.id}}"
|
||||
class="btn btn-small
|
||||
{% if task.milestone == milestone %}active{% endif %}
|
||||
{% if milestone.active or task.milestone == milestone %}ms{{task.id}}{%endif%}
|
||||
{% if not milestone.active %}btn-success
|
||||
{% if task.milestone != milestone %}disabled{%endif%}
|
||||
{% endif %}"
|
||||
{% if task.milestone != milestone and not milestone.active %}disabled="disabled"{%endif%}>
|
||||
{{ milestone.name }}</button>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<label class="after-buttongroup">Status</label>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
{% for code, status in taskstatuses %}
|
||||
<button type="button" data-value="{{code}}"
|
||||
class="stat{{ task.id }} btn btn-small btn-{{code|taskcolor}}{% if task.status == code %} active{% endif %}">{{ status }}</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<label class="after-buttongroup">Comment</label>
|
||||
<textarea class="input-block-level" name="comment" rows="3"
|
||||
placeholder="Add a comment"></textarea>
|
||||
<input type="hidden" id="ms{{task.id}}" name="milestone" value="{{ task.milestone.id }}">
|
||||
<input type="hidden" id="status{{task.id}}" name="status" value="{{ task.status }}">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<input class="btn btn-primary" type="submit" value="Save changes">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endfor %}
|
||||
<!-- Removetask Modals -->
|
||||
{% for task in story.task_set.all %}
|
||||
<form method="POST" action="/story/task/{{ task.id }}/delete">
|
||||
<div id="deletetask{{ task.id }}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="deleteTaskLabel" aria-hidden="true">
|
||||
{% csrf_token %}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="editTaskLabel">Delete
|
||||
{{task.project.name}}/{{task.series.name}} task ?</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>Comment</label>
|
||||
<textarea class="input-block-level" name="comment" rows="3"
|
||||
placeholder="Add a comment"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<input class="btn btn-primary" type="submit" value="Delete task">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
{% block moarscript %}
|
||||
$(".series").click(function() {
|
||||
$("#series").val($(this).data("value"));
|
||||
});
|
||||
$(".prio").click(function() {
|
||||
$("#priority").val($(this).data("value"));
|
||||
});
|
||||
{% for task in story.task_set.all %}
|
||||
$(".stat{{task.id}}").click(function() {
|
||||
$("#status{{task.id}}").val($(this).data("value"));
|
||||
});
|
||||
$(".ms{{task.id}}").click(function() {
|
||||
$("#ms{{task.id}}").val($(this).data("value"));
|
||||
});
|
||||
{% include "stories.modal_edittask.html" with task=task %}
|
||||
{% include "stories.modal_deltask.html" with task=task %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue