- update django
authorymh <ymh.work@gmail.com>
Sat, 28 Sep 2013 02:55:26 +0200
changeset 120 6ec0300b626e
parent 119 ece69ca3ac24
child 121 0d2a35462576
- update django - clear search input - footer
.hgignore
src/p4l/__init__.py
src/p4l/context_processors.py
src/p4l/settings.py
src/p4l/static/p4l/css/p4l.css
src/p4l/static/p4l/img/logo_IRI_footer.png
src/p4l/static/p4l/js/p4l.js
src/p4l/static/p4l/js/p4l_home.js
src/p4l/templates/p4l/base.html
src/p4l/templates/p4l/home.html
virtualenv/res/src/django-1.5.4-IRI.tar.gz
--- a/.hgignore	Thu Sep 26 15:24:41 2013 +0200
+++ b/.hgignore	Sat Sep 28 02:55:26 2013 +0200
@@ -6,4 +6,6 @@
 ^virtualenv/web/project-boot\.py$
 ^virtualenv/web/env$
 ^\.settings$
-^web/static$
\ No newline at end of file
+^web/static$
+syntax: regexp
+^doc/_build$
\ No newline at end of file
--- a/src/p4l/__init__.py	Thu Sep 26 15:24:41 2013 +0200
+++ b/src/p4l/__init__.py	Sat Sep 28 02:55:26 2013 +0200
@@ -0,0 +1,15 @@
+VERSION = (0, 1, 0, "alpha", 0)
+
+
+def get_version():
+    version = '%s.%s' % (VERSION[0], VERSION[1])
+    if VERSION[2]:
+        version = '%s.%s' % (version, VERSION[2])
+    if VERSION[3:] == ('alpha', 0):
+        version = '%s alpha' % version
+    else:
+        if VERSION[3] != 'final':
+            version = '%s %s %s' % (version, VERSION[3], VERSION[4])
+    return version
+
+__version__ = get_version()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/p4l/context_processors.py	Sat Sep 28 02:55:26 2013 +0200
@@ -0,0 +1,4 @@
+from p4l import get_version
+
+def version(request):
+    return { 'VERSION': get_version() }
--- a/src/p4l/settings.py	Thu Sep 26 15:24:41 2013 +0200
+++ b/src/p4l/settings.py	Sat Sep 28 02:55:26 2013 +0200
@@ -143,6 +143,7 @@
 TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
     'django.core.context_processors.i18n',
     'django.core.context_processors.request',
+    'p4l.context_processors.version',
 )
 
 # A sample logging configuration. The only tangible logging
--- a/src/p4l/static/p4l/css/p4l.css	Thu Sep 26 15:24:41 2013 +0200
+++ b/src/p4l/static/p4l/css/p4l.css	Sat Sep 28 02:55:26 2013 +0200
@@ -2,6 +2,12 @@
  * modif from bootstrap for p4l
  */
 
+html,
+body {
+	height: 100%;
+	/* The html and body elements cannot have any padding or margin. */
+}
+
 .container {
   margin: 0 auto;
   width: 950px;
@@ -22,8 +28,10 @@
 .two_buttons{
 	min-width: 100px;
 }
+
 footer {
-    padding-bottom: 20px;    
+    padding-bottom: 20px;
+    border-top: 1px solid gray;
 }
 .bottom-5 {
     margin-bottom: 5px;
@@ -93,3 +101,55 @@
 [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
   display: none !important;
 }
+
+
+.version {
+    text-align: right;
+    color: white;
+    font-size:9px;
+}
+
+.version:hover {
+    color: inherit;
+	text-decoration: none;
+    border-bottom-width: 0px;
+    border-bottom-style: none;
+}
+
+#wrapper {
+	min-height: 100%;
+	height: auto !important;
+	height: 100%;
+	/* Negative indent footer by it's height */
+	margin: 0 auto -70px;
+}
+
+/* Set the fixed height of the footer here */
+#push,
+footer {
+    height: 70px;
+}
+
+.footer-img {
+	padding: 10px 0;
+}
+
+#search-input {
+	padding-right: 24px;
+}
+
+#search-input-cancel {
+    text-indent: -1000em;
+    top: 3px;
+    right: 0.5em;
+}
+
+#langselect {
+	padding-bottom: 10px;
+}
+
+
+#copyright-version a {
+	text-decoration: none;
+	color: inherit;
+}
\ No newline at end of file
Binary file src/p4l/static/p4l/img/logo_IRI_footer.png has changed
--- a/src/p4l/static/p4l/js/p4l.js	Thu Sep 26 15:24:41 2013 +0200
+++ b/src/p4l/static/p4l/js/p4l.js	Sat Sep 28 02:55:26 2013 +0200
@@ -185,7 +185,9 @@
     	  // Get queries attributes from $scope listname and context query dict
     	  var attr_dict = context.query_dicts[$scope.listname];    	  
     	  for (var k in attr_dict){
-    	      $scope[k] = attr_dict[k];
+			  if (attr_dict.hasOwnProperty(k)) {
+			      $scope[k] = attr_dict[k];
+			  }
 		  }
 		  $scope.formVisible = false;
     	  // initalize autocomplete and browse thesaurus events
@@ -239,12 +241,9 @@
         link: function($scope, $element, $attrs) {
             // Get queries attributes from $scope listname and context query dict
             var attr_dict = context.query_dicts[$scope.listname];
-            for (var k in attr_dict){
-                if (attr_dict.hasOwnProperty(k)) {
-                    $scope[k] = attr_dict[k];
-                }
-            }
+            angular.extend($scope, attr_dict);            
             $scope.formVisible = false;
+            
             // initalize autocomplete and browse thesaurus events
             // We have to timeout because init_browse needs the real ids and not {{ $id }}
             // NB : scope.apply generates bug
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/p4l/static/p4l/js/p4l_home.js	Sat Sep 28 02:55:26 2013 +0200
@@ -0,0 +1,19 @@
+"use strict";
+
+$(function() {    
+    $("#search-input").on('input', function(e) {
+        if($("#search-input").val().length) {
+            $("#search-input-cancel").show();
+        }
+        else {
+            $("#search-input-cancel").hide();
+        }
+    });
+    $("#search-input-cancel").click(function(e) {
+        if($("#search-input").val().length) {
+            $("#search-input").val("");
+            $("#search-input-cancel").hide();
+        }
+    });
+    
+});
\ No newline at end of file
--- a/src/p4l/templates/p4l/base.html	Thu Sep 26 15:24:41 2013 +0200
+++ b/src/p4l/templates/p4l/base.html	Sat Sep 28 02:55:26 2013 +0200
@@ -19,6 +19,7 @@
 </head>
 <body>
 {% block body %}
+    <div id="wrapper">
 	<header class="navbar navbar-inverse" role="banner">
 	  {% block header %}
 	  <div class="container">
@@ -45,18 +46,31 @@
     {% block content %}
     {% endblock %}
 	</div>
-    <footer class="container">
+    <div id="push"></div>
+    </div>
+    <footer>
+      <div class="container row">
       {% block footer %}
-        <div class="col-md-12 text-right" id='langselect'>
-            <form action="{% url 'django.views.i18n.set_language' %}" method="post" id="lang_form">
-            {% csrf_token %}
-            {% get_language_info_list for LANGUAGES as languages %}
-            {% for language in languages %}
-                <input type="submit" name="language" class="flag flag-{{ language.code }}{% if language.code == LANGUAGE_CODE %} selected{% endif %}" value="{{ language.code }}" title="{{ language.name_local }}" />
-            {% endfor %}
-            </form>
+        <div class="footer-img col-md-6">
+            <a href="http://www.iri.centrepompidou.fr" target="_blank"><img src="{% static 'p4l/img/logo_IRI_footer.png' %}" alt="Logo IRI" /></a>
+        </div>
+        <div class="col-md-6">
+          <div class="text-right" id='langselect'>
+              <form action="{% url 'django.views.i18n.set_language' %}" method="post" id="lang_form">
+              {% csrf_token %}
+              {% get_language_info_list for LANGUAGES as languages %}
+              {% for language in languages %}
+                  <input type="submit" name="language" class="flag flag-{{ language.code }}{% if language.code == LANGUAGE_CODE %} selected{% endif %}" value="{{ language.code }}" title="{{ language.name_local }}" />
+              {% endfor %}
+              </form>
+          </div>
+          <div class="text-right" id="copyright-version">
+              <div>©2013 <a href="http://www.iri.centrepompidou.fr" target="_blank">IRI</a></div>
+              <div id="versionwrapper"><span class="version" id="version">{{VERSION}}</span></div>
+          </div>
         </div>
       {% endblock %}
+      </div>
     </footer>
     {% block js_common %}
     <!--script type="text/javascript" src="{% static 'p4l/js/bootstrap.min.js' %}"></script-->
--- a/src/p4l/templates/p4l/home.html	Thu Sep 26 15:24:41 2013 +0200
+++ b/src/p4l/templates/p4l/home.html	Sat Sep 28 02:55:26 2013 +0200
@@ -5,13 +5,18 @@
 
 {% block page_title %}{% trans 'Record List' %} - {% trans 'Page' %} {{ page.number }}{% endblock %}
 
+{% block js_page %}
+<script type="text/javascript" src="{% static 'p4l/lib/jquery-1.9.1.js' %}"></script>
+<script type="text/javascript" src="{% static 'p4l/js/p4l_home.js' %}"></script>
+{% endblock %}
+
 {% block content %}
 <div class="row">
 	<h3 class="col-md-6">{% trans 'Record List' %}</h3>
 	<div class="col-md-6 text-right">
 	  <form method="GET" class="form-inline" role="form">
 	    <div class="form-group">
-	      <input id="id_title" class="form-control" type="text" placeholder="{% trans 'Query' %}" name="q" value="{{query}}"/>
+	        <input id="search-input" class="form-control" type="search" placeholder="{% trans 'Query' %}" name="q" value="{{query}}"></input><span id="search-input-cancel" class="glyphicon glyphicon-remove" {% if not query %}style="display: none;"{% endif %}></span>
 	    </div>
 	    <div class="form-group">
 	      <button type="submit" class="btn btn-default"><i class="glyphicon glyphicon-search"></i></button>
Binary file virtualenv/res/src/django-1.5.4-IRI.tar.gz has changed