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 2d198d5dbb
commit 3ebe96734e
5 changed files with 39 additions and 12 deletions

2
.idea/PyRIGS.iml generated
View File

@@ -11,7 +11,7 @@
</component> </component>
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" /> <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="sourceFolder" forTests="false" />
<orderEntry type="library" name="sass-stdlib" level="application" /> <orderEntry type="library" name="sass-stdlib" level="application" />
</component> </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"> <data-source source="LOCAL" name="Django default" uuid="09730cb6-cd27-4034-9959-d242e7905a51">
<driver-ref>sqlite.xerial</driver-ref> <driver-ref>sqlite.xerial</driver-ref>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver> <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 /> <libraries />
</data-source> </data-source>
</component> </component>

View File

@@ -99,6 +99,17 @@ USE_L10N = True
USE_TZ = 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) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/ # https://docs.djangoproject.com/en/1.7/howto/static-files/

View File

@@ -4,15 +4,17 @@
{% block title %}{{ object.name }}{% endblock %} {% block title %}{{ object.name }}{% endblock %}
{% block content %} {% block content %}
<div class="col-sm-10 col-sm-offset-1"> <div class="row">
<h3>{{ object.name }}</h3> {% if not request.is_ajax %}
<h3>{{ object.name }}</h3>
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'person_update' object.pk %}" class="btn btn-primary">Edit <span <a href="{% url 'person_update' object.pk %}" class="btn btn-primary">Edit <span
class="glyphicon glyphicon-pencil"></span></a> class="glyphicon glyphicon-pencil"></span></a>
</div> </div>
<div class="row col-sm-12"> {% endif %}
<div class="col-sm-6"> <div class="col-sm-10 col-sm-offset-1">
<div class="">
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>Name</dt> <dt>Name</dt>
<dd>{{ object.name }}</dd> <dd>{{ object.name }}</dd>
@@ -32,4 +34,13 @@
</div> </div>
</div> </div>
</div> </div>
{% endblock %} {% 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.email }}</td>
<td>{{ person.phone }}</td> <td>{{ person.phone }}</td>
<td>{{ person.notes|yesno|capfirst }}</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> </tr>
{% empty %} {% empty %}
<tr> <tr>