src/p4l/templates/p4l/record_update_form.html
author cavaliet
Wed, 04 Sep 2013 16:56:55 +0200
changeset 36 08cffedf6e60
parent 35 544bc92e6fe7
child 38 c4e5bb735ec1
permissions -rw-r--r--
first step of semantic tree, just to save. it will not be used as this in this project.

{% extends "p4l/p4l_base.html" %}
{% load static %}
{% load i18n %}

{% block page_title %}{% trans 'Record' %} {{ params.identifier }} - {% trans 'View' %}{% endblock %}

{% block js_page %}
<script type="text/javascript" src="{% static 'p4l/lib/angular/angular.min.js' %}"></script>
<script type="text/javascript" src="{% static 'p4l/lib/angular/angular-resource.min.js' %}"></script>
<script type="text/javascript" src="{% static 'p4l/js/p4l.js' %}"></script>
<script type="text/javascript">
    angular.module("recordApp")
        .value('context', {
            record_id: "{{record.identifier}}",
            uri_labels: {{uri_labels | safe}},
            urls: {
                record_api: "{% url 'record-detail' identifier=':recordId' %}".replace("\%3A",":")
            }
        });
</script>
{% endblock %}

{% block content %}
{% verbatim %}
<div ng-app="recordApp" ng-controller="RecordCtrl">
<table class="table record-table">
  <thead>
    <tr><td>property</td><td>value</td></tr>
  </thead>
  <tbody>
    <tr>
      <td>URI</td>
      <td>{{record.uri}}</td>
    </tr>
    <tr>
      <td>identifier</td>
      <td>{{record.identifier}}</td>
    </tr>
    <tr>
      <td>subjects</td>
      <td>
          <ul ng-repeat="subject in record.subjects">
              <li>{{uriLabels[subject]}} <small class="text-muted">({{subject}})</small></li>
          </ul>
          <form class="form-inline" role="form" ng-submit="addSubject()">
	        <div class="form-group">
	          <input ng-model="addSubjectText" class="form-control" type="text" placeholder="Add a new subject" required="required"/>
	        </div>
	        <div class="form-group">
	          <button type="submit" class="btn btn-primary">Add</button>
	        </div>
	      </form>
      </td>
    </tr>
  </tbody>
</table>
</div>
{% endverbatim %}
<div class="row">
    <div class="col-md-12 text-right">
      <a href="?lang=fr" alt="FR"><img src="{% static 'p4l/img/blank.gif' %}" class="flag flag-fr" alt="FR" /></a>&nbsp;
      <a href="?lang=en" alt="EN"><img src="{% static 'p4l/img/blank.gif' %}" class="flag flag-gb" alt="EN" /></a>&nbsp;
      <a href="?lang=es" alt="ES"><img src="{% static 'p4l/img/blank.gif' %}" class="flag flag-es" alt="ES" /></a>
    </div>
</div>
{% endblock %}