Browse Source

tweaked look of flash messages

php2python
Holger Frey 7 years ago
parent
commit
e06acbb26b
  1. 2
      ordr2/static/js/functions.js
  2. 2
      ordr2/templates/account/register_sucessful.jinja2
  3. 4
      ordr2/templates/macros.jinja2

2
ordr2/static/js/functions.js

@ -1 +1 @@
$(document).ready(function() { function capitalize(s){ return s.replace( /\b./g, function(a){ return a.toUpperCase(); } ); }; function generate_user_name() { var first_name = $('.registration .item-first_name input').val(); var last_name = $('.registration .item-last_name input').val(); var user_name = capitalize(first_name) + capitalize(last_name); return user_name.replace( /\s/g, '') }; // autocomplete of the username (registration form) $('.registration .item-user_name input').attr('disabled', 'disabled'); $('.registration .item-user_name input').val( generate_user_name() ); $('.registration .item-first_name input').keyup(function() { $('.registration .item-user_name input').val( generate_user_name() ); }); $('.registration .item-last_name input').keyup(function() { $('.registration .item-user_name input').val( generate_user_name() ); }); $('.registration #deformCreate_Account').click(function() { $('.registration .item-user_name input').removeAttr('disabled'); return true; }); // "dispatch" clicking a th to the corresponding anchor $('th.sortable').click( function() { window.location = $(this).children('a').attr('href'); }); // "dispatch" clicking list item in collapse to the corresponding anchor $('.accordion li').click( function() { window.location = $(this).children('a').attr('href'); }); // the mark all $('input[name="mark_all"]').click(function() { var checked_status = this.checked; $('input[name*="marked"]').each(function() { this.checked = checked_status; }); if( $('input[name="mark_all"]').is(':checked') && $('.marking-needed').is(':hidden') ) { $('.marking-needed').fadeIn("fast"); } else if( $('input[name="mark_all"]').is(':checked') && $('.marking-needed').is(':visible') ) { // do nothing } else { $('.marking-needed').fadeOut("fast"); } }); // show actions only if some data is marked $('input[name*="marked"]').change(function() { if( $('input[name*="marked"]').is(':checked') ) { if( $('.marking-needed').is(':hidden') ) $('.marking-needed').fadeIn("slow"); } else { $('.marking-needed').fadeOut("slow"); } }); // quick-actions $('.quick-action a[data-value]').click(function(event) { event.preventDefault(); var value = $(this).attr('data-value'); var action = $(this).closest('div').attr('data-action'); $('select[name*='+action+']').each(function() { $(this).val(value); }); }); // submit search $('.search-form input[type="search"]').keypress(function(event) { if( event.keyCode == 13 && $('.typeahead.dropdown-menu').is(':hidden') ) $('.search-form').submit(); }); // aside filter $('.filter input[type="checkbox"]').click( function() { if( $(this).is(':checked') ) { $(this).parents('li').addClass('active'); } else { $(this).parents('li').removeClass('active'); } }); // tooltips $('.page-controls').tooltip({ selector: "[rel=tooltip]" }); // calculator if ( $('input[name="price_unit"]').length ) { if( $('input[name="price_unit"]').val() != '' && $('input[name="quantity"]').val() != '' ){ var total = $('input[name="price_unit"]').val().replace(",", ".") * $('input[name="quantity"]').val(); total = Math.round(total*100)/100; $('input[name="price_total_disabled"]').attr( 'placeholder', total ); } $('input[name="price_unit"], input[name="quantity"]').keyup(function() { var total = $('input[name="price_unit"]').val().replace(",", ".") * $('input[name="quantity"]').val(); total = Math.round(total*100)/100; $('input[name="price_total_disabled"]').attr( 'placeholder', total ); }); } if ( $('input[name="currency"]').length ) { // added currency to total price if( $('input[name="currency"]').val() != '' ){ $('input[name="currency_disabled"]').attr( 'placeholder', $('input[name="currency"]').val() ); } $('input[name="currency"]').keyup(function() { $('input[name="currency_disabled"]').attr( 'placeholder', $('input[name="currency"]').val() ); }); $('input[name="currency"]').change(function() { $('input[name="currency_disabled"]').attr( 'placeholder', $('input[name="currency"]').val() ); }); } }); $(document).ready(function() { function capitalize(s){ return s.replace( /\b./g, function(a){ return a.toUpperCase(); } ); }; function generate_user_name() { var first_name = $('.registration .item-first_name input').val(); var last_name = $('.registration .item-last_name input').val(); var user_name = capitalize(first_name) + capitalize(last_name); return user_name.replace( /\s/g, '') }; // autocomplete of the username (registration form) $('.registration .item-user_name input').attr('disabled', 'disabled'); $('.registration .item-user_name input').val( generate_user_name() ); $('.registration .item-first_name input').keyup(function() { $('.registration .item-user_name input').val( generate_user_name() ); }); $('.registration .item-last_name input').keyup(function() { $('.registration .item-user_name input').val( generate_user_name() ); }); $('.registration #deformCreate_Account').click(function() { $('.registration .item-user_name input').removeAttr('disabled'); return true; }); // "dispatch" clicking a th to the corresponding anchor $('th.sortable').click( function() { window.location = $(this).children('a').attr('href'); }); // "dispatch" clicking list item in collapse to the corresponding anchor $('.accordion li').click( function() { window.location = $(this).children('a').attr('href'); }); // the mark all $('input[name="mark_all"]').click(function() { var checked_status = this.checked; $('input[name*="marked"]').each(function() { this.checked = checked_status; }); if( $('input[name="mark_all"]').is(':checked') && $('.marking-needed').is(':hidden') ) { $('.marking-needed').fadeIn("fast"); } else if( $('input[name="mark_all"]').is(':checked') && $('.marking-needed').is(':visible') ) { // do nothing } else { $('.marking-needed').fadeOut("fast"); } }); // show actions only if some data is marked $('input[name*="marked"]').change(function() { if( $('input[name*="marked"]').is(':checked') ) { if( $('.marking-needed').is(':hidden') ) $('.marking-needed').fadeIn("slow"); } else { $('.marking-needed').fadeOut("slow"); } }); // quick-actions $('.quick-action a[data-value]').click(function(event) { event.preventDefault(); var value = $(this).attr('data-value'); var action = $(this).closest('div').attr('data-action'); $('select[name*='+action+']').each(function() { $(this).val(value); }); }); // submit search $('.search-form input[type="search"]').keypress(function(event) { if( event.keyCode == 13 && $('.typeahead.dropdown-menu').is(':hidden') ) $('.search-form').submit(); }); // aside filter $('.filter input[type="checkbox"]').click( function() { if( $(this).is(':checked') ) { $(this).parents('li').addClass('active'); } else { $(this).parents('li').removeClass('active'); } }); // tooltips $('.page-controls').tooltip({ selector: "[rel=tooltip]" }); // calculator if ( $('input[name="price_unit"]').length ) { if( $('input[name="price_unit"]').val() != '' && $('input[name="quantity"]').val() != '' ){ var total = $('input[name="price_unit"]').val().replace(",", ".") * $('input[name="quantity"]').val(); total = Math.round(total*100)/100; $('input[name="price_total_disabled"]').attr( 'placeholder', total ); } $('input[name="price_unit"], input[name="quantity"]').keyup(function() { var total = $('input[name="price_unit"]').val().replace(",", ".") * $('input[name="quantity"]').val(); total = Math.round(total*100)/100; $('input[name="price_total_disabled"]').attr( 'placeholder', total ); }); } if ( $('input[name="currency"]').length ) { // added currency to total price if( $('input[name="currency"]').val() != '' ){ $('input[name="currency_disabled"]').attr( 'placeholder', $('input[name="currency"]').val() ); } $('input[name="currency"]').keyup(function() { $('input[name="currency_disabled"]').attr( 'placeholder', $('input[name="currency"]').val() ); }); $('input[name="currency"]').change(function() { $('input[name="currency_disabled"]').attr( 'placeholder', $('input[name="currency"]').val() ); }); } });

2
ordr2/templates/account/register_sucessful.jinja2

@ -17,7 +17,7 @@
<div class="span10 offset1"> <div class="span10 offset1">
{{ macros.flash_messages() }} {{ macros.flash_messages() }}
<div class="alert block-alert success-alert"> <div class="alert alert-info">
<h4 class="alert-heading">Not so fast!</h4> <h4 class="alert-heading">Not so fast!</h4>
<p> <p>
Before you can log in your account has first to be activated by an admin. Before you can log in your account has first to be activated by an admin.

4
ordr2/templates/macros.jinja2

@ -6,9 +6,9 @@
{% if message.dismissable %} {% if message.dismissable %}
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
{% endif %} {% endif %}
<strong>{{message.message|safe}}</strong> <h4 class="alert-heading">{{message.message|safe}}</h4>
{% if message.description %} {% if message.description %}
<br>{{message.description|safe}} <p>{{message.description|safe}}</p>
{% endif %} {% endif %}
</div> </div>
{% endfor %} {% endfor %}