Skip to content
Snippets Groups Projects
Commit 76af9f8d authored by Henrik Askjer's avatar Henrik Askjer
Browse files

add hgno and definition number to article refs

parent cff23eea
No related branches found
No related tags found
No related merge requests found
...@@ -5,9 +5,16 @@ ...@@ -5,9 +5,16 @@
:key="index" :key="index"
v-bind="item.props"><!-- v-bind="item.props"><!--
-->{{item.html}}<!-- -->{{item.html}}<!--
--><router-link v-if="item.type == 'article_ref'" :to="item.ref" @click.native="article_link_click(item)"><!--
-->{{item.link_text}}{{item.definition_order ? ` (${item.definition_order})` : ''}}<!-- --><router-link class="article_ref" v-if="item.type == 'article_ref'" :to="item.ref" @click.native="article_link_click(item)" :key="index">
--></router-link><!-- <span class="link_text">{{item.link_text}}</span><!--
-->
<span class="homograph" v-if="item.lemmas[0].hgno" :aria-label="item.lemmas[0].hgno" :key="index"><!--
--> ({{roman_hgno(item.lemmas[0])}}{{item.definition_order ? '': ')'}}</span>
<span class="def_order" v-if="item.definition_order" :aria-label="'definisjon '+item.definition_order">{{item.lemmas[0].hgno ? ', ': ' ('}}{{item.definition_order}})</span>
</router-link>
<!--
--><span class="numerator" v-if="item.type == 'fraction'">{{item.num}}</span><!-- --><span class="numerator" v-if="item.type == 'fraction'">{{item.num}}</span><!--
-->{{item.type == 'fraction' ? '' : ''}}<!-- -->{{item.type == 'fraction' ? '' : ''}}<!--
--><span class="denominator" v-if="item.type == 'fraction'">{{item.denom}}</span><!-- --><span class="denominator" v-if="item.type == 'fraction'">{{item.denom}}</span><!--
...@@ -52,10 +59,12 @@ export default { ...@@ -52,10 +59,12 @@ export default {
else if (item.type_ == 'article_ref') return { else if (item.type_ == 'article_ref') return {
type: item.type_, type: item.type_,
html: '', html: '',
lemmas: item.lemmas,
link_text: item.word_form || item.lemmas[0].lemma, link_text: item.word_form || item.lemmas[0].lemma,
ref: '/' + lang + '/' + item.article_id + '/' + encodeURIComponent(item.word_form || item.lemmas[0].lemma) + (item.definition_id ? '#def' + item.definition_id : ''), ref: '/' + lang + '/' + item.article_id + '/' + encodeURIComponent(item.word_form || item.lemmas[0].lemma) + (item.definition_id ? '#def' + item.definition_id : ''),
article_id: item.article_id, article_id: item.article_id,
definition_id: item.definition_id, definition_id: item.definition_id,
definition_order: item.definition_order,
source: path source: path
} }
else if (item.type_ == 'pronunciation') return {type: item.type_, html: item.string} else if (item.type_ == 'pronunciation') return {type: item.type_, html: item.string}
...@@ -86,7 +95,8 @@ export default { ...@@ -86,7 +95,8 @@ export default {
methods: { methods: {
article_link_click: function(item) { article_link_click: function(item) {
this.$emit('article-click', item) this.$emit('article-click', item)
} },
roman_hgno: helpers.roman_hgno
} }
} }
</script> </script>
...@@ -123,8 +133,20 @@ i { ...@@ -123,8 +133,20 @@ i {
font-style: normal; font-style: normal;
} }
.homograph { .article_ref {
vertical-align: sub; text-decoration: none;
}
.link_text {
text-decoration: underline;
}
.homograph, .def_order{
text-decoration: none !important;
color: black
} }
q:before { q:before {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment