Skip to content

Commit

Permalink
Add maintainer field to plugin update
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Nov 29, 2023
1 parent 08f01b4 commit 7527c5b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions qgis-app/plugins/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,24 @@ class Meta:
"tracker",
"repository",
"owners",
"created_by",
"tags",
"server",
)

def __init__(self, *args, **kwargs):
super(PluginForm, self).__init__(*args, **kwargs)
self.fields['owners'].label = "Collaborators"

choices = (
(self.instance.created_by.pk, self.instance.created_by.username + " (Plugin creator)"),
)
for owner in self.instance.owners.exclude(pk=self.instance.created_by.pk):
choices += ((owner.pk, owner.username + " (Collaborator)"),)

self.fields['created_by'].choices = choices
self.fields['created_by'].label = "Maintainer"

def clean(self):
"""
Check author
Expand Down
2 changes: 1 addition & 1 deletion qgis-app/plugins/templates/plugins/plugin_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h2>{{ form_title }} {{ plugin }}</h2>
let element = document.getElementById('id_owners');
if(element) {
$('#id_owners').chosen({
placeholder_text_multiple: "Select Some Owners",
placeholder_text_multiple: "Select Some Collaborators",
no_results_text: "Oops, nothing found!"
});
clearInterval(checkElement);
Expand Down

0 comments on commit 7527c5b

Please sign in to comment.