Projet

Général

Profil

0001-gers-cd32-add-assets-on-link-cell-48011.patch

Nicolas Roche, 03 novembre 2020 19:07

Télécharger (3,07 ko)

Voir les différences:

Subject: [PATCH] gers-cd32: add assets on link-cell (#48011)

 static/gers-cd32/_custom.scss                 | 37 +++++++++++++++++++
 static/gers-cd32/config.json                  |  5 +++
 .../variants/gers-cd32/combo/link-cell.html   | 16 ++++++++
 3 files changed, 58 insertions(+)
 create mode 100644 templates/variants/gers-cd32/combo/link-cell.html
static/gers-cd32/_custom.scss
95 95
	display: block;
96 96
}
97 97

  
98 98
#sidebar {
99 99
	box-shadow: 3px 3px 20px 0px #dedede;
100 100
	margin-right: 2.5em;
101 101
}
102 102

  
103
@mixin after-line($color: #cbd05d) {
104
	&::after {
105
		display: block;
106
		margin-top: 0.5em;
107
		content: '';
108
		background: $color;
109
		width: 2em;
110
		height: 2px;
111
	}
112
}
113

  
114
div.linkcell.has-asset-picture {
115
	border: 1px solid $secondary-color;
116
	text-transform: uppercase;
117
	font-size: 90%;
118
	&:hover {
119
		background-color: $secondary-color;
120
	}
121
	@media screen and ($max-mobile-viewport) {
122
		box-sizing: content-box;
123
	}
124
	a.image-link {
125
		padding: 5rem 0 0.5em 1.5em;
126
		background-position: 1rem 1rem;
127
		background-size: auto 2.5rem;
128
		background-repeat: no-repeat;
129
		display: block;
130
		@include after-line(#000);
131
		@media screen and ($max-mobile-viewport) {
132
			padding-top: 1rem;
133
			padding-left: 5rem;
134
			background-position: 1rem center;
135
		}
136
		text-decoration: none;
137
	}
138
}
139

  
103 140
@mixin form-icon($content) {
104 141
	content: $content;
105 142
	font-family: FontAwesome;
106 143
}
107 144

  
108 145
div#footer-wrapper {
109 146
	padding: 66px 0 73px;
110 147
}
static/gers-cd32/config.json
4 4
    "logo_link_url": "/",
5 5
    "theme_color": "#ae2217"
6 6
  },
7 7
  "settings": {
8 8
    "combo": {
9 9
      "COMBO_ASSET_SLOTS.update": {
10 10
        "header:background": { "label": "Têtière : fond" },
11 11
        "header:logo": { "label": "Têtière : logo" }
12
      },
13
      "COMBO_CELL_ASSET_SLOTS.update": {
14
        "data_linkcell": {
15
          "picture": {"prefix": "Image"}
16
        }
12 17
      }
13 18
    }
14 19
  }
15 20
}
templates/variants/gers-cd32/combo/link-cell.html
1
{% load assets %}
2
{% get_asset cell=cell type='picture' as asset %}
3

  
4
{% if asset.asset.url %}
5
<a class="image-link" href="{{url}}" style="background-image: url({{asset.asset.url}})">
6
<div>
7
  <strong>{{ title }}</strong>
8
  {% if cell.link_page.description %}<p>{{ cell.link_page.description }}</p>{% endif %}
9
</div>
10
</a>
11
{% else %}
12
{% block cell-content %}
13
{% include "combo/asset_picture_fragment.html" %}
14
<a href="{{url}}">{{title}}</a>
15
{% endblock %}
16
{% endif %}
0
-