Browse Source

turning main_pages/'s html into haml

Axolotle 2 years ago
parent
commit
5399746a60

+ 12
- 10
app/templates/_macros.haml View File

@@ -1,7 +1,7 @@
1 1
 -macro podcast_box(elem):
2 2
     %div.flex
3 3
         %a.picto.content-link href='{{ url_for('main.play', id=elem.id) }}'
4
-            %svg -> %use href='#small_play'
4
+            %svg -> %use href='#small-play'
5 5
         %div.bloc.name
6 6
             %h3 -> =elem.name
7 7
             -if elem.channel.name:
@@ -16,14 +16,14 @@
16 16
 -macro link_list(group, route, word, css, open=True, close=True):
17 17
     -if group|length > 0:
18 18
         -if open:
19
-            <p class="marg {% if css %}{{ css }}{% endif %}">{{ word }}
19
+            <p class='marg {% if css %}{{ css }}{% endif %}'>{{ word }}
20 20
         -else:
21 21
             =word
22 22
         -for elem in group:
23 23
             %a.content-link href='{{ url_for(route, id=elem.id)}}'
24 24
                 =elem.name
25 25
             -if not loop.last:
26
-                ,
26
+                ,&nbsp;
27 27
         -if close:
28 28
             </p>
29 29
 
@@ -33,11 +33,11 @@
33 33
             %p
34 34
                 %a.content-link href='{{ url_for(route, id=elem.id) }}'
35 35
                     =elem.name
36
-                =>
36
+                \ =>&nbsp;
37 37
                 %a.pabo href='{{ elem.website }}'
38 38
                     =elem.website
39 39
             %p.marg
40
-                ------> {{ elem.status }}
40
+                \------> {{ elem.status }}
41 41
 
42 42
 -macro description(desc, truncate_value, css):
43 43
     -if desc:
@@ -69,25 +69,27 @@
69 69
             -if not loop.last:
70 70
                 ,
71 71
 
72
--macro pagination(pag, endpoint):
72
+-macro add_pages(pag, endpoint):
73 73
     %div.pagination -> %ul.pagination
74
-        %li class="{% if not pag.has_prev %}disabled{% endif %}"
74
+        %li class='{% if not pag.has_prev %}disabled{% endif %}'
75 75
             %a.content-link href='{% if pag.has_prev %}\
76 76
             {{ url_for(endpoint, page = pag.page - 1, **kwargs) }}\
77
-            {% else %}#{% endif %}')
77
+            {% else %}#{% endif %}'
78 78
                 &laquo;
79 79
         -for p in pag.iter_pages():
80
+            &nbsp;
80 81
             -if p:
81 82
                 %li class='{% if p == pag.page %}active{% endif %}'
82 83
                     %a.content-link \
83 84
                     href='{{ url_for(endpoint, page = p, **kwargs) }}'
84
-                        =p
85
+                        {{p}}
85 86
             -else:
86 87
                 %li.disabled
87 88
                     %a href='#'
88 89
                         &hellip;
89 90
         %li class='{% if not pag.has_next %}disabled{% endif %}'
91
+            &nbsp;
90 92
             %a.content-link href='{% if pag.has_next %}\
91
-            {{ url_for(endpoint, page = pagination.page + 1, **kwargs) }}\
93
+            {{ url_for(endpoint, page = pag.page + 1, **kwargs) }}\
92 94
             {% else %}#{% endif %}'
93 95
                 &raquo;

+ 4
- 4
app/templates/base.haml View File

@@ -23,7 +23,7 @@
23 23
             =template|safe
24 24
         -include 'player.haml'
25 25
 
26
-    %script(type='text/javascript'\
27
-            src={{ url_for('static', filename='js/player.js') }})
28
-    %script(type='text/javascript'\
29
-            src={{ url_for('static', filename='js/app.js') }})
26
+    %script(type='text/javascript' \
27
+            src='{{ url_for('static', filename='js/player.js') }}')
28
+    %script(type='text/javascript' \
29
+            src='{{ url_for('static', filename='js/app.js') }}')

+ 14
- 0
app/templates/main_pages/about.haml View File

@@ -0,0 +1,14 @@
1
+-from '_macros.haml' import description
2
+
3
+%section.second
4
+    %div.title.marg2
5
+        -include 'svg/titles/title_about.svg'
6
+    =description(page.description)
7
+
8
+%section#subscribe.principal
9
+    %h3.iconbox-title.marg << Newsletter
10
+    %div.iconbox-desc.marg
11
+        %form#ml-subscribe method='POST' \
12
+        action='https://radiorhino.eu/mailman/subscribe/news'
13
+            %input(type='text' name='email' maxlength='80' size='20' placeholder='Votre adresse email' required).
14
+            %input.marg(type='submit' value="S'inscrire" href='javascript:{}' onclick='document.getElementById("ml-subscribe").submit(); return false;').

+ 0
- 18
app/templates/main_pages/about.html View File

