-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
69 additions
and
45 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from django.utils.timezone import now | ||
|
||
from django_unicorn.components import UnicornView | ||
|
||
|
||
class DirectViewView(UnicornView): | ||
name = "test" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% extends "www/base.html" %} | ||
{% load unicorn %} | ||
|
||
{% block content %} | ||
|
||
<div unicorn:view> | ||
<h2>Direct View</h2> | ||
|
||
<input u:model="name" /> | ||
{{ name }} | ||
</div> | ||
|
||
{% endblock content %} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,52 @@ | ||
{% load static unicorn %} | ||
|
||
<html> | ||
<head> | ||
<title>django-unicorn examples</title> | ||
<link rel="stylesheet" href="{% static 'css/marx.min.css' %}"> | ||
<link rel="stylesheet" href="{% static 'css/styles.css' %}"> | ||
<style> | ||
#menu { | ||
list-style: none; | ||
} | ||
#menu li { | ||
display: inline; | ||
padding: 0 10px; | ||
border-left: solid 1px black; | ||
} | ||
#menu li:first-child { | ||
border-left: none !important; | ||
} | ||
</style> | ||
|
||
{% unicorn_scripts %} | ||
</head> | ||
|
||
<body> | ||
<main> | ||
{% csrf_token %} | ||
|
||
<h1>django-unicorn</h1> | ||
|
||
<ul id="menu"> | ||
<li><a href="{% url 'www:index' %}">Index</a></li> | ||
<li><a href="{% url 'www:template' 'text-inputs' %}">Text inputs</a></li> | ||
<li><a href="{% url 'www:template' 'html-inputs' %}">Other inputs</a></li> | ||
<li><a href="{% url 'www:template' 'objects' %}">Objects</a></li> | ||
<li><a href="{% url 'www:template' 'validation' %}">Validation</a></li> | ||
<li><a href="{% url 'www:template' 'polling' %}">Polling</a></li> | ||
<li><a href="{% url 'www:template' 'models' %}">Models</a></li> | ||
<li><a href="{% url 'www:template' 'nested' %}">Nested components (table)</a></li> | ||
<li><a href="{% url 'www:template' 'js' %}">JavaScript integration</a></li> | ||
</ul> | ||
|
||
{% block content %}{% endblock content %} | ||
|
||
</main> | ||
</body> | ||
|
||
<head> | ||
<title>django-unicorn examples</title> | ||
<link rel="stylesheet" href="{% static 'css/marx.min.css' %}"> | ||
<link rel="stylesheet" href="{% static 'css/styles.css' %}"> | ||
<style> | ||
#menu { | ||
list-style: none; | ||
} | ||
|
||
#menu li { | ||
display: inline; | ||
padding: 0 10px; | ||
border-left: solid 1px black; | ||
} | ||
|
||
#menu li:first-child { | ||
border-left: none !important; | ||
} | ||
</style> | ||
|
||
{% unicorn_scripts %} | ||
</head> | ||
|
||
<body> | ||
<main> | ||
{% csrf_token %} | ||
|
||
<h1>django-unicorn</h1> | ||
|
||
<ul id="menu"> | ||
<li><a href="{% url 'www:index' %}">Index</a></li> | ||
<li><a href="{% url 'www:template' 'text-inputs' %}">Text inputs</a></li> | ||
<li><a href="{% url 'www:template' 'html-inputs' %}">Other inputs</a></li> | ||
<li><a href="{% url 'www:template' 'objects' %}">Objects</a></li> | ||
<li><a href="{% url 'www:template' 'validation' %}">Validation</a></li> | ||
<li><a href="{% url 'www:template' 'polling' %}">Polling</a></li> | ||
<li><a href="{% url 'www:template' 'models' %}">Models</a></li> | ||
<li><a href="{% url 'www:template' 'nested' %}">Nested components (table)</a></li> | ||
<li><a href="{% url 'www:template' 'js' %}">JavaScript integration</a></li> | ||
<li><a href="{% url 'www:direct-view' %}">Direct View</a></li> | ||
</ul> | ||
|
||
{% block content %}{% endblock content %} | ||
|
||
</main> | ||
</body> | ||
|
||
</html> |
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