Improve dashboard layout

master
Drew DeVault 3 years ago
parent a3fd75170b
commit dfaf5bceb5
  1. 8
      hubsrht/templates/dashboard.html
  2. 24
      hubsrht/templates/event.html
  3. 2
      hubsrht/templates/resource-new.html
  4. 8
      scss/main.scss

@ -18,7 +18,7 @@
>Create new project {{icon("caret-right")}}</a>
<a
href="#"
class="btn btn-default btn-block"
class="btn btn-white btn-sm btn-block"
>Discover projects on {{cfg('sr.ht', 'site-name')}} {{icon("caret-right")}}</a>
<a
href="{{url_for("public.getting_started")}}"
@ -60,7 +60,7 @@
<div class="pull-right">
<a
href="#"
class="btn btn-default"
class="btn btn-link"
>More projects&nbsp;{{icon("caret-right")}}</a>
</div>
<div class="clearfix"></div>
@ -70,13 +70,13 @@
<div class="col-md-12">
<div class="event-list project-events">
{% for event in events %}
{{ eventutil.event(event) }}
{{ eventutil.event(event, project=True) }}
{% endfor %}
</div>
<div class="pull-right">
<a
href="#"
class="btn btn-default"
class="btn btn-link"
>More events&nbsp;{{icon("caret-right")}}</a>
</div>
</div>

@ -1,35 +1,33 @@
{% macro event(event) %}
{% if event.event_type == EventType.source_repo_added %}
{% macro event(event, project=False) %}
<div class="event">
{% if event.event_type == EventType.source_repo_added %}
<a
href="{{event.source_repo.url()}}"
>{{event.source_repo.owner.canonical_name}}/{{event.source_repo.name}}</a>
<p>New {{event.source_repo.repo_type.value}} repository added</p>
<small class="text-muted">{{event.created | date}}</small>
</div>
{% elif event.event_type == EventType.mailing_list_added %}
<div class="event">
<a
href="{{event.mailing_list.url()}}"
>{{event.mailing_list.owner.canonical_name}}/{{event.mailing_list.name}}</a>
<p>New mailing list added</p>
<small class="text-muted">{{event.created | date}}</small>
</div>
{% elif event.event_type == EventType.tracker_added %}
<div class="event">
<a
href="{{event.tracker.url()}}"
>{{event.tracker.owner.canonical_name}}/{{event.tracker.name}}</a>
<p>New ticket tracker added</p>
<small class="text-muted">{{event.created | date}}</small>
</div>
{% elif event.event_type == EventType.external_event %}
<div class="event">
{{event.external_summary | md}}
{{event.external_details | md}}
<small class="text-muted">{{event.created | date}}</small>
</div>
{% else %}
TODO: implement event type {{event.event_type}}
{% endif %}
<small class="text-muted">
{{event.created | date}}
{% if project %}
via <a href="{{url_for("projects.summary_GET",
owner=event.project.owner.canonical_name,
project_name=event.project.name)}}">{{event.project.name}}</a>
{% endif %}
</small>
</div>
{% endmacro %}

@ -4,7 +4,7 @@
<div class="container">
<h2>
<a
href="{{url_for("users.user_summary_GET", username=owner.username)}}"
href="{{url_for("users.summary_GET", username=owner.username)}}"
>{{owner.canonical_name}}</a>/{{project.name}}
</h2>
{% macro link(path, title, alternates, cls="") %}

@ -8,12 +8,18 @@
border-color: $gray-500;
color: $gray-900 !important;
&.btn-sm {
padding: 0.2rem 0.25rem;
}
&:hover {
background: $white;
color: $black !important;
text-decoration: none;
border-color: $black;
border-color: $gray-900;
}
transition: border-color 0.2s linear;
}
.service-list {

Loading…
Cancel
Save