forked from aboutcode-org/scancode.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add clone method on Project model aboutcode-org#822 (aboutcode-org#874)
Signed-off-by: Thomas Druez <[email protected]>
- Loading branch information
Showing
12 changed files
with
228 additions
and
36 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
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,18 @@ | ||
<div class="modal" id="clone-modal"> | ||
<div class="modal-background"></div> | ||
<div class="modal-card"> | ||
<header class="modal-card-head"> | ||
<p class="modal-card-title">Clone this project</p> | ||
<button class="delete" aria-label="close"></button> | ||
</header> | ||
<form hx-post="{% url 'project_clone' project.slug %}" hx-target="#clone-modal-form-body">{% csrf_token %} | ||
<section id="clone-modal-form-body" class="modal-card-body" hx-get="{% url 'project_clone' project.slug %}" hx-trigger="revealed"> | ||
Loading form... | ||
</section> | ||
<footer class="modal-card-foot is-flex is-justify-content-space-between"> | ||
<button class="button" type="reset">Cancel</button> | ||
<button class="button is-no-close is-link" type="submit">Clone Project</button> | ||
</footer> | ||
</form> | ||
</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,5 @@ | ||
<div id="form-errors" class="notification is-danger {% if not form.errors %}is-hidden{% endif %}"> | ||
{% for field_name, errors in form.errors.items %} | ||
{{ errors }} | ||
{% endfor %} | ||
</div> |
36 changes: 36 additions & 0 deletions
36
scanpipe/templates/scanpipe/includes/project_clone_form.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,36 @@ | ||
{% include 'scanpipe/includes/form_errors.html' %} | ||
<div class="field"> | ||
<label class="label" for="{{ form.clone_name.id_for_label }}">{{ form.clone_name.label }}</label> | ||
<div class="control"> | ||
{{ form.clone_name }} | ||
<p class="help">{{ form.clone_name.help_text }}</p> | ||
</div> | ||
</div> | ||
<div class="field"> | ||
<label class="checkbox" for="{{ form.copy_inputs.id_for_label }}"> | ||
{{ form.copy_inputs }} | ||
{{ form.copy_inputs.label }} | ||
</label> | ||
<p class="help">{{ form.copy_inputs.help_text }}</p> | ||
</div> | ||
<div class="field"> | ||
<label class="checkbox" for="{{ form.copy_pipelines.id_for_label }}"> | ||
{{ form.copy_pipelines }} | ||
{{ form.copy_pipelines.label }} | ||
</label> | ||
<p class="help">{{ form.copy_pipelines.help_text }}</p> | ||
</div> | ||
<div class="field"> | ||
<label class="checkbox" for="{{ form.copy_settings.id_for_label }}"> | ||
{{ form.copy_settings }} | ||
{{ form.copy_settings.label }} | ||
</label> | ||
<p class="help">{{ form.copy_settings.help_text }}</p> | ||
</div> | ||
<div class="field"> | ||
<label class="checkbox" for="{{ form.execute_now.id_for_label }}-clone"> | ||
<input type="checkbox" name="{{ form.execute_now.name }}" id="{{ form.execute_now.id_for_label }}-clone"> | ||
{{ form.execute_now.label }} | ||
</label> | ||
<p class="help">{{ form.execute_now.help_text }}</p> | ||
</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
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
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