Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beta.ordbok.uib.no
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Språksamlingane
beta.ordbok.uib.no
Commits
3c75ec04
Commit
3c75ec04
authored
4 years ago
by
Ole Voldsæter
Browse files
Options
Downloads
Patches
Plain Diff
takler feil ifm. oppslag på artikkel-ID
parent
2a52e432
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/App.vue
+17
-1
17 additions, 1 deletion
src/App.vue
src/components/Article.vue
+8
-4
8 additions, 4 deletions
src/components/Article.vue
with
25 additions
and
5 deletions
src/App.vue
+
17
−
1
View file @
3c75ec04
...
...
@@ -22,7 +22,7 @@
<img
id=
"spinner"
:class=
"waiting ? 'show' : 'hide'"
src=
"./assets/spinner.gif"
alt=
"Venter på innhold"
/>
<SearchResults
:hits=
"search_results"
:lang=
"lang"
@
search-hit-click=
"search_hit_click"
v-show=
"! waiting"
/>
<Article
:key=
"article_key"
:article=
"article"
@
article-click=
"article_link_click"
/>
<div
class=
"welcome"
v-show=
"! (article.lemmas.length || search_results.length || waiting)"
>
<div
class=
"welcome"
v-show=
"! (
article.error ||
article.lemmas.length || search_results.length || waiting)"
>
<p>
Bør ordet
<em>
crew
</em>
inn i dei norske standardordbøkene? Korleis definerar vi
<em>
c-kjendis
</em>
, og korleis
bøyar vi eigentleg
<em>
abaya
</em>
på nynorsk - er det fleire
<em>
abayaer
</em>
eller
<em>
abayaar
</em>
? Blir
<em>
en vegetar
</em>
framleis brukt som ein rettskrivingsvariant av
<em>
en vegetarianer
</em>
i bokmål? Og bør
<em>
tjuesesse
</em>
bli eit opplsagsord i Bokmålsordboka
...
...
@@ -79,6 +79,22 @@ function navigate_to_article(self, article_id) {
axios
.
get
(
self
.
api_pref
+
''
+
article_id
)
.
then
(
function
(
response
){
self
.
article
=
response
.
data
})
.
catch
(
function
(
error
){
if
(
error
.
response
&&
error
.
response
.
status
==
404
)
{
self
.
article
=
{
lemmas
:
[],
error
:
"
Vi har ingen artikkel med id
"
+
article_id
}
}
else
{
self
.
article
=
{
lemmas
:
[],
error
:
"
Noe gikk galt...
"
}
console
.
log
(
error
)
}
})
.
then
(
function
(
response
){
self
.
waiting_for_articles
=
false
history
.
replaceState
({
article
:
self
.
article
,
search_results
:
self
.
search_results
,
lang
:
self
.
lang
},
''
)
})
...
...
This diff is collapsed.
Click to expand it.
src/components/Article.vue
+
8
−
4
View file @
3c75ec04
<
template
>
<article
v-show=
"article.lemmas.length"
>
<article
v-show=
"article.lemmas.length
|| article.error
"
>
<Header
:lemmas=
"article.lemmas"
/>
<section
v-if=
"article.body.pronunciation && article.body.pronunciation.length"
>
<section
v-if=
"
! article.error &&
article.body.pronunciation && article.body.pronunciation.length"
>
<h3>
Uttale
</h3>
<ul>
<DefElement
v-for=
"(element, index) in article.body.pronunciation"
:key=
"index"
:body=
'element'
@
article-click=
"article_link_click"
/>
</ul>
</section>
<section
v-if=
"article.body.etymology && article.body.etymology.length"
>
<section
v-if=
"
! article.error &&
article.body.etymology && article.body.etymology.length"
>
<h3>
Etymologi
</h3>
<ul>
<DefElement
v-for=
"(element, index) in article.body.etymology"
:key=
"index"
:body=
'element'
@
article-click=
"article_link_click"
/>
</ul>
</section>
<section>
<section
v-if=
"! article.error"
>
<h3>
Definisjoner
</h3>
<ol>
<Definition
v-for=
"definition in article.body.definitions"
:level=
"1"
:key=
"definition.id"
:body=
'definition'
@
article-click=
"article_link_click"
/>
</ol>
</section>
<section
v-if=
"article.error"
>
<h1>
Ooops...
</h1>
<p>
{{
article
.
error
}}
</p>
</section>
</article>
</
template
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment