--- a/integration/css/egonomy.css Tue Feb 19 13:12:30 2013 +0100
+++ b/integration/css/egonomy.css Tue Feb 19 13:14:20 2013 +0100
@@ -152,9 +152,21 @@
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
- width: 100%; border: none; background: #d0e0FF;
- padding: 2px; margin: 3px 0; height: 20px;
+ border: none; background: #d0e0FF;
+ padding: 2px; margin: 2px 0; height: 20px;
+ font-size: 13px; width: 210px; float: left;
+ line-height: 20px; height: 20px;
+}
+
+.search-type {
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ border: none; background: #E0E0E0;
+ float: left; width: 100px;
+ padding: 2px; margin: 2px 0 0 1px;
font-size: 13px;
+ line-height: 20px; height: 20px;
}
.placeholder {
@@ -206,7 +218,7 @@
}
.subcol-eighth {
- width: 110px;
+ width: 110px; margin-left: 12px;
}
.subcol-eighth:nth-child(even) {
--- a/integration/home-v1.html Tue Feb 19 13:12:30 2013 +0100
+++ b/integration/home-v1.html Tue Feb 19 13:14:20 2013 +0100
@@ -14,6 +14,10 @@
<h1 class="column column-third">TagItAll by eGonomy</h1>
<form class="column column-third">
<input class="search-field" type="search" placeholder="Rechercher" />
+ <select class="search-type">
+ <option value="fragments">Fragments</option>
+ <option value="images">Images</option>
+ </select>
</form>
<nav class="column column-third">
<a href="#">Se connecter</a>
--- a/src/egonomy/static/egonomy/css/egonomy.css Tue Feb 19 13:12:30 2013 +0100
+++ b/src/egonomy/static/egonomy/css/egonomy.css Tue Feb 19 13:14:20 2013 +0100
@@ -156,9 +156,21 @@
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
- width: 100%; border: none; background: #d0e0FF;
- padding: 2px; margin: 3px 0; height: 20px;
+ border: none; background: #d0e0FF;
+ padding: 2px; margin: 2px 0; height: 20px;
+ font-size: 13px; width: 210px; float: left;
+ line-height: 20px; height: 20px;
+}
+
+.search-type {
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ border: none; background: #E0E0E0;
+ float: left; width: 100px;
+ padding: 2px; margin: 2px 0 0 1px;
font-size: 13px;
+ line-height: 20px; height: 20px;
}
.placeholder {
--- a/src/egonomy/templates/egonomy_base.html Tue Feb 19 13:12:30 2013 +0100
+++ b/src/egonomy/templates/egonomy_base.html Tue Feb 19 13:14:20 2013 +0100
@@ -13,15 +13,33 @@
<link rel="stylesheet" href="{% static 'egonomy/css/egonomy.css' %}" />
{% endblock %}
{% block css_page %}{% endblock %}
- {% block js_import %}{% endblock %}
+ {% block js_import %}
+ <script type="text/javascript" src="{% static 'egonomy/lib/jquery.min.js' %}"></script>
+ {% endblock %}
+ {% block js_inline %}
+ <script type="text/javascript">
+ $(function() {
+ $(".search-type").change(function() {
+ $(".search-form").attr("action", $(this).val());
+ if ($(".search-field").val()) {
+ $(".search-form").submit();
+ }
+ });
+ });
+ </script>
+ {% endblock %}
</head>
{% endblock %}
<body>
<div class="header-wrap fullwidth">
<header>
<h1 class="column column-third"><a href="{% url 'home' %}">TagItAll {% trans "by" %} eGonomy</a></h1>
- <form class="column column-third" action="{% if search_fragment %}{% url 'all_fragments' %}{% else %}{% url 'all_pictures' %}{% endif %}" method="GET">
+ <form class="search-form column column-third" action="{% if search_fragment %}{% url 'all_fragments' %}{% else %}{% url 'all_pictures' %}{% endif %}" method="GET">
<input class="search-field" type="search" placeholder="{% trans 'Search' %}" id="id_search" name="search"/>
+ <select class="search-type">
+ <option value="{% url 'all_pictures' %}"{% if not search_fragment %} selected{% endif %}>Images</option>
+ <option value="{% url 'all_fragments' %}"{% if search_fragment %} selected{% endif %}>Fragments</option>
+ </select>
<input type="hidden" value="all" name="field">
</form>
<nav class="column column-third">
--- a/src/egonomy/templates/egonomy_create_fragment.html Tue Feb 19 13:12:30 2013 +0100
+++ b/src/egonomy/templates/egonomy_create_fragment.html Tue Feb 19 13:14:20 2013 +0100
@@ -7,7 +7,6 @@
{% block js_import %}
{{block.super}}
- <script type="text/javascript" src="{% static 'egonomy/lib/jquery.min.js' %}"></script>
<script type="text/javascript" src="{% static 'egonomy/lib/raphael-min.js' %}"></script>
<script type="text/javascript" src="{% static 'egonomy/js/cutout.js' %}"></script>
{% endblock %}