This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@require_POST | |
def ajax_notes_create(request, notebook_pk): | |
notebook = get_object_or_404(Notebook, pk=notebook_pk) | |
data = {} | |
note = None | |
form = NoteForm(request.POST) | |
if form.is_valid(): | |
note = form.save(commit=False) | |
note.notebook = notebook | |
note.save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NotebookNotesView(DetailView): | |
template_name = "notes.html" | |
model = Notebook | |
def get_context_data(self, **kwargs): | |
context = super().get_context_data(**kwargs) | |
context["note_list"] = self.object.notes | |
context["form"] = NoteForm() | |
context["post_url"] = reverse("ajax_notes_create", kwargs=dict(notebook_pk=self.object.pk)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load bootstrap %} | |
<form id="note-form" action="{{ post_url }}" method="post" class="ajax" data-replace="#note-form"> | |
{% csrf_token %} | |
{{ form|bootstrap }} | |
<div class="mt-5"> | |
<button class="btn btn-primary btn-block"> | |
{% if note %}Update{% else %}Create{% endif %} | |
Note | |
</button> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "site_base.html" %} | |
{% block body %} | |
<div class="row notes-container"> | |
<div class="col notes-form-container"> | |
{% include "_note_form.html" %} | |
</div> | |
<div class="col notes-list-container"> | |
<h4>{{ notebook.name }} Notes</h4> | |
<div id="note-list" data-save-order-url="{% url "ajax_notes_update_order" notebook.pk %}"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.template.loader import render_to_string | |
class EldarionAjaxDataMixin(object): | |
""" | |
Add to your view that handles eldarion-ajax requests to make it easier to | |
build up your response. | |
Example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "node_modules/bootstrap/scss/bootstrap"; | |
@import "node_modules/font-awesome/scss/font-awesome"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="overall-rating"> | |
<div class="overall-rating-top" style="width: 83%"> | |
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i> | |
</div> | |
<div class="overall-rating-bottom"> | |
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
1. Create a new repo and setup your pipeline to match JIRA | |
2. Edit the constants to suit your needs | |
3. Run `source jira.env` | |
4. Run `python jira-migration.py` | |
""" | |
import os | |
import requests |