You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2018/02/27 17:08:03 UTC

[airavata-django-portal] 03/03: AIRAVATA-2698 App descriptions, displayed on home page

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 3464e2f31a7d7f5a18084896ab4db412ee7302fb
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Tue Feb 27 12:07:54 2018 -0500

    AIRAVATA-2698 App descriptions, displayed on home page
---
 django_airavata/app_config.py                      |  6 ++++++
 django_airavata/apps/groups/apps.py                |  3 +++
 django_airavata/apps/workspace/apps.py             |  3 +++
 .../templates/django_airavata/home.html            | 25 +++++++++++++++++-----
 4 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/django_airavata/app_config.py b/django_airavata/app_config.py
index f4dfb34..57fdde2 100644
--- a/django_airavata/app_config.py
+++ b/django_airavata/app_config.py
@@ -30,3 +30,9 @@ class AiravataAppConfig(AppConfig, ABC):
     def fa_icon_class(self):
         """Font Awesome icon class name."""
         pass
+
+    @property
+    @abstractmethod
+    def app_description(self):
+        """Some user friendly text to briefly describe the application."""
+        pass
diff --git a/django_airavata/apps/groups/apps.py b/django_airavata/apps/groups/apps.py
index 1680810..7abdfba 100755
--- a/django_airavata/apps/groups/apps.py
+++ b/django_airavata/apps/groups/apps.py
@@ -9,3 +9,6 @@ class GroupsConfig(AiravataAppConfig):
     app_order = 10
     url_home = url_app_name + ':manage'
     fa_icon_class = 'fa-users'
+    app_description = """
+        Create and manage user groups.
+    """
diff --git a/django_airavata/apps/workspace/apps.py b/django_airavata/apps/workspace/apps.py
index 2692ec1..e95c1d7 100644
--- a/django_airavata/apps/workspace/apps.py
+++ b/django_airavata/apps/workspace/apps.py
@@ -9,3 +9,6 @@ class WorkspaceConfig(AiravataAppConfig):
     app_order = 0
     url_home = 'django_airavata_workspace:dashboard'
     fa_icon_class = 'fa-flask'
+    app_description = """
+        Launch applications and manage your experiments and projects.
+    """
diff --git a/django_airavata/templates/django_airavata/home.html b/django_airavata/templates/django_airavata/home.html
index 00c7ce4..048df50 100644
--- a/django_airavata/templates/django_airavata/home.html
+++ b/django_airavata/templates/django_airavata/home.html
@@ -2,16 +2,31 @@
 
 {% block content %}
 <div class="jumbotron">
-    <div class="container">
         <h1>Welcome!</h1>
         <p>This is the Django based web portal for the Airavata project. This
         portal can be used as the basis for developing a science gateway using
         Airavata.</p>
-        {% if user.is_authenticated %}
-        <p><a class="btn btn-primary btn-lg" href="{% url 'django_airavata_workspace:projects' %}" role="button">Go to your Projects »</a></p>
-        {% else %}
+        {% if not user.is_authenticated %}
         <p><a class="btn btn-primary btn-lg" href="{% url 'django_airavata_auth:login' %}" role="button">Login »</a></p>
         {% endif %}
-    </div>
 </div>
+{% if user.is_authenticated %}
+    {% for app in airavata_apps %}
+    {% if not forloop.counter|divisibleby:"2" %}
+    <div class="row">
+    {% endif %}
+        <div class="col-sm-6">
+            <div class="card">
+                <div class="card-body">
+                    <h5 class="card-title"><i class="fa {{ app.fa_icon_class }} mr-2"></i>{{ app.verbose_name }}</h5>
+                    <p class="card-text">{{ app.app_description }}</p>
+                    <a href="{% url app.url_home %}" class="btn btn-primary">Go to {{ app.verbose_name }} »</a>
+                </div>
+            </div>
+        </div>
+    {% if forloop.counter|divisibleby:"2" %}
+    </div>
+    {% endif %}
+    {% endfor %}
+{% endif %}
 {% endblock content %}

-- 
To stop receiving notification emails like this one, please contact
machristie@apache.org.