This repository has been archived by the owner on Mar 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When the user clicks 'Clone module' on a new or existing dashboard it will redirect to a page containing a dropdown of dashboards to select from and the form progress will be saved in the session (because of the update_modules_form_and_redirect decorator). When the user selects a dashboard and submits it will redirect back to the page, but now there will also be a dropdown containing modules on the selected dashboard. Clicking a link in this dropdown will redirect to the original dashboard page with the module now appended to the form using the following mechanism: A link of the format 'admin/dashboards/new?clone_module={module_id}' or 'admin/dashboards/dashboard_uuid?clone_module={module_id}' which when followed will redirect to a new or the existing dashboard with anything in the session still there and the new module prefilled and present.
- Loading branch information
1 parent
a6e3991
commit b1dcef7
Showing
7 changed files
with
507 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -236,3 +236,7 @@ ul.checkbox-set { | |
border-radius: 3px; | ||
color: black; | ||
} | ||
|
||
select#dashboard-uuid { | ||
max-width: 600px; | ||
} |
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,53 @@ | ||
|
||
{% extends "base.html" %} | ||
|
||
{% block body %} | ||
<div class="row"> | ||
<div class="col-lg-12"> | ||
{% if dashboards %} | ||
<form method="post" action="{{ url_for('clone_module', target_dashboard_uuid=target_dashboard_uuid) }}" role="form" class="form-inline"> | ||
<div class='form-group'> | ||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/> | ||
<label for="dashboard_uuid">Select dashboard: </label> | ||
<select class='form-control' name="dashboard_uuid" id="dashboard-uuid"> | ||
{% for dashboard in dashboards %} | ||
{% if(source_dashboard_uuid == dashboard.id) %} | ||
<option selected value="{{dashboard.id}}"> | ||
{{ dashboard.title }} | ||
</option> | ||
{% else %} | ||
<option value="{{dashboard.id}}"> | ||
{{ dashboard.title }} | ||
</option> | ||
{% endif %} | ||
{% endfor %} | ||
</select> | ||
<input type="submit" class="btn btn-default" value="Get modules" name="modules_for_dashboard"> | ||
{% if modules %} | ||
<div class="btn-group"> | ||
<button class="btn btn-primary dropdown-toggle" type="button" id="module-select" data-toggle="dropdown" aria-expanded="true"> | ||
Select modules from {{selected_dashboard.title}} | ||
<span class="caret"></span> | ||
</button> | ||
<ul class="dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="module-select"> | ||
{% for module in modules %} | ||
<li role="presentation"> | ||
<a role="menuitem" tabindex="-1" href="{{'{}?clone_module={}'.format(target_dashboard_url, module.id)}}">{{ module.title }}</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endif %} | ||
</div> | ||
</form> | ||
{% endif %} | ||
</div><!-- /.col-lg-6 --> | ||
</div><!-- /.row --> | ||
{% endblock %} | ||
|
||
{% block footer_javascripts %} | ||
<script src='/static/javascripts/jsonlint/jsonlint.js'></script> | ||
<script src='/static/javascripts/sticky-kit/sticky-kit.js'></script> | ||
<script src='/static/javascripts/sortable/jquery.sortable.min.js'></script> | ||
<script src='/static/javascripts/edit_dashboard.js'></script> | ||
{% endblock %} |
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
Oops, something went wrong.