Add blogging instance to profile edit screen

main
Bob Mottram 2020-09-30 17:13:08 +01:00
parent c1a03228ce
commit a7e0c68a96
18 changed files with 63 additions and 20 deletions

View File

@ -3205,10 +3205,14 @@ class PubServer(BaseHTTPRequestHandler):
self.server.defaultTimeline = 'inbox'
if fields['mediaInstance'] == 'on':
self.server.mediaInstance = True
self.server.blogsInstance = False
self.server.defaultTimeline = 'tlmedia'
setConfigParam(baseDir,
"mediaInstance",
self.server.mediaInstance)
setConfigParam(baseDir,
"blogsInstance",
self.server.blogsInstance)
else:
if self.server.mediaInstance:
self.server.mediaInstance = False
@ -3223,10 +3227,14 @@ class PubServer(BaseHTTPRequestHandler):
self.server.defaultTimeline = 'inbox'
if fields['blogsInstance'] == 'on':
self.server.blogsInstance = True
self.server.mediaInstance = False
self.server.defaultTimeline = 'tlblogs'
setConfigParam(baseDir,
"blogsInstance",
self.server.blogsInstance)
setConfigParam(baseDir,
"mediaInstance",
self.server.mediaInstance)
else:
if self.server.blogsInstance:
self.server.blogsInstance = False

View File

@ -615,11 +615,15 @@ if not args.mediainstance:
mediaInstance = getConfigParam(baseDir, 'mediaInstance')
if mediaInstance is not None:
args.mediainstance = mediaInstance
if args.mediainstance:
args.blogsinstance = False
if not args.blogsinstance:
blogsInstance = getConfigParam(baseDir, 'blogsInstance')
if blogsInstance is not None:
args.blogsinstance = blogsInstance
if args.blogsinstance:
args.mediainstance = False
# set the instance title in config.json
title = getConfigParam(baseDir, 'instanceTitle')

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "علامات التجزئة المُنشأة تلقائيًا",
"Autogenerated Content Warnings": "تحذيرات المحتوى المُنشأ تلقائيًا",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag محظور"
"Hashtag Blocked": "Hashtag محظور",
"This is a blogging instance": ""
}

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "Hashtags autogenerats",
"Autogenerated Content Warnings": "Advertiments de contingut autogenerats",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag bloquejat"
"Hashtag Blocked": "Hashtag bloquejat",
"This is a blogging instance": ""
}

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "Hashtags awtogeneiddiedig",
"Autogenerated Content Warnings": "Rhybuddion Cynnwys Autogenerated",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag wedi'i Blocio"
"Hashtag Blocked": "Hashtag wedi'i Blocio",
"This is a blogging instance": ""
}

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "Automatisch generierte Hashtags",
"Autogenerated Content Warnings": "Warnungen vor automatisch generierten Inhalten",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag blockiert"
"Hashtag Blocked": "Hashtag blockiert",
"This is a blogging instance": ""
}

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "Autogenerated Hashtags",
"Autogenerated Content Warnings": "Autogenerated Content Warnings",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag Blocked"
"Hashtag Blocked": "Hashtag Blocked",
"This is a blogging instance": "This is a blogging instance"
}

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "Hashtags autogenerados",
"Autogenerated Content Warnings": "Advertencias de contenido generado automáticamente",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag bloqueada"
"Hashtag Blocked": "Hashtag bloqueada",
"This is a blogging instance": ""
}

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "Hashtags générés automatiquement",
"Autogenerated Content Warnings": "Avertissements de contenu générés automatiquement",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag bloqué"
"Hashtag Blocked": "Hashtag bloqué",
"This is a blogging instance": ""
}

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "Hashtags uathghinte",
"Autogenerated Content Warnings": "Rabhaidh Ábhar Uathghinte",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag Blocáilte"
"Hashtag Blocked": "Hashtag Blocáilte",
"This is a blogging instance": ""
}

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "ऑटोजेनरेटेड हैशटैग",
"Autogenerated Content Warnings": "स्वतः प्राप्त सामग्री चेतावनी",
"Indymedia": "Indymedia",
"Hashtag Blocked": "हैशटैग अवरुद्ध"
"Hashtag Blocked": "हैशटैग अवरुद्ध",
"This is a blogging instance": ""
}

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "Hashtag generati automaticamente",
"Autogenerated Content Warnings": "Avvisi sui contenuti generati automaticamente",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag bloccato"
"Hashtag Blocked": "Hashtag bloccato",
"This is a blogging instance": ""
}

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "自動生成されたハッシュタグ",
"Autogenerated Content Warnings": "自動生成されたコンテンツの警告",
"Indymedia": "Indymedia",
"Hashtag Blocked": "ハッシュタグがブロックされました"
"Hashtag Blocked": "ハッシュタグがブロックされました",
"This is a blogging instance": ""
}

