<div class="htmlText" style="margin:5px">
{% if request.user.profile.authenticated %}
    {% block hello_user %}
        <p>{{_("Quick links:")}}
        {% for mi in settings.SITE.get_quicklinks(ar).items %}
        [{{E.tostring(ar.window_action_button(mi.bound_action,icon_name=None))}}]
        {% endfor %}
        </p>
        {% if site.use_davlink %}
        <p align="right"><a href="javascript:Lino.davlink_reset()">reset DavLink</a></p>
        {% endif %}
        {% if site.use_eidreader %}
        <p align="right"><a href="javascript:Lino.read_eid_card()">read an eID card</a></p>
        {% endif %}
        <h2>{{_("Welcome")}}</h2>
        <p>{{_("Hi, %(first_name)s!") % dict(first_name=ar.get_user().first_name)}}
        {% set sep = joiner(',') %}
        {% for msg in settings.SITE.get_welcome_messages(ar) %}
            {{ E.tostring(msg) }}
        {% endfor %}
        {% for table,text in settings.SITE.get_todo_tables(ar) %}
            {% set r = table.request(user=ar.get_user()) %}
            {% if r.get_total_count() != 0 %}
              {{ sep() or _("You have") }} {{ E.tostring(ar.href_to_request(r,text % r.get_total_count())) }} 
            {% endif %}
        {% endfor %}
        </p>
        {% block feedback %}
        {% if site.is_demo_site %}
        <p>
        {{_("This is a Lino demo site.")}}
        {{_("Try also the other <a href=\"http://lino-framework.org/demos.html\">demo sites</a>.")}}
        {{_("Your feedback is welcome to <em>lino-users@googlegroups.com</em> or directly to the person who invited you.")}}
        </p>
        {% endif %}
        {% endblock %}
        
        {% block admin_main_items %}
        {% for T in settings.SITE.get_admin_main_items(ar) %}
        {% if T.default_action.get_view_permission(ar.get_user().profile) %}
        <h2>{{T.label}} 
        {# {{E.tostring(ar.window_action_button(T.default_action,
            title=_("Show this panel in own window"),
            icon_ffile="../wikipedia/external_text"))}} #}
        {{E.tostring(ar.window_action_button(T.default_action,
            title=_("Show this panel in own window"),
            style='vertical-align:0;',
            icon_name="../xsite/link"))}}
        </h2>
        
        {{E.tostring(ar.show(T,limit=5))}}
        {% endif %}
        {% endfor %}
        {% endblock %}
        
    {% endblock %}
{% else %}
  {% block hello_anonymous %}
      {% if site.admin_prefix %}
        <p>
        {{_("You have entered the <b>admin</b> section.")}}
        {{_("Unlike the <a href=\"/\">web content section</a> there is now a GUI menu bar in the upper part of the screen.")}}
        </p>
      {% else %}
        <p>
        {{_("Welcome to the <b>%s</b> site.") % site.title}}
        {% if site.verbose_name and site.url and site.version %}
        {{_("We are running %(name)s version %(version)s") % dict(
            name=E.tostring(E.a(site.verbose_name,href=site.url)),
            version=site.version)}}
        {% endif %}
        </p>
      {% endif %}
      <p>
      {{_("You will now probably want to use the <b>Log in</b> button in the upper right corner and log in.")}}
      </p>
      {% if site.user_model and site.is_demo_site %}
        <p>
        {{_("This demo site has %d users, they all have \"1234\" as password:") % site.modules.users.UsersOverview.request().get_total_count()}}
        </p>
        {{as_ul('users.UsersOverview')}}
      {% endif %}
      {{ self.feedback() }}
  {% endblock %}
{% endif %}
</div>