@@ -1,18 +0,0 @@
1
-% from "_macros.html" import description
2
-
3
-<section class="second">
4
-    <div class="title marg2">
5
-        {% include 'svg/titles/title_about.svg' %}
6
-    </div>
7
-    {{ description(page.description) -}}
8
-</section>
9
-
10
-<section id="subscribe" class="principal">
11
-  <h3 class="iconbox-title marg">Newsletter</h3>
12
-    <div class="iconbox-desc marg">
13
-    <form id="ml-subscribe" method="POST" action="https://radiorhino.eu/mailman/subscribe/news">
14
-        <input  type="text" name="email" maxlength="80" size="20" placeholder="Votre adresse email" required>
15
-        <input class="marg" type="submit" value="S'inscrire" href="javascript:{}" onclick="document.getElementById('ml-subscribe').submit(); return false;">
16
-    </form>
17
-    </div>
18
-</section>

+ 17
- 0
app/templates/main_pages/agendas.haml View File

@@ -0,0 +1,17 @@
1
+-from '_macros.haml' import description, title, more_button, add_pages
2
+
3
+%section.second
4
+    %div.title.marg2
5
+        -include 'svg/titles/title_agenda.svg'
6
+
7
+    -for elem in events:
8
+        %article.widgetBis
9
+            =title('main.agenda', elem.id, elem.name)
10
+            %p.marg
11
+                Du {{ elem.begin|format_date }} au {{ elem.end|format_date }}
12
+            -if elem.place:
13
+                %p << Lieu : {{ elem.place }}
14
+            =description(elem.description)
15
+            =more_button('main.agenda', elem.id)
16
+
17
+    =add_pages(pagination, 'main.agendas')

+ 0
- 24
app/templates/main_pages/agendas.html View File

@@ -1,24 +0,0 @@
1
-% from "_macros.html" import description, title, more_button, pagination_widget
2
-
3
-<section class="second">
4
-    <div class="title marg2">
5
-        {% include 'svg/titles/title_agenda.svg' %}
6
-    </div>
7
-
8
-    % for elem in events
9
-    <article class="widgetBis">
10
-        {{ title('main.agenda', elem.id, elem.name) -}}
11
-
12
-        <p class="marg">Du {{ elem.begin|format_date  }} au {{ elem.end|format_date }}</p>
13
-
14
-        % if elem.place
15
-        <p>Lieu : {{ elem.place }}</p>
16
-        % endif
17
-
18
-        {{ description(elem.description) -}}
19
-    </article>
20
-    {{ more_button('main.agenda', elem.id) }}
21
-    % endfor
22
-
23
-{{ pagination_widget(pagination, 'main.agendas') }}
24
-</section>

+ 17
- 0
app/templates/main_pages/blogs.haml View File

@@ -0,0 +1,17 @@
1
+-from '_macros.haml' import link_list, description, more_button, title, add_pages
2
+
3
+%section.second
4
+    %div.title
5
+        -include 'svg/titles/title_blog.svg'
6
+
7
+    -for elem in blog_posts:
8
+        %article.widgetBis
9
+            =title('main.blog', elem.id, elem.name)
10
+            %span.license
11
+                =elem.timestamp|format_date
12
+            =link_list(elem.contributors, 'main.contributor', 'Par ', close=False)
13
+            =link_list(elem.collectives, 'main.collective', ' @ ', open=False)
14
+            =description(elem.description, 200)
15
+            =more_button('main.blog', elem.id)
16
+
17
+    =add_pages(pagination, 'main.blogs')

+ 0
- 22
app/templates/main_pages/blogs.html View File

@@ -1,22 +0,0 @@
1
-% from "_macros.html" import link_list, description, more_button, title, pagination_widget
2
-
3
-<section class="second">
4
-    <div class="title">
5
-        {% include 'svg/titles/title_blog.svg' %}
6
-    </div>
7
-
8
-    % for elem in blog_posts
9
-    <article class="widgetBis">
10
-        {{ title('main.blog', elem.id, elem.name) -}}
11
-        <span class="license">{{ elem.timestamp|format_date }}</span>
12
-
13
-        {{ link_list(elem.contributors, 'main.contributor', 'Par', close=False) -}}
14
-        {{ link_list(elem.collectives, 'main.collective', ' @', open=False) -}}
15
-
16
-        {{ description(elem.description, 200) -}}
17
-    </article>
18
-    {{ more_button('main.blog', elem.id) }}
19
-    % endfor
20
-
21
-{{ pagination_widget(pagination, 'main.blogs') }}
22
-</section>

+ 13
- 0
app/templates/main_pages/channels.haml View File

@@ -0,0 +1,13 @@
1
+-from '_macros.haml' import link_list, description, more_button, title
2
+
3
+%section.second
4
+    %div.title
5
+        %h3 << Chaînes
6
+
7
+    -for elem in channels:
8
+        %article.widgetBis
9
+            =title('main.channel', elem.id, elem.name)
10
+            =link_list(elem.collectives, 'main.collective', 'Animée par ')
11
+            =link_list(elem.contributors, 'main.contributor', '')
12
+            =description(elem.description, 100)
13
+            =more_button('main.channel', elem.id)