View File

@ -283,5 +283,6 @@
"Autogenerated Hashtags": "Autogenerated Hashtags",
"Autogenerated Content Warnings": "Autogenerated Content Warnings",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag Blocked"
"Hashtag Blocked": "Hashtag Blocked",
"This is a blogging instance": "This is a blogging instance"
}

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "Hashtags autogeradas",
"Autogenerated Content Warnings": "Avisos de conteúdo gerado automaticamente",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Hashtag bloqueada"
"Hashtag Blocked": "Hashtag bloqueada",
"This is a blogging instance": ""
}

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "Автоматически сгенерированные хештеги",
"Autogenerated Content Warnings": "Автоматические предупреждения о содержании",
"Indymedia": "Indymedia",
"Hashtag Blocked": "Хештег заблокирован"
"Hashtag Blocked": "Хештег заблокирован",
"This is a blogging instance": ""
}

View File

@ -287,5 +287,6 @@
"Autogenerated Hashtags": "自动生成的标签",
"Autogenerated Content Warnings": "自动生成的内容警告",
"Indymedia": "Indymedia",
"Hashtag Blocked": "标签被阻止"
"Hashtag Blocked": "标签被阻止",
"This is a blogging instance": ""
}

View File

@ -1230,6 +1230,7 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
notifyLikes = ''
hideLikeButton = ''
mediaInstanceStr = ''
blogsInstanceStr = ''
displayNickname = nickname
bioStr = ''
donateUrl = ''
@ -1287,6 +1288,13 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
if mediaInstance:
if mediaInstance is True:
mediaInstanceStr = 'checked'
blogsInstanceStr = ''
blogsInstance = getConfigParam(baseDir, "blogInstance")
if blogsInstance:
if blogsInstance is True:
blogsInstanceStr = 'checked'
mediaInstanceStr = ''
filterStr = ''
filterFilename = \
@ -1607,6 +1615,19 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
editProfileForm += \
' <input type="text" name="passwordconfirm" value="">\n'
editProfileForm += ' </div>\n'
if path.startswith('/users/' + adminNickname + '/'):
editProfileForm += ' <div class="container">\n'
editProfileForm += \
' <input type="checkbox" class="profilecheckbox" ' + \
'name="mediaInstance" ' + mediaInstanceStr + '> ' + \
translate['This is a media instance'] + '<br>\n'
editProfileForm += \
' <input type="checkbox" class="profilecheckbox" ' + \
'name="blogsInstance" ' + blogsInstanceStr + '> ' + \
translate['This is a blogging instance'] + '<br>\n'
editProfileForm += ' </div>\n'
editProfileForm += ' <div class="container">\n'
editProfileForm += \
' <input type="checkbox" class="profilecheckbox" ' + \
@ -1628,11 +1649,6 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
' <input type="checkbox" class="profilecheckbox" ' + \
'name="removeTwitter" ' + removeTwitter + '> ' + \
translate['Remove Twitter posts'] + '<br>\n'
if path.startswith('/users/' + adminNickname + '/'):
editProfileForm += \
' <input type="checkbox" class="profilecheckbox" ' + \
'name="mediaInstance" ' + mediaInstanceStr + '> ' + \
translate['This is a media instance'] + '<br>\n'
editProfileForm += \
' <input type="checkbox" class="profilecheckbox" ' + \
'name="notifyLikes" ' + notifyLikes + '> ' + \