return ret
+ # Description
+
+ def get_description(self):
+ return self._get_string("description")
+
+ def set_description(self, description):
+ self._set_string("description", description)
+
+ description = property(get_description, set_description)
+
+ # Avatar
+
def has_avatar(self):
has_avatar = self.memcache.get("accounts:%s:has-avatar" % self.uid)
if has_avatar is None:
</select>
</div>
- <div class="form-group">
- <label>{{ _("Avatar") }}</label>
+ <fieldset>
+ <legend>{{ _("Tell Us Who You Are") }}</legend>
- <input type="file" class="form-control-file" name="avatar">
+ <div class="form-group">
+ <textarea type="text" class="form-control" name="description" rows="5"
+ placeholder="{{ _("Tell Us Who You Are") }}">{{ account.description }}</textarea>
- <small class="form-text text-muted">
- {{ _("Upload a new avatar") }}
- </small>
- </div>
+ <small class="form-text text-muted">
+ {{ _("You can use Markdown syntax as you know it from the IPFire Wiki") }}
+ </small>
+ </div>
+
+ <div class="form-group">
+ <label>{{ _("Avatar") }}</label>
+
+ <input type="file" class="form-control-file" name="avatar">
+
+ <small class="form-text text-muted">
+ {{ _("Upload a new avatar") }}
+ </small>
+ </div>
+ </fieldset>
{% if account.has_mail() %}
<fieldset>
<div class="card mb-3">
<div class="card-body">
+ {% if account.description %}
+ <div class="row">
+ <div class="col">
+ {% module Markdown(account.description) %}
+ </div>
+ </div>
+ {% end %}
+
<div class="row">
<div class="col">
<a class="btn btn-dark btn-block" href="mailto:{{ account.email }}">
"WikiList" : wiki.WikiListModule,
# Misc
+ "Markdown" : ui_modules.MarkdownModule,
"Map" : ui_modules.MapModule,
"ProgressBar" : ui_modules.ProgressBarModule,
},
account.city = self.get_argument("city", None)
account.postal_code = self.get_argument("postal_code", None)
account.country_code = self.get_argument("country_code", None)
+ account.description = self.get_argument("description", None)
# Avatar
try:
return self.handler.backend
+class MarkdownModule(UIModule):
+ def render(self, markdown):
+ return self.backend.blog._render_text(markdown)
+
+
class MapModule(UIModule):
def render(self, latitude, longitude):
return self.render_string("modules/map.html", latitude=latitude, longitude=longitude)