Skip to content

Commit

Permalink
Add "Add collaborator" in the management section when editing a datap…
Browse files Browse the repository at this point in the history
…ackage
  • Loading branch information
cpina committed Nov 24, 2020
1 parent e1541b7 commit 0d99271
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion SchemaCollaboration/core/templates/core/_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css">

<link rel="stylesheet" type="text/css" href="{% static '/css/css.css' %}">

<style>{% block style %}{% endblock %}</style>
<title>{% block title %}{% endblock %}</title>
</head>
<body class="{% block body_class %}{% endblock %}">
Expand Down
6 changes: 5 additions & 1 deletion SchemaCollaboration/management/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ def __init__(self, *args, **kwargs):

self.fields['status'].queryset = self.fields['status'].queryset.order_by('name')
self.fields['collaborators'].queryset = self.fields['collaborators'].queryset.order_by('full_name')
self.fields['collaborators'].help_text = 'Hold down “Control”, or “Command” on a Mac, to select more than one'
self.fields['collaborators'].help_text = 'Refresh page to show new collaborators. Hold down “Control”, or “Command” on a Mac, to select more than one'
self.fields['collaborators'].widget.attrs = {'size': 10}

collaborator_add_url = reverse('management:collaborator-add')

self.fields['collaborators'].label = f'Collaborators <div class="float-right"><a target="_blank" href="{collaborator_add_url}"><i class="fas fa-user-plus"></i> Add collaborator <i class="fas fa-external-link-alt"></i></a></div>'

self.helper.layout = Layout(
Div(
Div('status', css_class='col-6'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{% extends 'management/_base_with_sidebar.html' %}
{% load crispy_forms_tags %}

{% block style %}
{#Makes the label a block: we can use the float-right in the Form for "Add collaborator" #}
#div_id_collaborators > label {
display: block;
}
{% endblock %}

{% block title %}Datapackage{% endblock %}
{% block main_contents %}
<h1>Datapackage</h1>
Expand Down

0 comments on commit 0d99271

Please sign in to comment.