diff --git a/package.json b/package.json index a733cdebb2..5aee89a816 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "1.4.3", + "version": "1.4.4", "homepage": "http://www.nodebb.org", "repository": { "type": "git", diff --git a/public/language/de/admin/advanced/events.json b/public/language/de/admin/advanced/events.json index 15976369c3..6ed2a251da 100644 --- a/public/language/de/admin/advanced/events.json +++ b/public/language/de/admin/advanced/events.json @@ -1,6 +1,6 @@ { - "events": "Veranstaltungen", - "no-events": "Es gibt keine Veranstaltungen", - "control-panel": "Veranstaltungen Steuerung", - "delete-events": "Veranstaltungen löschen" + "events": "Ereignisse", + "no-events": "Es gibt keine Ereignisse", + "control-panel": "Ereignis-Steuerung", + "delete-events": "Ereignisse löschen" } \ No newline at end of file diff --git a/public/language/tr/admin/settings/user.json b/public/language/tr/admin/settings/user.json index 258f7f4121..dd7154fc35 100644 --- a/public/language/tr/admin/settings/user.json +++ b/public/language/tr/admin/settings/user.json @@ -7,14 +7,14 @@ "allow-login-with": "Allow login with", "allow-login-with.username-email": "Kullanıcı adı veya Email", "allow-login-with.username": "Sadece kullanıcı adı", - "allow-login-with.email": "Email Only", + "allow-login-with.email": "Sadece Email", "account-settings": "Hesap Ayarları", - "disable-username-changes": "Disable username changes", - "disable-email-changes": "Disable email changes", - "disable-password-changes": "Disable password changes", - "allow-account-deletion": "Allow account deletion", - "user-info-private": "Make user info private", - "themes": "Themes", + "disable-username-changes": "Kullanıcı adı değişikliği kapalı", + "disable-email-changes": "Email değişikliği kapalı", + "disable-password-changes": "Parola değişikliği kapalı", + "allow-account-deletion": "Hesap silmeye izin ver", + "user-info-private": "Kullanıcı bilgilerini gizli yap", + "themes": "Temalar", "disable-user-skins": "Prevent users from choosing a custom skin", "account-protection": "Account Protection", "login-attempts": "Login attempts per hour", @@ -23,13 +23,13 @@ "login-days": "Days to remember user login sessions", "password-expiry-days": "Force password reset after a set number of days", "registration": "User Registration", - "registration-type": "Registration Type", + "registration-type": "Kayıt Tipi", "registration-type.normal": "Normal", - "registration-type.admin-approval": "Admin Approval", - "registration-type.admin-approval-ip": "Admin Approval for IPs", - "registration-type.invite-only": "Invite Only", - "registration-type.admin-invite-only": "Admin Invite Only", - "registration-type.disabled": "No registration", + "registration-type.admin-approval": "Yönetici Onayı", + "registration-type.admin-approval-ip": "IP'ler için Yönetici Onayı", + "registration-type.invite-only": "Sadece Davet", + "registration-type.admin-invite-only": "Sadece Yönetici Daveti", + "registration-type.disabled": "Kayıt yok", "registration-type.help": "Normal - Users can register from the /register page.
\nAdmin Approval - User registrations are placed in an approval queue for administrators.
\nAdmin Approval for IPs - Normal for new users, Admin Approval for IP addresses that already have an account.
\nInvite Only - Users can invite others from the users page.
\nAdmin Invite Only - Only administrators can invite others from users and admin/manage/users pages.
\nNo registration - No user registration.
", "registration.max-invites": "Maximum Invitations per User", "max-invites": "Maximum Invitations per User", diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js index 79fff176ec..7e93618cc7 100644 --- a/public/src/modules/helpers.js +++ b/public/src/modules/helpers.js @@ -102,19 +102,18 @@ helpers.generateChildrenCategories = function (category) { var html = ''; var relative_path = (typeof config !== 'undefined' ? config.relative_path : require('nconf').get('relative_path')); - if (!category || !category.children) { + if (!category || !category.children || !category.children.length) { return html; } category.children.forEach(function (child) { - if (!child) { - return; + if (child) { + var link = child.link ? child.link : (relative_path + '/category/' + child.slug); + html += '' + + '' + + '' + + '' + + '' + child.name + ' '; } - var link = child.link ? child.link : (relative_path + '/category/' + child.slug); - html += '' + - '' + - '' + - '' + - '' + child.name + ' '; }); html = html ? ('' + html + '') : html; return html; @@ -142,10 +141,6 @@ return style.join(' '); }; - helpers.getBookmarkFromIndex = function (topic) { - return (topic.index || 0) + 1; - }; - helpers.displayUserSearch = function (data, allowGuestUserSearching) { return data.loggedIn || allowGuestUserSearching === 'true'; }; diff --git a/public/vendor/fontawesome/fonts/FontAwesome.otf b/public/vendor/fontawesome/fonts/FontAwesome.otf index d4de13e832..401ec0f36e 100644 Binary files a/public/vendor/fontawesome/fonts/FontAwesome.otf and b/public/vendor/fontawesome/fonts/FontAwesome.otf differ diff --git a/public/vendor/fontawesome/fonts/fontawesome-webfont.eot b/public/vendor/fontawesome/fonts/fontawesome-webfont.eot index c7b00d2ba8..e9f60ca953 100644 Binary files a/public/vendor/fontawesome/fonts/fontawesome-webfont.eot and b/public/vendor/fontawesome/fonts/fontawesome-webfont.eot differ diff --git a/public/vendor/fontawesome/fonts/fontawesome-webfont.svg b/public/vendor/fontawesome/fonts/fontawesome-webfont.svg index 8b66187fe0..855c845e53 100644 --- a/public/vendor/fontawesome/fonts/fontawesome-webfont.svg +++ b/public/vendor/fontawesome/fonts/fontawesome-webfont.svg @@ -1,685 +1,2671 @@ - - + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/vendor/fontawesome/fonts/fontawesome-webfont.ttf b/public/vendor/fontawesome/fonts/fontawesome-webfont.ttf index f221e50a2e..35acda2fa1 100644 Binary files a/public/vendor/fontawesome/fonts/fontawesome-webfont.ttf and b/public/vendor/fontawesome/fonts/fontawesome-webfont.ttf differ diff --git a/public/vendor/fontawesome/fonts/fontawesome-webfont.woff b/public/vendor/fontawesome/fonts/fontawesome-webfont.woff index 6e7483cf61..400014a4b0 100644 Binary files a/public/vendor/fontawesome/fonts/fontawesome-webfont.woff and b/public/vendor/fontawesome/fonts/fontawesome-webfont.woff differ diff --git a/public/vendor/fontawesome/fonts/fontawesome-webfont.woff2 b/public/vendor/fontawesome/fonts/fontawesome-webfont.woff2 index 7eb74fd127..4d13fc6040 100644 Binary files a/public/vendor/fontawesome/fonts/fontawesome-webfont.woff2 and b/public/vendor/fontawesome/fonts/fontawesome-webfont.woff2 differ diff --git a/public/vendor/fontawesome/less/font-awesome.less b/public/vendor/fontawesome/less/font-awesome.less index c44e5f466a..c3677def31 100644 --- a/public/vendor/fontawesome/less/font-awesome.less +++ b/public/vendor/fontawesome/less/font-awesome.less @@ -1,5 +1,5 @@ /*! - * Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) */ diff --git a/public/vendor/fontawesome/less/icons.less b/public/vendor/fontawesome/less/icons.less index ba21b222d6..159d600425 100644 --- a/public/vendor/fontawesome/less/icons.less +++ b/public/vendor/fontawesome/less/icons.less @@ -605,6 +605,7 @@ .@{fa-css-prefix}-opencart:before { content: @fa-var-opencart; } .@{fa-css-prefix}-expeditedssl:before { content: @fa-var-expeditedssl; } .@{fa-css-prefix}-battery-4:before, +.@{fa-css-prefix}-battery:before, .@{fa-css-prefix}-battery-full:before { content: @fa-var-battery-full; } .@{fa-css-prefix}-battery-3:before, .@{fa-css-prefix}-battery-three-quarters:before { content: @fa-var-battery-three-quarters; } @@ -731,3 +732,58 @@ .@{fa-css-prefix}-google-plus-official:before { content: @fa-var-google-plus-official; } .@{fa-css-prefix}-fa:before, .@{fa-css-prefix}-font-awesome:before { content: @fa-var-font-awesome; } +.@{fa-css-prefix}-handshake-o:before { content: @fa-var-handshake-o; } +.@{fa-css-prefix}-envelope-open:before { content: @fa-var-envelope-open; } +.@{fa-css-prefix}-envelope-open-o:before { content: @fa-var-envelope-open-o; } +.@{fa-css-prefix}-linode:before { content: @fa-var-linode; } +.@{fa-css-prefix}-address-book:before { content: @fa-var-address-book; } +.@{fa-css-prefix}-address-book-o:before { content: @fa-var-address-book-o; } +.@{fa-css-prefix}-vcard:before, +.@{fa-css-prefix}-address-card:before { content: @fa-var-address-card; } +.@{fa-css-prefix}-vcard-o:before, +.@{fa-css-prefix}-address-card-o:before { content: @fa-var-address-card-o; } +.@{fa-css-prefix}-user-circle:before { content: @fa-var-user-circle; } +.@{fa-css-prefix}-user-circle-o:before { content: @fa-var-user-circle-o; } +.@{fa-css-prefix}-user-o:before { content: @fa-var-user-o; } +.@{fa-css-prefix}-id-badge:before { content: @fa-var-id-badge; } +.@{fa-css-prefix}-drivers-license:before, +.@{fa-css-prefix}-id-card:before { content: @fa-var-id-card; } +.@{fa-css-prefix}-drivers-license-o:before, +.@{fa-css-prefix}-id-card-o:before { content: @fa-var-id-card-o; } +.@{fa-css-prefix}-quora:before { content: @fa-var-quora; } +.@{fa-css-prefix}-free-code-camp:before { content: @fa-var-free-code-camp; } +.@{fa-css-prefix}-telegram:before { content: @fa-var-telegram; } +.@{fa-css-prefix}-thermometer-4:before, +.@{fa-css-prefix}-thermometer:before, +.@{fa-css-prefix}-thermometer-full:before { content: @fa-var-thermometer-full; } +.@{fa-css-prefix}-thermometer-3:before, +.@{fa-css-prefix}-thermometer-three-quarters:before { content: @fa-var-thermometer-three-quarters; } +.@{fa-css-prefix}-thermometer-2:before, +.@{fa-css-prefix}-thermometer-half:before { content: @fa-var-thermometer-half; } +.@{fa-css-prefix}-thermometer-1:before, +.@{fa-css-prefix}-thermometer-quarter:before { content: @fa-var-thermometer-quarter; } +.@{fa-css-prefix}-thermometer-0:before, +.@{fa-css-prefix}-thermometer-empty:before { content: @fa-var-thermometer-empty; } +.@{fa-css-prefix}-shower:before { content: @fa-var-shower; } +.@{fa-css-prefix}-bathtub:before, +.@{fa-css-prefix}-s15:before, +.@{fa-css-prefix}-bath:before { content: @fa-var-bath; } +.@{fa-css-prefix}-podcast:before { content: @fa-var-podcast; } +.@{fa-css-prefix}-window-maximize:before { content: @fa-var-window-maximize; } +.@{fa-css-prefix}-window-minimize:before { content: @fa-var-window-minimize; } +.@{fa-css-prefix}-window-restore:before { content: @fa-var-window-restore; } +.@{fa-css-prefix}-times-rectangle:before, +.@{fa-css-prefix}-window-close:before { content: @fa-var-window-close; } +.@{fa-css-prefix}-times-rectangle-o:before, +.@{fa-css-prefix}-window-close-o:before { content: @fa-var-window-close-o; } +.@{fa-css-prefix}-bandcamp:before { content: @fa-var-bandcamp; } +.@{fa-css-prefix}-grav:before { content: @fa-var-grav; } +.@{fa-css-prefix}-etsy:before { content: @fa-var-etsy; } +.@{fa-css-prefix}-imdb:before { content: @fa-var-imdb; } +.@{fa-css-prefix}-ravelry:before { content: @fa-var-ravelry; } +.@{fa-css-prefix}-eercast:before { content: @fa-var-eercast; } +.@{fa-css-prefix}-microchip:before { content: @fa-var-microchip; } +.@{fa-css-prefix}-snowflake-o:before { content: @fa-var-snowflake-o; } +.@{fa-css-prefix}-superpowers:before { content: @fa-var-superpowers; } +.@{fa-css-prefix}-wpexplorer:before { content: @fa-var-wpexplorer; } +.@{fa-css-prefix}-meetup:before { content: @fa-var-meetup; } diff --git a/public/vendor/fontawesome/less/variables.less b/public/vendor/fontawesome/less/variables.less index a2019dcadc..1620d22dd7 100644 --- a/public/vendor/fontawesome/less/variables.less +++ b/public/vendor/fontawesome/less/variables.less @@ -4,14 +4,18 @@ @fa-font-path: "./vendor/fontawesome/fonts"; @fa-font-size-base: 14px; @fa-line-height-base: 1; -//@fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.6.3/fonts"; // for referencing Bootstrap CDN font files directly +//@fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.7.0/fonts"; // for referencing Bootstrap CDN font files directly @fa-css-prefix: fa; -@fa-version: "4.6.3"; +@fa-version: "4.7.0"; @fa-border-color: #eee; @fa-inverse: #fff; @fa-li-width: (30em / 14); @fa-var-500px: "\f26e"; +@fa-var-address-book: "\f2b9"; +@fa-var-address-book-o: "\f2ba"; +@fa-var-address-card: "\f2bb"; +@fa-var-address-card-o: "\f2bc"; @fa-var-adjust: "\f042"; @fa-var-adn: "\f170"; @fa-var-align-center: "\f037"; @@ -60,11 +64,15 @@ @fa-var-backward: "\f04a"; @fa-var-balance-scale: "\f24e"; @fa-var-ban: "\f05e"; +@fa-var-bandcamp: "\f2d5"; @fa-var-bank: "\f19c"; @fa-var-bar-chart: "\f080"; @fa-var-bar-chart-o: "\f080"; @fa-var-barcode: "\f02a"; @fa-var-bars: "\f0c9"; +@fa-var-bath: "\f2cd"; +@fa-var-bathtub: "\f2cd"; +@fa-var-battery: "\f240"; @fa-var-battery-0: "\f244"; @fa-var-battery-1: "\f243"; @fa-var-battery-2: "\f242"; @@ -214,19 +222,25 @@ @fa-var-dot-circle-o: "\f192"; @fa-var-download: "\f019"; @fa-var-dribbble: "\f17d"; +@fa-var-drivers-license: "\f2c2"; +@fa-var-drivers-license-o: "\f2c3"; @fa-var-dropbox: "\f16b"; @fa-var-drupal: "\f1a9"; @fa-var-edge: "\f282"; @fa-var-edit: "\f044"; +@fa-var-eercast: "\f2da"; @fa-var-eject: "\f052"; @fa-var-ellipsis-h: "\f141"; @fa-var-ellipsis-v: "\f142"; @fa-var-empire: "\f1d1"; @fa-var-envelope: "\f0e0"; @fa-var-envelope-o: "\f003"; +@fa-var-envelope-open: "\f2b6"; +@fa-var-envelope-open-o: "\f2b7"; @fa-var-envelope-square: "\f199"; @fa-var-envira: "\f299"; @fa-var-eraser: "\f12d"; +@fa-var-etsy: "\f2d7"; @fa-var-eur: "\f153"; @fa-var-euro: "\f153"; @fa-var-exchange: "\f0ec"; @@ -294,6 +308,7 @@ @fa-var-forumbee: "\f211"; @fa-var-forward: "\f04e"; @fa-var-foursquare: "\f180"; +@fa-var-free-code-camp: "\f2c5"; @fa-var-frown-o: "\f119"; @fa-var-futbol-o: "\f1e3"; @fa-var-gamepad: "\f11b"; @@ -326,6 +341,7 @@ @fa-var-google-wallet: "\f1ee"; @fa-var-graduation-cap: "\f19d"; @fa-var-gratipay: "\f184"; +@fa-var-grav: "\f2d6"; @fa-var-group: "\f0c0"; @fa-var-h-square: "\f0fd"; @fa-var-hacker-news: "\f1d4"; @@ -342,6 +358,7 @@ @fa-var-hand-scissors-o: "\f257"; @fa-var-hand-spock-o: "\f259"; @fa-var-hand-stop-o: "\f256"; +@fa-var-handshake-o: "\f2b5"; @fa-var-hard-of-hearing: "\f2a4"; @fa-var-hashtag: "\f292"; @fa-var-hdd-o: "\f0a0"; @@ -365,8 +382,12 @@ @fa-var-houzz: "\f27c"; @fa-var-html5: "\f13b"; @fa-var-i-cursor: "\f246"; +@fa-var-id-badge: "\f2c1"; +@fa-var-id-card: "\f2c2"; +@fa-var-id-card-o: "\f2c3"; @fa-var-ils: "\f20b"; @fa-var-image: "\f03e"; +@fa-var-imdb: "\f2d8"; @fa-var-inbox: "\f01c"; @fa-var-indent: "\f03c"; @fa-var-industry: "\f275"; @@ -404,6 +425,7 @@ @fa-var-link: "\f0c1"; @fa-var-linkedin: "\f0e1"; @fa-var-linkedin-square: "\f08c"; +@fa-var-linode: "\f2b8"; @fa-var-linux: "\f17c"; @fa-var-list: "\f03a"; @fa-var-list-alt: "\f022"; @@ -436,8 +458,10 @@ @fa-var-meanpath: "\f20c"; @fa-var-medium: "\f23a"; @fa-var-medkit: "\f0fa"; +@fa-var-meetup: "\f2e0"; @fa-var-meh-o: "\f11a"; @fa-var-mercury: "\f223"; +@fa-var-microchip: "\f2db"; @fa-var-microphone: "\f130"; @fa-var-microphone-slash: "\f131"; @fa-var-minus: "\f068"; @@ -502,6 +526,7 @@ @fa-var-plus-circle: "\f055"; @fa-var-plus-square: "\f0fe"; @fa-var-plus-square-o: "\f196"; +@fa-var-podcast: "\f2ce"; @fa-var-power-off: "\f011"; @fa-var-print: "\f02f"; @fa-var-product-hunt: "\f288"; @@ -511,10 +536,12 @@ @fa-var-question: "\f128"; @fa-var-question-circle: "\f059"; @fa-var-question-circle-o: "\f29c"; +@fa-var-quora: "\f2c4"; @fa-var-quote-left: "\f10d"; @fa-var-quote-right: "\f10e"; @fa-var-ra: "\f1d0"; @fa-var-random: "\f074"; +@fa-var-ravelry: "\f2d9"; @fa-var-rebel: "\f1d0"; @fa-var-recycle: "\f1b8"; @fa-var-reddit: "\f1a1"; @@ -541,6 +568,7 @@ @fa-var-rub: "\f158"; @fa-var-ruble: "\f158"; @fa-var-rupee: "\f156"; +@fa-var-s15: "\f2cd"; @fa-var-safari: "\f267"; @fa-var-save: "\f0c7"; @fa-var-scissors: "\f0c4"; @@ -565,6 +593,7 @@ @fa-var-shopping-bag: "\f290"; @fa-var-shopping-basket: "\f291"; @fa-var-shopping-cart: "\f07a"; +@fa-var-shower: "\f2cc"; @fa-var-sign-in: "\f090"; @fa-var-sign-language: "\f2a7"; @fa-var-sign-out: "\f08b"; @@ -581,6 +610,7 @@ @fa-var-snapchat: "\f2ab"; @fa-var-snapchat-ghost: "\f2ac"; @fa-var-snapchat-square: "\f2ad"; +@fa-var-snowflake-o: "\f2dc"; @fa-var-soccer-ball-o: "\f1e3"; @fa-var-sort: "\f0dc"; @fa-var-sort-alpha-asc: "\f15d"; @@ -626,6 +656,7 @@ @fa-var-subway: "\f239"; @fa-var-suitcase: "\f0f2"; @fa-var-sun-o: "\f185"; +@fa-var-superpowers: "\f2dd"; @fa-var-superscript: "\f12b"; @fa-var-support: "\f1cd"; @fa-var-table: "\f0ce"; @@ -635,6 +666,7 @@ @fa-var-tags: "\f02c"; @fa-var-tasks: "\f0ae"; @fa-var-taxi: "\f1ba"; +@fa-var-telegram: "\f2c6"; @fa-var-television: "\f26c"; @fa-var-tencent-weibo: "\f1d5"; @fa-var-terminal: "\f120"; @@ -644,6 +676,17 @@ @fa-var-th-large: "\f009"; @fa-var-th-list: "\f00b"; @fa-var-themeisle: "\f2b2"; +@fa-var-thermometer: "\f2c7"; +@fa-var-thermometer-0: "\f2cb"; +@fa-var-thermometer-1: "\f2ca"; +@fa-var-thermometer-2: "\f2c9"; +@fa-var-thermometer-3: "\f2c8"; +@fa-var-thermometer-4: "\f2c7"; +@fa-var-thermometer-empty: "\f2cb"; +@fa-var-thermometer-full: "\f2c7"; +@fa-var-thermometer-half: "\f2c9"; +@fa-var-thermometer-quarter: "\f2ca"; +@fa-var-thermometer-three-quarters: "\f2c8"; @fa-var-thumb-tack: "\f08d"; @fa-var-thumbs-down: "\f165"; @fa-var-thumbs-o-down: "\f088"; @@ -653,6 +696,8 @@ @fa-var-times: "\f00d"; @fa-var-times-circle: "\f057"; @fa-var-times-circle-o: "\f05c"; +@fa-var-times-rectangle: "\f2d3"; +@fa-var-times-rectangle-o: "\f2d4"; @fa-var-tint: "\f043"; @fa-var-toggle-down: "\f150"; @fa-var-toggle-left: "\f191"; @@ -693,11 +738,16 @@ @fa-var-usb: "\f287"; @fa-var-usd: "\f155"; @fa-var-user: "\f007"; +@fa-var-user-circle: "\f2bd"; +@fa-var-user-circle-o: "\f2be"; @fa-var-user-md: "\f0f0"; +@fa-var-user-o: "\f2c0"; @fa-var-user-plus: "\f234"; @fa-var-user-secret: "\f21b"; @fa-var-user-times: "\f235"; @fa-var-users: "\f0c0"; +@fa-var-vcard: "\f2bb"; +@fa-var-vcard-o: "\f2bc"; @fa-var-venus: "\f221"; @fa-var-venus-double: "\f226"; @fa-var-venus-mars: "\f228"; @@ -722,10 +772,16 @@ @fa-var-wheelchair-alt: "\f29b"; @fa-var-wifi: "\f1eb"; @fa-var-wikipedia-w: "\f266"; +@fa-var-window-close: "\f2d3"; +@fa-var-window-close-o: "\f2d4"; +@fa-var-window-maximize: "\f2d0"; +@fa-var-window-minimize: "\f2d1"; +@fa-var-window-restore: "\f2d2"; @fa-var-windows: "\f17a"; @fa-var-won: "\f159"; @fa-var-wordpress: "\f19a"; @fa-var-wpbeginner: "\f297"; +@fa-var-wpexplorer: "\f2de"; @fa-var-wpforms: "\f298"; @fa-var-wrench: "\f0ad"; @fa-var-xing: "\f168"; diff --git a/src/controllers/accounts/edit.js b/src/controllers/accounts/edit.js index 25f1112556..3c2e57bec4 100644 --- a/src/controllers/accounts/edit.js +++ b/src/controllers/accounts/edit.js @@ -2,7 +2,6 @@ var async = require('async'); var fs = require('fs'); -var nconf = require('nconf'); var winston = require('winston'); var db = require('../../database'); @@ -158,7 +157,7 @@ editController.uploadPicture = function (req, res, next) { res.json([{ name: userPhoto.name, - url: image.url.startsWith('http') ? image.url : nconf.get('relative_path') + image.url, + url: image.url, }]); }); }; diff --git a/src/controllers/groups.js b/src/controllers/groups.js index fb780c1b97..94f5469ef4 100644 --- a/src/controllers/groups.js +++ b/src/controllers/groups.js @@ -1,7 +1,6 @@ 'use strict'; var async = require('async'); -var nconf = require('nconf'); var validator = require('validator'); var meta = require('../meta'); @@ -181,7 +180,7 @@ groupsController.uploadCover = function (req, res, next) { if (err) { return next(err); } - res.json([{ url: image.url.startsWith('http') ? image.url : nconf.get('relative_path') + image.url }]); + res.json([{ url: image.url }]); }); }; diff --git a/src/database/redis/hash.js b/src/database/redis/hash.js index 938beb2971..61d83a93f6 100644 --- a/src/database/redis/hash.js +++ b/src/database/redis/hash.js @@ -96,6 +96,9 @@ module.exports = function (redisClient, module) { module.deleteObjectField = function (key, field, callback) { callback = callback || function () {}; + if (field === null) { + return setImmediate(callback); + } redisClient.hdel(key, field, function (err) { callback(err); }); diff --git a/src/views/partials/fontawesome.tpl b/src/views/partials/fontawesome.tpl index f6a84268bc..377afe09ff 100644 --- a/src/views/partials/fontawesome.tpl +++ b/src/views/partials/fontawesome.tpl @@ -5,6 +5,10 @@
+ + + + @@ -53,11 +57,15 @@ + + + + @@ -207,19 +215,25 @@ + + + + + + @@ -287,6 +301,7 @@ + @@ -319,6 +334,7 @@ + @@ -335,6 +351,7 @@ + @@ -358,8 +375,12 @@ + + + + @@ -397,6 +418,7 @@ + @@ -429,8 +451,10 @@ + + @@ -495,6 +519,7 @@ + @@ -504,10 +529,12 @@ + + @@ -534,6 +561,7 @@ + @@ -558,6 +586,7 @@ + @@ -574,6 +603,7 @@ + @@ -619,6 +649,7 @@ + @@ -628,6 +659,7 @@ + @@ -637,6 +669,17 @@ + + + + + + + + + + + @@ -646,6 +689,8 @@ + + @@ -686,11 +731,16 @@ + + + + + @@ -715,10 +765,16 @@ + + + + + + diff --git a/src/webserver.js b/src/webserver.js index d816a861a2..4ce61b1c2e 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -79,7 +79,6 @@ module.exports.listen = function (callback) { }; function initializeNodeBB(callback) { - winston.info('initializing NodeBB ...'); var middleware = require('./middleware'); async.waterfall([ diff --git a/test/helpers/index.js b/test/helpers/index.js index 30aab3c11f..2c37f85500 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -34,64 +34,56 @@ helpers.loginUser = function (username, password, callback) { if (err || res.statusCode !== 200) { return callback(err || new Error('[[error:invalid-response]]')); } - myXhr.callbacks.test2 = function () { - this.setDisableHeaderCheck(true); - var stdOpen = this.open; - this.open = function () { - stdOpen.apply(this, arguments); - this.setRequestHeader('Cookie', res.headers['set-cookie'][0].split(';')[0]); - this.setRequestHeader('Origin', nconf.get('url')); - }; - }; - - var socketClient = require('socket.io-client'); - - var io = socketClient.connect(nconf.get('url'), { forceNew: true, multiplex: false }); - io.on('connect', function () { - callback(null, jar, io, body.csrf_token); - }); - - io.on('error', function (err) { - callback(err); + helpers.connectSocketIO(res, function (err, io) { + callback(err, jar, io, body.csrf_token); }); }); }); }; +helpers.connectSocketIO = function (res, callback) { + myXhr.callbacks.headerCallback = function () { + this.setDisableHeaderCheck(true); + var stdOpen = this.open; + this.open = function () { + stdOpen.apply(this, arguments); + this.setRequestHeader('Cookie', res.headers['set-cookie'][0].split(';')[0]); + this.setRequestHeader('Origin', nconf.get('url')); + }; + }; + + var socketClient = require('socket.io-client'); + + var io = socketClient.connect(nconf.get('base_url'), { + path: nconf.get('relative_path') + '/socket.io', + forceNew: true, + multiplex: false, + }); + io.on('connect', function () { + callback(null, io); + }); + + io.on('error', function (err) { + callback(err); + }); +}; + helpers.initSocketIO = function (callback) { var jar; request.get({ url: nconf.get('url') + '/api/config', jar: jar, json: true, - }, function (err, res, body) { + }, function (err, res) { if (err) { return callback(err); } - - myXhr.callbacks.test2 = function () { - this.setDisableHeaderCheck(true); - var stdOpen = this.open; - this.open = function () { - stdOpen.apply(this, arguments); - this.setRequestHeader('Cookie', res.headers['set-cookie'][0].split(';')[0]); - this.setRequestHeader('Origin', nconf.get('url')); - }; - }; - - var io = require('socket.io-client')(nconf.get('url'), { forceNew: true }); - - io.on('connect', function () { - callback(null, jar, io); - }); - - io.on('error', function (err) { - callback(err); + helpers.connectSocketIO(res, function (err, io) { + callback(err, jar, io); }); }); }; - helpers.uploadFile = function (uploadEndPoint, filePath, body, jar, csrf_token, callback) { var formData = { files: [ @@ -134,12 +126,8 @@ helpers.registerUser = function (data, callback) { headers: { 'x-csrf-token': body.csrf_token, }, - }, function (err, res, body) { - if (err) { - return callback(err); - } - - callback(null, jar); + }, function (err) { + callback(err, jar); }); }); }; diff --git a/test/socket.io.js b/test/socket.io.js index 575983a18a..6c935657ac 100644 --- a/test/socket.io.js +++ b/test/socket.io.js @@ -12,11 +12,10 @@ var request = require('request'); var cookies = request.jar(); var db = require('./mocks/databasemock'); -var myXhr = require('./mocks/newXhr'); var user = require('../src/user'); var groups = require('../src/groups'); var categories = require('../src/categories'); - +var helpers = require('./helpers'); describe('socket.io', function () { var io; @@ -64,26 +63,12 @@ describe('socket.io', function () { 'x-csrf-token': body.csrf_token, }, json: true, - }, function (err, res, body) { + }, function (err, res) { assert.ifError(err); - myXhr.callbacks.test2 = function () { - this.setDisableHeaderCheck(true); - var stdOpen = this.open; - this.open = function () { - stdOpen.apply(this, arguments); - this.setRequestHeader('Cookie', res.headers['set-cookie'][0].split(';')[0]); - this.setRequestHeader('Origin', nconf.get('url')); - }; - }; - - io = require('socket.io-client')(nconf.get('url'), { forceNew: true }); - - io.on('connect', function () { - done(); - }); - - io.on('error', function (err) { + helpers.connectSocketIO(res, function (err, _io) { + io = _io; + assert.ifError(err); done(err); }); }); diff --git a/test/template-helpers.js b/test/template-helpers.js index b5921b81c9..eb145e98a8 100644 --- a/test/template-helpers.js +++ b/test/template-helpers.js @@ -1,6 +1,6 @@ 'use strict'; -var async = require('async'); +var nconf = require('nconf'); var assert = require('assert'); var db = require('./mocks/databasemock'); @@ -13,7 +13,6 @@ describe('helpers', function () { done(); }); - it('should return false if route is /users and privateUserInfo is on and user is not logged in', function (done) { var flag = helpers.displayMenuItem({ navigation: [{ route: '/users' }], @@ -49,4 +48,186 @@ describe('helpers', function () { assert.equal(str, 'gdkfhgk < some > and &'); done(); }); + + it('should return empty string if category is falsy', function (done) { + assert.equal(helpers.generateCategoryBackground(null), ''); + done(); + }); + + it('should generate category background', function (done) { + var category = { + bgColor: '#ff0000', + color: '#00ff00', + backgroundImage: '/assets/uploads/image.png', + imageClass: 'auto', + }; + var bg = helpers.generateCategoryBackground(category); + assert.equal(bg, 'background-color: #ff0000; color: #00ff00; background-image: url(/assets/uploads/image.png); background-size: auto;'); + done(); + }); + + it('should return empty string if category has no children', function (done) { + var category = { + children: [], + }; + var bg = helpers.generateChildrenCategories(category); + assert.equal(bg, ''); + done(); + }); + + it('should generate html for children', function (done) { + var category = { + children: [ + { + link: '', + bgColor: '#ff0000', + color: '#00ff00', + name: 'children', + }, + ], + }; + var html = helpers.generateChildrenCategories(category); + assert.equal(html, 'children '); + done(); + }); + + it('should generate topic class', function (done) { + var className = helpers.generateTopicClass({ locked: true, pinned: true, deleted: true, unread: true }); + assert.equal(className, 'locked pinned deleted unread'); + done(); + }); + + it('should show leave button if isMember and group is not administrators', function (done) { + var btn = helpers.membershipBtn({ displayName: 'some group', name: 'some group', isMember: true }); + assert.equal(btn, ''); + done(); + }); + + it('should show pending button if isPending and group is not administrators', function (done) { + var btn = helpers.membershipBtn({ displayName: 'some group', name: 'some group', isPending: true }); + assert.equal(btn, ''); + done(); + }); + + it('should show reject invite button if isInvited', function (done) { + var btn = helpers.membershipBtn({ displayName: 'some group', name: 'some group', isInvited: true }); + assert.equal(btn, ''); + done(); + }); + + it('should show join button if join requests are not disabled and group is not administrators', function (done) { + var btn = helpers.membershipBtn({ displayName: 'some group', name: 'some group', disableJoinRequests: false }); + assert.equal(btn, ''); + done(); + }); + + it('should show nothing if group is administrators ', function (done) { + var btn = helpers.membershipBtn({ displayName: 'administrators', name: 'administrators' }); + assert.equal(btn, ''); + done(); + }); + + it('should spawn privilege states', function (done) { + var privs = { + find: true, + read: true, + }; + var html = helpers.spawnPrivilegeStates('guests', privs); + assert.equal(html, ''); + done(); + }); + + it('should spawn privilege states', function (done) { + var privs = { + find: true, + read: true, + }; + var html = helpers.spawnPrivilegeStates('guests', privs); + assert.equal(html, ''); + done(); + }); + + it('should render thumb as topic image', function (done) { + var topicObj = { thumb: '/uploads/1.png', user: { username: 'baris' } }; + var html = helpers.renderTopicImage(topicObj); + assert.equal(html, ''); + done(); + }); + + it('should render user picture as topic image', function (done) { + var topicObj = { thumb: '', user: { uid: 1, username: 'baris', picture: '/uploads/2.png' } }; + var html = helpers.renderTopicImage(topicObj); + assert.equal(html, ''); + done(); + }); + + it('should render digest avatar', function (done) { + var block = { teaser: { user: { username: 'baris', picture: '/uploads/1.png' } } }; + var html = helpers.renderDigestAvatar(block); + assert.equal(html, ''); + done(); + }); + + it('should render digest avatar', function (done) { + var block = { teaser: { user: { username: 'baris', 'icon:text': 'B', 'icon:bgColor': '#ff000' } } }; + var html = helpers.renderDigestAvatar(block); + assert.equal(html, '
' + block.teaser.user['icon:text'] + '
'); + done(); + }); + + it('should render digest avatar', function (done) { + var block = { user: { username: 'baris', picture: '/uploads/1.png' } }; + var html = helpers.renderDigestAvatar(block); + assert.equal(html, ''); + done(); + }); + + it('should render digest avatar', function (done) { + var block = { user: { username: 'baris', 'icon:text': 'B', 'icon:bgColor': '#ff000' } }; + var html = helpers.renderDigestAvatar(block); + assert.equal(html, '
' + block.user['icon:text'] + '
'); + done(); + }); + + it('shoud render user agent/browser icons', function (done) { + var html = helpers.userAgentIcons({ platform: 'Linux', browser: 'Chrome' }); + assert.equal(html, ''); + done(); + }); + + it('shoud render user agent/browser icons', function (done) { + var html = helpers.userAgentIcons({ platform: 'Microsoft Windows', browser: 'Firefox' }); + assert.equal(html, ''); + done(); + }); + + it('shoud render user agent/browser icons', function (done) { + var html = helpers.userAgentIcons({ platform: 'Apple Mac', browser: 'Safari' }); + assert.equal(html, ''); + done(); + }); + + it('shoud render user agent/browser icons', function (done) { + var html = helpers.userAgentIcons({ platform: 'Android', browser: 'IE' }); + assert.equal(html, ''); + done(); + }); + + it('shoud render user agent/browser icons', function (done) { + var html = helpers.userAgentIcons({ platform: 'iPad', browser: 'Edge' }); + assert.equal(html, ''); + done(); + }); + + it('shoud render user agent/browser icons', function (done) { + var html = helpers.userAgentIcons({ platform: 'iPhone', browser: 'unknow' }); + assert.equal(html, ''); + done(); + }); + + it('shoud render user agent/browser icons', function (done) { + var html = helpers.userAgentIcons({ platform: 'unknow', browser: 'unknown' }); + assert.equal(html, ''); + done(); + }); }); diff --git a/test/uploads.js b/test/uploads.js index 0c4ca8d1d6..624b1c25b7 100644 --- a/test/uploads.js +++ b/test/uploads.js @@ -71,7 +71,7 @@ describe('Upload Controllers', function () { assert.equal(res.statusCode, 200); assert(Array.isArray(body)); assert.equal(body.length, 1); - assert.equal(body[0].url, '/assets/uploads/profile/' + regularUid + '-profileavatar.png'); + assert.equal(body[0].url, nconf.get('relative_path') + '/assets/uploads/profile/' + regularUid + '-profileavatar.png'); done(); }); }); @@ -165,7 +165,7 @@ describe('Upload Controllers', function () { assert.ifError(err); assert.equal(res.statusCode, 200); assert(Array.isArray(body)); - assert.equal(body[0].url, '/assets/uploads/system/site-logo.png'); + assert.equal(body[0].url, nconf.get('relative_path') + '/assets/uploads/system/site-logo.png'); done(); }); }); @@ -175,7 +175,7 @@ describe('Upload Controllers', function () { assert.ifError(err); assert.equal(res.statusCode, 200); assert(Array.isArray(body)); - assert.equal(body[0].url, '/assets/uploads/category/category-1.png'); + assert.equal(body[0].url, nconf.get('relative_path') + '/assets/uploads/category/category-1.png'); done(); }); }); diff --git a/test/user.js b/test/user.js index 00794b3d0e..468ab9b0b4 100644 --- a/test/user.js +++ b/test/user.js @@ -522,7 +522,7 @@ describe('User', function () { }; User.uploadPicture(uid, picture, function (err, uploadedPicture) { assert.ifError(err); - assert.equal(uploadedPicture.url, '/assets/uploads/profile/' + uid + '-profileavatar.png'); + assert.equal(uploadedPicture.url, nconf.get('relative_path') + '/assets/uploads/profile/' + uid + '-profileavatar.png'); assert.equal(uploadedPicture.path, path.join(nconf.get('base_dir'), 'public', 'uploads', 'profile', uid + '-profileavatar.png')); done(); });