Projet

Général

Profil

0001-new-theme-braine-l-alleud-53844.patch

Nicolas Roche, 12 mai 2021 19:26

Télécharger (13,7 ko)

Voir les différences:

Subject: [PATCH] new theme: braine-l-alleud (#53844)

 static/braine-l-alleud/_custom.scss           |  25 +++++++
 static/braine-l-alleud/_tiles.scss            |  70 ++++++++++++++++++
 static/braine-l-alleud/_vars.scss             |  20 +++++
 static/braine-l-alleud/config.json            |  24 ++++++
 static/braine-l-alleud/extra.js               |  52 +++++++++++++
 static/braine-l-alleud/img/coeur-plein.png    | Bin 0 -> 1028 bytes
 static/braine-l-alleud/img/coeur-rouge.png    | Bin 0 -> 1035 bytes
 static/braine-l-alleud/img/coeur-vide.png     | Bin 0 -> 1537 bytes
 static/braine-l-alleud/style.scss             |   6 ++
 .../combo/json/activite-favorite.html         |  28 +++++++
 10 files changed, 225 insertions(+)
 create mode 100644 static/braine-l-alleud/_custom.scss
 create mode 100644 static/braine-l-alleud/_tiles.scss
 create mode 100644 static/braine-l-alleud/_vars.scss
 create mode 100644 static/braine-l-alleud/config.json
 create mode 100644 static/braine-l-alleud/extra.js
 create mode 100644 static/braine-l-alleud/img/coeur-plein.png
 create mode 100644 static/braine-l-alleud/img/coeur-rouge.png
 create mode 100644 static/braine-l-alleud/img/coeur-vide.png
 create mode 100644 static/braine-l-alleud/style.scss
 create mode 100644 templates/variants/braine-l-alleud/combo/json/activite-favorite.html
static/braine-l-alleud/_custom.scss
1
#header #top #logo a {
2
	height: 100px;
3
	line-height: 100px;
4
	color: $primary-color;
5
	text-transform: uppercase;
6
	font-weight: normal;
7
}
8

  
9
#nav-wrapper {
10
	background: $nav-background;
11
	border-top: 1px solid #EAEAEA;
12
	border-bottom: 1px solid #EAEAEA;
13
	margin-bottom: 10px;
14
	div#nav > ul > li > a {
15
		border-radius: $border-radius;
16
	}
17
}
18

  
19
@media screen and ($max-mobile-viewport) {
20
	#header #top #logo a {
21
		display: block;
22
		height: 75px;
23
		overflow: hidden;
24
	}
