Fixed intro
Change-Id: Ifd2af380084eadff629bddb3edb8fad34a39ed0b
diff --git a/lib/Kalamar/API.pm b/lib/Kalamar/API.pm
index e5af2c8..ed58b8a 100644
--- a/lib/Kalamar/API.pm
+++ b/lib/Kalamar/API.pm
@@ -72,7 +72,8 @@
# Check cache for total results
my $total_results;
- my $user = $c->stash('user') // '?';
+ # In case the user is not known, it is assumed, the user is not logged in
+ my $user = $c->stash('user') // 'not_logged_in';
if (!$index->no_cache &&
defined ($total_results = $c->chi->get($user . $index->_api_cache))) {
@@ -156,8 +157,8 @@
# Trace non-blocking
$ua->start(
$tx => sub {
- $self->_process_response('trace', $index, pop);
- return $cb->($index);
+ $self->_process_response('trace', $index, pop);
+ return $cb->($index);
});
}
# Trace blocking
@@ -233,7 +234,7 @@
# Get controller
my $c = $index->controller;
- my $user = $c->stash('user') // '?';
+ my $user = $c->stash('user') // 'not_logged_in';
# If there is a callback, do async
my $cb = pop if ref $_[-1] && ref $_[-1] eq 'CODE';
@@ -293,9 +294,9 @@
if (my $e = $tx->error) {
$c->notify(
error =>
- ($e->{code} ? $e->{code} . ': ' : '') .
- $e->{message} . ' for ' . $type . ' (remote)'
- );
+ ($e->{code} ? $e->{code} . ': ' : '') .
+ $e->{message} . ' for ' . $type . ' (remote)'
+ );
return;
};
@@ -396,7 +397,7 @@
my $c = $index->controller;
# TODO: Cache on auth_keys!
- my $user = $c->stash('user') // '?';
+ my $user = $c->stash('user') // 'not_logged_in';
$c->app->log->debug('Cache total result');
$c->chi->set($user . $index->_api_cache => $meta->{totalResults}, '120min');
@@ -425,7 +426,7 @@
my ($self, $index, $json) = @_;
my $c = $index->controller;
- my $user = $c->stash('user') // '?';
+ my $user = $c->stash('user') // 'not_logged_in';
# TODO: That's unfortunate, as it prohibits multiple resources
$c->stash('search.resource' => $json);
diff --git a/lib/Kalamar/Controller/Search.pm b/lib/Kalamar/Controller/Search.pm
index c246ba1..2e55e87 100644
--- a/lib/Kalamar/Controller/Search.pm
+++ b/lib/Kalamar/Controller/Search.pm
@@ -16,6 +16,9 @@
$v->optional('count');
$v->optional('p');
+ #my $tx = $ua->build_tx(TRACE => $url . 'search?cq=corpusAuthor+%3D+%22Baum%22');
+ #{"@context":"http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld","errors":[[301,"You did not specify a query!"]],"collection":{"@type":"koral:doc","key":"corpusAuthor","value":"Baum","match":"match:eq"}}
+
my $query = $v->param('q');
# No query
diff --git a/t/remote.t b/t/remote.t
index 7148428..ccb4f67 100644
--- a/t/remote.t
+++ b/t/remote.t
@@ -47,5 +47,8 @@
->text_like('.notify-error', qr!No entity found!)
;
+
+
+
done_testing;
__END__
diff --git a/t/remote_user.t b/t/remote_user.t
index a484d1d..d8a0450 100644
--- a/t/remote_user.t
+++ b/t/remote_user.t
@@ -73,6 +73,10 @@
__END__
+# Login mit falschem Nutzernamen:
+# 400 und:
+{"errors":[[2022,"LDAP Authentication failed due to unknown user or password!"]]}
+
ok(!$c->user->get('details'), 'User not logged in');
diff --git a/templates/de/intro.html.ep b/templates/de/intro.html.ep
index f4134a0..b9f87f8 100644
--- a/templates/de/intro.html.ep
+++ b/templates/de/intro.html.ep
@@ -5,8 +5,8 @@
<div class="intro">
<p><strong>KorAP</strong> ist eine neue Korpusanalyseplattform, optimiert für große, mehrfach annotierte Korpora und komplexe Suchmechanismen. Dabei versucht KorAP unabhängig von spezifischen Forschungsfragen zu sein.</p>
- <p>Dies ist die neue Webschnittstelle von KorAP, <strong>Kalamar</strong>. Kalamar bietet derzeit nur Zugriff auf freie Korpora - für vollständigen Zugriff auf alle Korpora, verwenden Sie bitte die <a href="http://korap.ids-mannheim.de/app">erste Webschnittstelle</a>.
-
+ <p><noscript>KorAP erwartet für einige Funktionen die Aktivierung von JavaScript.</noscript></p>
+
<p><strong>Neu bei KorAP?</strong> Dann starten Sie doch mit unserer <%= doc_opener 'korap', begin %>Einführung<% end %>!</p>
<p>KorAP wird am <a href="http://www.ids-mannheim.de">Institut für Deutsche Sprache</a> in Mannheim entwickelt, Mitglied der <a href="http://www.leibniz-gemeinschaft.de/en/about-us/leibniz-competition/projekte-2011/2011-funding-line-2/">Leibniz Gemeinschaft</a>. Die einzelnen Module werden als Open Source auf <a href="http://github.com/KorAP">GitHub</a> veröffentlicht.</p>
diff --git a/templates/intro.html.ep b/templates/intro.html.ep
index ba9da37..2782cab 100644
--- a/templates/intro.html.ep
+++ b/templates/intro.html.ep
@@ -5,7 +5,8 @@
<div class="intro">
<p><strong>KorAP</strong> is a new Corpus Analysis Platform, suited for large, multiple annotated corpora and complex search queries independent of particular research questions.</p>
- <p>This is the new frontend for KorAP, <strong>Kalamar</strong>, with currently no access to restricted corpora. For full access, please visit the <a href="http://korap.ids-mannheim.de/app">first frontend</a>. <noscript>Kalamar expects activated JavaScript for some features.</noscript></p>
+
+ <p><noscript>KorAP expects activated JavaScript for some features.</noscript></p>
<p><strong>New to KorAP?</strong> Please check out our <%= doc_opener 'korap', begin %>tutorial<% end %>!</p>
@@ -13,8 +14,6 @@
</div>
-<!-- form -->
-
<div id="logos">
<div>
<a href="http://www.ids-mannheim.de/" class="logo"><p id="ids-logo"><span>Developed at the Institute for the German Language (IDS)</span></p></a>