diff options
-rw-r--r-- | static/saclay/css/styles.css | 29 | ||||
-rw-r--r-- | static/saclay/js/interface.js | 2 | ||||
-rwxr-xr-x | static/saclay/js/search.js | 48 | ||||
-rw-r--r-- | templates/chimere/base.html | 1 | ||||
-rw-r--r-- | templates/chimere/blocks/welcome.html | 61 | ||||
-rw-r--r-- | templates/chimere/main_map.html | 2 |
6 files changed, 102 insertions, 41 deletions
diff --git a/static/saclay/css/styles.css b/static/saclay/css/styles.css index 6046bb2..5847c3c 100644 --- a/static/saclay/css/styles.css +++ b/static/saclay/css/styles.css @@ -452,6 +452,7 @@ a#ui-active-menuitem.ui-state-hover{ width: 281px; } +#haystack-search-page, #haystack-search{ width:35px; height:28px; @@ -463,6 +464,19 @@ a#ui-active-menuitem.ui-state-hover{ vertical-align:top; } +#haystack-search-page .action-label, +#haystack-search .action-label{ + display: none; +} + +#id_welcome_search{ + height: 20px; +} + +.welcome-dialog p.welcome-search{ + padding: 10px 0 20px 0; +} + #search-listing img{ vertical-align:middle; } @@ -2118,3 +2132,18 @@ select#id_categories{ color:#d38fac; } +#welcome h3, #welcome h4, +#welcome{ + font-family: 'Numans', sans-serif; + text-align: center; + color: #999; + font-weight: 300; +} + +#welcome h3{ + font-size: 50px; +} + +#welcome h4{ + font-size: 30px; +} diff --git a/static/saclay/js/interface.js b/static/saclay/js/interface.js index e004ce4..ebfa527 100644 --- a/static/saclay/js/interface.js +++ b/static/saclay/js/interface.js @@ -162,6 +162,8 @@ $(function(){ $('input[name="transport"]').change(change_routing_transport); $('input[name="speed"]').change(change_routing_speed); $('#id_speed').change(change_routing_speed); + + $('#haystack-search-page').click(welcome_search); }); function change_routing_speed(){ diff --git a/static/saclay/js/search.js b/static/saclay/js/search.js new file mode 100755 index 0000000..27e9a3a --- /dev/null +++ b/static/saclay/js/search.js @@ -0,0 +1,48 @@ +function load_search_box(){ + if (!search_url) return; + $.ajax({url: search_url}).done(function( data ) { + $("#search-box").html(data); + }); +} + +function haystack_search(evt, page){ + search_result = new Array(); + $('#categories').find('#ul_categories > li > input').attr("checked", false); + if (!$('#id_q').val()){ + $('.ac-results').remove(); + $('#search-result').html('').show('slow'); + return false; + } + + var c_url = search_url + "?q=" + $('#id_q').val(); + if (page){ + c_url += '&page=' + page; + } + $.get(c_url).done(function( data ) { + $('.ac-results').remove(); + $('#search-result').html(data).show('slow'); + }); + return false; +} + +function welcome_search(){ + if ($("#welcome").is(":visible") && $("#id_welcome_search").val()) { + $("#id_q").val($("#id_welcome_search").val()); + $("#action-search").click(); + $('#welcome').dialog('close'); + $("#haystack-search").click(); + return true; + } +} + +// disable enter +$(window).keydown(function(event){ + if (event.keyCode == 13) { + event.preventDefault(); + if (!welcome_search()){ + $("#haystack-search").click(); + } + return false; + } +}); + diff --git a/templates/chimere/base.html b/templates/chimere/base.html index 375feda..5f88092 100644 --- a/templates/chimere/base.html +++ b/templates/chimere/base.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% load chimere_tags i18n %} {% block extra_head %} +<link href='https://fonts.googleapis.com/css?family=Numans' rel='stylesheet' type='text/css'/> <link rel="shortcut icon" href="{{ STATIC_URL }}saclay/images/favicon.png"/> <link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/styles.css" /> <link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/print.css" media='print'/> diff --git a/templates/chimere/blocks/welcome.html b/templates/chimere/blocks/welcome.html index 8d7add2..66f3011 100644 --- a/templates/chimere/blocks/welcome.html +++ b/templates/chimere/blocks/welcome.html @@ -6,7 +6,7 @@ $(function(){ $('#welcome div.media-player').jmeEmbedControls(); $('#welcome video').each(function(index){$(this).pause()}); $('#welcome audio').each(function(index){$(this).pause()}); - $("#welcome").dialog({width:826, height:410, dialogClass:'welcome-dialog' + $("#welcome").dialog({width:550, height:300, dialogClass:'welcome-dialog' {% if not display %}, autoOpen:false{% endif %}, open: function () { $("#welcome_content").scrollTop(0); } }); @@ -14,47 +14,28 @@ $(function(){ // --> </script> <div id='welcome' style='display:none'> - <div class='title'> - <h2>{{title}}</h2> - </div> - {% comment %} <img src='{{STATIC_URL}}saclay/images/popup/welcome_header.png' alt='Welcome header'/> {% endcomment %} <div id='welcome_message'> - <div id='welcome_content'> - {{welcome_message|safe}} - </div> - <div id='logos'> - <a href='http://www.paris-malaquais.archi.fr/'><img alt='Paris Malaquais link' src='{{STATIC_URL}}saclay/images/popup/welcome_logo-paris-malaquais.png'/></a><a href='http://www.terreetcite.org/'><img alt='Terre et cité link' src='{{STATIC_URL}}saclay/images/popup/welcome_logo-terre-et-cite.png'/></a><a href='http://www.groupechronos.org/'><img alt='Chronos link' src='{{STATIC_URL}}saclay/images/popup/welcome_logo-chronos.png'/></a> - </div> + <h3>Trouvez</h3> + <p>un concert, du fromage de chèvre, une randonnée</p> + + <p class='welcome-search'> + <input id="id_welcome_search" name='__welcome_search__' autocomplete="off" type="text"> + <button type="button" id='haystack-search-page' class="btn btn-default"><span class="action-label">Rechercher </span><span class="glyphicon glyphicon-search"></span></button> + </p> + + + <h4>L'agenda du Plateau en 1 clic</h4> + <p> + <a href='http://saclay.carte-ouverte.org/saclay/ty/RH'><img src='http://saclay.carte-ouverte.org/media/icons/event_reunions.png' title='Réunions publiques' alt='Réunions publiques'/></a> + <a href='http://saclay.carte-ouverte.org/saclay/ty/RI'><img src='http://saclay.carte-ouverte.org/media/icons/event_conf.png' title='Conférences et projections' alt='Conférences et projections'/></a> + <a href='http://saclay.carte-ouverte.org/saclay/ty/RJ'><img src='http://saclay.carte-ouverte.org/media/icons/event_expos.png' title='Expositions et visites' alt='Expositions et visites'/></a> + <a href='http://saclay.carte-ouverte.org/saclay/ty/RO'><img src='http://saclay.carte-ouverte.org/media/icons/event_spectacle.png' title='Festivals' alt='Festivals'/></a> + <a href='http://saclay.carte-ouverte.org/saclay/ty/RN'><img src='http://saclay.carte-ouverte.org/media/icons/event_forma_ateliers.png' title='' alt=''/></a> + <a href='http://saclay.carte-ouverte.org/saclay/ty/RM'><img src='http://saclay.carte-ouverte.org/media/icons/event_brocante.png' title='' alt=''/></a> + <a href='http://saclay.carte-ouverte.org/saclay/ty/RL'><img src='http://saclay.carte-ouverte.org/media/icons/event_rando.png' title='' alt=''/></a> + <a href='http://saclay.carte-ouverte.org/saclay/ty/RK'><img src='http://saclay.carte-ouverte.org/media/icons/event_sports.png' title='' alt=''/></a> + </p> </div> - {% comment %} <div class='welcome-col'> - <div class='news'> - {% if news_lst %} - {% for news in news_lst %} - <div class='info'> - {% if news.title %} - <h4>{{news.title}} – {{ news.date }}</h4> - {{news.short_desc|safe}} - {% else %} - <h4>{{news.name}} – {{ news.start_date }}{% if news.end_date %} - {{ news.end_date }}{% endif %}</h4> - {% if news.description %} - {{news.short_desc|sanitize:"p b i br hr strong em span:style a:href:target ul li ol h1 h2 h3 h4 table td th tr"|safe}}... - {% endif %} - {% endif %} - <p class='marker_link'> - {% if news.point %} - <a href='{% get_tinyfied_url news area_name %}'>{% trans "See it on the map"%}</a> - - {% endif %} - <a href='#' class='get_more_information'>{% trans "More informations"%}</a> - {% if news.url %} - - <a href='{{news.url}}'>{% trans "Go to the event website"%}</a> - {% endif %} - </p> - </div> - {%endfor%} - {% endif %} - </div> - <div class='footer'><a href='#' class='get_more_information'>{% trans "See all news" %}</a></div> - </div>{% endcomment %} </div> <script type='text/javascript'> <!-- diff --git a/templates/chimere/main_map.html b/templates/chimere/main_map.html index 2acbba5..f1409d0 100644 --- a/templates/chimere/main_map.html +++ b/templates/chimere/main_map.html @@ -9,7 +9,7 @@ <script src="{{ STATIC_URL }}saclay/js/SaclayCloud.js" type="text/javascript"></script> <script src="{{ STATIC_URL }}saclay/js/jquery.form.js" type="text/javascript"></script> {% if has_search %} -<script src="{{ STATIC_URL }}chimere/js/search.js" type="text/javascript"></script> +<script src="{{ STATIC_URL }}saclay/js/search.js" type="text/javascript"></script> <script src="{{ STATIC_URL }}chimere/js/search-autocomplete.js" type="text/javascript"></script>{% endif %} <script type='text/javascript' language='javascript'> |