| {#- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| -#} |
| {% extends "allura.ext.personal_dashboard:templates/dashboard_section_base.html" %} |
| {% import 'allura:templates/jinja_master/lib.html' as lib with context %} |
| {% import g.theme.jinja_macros as theme_macros with context %} |
| |
| {% block title %} |
| Projects |
| {% endblock %} |
| |
| {% block actions %} |
| {% if user == c.user %} |
| <a href="/{{ config.get('default_neighborhood', 'p') }}/add_project">Add Project</a> |
| {% endif %} |
| {% endblock %} |
| |
| {% block section_class %}projects{% endblock %} |
| |
| {% block content %} |
| <ul> |
| {% for project in projects %} |
| <li{% if loop.index > 5 %} class="hidden"{% endif %}> |
| {% if project.icon -%} |
| <img {{ lib.project_icon_srcs(project) }} alt="Project Logo" width="48" height="48"/> |
| {%- else -%} |
| {{ theme_macros.placeholder_project_icon() }} |
| {%- endif -%} |
| <span class="project-info"> |
| <a href="{{ project.url() }}">{{ project.name }}</a> |
| {{ project.summary or (' '|safe) }} |
| </span> |
| <span class="project-last-updated"> |
| Last Updated: |
| <time datetime="{{ project.last_updated }}" title="{{ project.last_updated }}"> |
| {{ h.ago(project.last_updated) }} |
| </time> |
| </span> |
| </li> |
| {% else %} |
| <li class="empty">No projects to display.</li> |
| {% endfor %} |
| </ul> |
| {% if projects|length > 5 %} |
| <div class="show-more-projects"> |
| <button id="show-more-profile-projects"> |
| {{ g.icons['add'].render(title='Show More', show_title=True, tag='b') }} |
| </button> |
| </div> |
| {% endif %} |
| {% endblock %} |
| |
| {% block extra_js %} |
| <script> |
| $('#show-more-profile-projects').on('click', function(e){ |
| $(this).hide().closest('.section-body').find('li.hidden').show(); |
| }); |
| </script> |
| {% endblock %} |