+ 0
- 21
app/templates/main_pages/channels.html View File

@@ -1,21 +0,0 @@
1
-% from "_macros.html" import link_list, description, more_button, title
2
-
3
-<section class="second">
4
-    <div class="title">
5
-        <h3>Chaînes</h3>
6
-    </div>
7
-
8
-    % for elem in channels
9
-    <article class="widgetBis">
10
-        {{ title('main.channel', elem.id, elem.name) -}}
11
-
12
-        {{ link_list(elem.collectives, 'main.collective', 'Animée par') -}}
13
-
14
-        {{ link_list(elem.contributors, 'main.contributor', '') -}}
15
-
16
-        {{ description(elem.description, 100) -}}
17
-    </article>
18
-    {{ more_button('main.channel', elem.id) }}
19
-    % endfor
20
-
21
-</section>

+ 6
- 0
app/templates/main_pages/contribute.haml View File

@@ -0,0 +1,6 @@
1
+-from '_macros.haml' import description
2
+
3
+%section.second
4
+    %div.title.marg2
5
+        -include 'svg/titles/title_contribute.svg'
6
+    =description(page.description)

+ 0
- 8
app/templates/main_pages/contribute.html View File

@@ -1,8 +0,0 @@
1
-% from "_macros.html" import description
2
-
3
-<section class="second">
4
-    <div class="title marg2">
5
-        {% include 'svg/titles/title_contribute.svg' %}
6
-    </div>
7
-    {{ description(page.description) -}}
8
-</section>

+ 11
- 0
app/templates/main_pages/contributors.haml View File

@@ -0,0 +1,11 @@
1
+-from '_macros.haml' import contributors_list
2
+
3
+%section.solo
4
+    %div.title
5
+        -include 'svg/titles/title_contributors.svg'
6
+    =contributors_list(contributors, 'main.contributor')
7
+
8
+%section.solo
9
+    %div.title
10
+        -include 'svg/titles/title_collectives.svg'
11
+    =contributors_list(collectives, 'main.collective')

+ 0
- 17
app/templates/main_pages/contributors.html View File

@@ -1,17 +0,0 @@
1
-% from "_macros.html" import contributors_list
2
-
3
-<section class="solo">
4
-    <div class="title">
5
-        {% include 'svg/titles/title_contributors.svg' %}
6
-    </div>
7
-
8
-    {{ contributors_list(contributors, 'main.contributor') }}
9
-</section>
10
-
11
-<section class="solo">
12
-    <div class="title">
13
-        {% include 'svg/titles/title_collectives.svg' %}
14
-    </div>
15
-
16
-    {{ contributors_list(collectives, 'main.collective') }}
17
-</section>

+ 17
- 0
app/templates/main_pages/podcasts.haml View File

@@ -0,0 +1,17 @@
1
+-import '_macros.haml' as gen
2
+-include 'svg/pictos/small_play.svg'
3
+
4
+%section.solo
5
+    %div.title
6
+        -include 'svg/titles/title_podcasts.svg'
7
+    -for elem in podcasts:
8
+        %article.widgetBis
9
+            =gen.podcast_box(elem)
10
+            %span.license
11
+                =elem.date|format_date
12
+            =gen.link_list(elem.collectives, 'main.collective', 'Par', 'decal')
13
+            =gen.link_list(elem.contributors, 'main.contributor', 'Avec', 'decal')
14
+            =gen.description(elem.description, 100, 'decal')
15
+            =gen.more_button('main.podcast', elem.id)
16
+
17
+    =gen.add_pages(pagination, 'main.podcasts')

+ 0
- 22
app/templates/main_pages/podcasts.html View File

@@ -1,22 +0,0 @@
1
-% import "_macros.html" as gen
2
-{% include 'svg/pictos/small_play.svg' %}
3
-
4
-<section class="solo">
5
-    <div class="title">
6
-        {% include 'svg/titles/title_podcasts.svg' %}
7
-    </div>
8
-    % for elem in podcasts
9
-    <article class="widgetBis">
10
-        {{ gen.podcast_box(elem) }}
11
-        <span class="license">{{ elem.date|format_date }}</span>
12
-        {{ gen.link_list(elem.collectives, 'main.collective', 'Par', 'decal') -}}
13
-
14
-        {{ gen.link_list(elem.contributors, 'main.contributor', 'Avec', 'decal') -}}
15
-
16
-        {{ gen.description(elem.description, 100, 'decal') -}}
17
-    </article>
18
-    {{ gen.more_button('main.podcast', elem.id) }}
19
-    % endfor
20
-
21
-{{ gen.pagination_widget(pagination, 'main.podcasts') }}
22
-</section>

+ 1
- 1
app/templates/player.haml View File

@@ -36,5 +36,5 @@
36 36
                 %p << active :
37 37
 
38 38
     %audio#audio
39
-        %source.mp3_src(src='' type='audio/mp3')
39
+        %source.mp3_src src='' type='audio/mp3'.
40 40
         Your browser does not support the audio element.

Loading…
Cancel
Save