25
}
static/braine-l-alleud/_tiles.scss
1

  
2
.dashboard-cell-icons {
3
	position: absolute;
4
	right: 0rem;
5
	top: 0rem;
6
	z-index: 100;
7
}
8

  
9
.dashboard-cell-icons .add-to-dashboard,
10
.dashboard-cell-icons .remove-from-dashboard {
11
	display: inline-block;
12
	width: 41px;
13
	height: 37px;
14
	background: none center center no-repeat;
15
	background-size: 1rem;
16
	&.remove-from-dashboard {
17
		background-image: url(img/coeur-rouge.png);
18
		&:hover {
19
			background-image: url(img/coeur-vide.png);
20
		}
21
	}
22
	&.add-to-dashboard {
23
		background-image: url(img/coeur-vide.png);
24
		&:hover {
25
			background-image: url(img/coeur-rouge.png);
26
		}
27
	}
28
	&.remove-from-dashboard.new, &.add-to-dashboard.new {
29
		&::after {
30
			content: "";
31
			display: block;
32
			background-image: url(img/coeur-rouge.png);
33
			width: 100%;
34
			height: 100%;
35
			animation-name: favorite_pulse_animation;
36
			animation-duration: 3000ms;
37
			animation-iteration-count: 1;
38
			animation-timing-function: linear;
39
			opacity: 0;
40
		}
41
	}
42
}
43

  
44
@keyframes favorite_pulse_animation {
45
	0% { transform: scale(0.5); opacity: 1;}
46
	20% { transform: scale(1); }
47
	40% { transform: scale(0.5); opacity: 1;}
48
	60% { transform: scale(1); }
49
	80% { transform: scale(0.5); }
50
	100% { opacity: 0; display: black; }
51
}
52

  
53
.gru-content .dashboard-cell {
54
	border: 0;
55
	.cell {
56
		margin-left: 0;
57
		margin-right: 0;
58
	}
59
}
60

  
61
.activite-favorite {
62
	position: relative;
63
	h3 {
64
		@extend %title;
65
		background: #019D8B;
66
	}
67
	.activite-favorite-content {
68
		margin-left: 1rem;
69
	}
70
}
static/braine-l-alleud/_vars.scss
1
$primary-color: #018B9D;
2

  
3
$width: 1160px;
4
$font-color: #666;
5
$font-size: 0.938em;
6
$nav-background: #fafafa;
7
$nav-submenu-background: #eee;
8
$nav-submenu-color: #333;
9
$nav-color: $font-color;
10
$nav-active-color: $primary-color;
11
$nav-item-selected-color: white;
12
$nav-item-hover-color: white;
13
$border-radius: 4px;
14
$button-background: $primary-color;
15
$title-background: $primary-color;
16
$title-color: white;
17
$nav-mobile-mode: bottom-bar;
18

  
19
$cell-image-position: top;
20
$cell-image-padding: none;
static/braine-l-alleud/config.json
1
{
2
  "label": "Braine l'Alleud",
3
  "variables": {
4
    "theme_color": "#018B9D"
5
  },
6
  "settings": {
7
    "combo": {
8
      "COMBO_ASSET_SLOTS.update": {
9
        "header:background": { "label": "Têtière : fond" },
10
        "header:logo": { "label": "Têtière : logo" }
11
      },
12
      "JSON_CELL_TYPES.update": {
13
        "activite-favorite": {
14
          "url": "https://perso.entrouvert.org/~nroche/contenu.json",
15
          "name": "Activité favorite",
16
          "cache_duration": 60,
17
          "force_async": false,
18
          "form": [{"varname": "activite", "type": "string", "label": "Activité"}]
19
        }
20
      }
21
    }
22
  }
23
}
24

  
static/braine-l-alleud/extra.js
1
$(function() {
2
  var $sidebar = $('#sidebar');
3

  
4
  /* add & remove tile */
5
  $('div.cell, div#sidebar').delegate('a.remove-from-dashboard', 'click', function(e) {
6
    var dashboard = $(this).parents('.dashboardcell');
7
    var cell = $(this).parents('.cell')[0];
8
    var link = $(this);
9
    $.ajax({
10
      url: $(this).attr('href'),
11
      success: function(data) {
12
        if (dashboard.length) {
13
          /* if the user is on the dashboard, remove tile from screen */
14
          $(cell).hide({
15
            duration: 300,
16
            complete: function() {
17
              $(cell).remove();
18
            }
19
          });
20
        } else {
21
          $(link).hide();
22
          $(link).parent().find('.cell-added').remove();
23
          var $add_to_dashboard = $('<a class="add-to-dashboard new"></a>');
24
          $add_to_dashboard.attr('href', data.cell_data.add_url);
25
          $add_to_dashboard.appendTo($(link).parent());
26
          $(link).remove();
27
        }
28
      }
29
    });
30
    e.stopPropagation();
31
    return false;
32
  });
33
  $('div.cell, div#sidebar').delegate('a.add-to-dashboard', 'click', function(e) {
34
    var link = $(this);
35
    $.ajax({
36
      url: $(this).attr('href'),
37
      success: function(data) {
38
        $(link).hide();
39
        var $added_info = $('<span class="cell-added">Ajouté à votre tableau de bord</span>');
40
        $added_info.appendTo($(link).parent());
41
        setTimeout(function() { $added_info.remove(); }, 3000);
42
        var $remove_from_dashboard = $('<a class="remove-from-dashboard new"></a>');
43
        $remove_from_dashboard.attr('href', data.cell_data.remove_url);
44
        $remove_from_dashboard.appendTo($(link).parent());
45
        $(link).remove();
46
      }
47
    });
48
    e.stopPropagation();
49
    return false;
50
  });
51

  
52
});
static/braine-l-alleud/style.scss
1
@charset "UTF-8";
2

  
3
@import 'vars';
4
@import '../includes/publik';
5
@import 'tiles';
6
@import 'custom';
templates/variants/braine-l-alleud/combo/json/activite-favorite.html
1
{% load dashboard %}
2

  
3
<h3>
4
  Activité {{ activite }}
5
</h3>
6

  
7
<div class="activite-favorite-content">
8
  {% include "combo/dashboard_cell_icons.html" %}
9

  
10
  {% if not in_dashboard %}
11

  
12
  Desciptif de l'activité {{ activite }}
13

  
14
  {% else %}
15

  
16
  Contenu :
17
  <ul>
18
    {% for content in json.data %}
19
    <li>
20
      <a href="{{ content.url }}">
21
        {{ content.title }}
22
      </a>
23
    </li>
24
    {% endfor %}
25
  </ul>
26

  
27
  {% endif %}
28
</div>
0
-