Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jacques Dafflon
committed
May 27, 2015
1 parent
6f519b0
commit d103efa
Showing
8 changed files
with
150 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* This file is part of Indico. | ||
* Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). | ||
* | ||
* Indico is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License as | ||
* published by the Free Software Foundation; either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* Indico is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Indico; if not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
@import 'base'; | ||
|
||
.static-sites { | ||
width: 650px; | ||
.i-table-widget { | ||
border: 0; | ||
// date | ||
th:nth-child(2), | ||
td:nth-child(2), | ||
// download | ||
th:nth-child(4), | ||
td:nth-child(4) { | ||
text-align: center; | ||
} | ||
// date | ||
td:nth-child(2) { | ||
color: $dark-gray; | ||
} | ||
// status | ||
th:nth-child(3), | ||
td:nth-child(3) { | ||
text-align: center; | ||
.i-label { | ||
width: 100%; | ||
|
||
border: 0; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
indico/modules/events/static/templates/events/static/static_sites.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<div class="i-box-group vert fixed-width static-sites"> | ||
<div class="i-box titled"> | ||
<div class="i-box-header"> | ||
<div class="i-box-title">{%- trans %}New Offline Copy{% endtrans -%}</div> | ||
<button id="test" class="i-button icon-wrench right" type="button" | ||
data-method="post" | ||
data-href="{{ url_for('static_site.build', event) }}" | ||
data-title="{{ _('Build an offline copy') }}" | ||
data-confirm="{{ _('Are you sure you want to build an offline copy of this event?<br>Beware that it is a heavy operation, especially for large events, and it might take some time to finish.') }}">{{_('Build offline copy')}} | ||
</button> | ||
</div> | ||
<div class="i-box-content"> | ||
{% trans %}This will build an offline copy of the event. This is useful if you want to make it available where no Internet connection is available.{% endtrans %}</li> | ||
</div> | ||
</div> | ||
<div class="i-box titled no-padding"> | ||
<div class="i-box-header"> | ||
<div class="i-box-title">{%- trans %}Existing Offline Copies{% endtrans -%}</div> | ||
</div> | ||
<div class="i-box-content"> | ||
{% if static_sites %} | ||
{% set label_mapping = { | ||
'success': 'accept', | ||
'failed': 'danger', | ||
'expired': 'warning', | ||
'running': 'highlight' | ||
} %} | ||
{% set has_downloads = static_sites|selectattr('state.name', 'equalto', 'success')|any %} | ||
<table class="i-table-widget"> | ||
<thead> | ||
<tr> | ||
<th>{% trans %}Requested by{% endtrans %}</th> | ||
<th>{% trans %}Requested on{% endtrans %}</th> | ||
<th>{% trans %}Status{% endtrans %}</th> | ||
{% if has_downloads %} | ||
<th>{% trans %}Download{% endtrans %}</th> | ||
{% endif %} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for site in static_sites %} | ||
<tr> | ||
<td>{{ site.user.full_name }}</td> | ||
<td>{{ site.requested_dt|format_datetime }}</td> | ||
<td><span class="i-label {{ label_mapping.get(site.state.name, 'disabled') }}">{{ site.state.title }}</span></td> | ||
{% if has_downloads %} | ||
<td> | ||
{% if site.state.name == 'success' %} | ||
<a href="{{ url_for('static_site.download', site, _external=True) }}" class="i-button icon-file-download"> | ||
{%- trans %}Download{% endtrans -%} | ||
</a> | ||
{% endif %} | ||
</td> | ||
{% endif %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% else %} | ||
<span class="empty">{% trans %}There are no offline copies of this event.{% endtrans %}</span> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This file is part of Indico. | ||
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). | ||
# | ||
# Indico is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation; either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# Indico is distributed in the hope that it will be useful, but | ||
# WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with Indico; if not, see <http://www.gnu.org/licenses/>. | ||
|
||
from MaKaC.webinterface.pages.conferences import WPConfModifToolsBase | ||
from MaKaC.webinterface.pages.base import WPJinjaMixin | ||
|
||
|
||
class WPStaticSites(WPConfModifToolsBase, WPJinjaMixin): | ||
template_prefix = 'events/static/' | ||
|
||
def getCSSFiles(self): | ||
return WPConfModifToolsBase.getCSSFiles(self) + self._asset_env['event_management_sass'].urls() | ||
|
||
def _setActiveTab(self): | ||
self._tabOffline.setActive() | ||
|
||
def _getTabContent(self, params): | ||
return WPJinjaMixin._getPageContent(self, params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters