Added buttons to view and edit people from index.

Updated additional ajax realted template things
This commit is contained in:
Tom Price
2014-11-04 00:11:04 +00:00
parent 194d9d6782
commit d8f399bfe3
6 changed files with 39 additions and 12 deletions

2
.idea/PyRIGS.iml generated
View File

@@ -11,7 +11,7 @@
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 2.7.5 virtualenv at ~/pyrigs" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 2.7.6 virtualenv at D:\Users\Ghost\.virtualenvs\pyrigs" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="sass-stdlib" level="application" />
</component>

2
.idea/dataSources.xml generated
View File

@@ -4,7 +4,7 @@
<data-source source="LOCAL" name="Django default" uuid="09730cb6-cd27-4034-9959-d242e7905a51">
<driver-ref>sqlite.xerial</driver-ref>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/db.sqlite3</jdbc-url>
<jdbc-url>jdbc:sqlite:D:\Users\Ghost\PycharmProjects\pyrigs\db.sqlite3</jdbc-url>
<libraries />
</data-source>
</component>

View File

@@ -99,6 +99,17 @@ USE_L10N = True
USE_TZ = True
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.tz",
"django.core.context_processors.request",
"django.contrib.messages.context_processors.messages",
)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/

View File

@@ -4,15 +4,17 @@
{% block title %}{{ object.name }}{% endblock %}
{% block content %}
<div class="col-sm-10 col-sm-offset-1">
<div class="row">
{% if not request.is_ajax %}
<h3>{{ object.name }}</h3>
<div class="pull-right">
<a href="{% url 'person_update' object.pk %}" class="btn btn-primary">Edit <span
class="glyphicon glyphicon-pencil"></span></a>
</div>
<div class="row col-sm-12">
<div class="col-sm-6">
{% endif %}
<div class="col-sm-10 col-sm-offset-1">
<div class="">
<dl class="dl-horizontal">
<dt>Name</dt>
<dd>{{ object.name }}</dd>
@@ -33,3 +35,12 @@
</div>
</div>
{% endblock %}
{% if request.is_ajax %}
{% block footer %}
<div class="pull-right">
<a href="{% url 'person_update' object.pk %}" class="btn btn-primary">Edit <span
class="glyphicon glyphicon-pencil"></span></a>
</div>
{% endblock %}
{% endif %}

View File

@@ -28,7 +28,12 @@
<td>{{ person.email }}</td>
<td>{{ person.phone }}</td>
<td>{{ person.notes|yesno|capfirst }}</td>
<td>Add buttons</td>
<td>
<a href="{% url 'person_detail' person.pk %}" class="btn btn-default" data-toggle="modal" data-target="#modal">
<span class="glyphicon glyphicon-eye-open"></span>
</a>
<a href="{% url 'person_update' person.pk %}" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
</td>
</tr>
{% empty %}
<tr>

Binary file not shown.