code: rudimentary implementation of detail and create
This commit is contained in:
@@ -110,12 +110,12 @@
|
||||
<a href="{{ model.admin_url }}" {% if model.admin_url in request.path|urlencode %} aria-current="page" {%
|
||||
endif %}>{{ model.name }}</a>
|
||||
{% else %}
|
||||
{{ model.name }}
|
||||
<span>{{ model.name }}</span>
|
||||
{% endif %}
|
||||
|
||||
<i class="plus link icon"></i>
|
||||
{% if model.add_url %}
|
||||
<a href="{{ model.add_url }}" class="addlink">{{ translate( 'Add') }}</a>
|
||||
|
||||
{% if model.add_url %}<i class="plus link icon">
|
||||
<a href="{{ model.add_url }}" class="addlink">{{ translate( 'Add') }}</a></i>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
17
templates/admin/items/item_create.jinja
Normal file
17
templates/admin/items/item_create.jinja
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends "admin/base.jinja" %}
|
||||
|
||||
{% macro input(name, value="", type="text") -%}
|
||||
<input type="{{ type }}" name="{{ name }}" value="{{ value }}">
|
||||
{%- endmacro %}
|
||||
|
||||
{% block content %}
|
||||
Create {{item_model.name}} in {{item_info.name}}
|
||||
|
||||
<form>
|
||||
{% set fields = item_info.display_list %}
|
||||
{% for field in fields %}
|
||||
<p><label>{{field}}</label>{{ input(field) }}</p>
|
||||
{% endfor %}
|
||||
<input type="submit" name="submit" value="Create">
|
||||
</form>
|
||||
{% endblock content %}
|
||||
@@ -1 +1,11 @@
|
||||
Item Detail.
|
||||
{% extends "admin/base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if item %}
|
||||
{{item.fields}}
|
||||
{% else %}
|
||||
No Item found.
|
||||
{% endif %}
|
||||
|
||||
{% endblock content %}
|
||||
@@ -16,7 +16,7 @@
|
||||
{% set primary_key = item_info.lookup_key %}
|
||||
{% endif %}
|
||||
|
||||
<div class="ui short scrolling container">
|
||||
<div class="ui basic container">
|
||||
<table class="ui very compact celled table head stuck unstackable">
|
||||
<caption>{{ item_info.name|none(content) }}</caption>
|
||||
<thead>
|
||||
@@ -39,12 +39,11 @@
|
||||
<tr>
|
||||
{% for key in item_keys %}
|
||||
{% if key==primary_key %}
|
||||
<td class="selectable warning">
|
||||
<a href="#">{{ item[key] }}</a>
|
||||
</td>
|
||||
<td class="selectable warning">{% if item.detail_url %}<a href="{{item.detail_url}}">{{
|
||||
item.fields[key] }}</a>{%
|
||||
else %}{{item.fields[key] }}{% endif %}</td>
|
||||
{% else %}
|
||||
<td>{{ item[key] }}</td>
|
||||
{% endif %}
|
||||
<td>{{ item.fields[key] }}</td>{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user