Skip to content

Commit 75fe527

Browse files
authored
Merge pull request #368 from linuxfrorg/fix_link_preview
Fix #2057 Affichage de la langue du lien en prévisualisation
2 parents f546634 + 003877e commit 75fe527

File tree

6 files changed

+28
-6
lines changed

6 files changed

+28
-6
lines changed

app/assets/javascripts/application.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ $("textarea, #form_answers input").keypress (event) ->
3333

3434
# Add/Remove dynamically links in the news form
3535
langs =
36+
xx: "!? hmmm ?!"
3637
fr: "Français"
3738
de: "Allemand"
3839
en: "Anglais"
3940
eu: "Basque"
4041
ct: "Catalan"
4142
cn: "Chinois"
43+
wq: "Code/binaire"
4244
ko: "Coréen"
4345
da: "Danois"
4446
es: "Espagnol"
@@ -53,8 +55,6 @@ langs =
5355
pt: "Portugais"
5456
ru: "Russe"
5557
sv: "Suédois"
56-
xx: "!? hmmm ?!"
57-
wq: "Code/binaire"
5858

5959
$("#form_links").nested_fields "news", "link", "lien", "fieldset", title: "text", url: "url", lang: langs
6060
$("#form_answers").nested_fields "poll", "answer", "choix", "p", answer: "text"

app/assets/stylesheets/contrib/grayscale.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,6 +2311,11 @@ form#new_diary > p:nth-child(4) {
23112311
position: relative;
23122312
top: 2px;
23132313
}
2314+
*:not(.markItUpHeader) > ul > .link[lang="ee"]:before {
2315+
content: url("/images/langs/ee.png");
2316+
position: relative;
2317+
top: 2px;
2318+
}
23142319
*:not(.markItUpHeader) > ul > .link[lang="el"]:before {
23152320
content: url("/images/contrib/grayscale/flags/el.png");
23162321
position: relative;
@@ -2391,6 +2396,11 @@ form#new_diary > p:nth-child(4) {
23912396
position: relative;
23922397
top: 2px;
23932398
}
2399+
*:not(.markItUpHeader) > ul > .link[lang="wq"]:before {
2400+
content: url("/images/langs/wq.png");
2401+
position: relative;
2402+
top: 2px;
2403+
}
23942404
#phare .link,
23952405
#phare .meta,
23962406
#phare footer {

app/assets/stylesheets/contrib/kaiska-new.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,9 @@ li.link[lang="da"] {
763763
li.link[lang="de"] {
764764
list-style: url("/images/langs/de.png");
765765
}
766+
li.link[lang="ee"] {
767+
list-style: url("/images/langs/ee.png");
768+
}
766769
li.link[lang="el"] {
767770
list-style: url("/images/langs/el.png");
768771
}
@@ -811,6 +814,9 @@ li.link[lang="sv"] {
811814
li.link[lang="xx"] {
812815
list-style: url("/images/langs/xx.png");
813816
}
817+
li.link[lang="wq"] {
818+
list-style: url("/images/langs/wq.png");
819+
}
814820

815821
div.content a[href^="/wiki/"],
816822
div.content a[href^="//linuxfr.org/wiki/"] {

app/assets/stylesheets/contrib/solarized/langs.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ li.link[lang="da"] {
1515
li.link[lang="de"] {
1616
list-style-image: url("/images/langs/de.png");
1717
}
18+
li.link[lang="ee"] {
19+
list-style-image: url("/images/langs/ee.png");
20+
}
1821
li.link[lang="el"] {
1922
list-style-image: url("/images/langs/el.png");
2023
}
@@ -63,3 +66,6 @@ li.link[lang="sv"] {
6366
li.link[lang="xx"] {
6467
list-style-image: url("/images/langs/xx.png");
6568
}
69+
li.link[lang="wq"] {
70+
list-style-image: url("/images/langs/wq.png");
71+
}

app/views/bookmarks/_preview.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
- c.image = mini_avatar_img(preview.node.user)
44
- c.body = capture do
55
%ul
6-
%li{lang: preview.lang}= "#{link_to preview.link, preview.link, hreflang: preview.lang}".html_safe
6+
%li.link{lang: preview.lang}= "#{link_to preview.link, preview.link, hreflang: preview.lang}".html_safe

db/seeds.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
Logo.image = '/images/logos/linuxfr2_classic.png'
55

66
# Langs
7-
Lang['fr'] = 'Français'
7+
Lang['xx'] = '!? hmmm ?!' # default choice
8+
Lang['fr'] = 'Français' # main language, then others sorted
89
Lang['de'] = 'Allemand'
910
Lang['en'] = 'Anglais'
1011
Lang['eu'] = 'Basque'
1112
Lang['ct'] = 'Catalan'
1213
Lang['cn'] = 'Chinois'
14+
Lang['wq'] = 'Code/binaire'
1315
Lang['ko'] = 'Coréen'
1416
Lang['da'] = 'Danois'
1517
Lang['es'] = 'Espagnol'
@@ -24,8 +26,6 @@
2426
Lang['pt'] = 'Portugais'
2527
Lang['ru'] = 'Russe'
2628
Lang['sv'] = 'Suédois'
27-
Lang['xx'] = '!? hmmm ?!'
28-
Lang['wq'] = 'Code/binaire'
2929

3030
# Category
3131
%w(Autres Administration\ site Commentaires Feuilles\ de\ style\ (CSS) Dépêches Forums Journaux Modération Proposition Recherche Sondages Suivi Barre\ d’outils Tribune Wiki Avatars Étiquettes Vieux\ navigateurs Comptes\ utilisateurs Statistiques Rédaction Administration\ système À\ ranger\ quelque\ part Aide\ et\ documentation Notifications Syntaxe\ markdown API\ OAuth Images Flux\ Atom Epub Liens).each do |cat|

0 commit comments

Comments
 (0)