Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
externe Matthieu
Géocontrib Frontend
Commits
50253d40
Commit
50253d40
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
get events for currrent feature and adapt template
parent
7fd990f0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/services/feature-api.js
+14
-0
14 additions, 0 deletions
src/services/feature-api.js
src/views/feature/Feature_detail.vue
+15
-20
15 additions, 20 deletions
src/views/feature/Feature_detail.vue
with
29 additions
and
20 deletions
src/services/feature-api.js
+
14
−
0
View file @
50253d40
...
@@ -4,6 +4,20 @@ import store from '../store'
...
@@ -4,6 +4,20 @@ import store from '../store'
const
baseUrl
=
store
.
state
.
configuration
.
VUE_APP_DJANGO_API_BASE
;
const
baseUrl
=
store
.
state
.
configuration
.
VUE_APP_DJANGO_API_BASE
;
const
featureAPI
=
{
const
featureAPI
=
{
async
getFeatureEvents
(
featureId
)
{
const
response
=
await
axios
.
get
(
`
${
baseUrl
}
features/
${
featureId
}
/events/`
);
if
(
response
.
status
===
200
&&
response
.
data
)
{
return
response
.
data
;
}
else
{
return
null
;
}
},
async
getFeatureAttachments
(
featureId
)
{
async
getFeatureAttachments
(
featureId
)
{
const
response
=
await
axios
.
get
(
const
response
=
await
axios
.
get
(
`
${
baseUrl
}
features/
${
featureId
}
/attachments/`
`
${
baseUrl
}
features/
${
featureId
}
/attachments/`
...
...
This diff is collapsed.
Click to expand it.
src/views/feature/Feature_detail.vue
+
15
−
20
View file @
50253d40
...
@@ -235,17 +235,15 @@
...
@@ -235,17 +235,15 @@
</div>
</div>
<div
class=
"extra text"
>
<div
class=
"extra text"
>
{{
event
.
related_comment
.
comment
}}
{{
event
.
related_comment
.
comment
}}
<div
v-frag
v-if=
"event.related_comment.attachments"
>
<div
v-frag
v-if=
"event.related_comment.attachment"
>
<div
<br
/><a
v-frag
:href=
"
v-for=
"att in event.related_comment.attachments"
DJANGO_BASE_URL + event.related_comment.attachment.url
:key=
"att.title"
"
tarrget=
"_blank"
><i
class=
"paperclip fitted icon"
></i>
{{
event
.
related_comment
.
attachment
.
title
}}
</a
>
>
<br
/><a
:href=
"att.url"
tarrget=
"_blank"
><i
class=
"paperclip fitted icon"
></i>
{{
att
.
title
}}
</a
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -273,15 +271,6 @@
...
@@ -273,15 +271,6 @@
method=
"POST"
method=
"POST"
enctype=
"multipart/form-data"
enctype=
"multipart/form-data"
>
>
<!--
<div
v-if=
"comment_form.non_field_errors"
class=
"alert alert-danger"
role=
"alert"
>
<span
v-for=
"error in comment_form.non_field_errors"
:key=
"error"
>
{{
error
}}
</span>
</div>
-->
<div
class=
"required field"
>
<div
class=
"required field"
>
<label
:for=
"comment_form.comment.id_for_label"
<label
:for=
"comment_form.comment.id_for_label"
>
Ajouter un commentaire
</label
>
Ajouter un commentaire
</label
...
@@ -539,6 +528,12 @@ export default {
...
@@ -539,6 +528,12 @@ export default {
});
});
},
},
getFeatureEvents
()
{
featureAPI
.
getFeatureEvents
(
this
.
$route
.
params
.
slug_signal
)
.
then
((
data
)
=>
(
this
.
events
=
data
));
},
getFeatureAttachments
()
{
getFeatureAttachments
()
{
featureAPI
featureAPI
.
getFeatureAttachments
(
this
.
$route
.
params
.
slug_signal
)
.
getFeatureAttachments
(
this
.
$route
.
params
.
slug_signal
)
...
@@ -562,7 +557,7 @@ export default {
...
@@ -562,7 +557,7 @@ export default {
"
feature_type/SET_CURRENT_FEATURE_TYPE_SLUG
"
,
"
feature_type/SET_CURRENT_FEATURE_TYPE_SLUG
"
,
this
.
$route
.
params
.
slug_type_signal
this
.
$route
.
params
.
slug_type_signal
);
);
this
.
getFeatureEvents
();
this
.
getFeatureAttachments
();
this
.
getFeatureAttachments
();
this
.
getLinkedFeatures
();
this
.
getLinkedFeatures
();
},
},
...
...
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