diff --git a/hc/accounts/models.py b/hc/accounts/models.py index d236b0bf..b58b562a 100644 --- a/hc/accounts/models.py +++ b/hc/accounts/models.py @@ -115,7 +115,7 @@ class Profile(models.Model): is_owner = models.Q(owner=self.user) is_member = models.Q(member__user=self.user) - return Project.objects.filter(is_owner | is_member) + return Project.objects.filter(is_owner | is_member).order_by("name") def checks_from_all_projects(self): """ Return a queryset of checks from projects we have access to. """ diff --git a/hc/front/views.py b/hc/front/views.py index f6774d61..1b0ca833 100644 --- a/hc/front/views.py +++ b/hc/front/views.py @@ -102,6 +102,7 @@ def my_checks(request, code): request.profile.save() if request.profile.current_project_id != project.id: + request.project = project request.profile.current_project = project request.profile.save() diff --git a/static/css/add_project_modal.css b/static/css/add_project_modal.css new file mode 100644 index 00000000..5307f861 --- /dev/null +++ b/static/css/add_project_modal.css @@ -0,0 +1,12 @@ +#add-project-modal .modal-header { + border-bottom: 0; +} + +#add-project-modal .modal-body { + padding: 0 50px 50px 50px; +} + +#add-project-modal h1 { + text-align: center; + margin: 0 0 50px 0; +} \ No newline at end of file diff --git a/static/css/projects.css b/static/css/projects.css index bcfafc98..e18112a2 100644 --- a/static/css/projects.css +++ b/static/css/projects.css @@ -1,15 +1,13 @@ -#my-projects a { - display: block; +#project-selector a { color: #333; } -#my-projects a:hover { +#project-selector a:hover { text-decoration: none; } -#my-projects a:hover .panel { +#project-selector a:hover .panel { border-color: #0091EA; } - diff --git a/templates/accounts/add_project_modal.html b/templates/accounts/add_project_modal.html new file mode 100644 index 00000000..44ebbe7d --- /dev/null +++ b/templates/accounts/add_project_modal.html @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/templates/accounts/profile.html b/templates/accounts/profile.html index d6059708..db00a822 100644 --- a/templates/accounts/profile.html +++ b/templates/accounts/profile.html @@ -117,7 +117,7 @@ href="#" class="btn btn-default pull-right" data-toggle="modal" - data-target="#create-project-modal">Create Project + data-target="#add-project-modal">Create New Project {% if left_project %} @@ -170,39 +170,6 @@ - - +{% include "accounts/add_project_modal.html" %} + {% endblock %} {% block scripts %} diff --git a/templates/base.html b/templates/base.html index d269ec28..b09686b6 100644 --- a/templates/base.html +++ b/templates/base.html @@ -44,6 +44,7 @@ + {% endcompress %} diff --git a/templates/front/projects.html b/templates/front/projects.html index 796cbb80..f68a4834 100644 --- a/templates/front/projects.html +++ b/templates/front/projects.html @@ -7,16 +7,22 @@ {% block content %}
-

My Projects

- {% for message in messages %} -

{{ message }}

- {% endfor %} - - +{% include "accounts/add_project_modal.html" %} + {% endblock %} {% block scripts %}