Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
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
SFB 1288 - INF
nopaque
Commits
c2471e18
Commit
c2471e18
authored
1 year ago
by
Inga Kirschnick
Browse files
Options
Downloads
Plain Diff
Merge branch 'public-corpus' of gitlab.ub.uni-bielefeld.de:sfb1288inf/nopaque into public-corpus
parents
4c277cd6
d6789a03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/corpora/followers/json_routes.py
+1
-0
1 addition, 0 deletions
app/corpora/followers/json_routes.py
app/models.py
+11
-5
11 additions, 5 deletions
app/models.py
app/templates/corpora/corpus.html.j2
+1
-1
1 addition, 1 deletion
app/templates/corpora/corpus.html.j2
with
13 additions
and
6 deletions
app/corpora/followers/json_routes.py
+
1
−
0
View file @
c2471e18
...
...
@@ -11,6 +11,7 @@ from app.models import (
from
..decorators
import
corpus_follower_permission_required
from
.
import
bp
@bp.route
(
'
/<hashid:corpus_id>/followers
'
,
methods
=
[
'
POST
'
])
@corpus_follower_permission_required
(
'
MANAGE_FOLLOWERS
'
)
@content_negotiation
(
consumes
=
'
application/json
'
,
produces
=
'
application/json
'
)
...
...
This diff is collapsed.
Click to expand it.
app/models.py
+
11
−
5
View file @
c2471e18
...
...
@@ -787,11 +787,17 @@ class User(HashidMixin, UserMixin, db.Model):
#endregion Profile Privacy settings
def
follow_corpus
(
self
,
corpus
,
role
=
None
):
if
role
is
None
:
cfr
=
CorpusFollowerRole
.
query
.
filter_by
(
default
=
True
).
first
()
else
:
cfr
=
role
if
self
.
is_following_corpus
(
corpus
):
return
r
=
CorpusFollowerRole
.
query
.
filter_by
(
default
=
True
).
first
()
if
role
is
None
else
role
cfa
=
CorpusFollowerAssociation
(
corpus
=
corpus
,
role
=
r
,
follower
=
self
)
db
.
session
.
add
(
cfa
)
cfa
=
CorpusFollowerAssociation
.
query
.
filter_by
(
corpus
=
corpus
,
follower
=
self
).
first
()
if
cfa
.
role
!=
cfr
:
cfa
.
role
=
cfr
else
:
cfa
=
CorpusFollowerAssociation
(
corpus
=
corpus
,
role
=
cfr
,
follower
=
self
)
db
.
session
.
add
(
cfa
)
def
unfollow_corpus
(
self
,
corpus
):
if
not
self
.
is_following_corpus
(
corpus
):
...
...
@@ -840,7 +846,7 @@ class User(HashidMixin, UserMixin, db.Model):
if
role
is
None
:
return
False
self
.
follow_corpus
(
corpus
,
role
)
db
.
session
.
add
(
self
)
#
db.session.add(self)
return
True
def
to_json_serializeable
(
self
,
backrefs
=
False
,
relationships
=
False
,
filter_by_privacy_settings
=
False
):
...
...
This diff is collapsed.
Click to expand it.
app/templates/corpora/corpus.html.j2
+
1
−
1
View file @
c2471e18
...
...
@@ -192,7 +192,7 @@
<div class="input-field">
<i class="material-icons prefix">badge</i>
<select id="share-link-modal-corpus-follower-role-select">
{% for cfr in cfrs %}
{% for cfr in cfrs
if cfr.name != 'Anonymous'
%}
<option value="{{ cfr.name }}">{{ cfr.name }}</option>
{% endfor %}
</select>
...
...
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