]> git.ipfire.org Git - pbs.git/commitdiff
web: Drop the unused Modal module
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Oct 2022 17:45:46 +0000 (17:45 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Oct 2022 17:45:46 +0000 (17:45 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/templates/modules/modal-base.html [deleted file]
src/templates/modules/modal-build-comment.html [deleted file]
src/templates/modules/modal-build-push.html [deleted file]
src/templates/modules/modal-build-unpush.html [deleted file]
src/web/__init__.py
src/web/ui_modules.py

index 9e0f6881eab93136be85c2c7515c2db852cde45a..6348ccd4a2b9da340244dea0d66f5d9cfe7e5c82 100644 (file)
@@ -255,10 +255,6 @@ dist_templates_modules_DATA = \
        src/templates/modules/commits-table.html \
        src/templates/modules/commit-message.html \
        src/templates/modules/link-to-user.html \
-       src/templates/modules/modal-base.html \
-       src/templates/modules/modal-build-comment.html \
-       src/templates/modules/modal-build-push.html \
-       src/templates/modules/modal-build-unpush.html \
        src/templates/modules/packages-files-table.html \
        src/templates/modules/source-table.html \
        src/templates/modules/text.html
diff --git a/src/templates/modules/modal-base.html b/src/templates/modules/modal-base.html
deleted file mode 100644 (file)
index f26143a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<div class="modal fade" id="{% block id %}{% end block %}" tabindex="-1">
-       <div class="modal-dialog modal-lg" role="document">
-               <div class="modal-content">
-                       <div class="modal-header">
-                               {% block header %}
-                                       <h3 style="word-wrap: break-word;" class="modal-title" id="{% block id %}{% end block %}">
-                                               {% block title %}{% end block %}
-                                       </h3>
-                                       <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                                               <span aria-hidden="true">&times;</span>
-                                       </button>
-                               {% end block %}
-                       </div>
-                       <form method="POST" action="{% block form_action %}{% end block %}">
-                               {% raw xsrf_form_html() %}
-                               <div class="modal-body">
-                                       {% block body %}{% end block %}
-                               </div>
-                               <div class="modal-footer">
-                                       <div class="float-right" style="width:100%">
-                                               {% block footer %}
-                                                       <p class="float-left">
-                                                               {% block footer_text %}{% end block %}
-                                                       </p>
-                                                       <button type="submit" class="btn btn-primary mb-2">
-                                                               {% block submit_text %}{{ _("Submit") }}{% end block %}
-                                                       </button>
-                                                       <a class="btn mb-2" data-dismiss="modal">
-                                                               {% block close_text %}{{ _("Cancel") }}{% end block %}
-                                                       </a>
-                                               {% end block %}
-                                       </div>
-                               </div>
-                       </form>
-               </div>
-       </div>
-</div>
\ No newline at end of file
diff --git a/src/templates/modules/modal-build-comment.html b/src/templates/modules/modal-build-comment.html
deleted file mode 100644 (file)
index d292ab1..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-{% extends "modal-base.html" %}
-
-{% block id %}comment{% end block %}
-{% block form_action %}/build/{{ build.uuid }}/comment{% end block %}
-
-{% block title %}
-       {% if current_user %}
-               {{ _("Comment on %s") % build.name }}
-       {% else %}
-               {{ _("Log in to comment") }}
-       {% end %}
-{% end block %}
-
-{% block body %}
-       {% if current_user %}
-                       <div class="form-group">
-                               <label for="cmttxt">{{ _("Comment") }}</label>
-                               <textarea class="form-control" id="cmttxt" name="text" rows="8"></textarea>
-                               </div>
-                       <div class="form-group">
-                               <label for="vote">{{ _("Vote") }}</label>
-                               <select class="form-control" id="vote" name="vote">
-                                       <option value="option1" checked>{{ _("Not tested.") }}</option>
-                                       <option value="up">{{ _("Works for me.") }}</option>
-                                       <option value="down">{{ _("Does not work.") }}</option>
-                               </select>
-                       </div>
-       {% else %}
-               <p>
-                       {{ _("You need to log in to comment.") }}
-                       {{ _("Click on the button below to do so.") }}
-               </p>
-       {% end %}
-{% end block %}
-
-{% block footer %}
-       {% if current_user %}
-               <button type="submit" class="btn btn-primary">{{ _("Submit comment") }}</button>
-       {% else %}
-               <a class="btn btn-primary" href="/login">{{ _("Login") }}</a>
-       {% end %}
-
-       <a class="btn" href="#" data-dismiss="modal">{{ _("Cancel") }}</a>
-{% end block %}
diff --git a/src/templates/modules/modal-build-push.html b/src/templates/modules/modal-build-push.html
deleted file mode 100644 (file)
index 7fb61b1..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-{% extends "modal-base.html" %}
-
-{% block id %}push{% end block %}
-{% block form_action %}/build/{{ build.uuid }}/manage{% end block %}
-
-{% block title %}
-       {{ _("Push %s to a repository") % build.name }}
-{% end block %}
-
-{% block body %}
-       <input type="hidden" name="action" value="push" />
-
-       {% if not build.all_jobs_finished %}
-               <div class="alert alert-warning">
-                       <strong>{{ _("Not all jobs are finished!") }}</strong>
-                       {{ _("So it is <em>strongly</em> discouraged to push this build into the next repository.") }}
-               </div>
-
-               <hr>
-       {% end %}
-
-       <fieldset>
-               <div class="control-group">
-                       <label class="control-label">{{ _("New repository") }}</label>
-                       <div class="controls">
-                               <select id="repo" name="repo" {% if not current_user.is_admin() %}disabled{% end %}>
-                                       {% for repo in [r for r in build.distro.repositories if not r == current_repo] %}
-                                               <option value="{{ repo.identifier }}" {% if repo == next_repo %}selected{% end %}>
-                                                       {{ repo.name }} - {{ repo.summary }}
-                                               </option>
-                                       {% end %}
-                               </select>
-
-                               <p class="help-block">
-                                       {{ _("The build will be put into this repository.") }}
-                               </p>
-                       </div>
-               </div>
-       </fieldset>
-
-       <hr>
-
-       <p>
-               {{ _("You are going to push this build into a new repository.") }}
-               {{ _("This means that the build won't be part of the repository it is currently in anymore.") }}
-       </p>
-       <p>
-               {{ _("Please make sure you tested this build well enough that it will keep up with the quality level of the target repository.") }}
-       </p>
-{% end block %}
-
-{% block footer_text %}
-       {% if current_repo %}
-               {{ _("Current repository") }}:
-               <a href="/distro/{{ build.distro.identifier }}/repo/{{ current_repo.identifier }}">
-                       {{ current_repo.name }}
-               </a>
-       {% end %}
-{% end %}
-{% block submit_text %}{{ _("Push") }}{% end block %}
diff --git a/src/templates/modules/modal-build-unpush.html b/src/templates/modules/modal-build-unpush.html
deleted file mode 100644 (file)
index eeacfb7..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-{% extends "modal-base.html" %}
-
-{% block id %}unpush{% end block %}
-{% block form_action %}/build/{{ build.uuid }}/manage{% end block %}
-
-{% block title %}{{ _("Unpush %s from a repository") % build.name }}{% end block %}
-
-{% block body %}
-       <input type="hidden" name="action" value="unpush" />
-
-       <fieldset>
-               <div class="control-group">
-                       <label class="control-label">{{ _("Current repository") }}</label>
-                       <div class="controls">
-                               <select id="repo" name="repo" disabled>
-                                       <option value="{{ repo.identifier }}">
-                                               {{ repo.name }} - {{ repo.summary }}
-                                       </option>
-                               </select>
-                       </div>
-               </div>
-       </fieldset>
-
-       <hr>
-
-       <p>
-               {{ _("You are going to unpush this build from its repository.") }}
-               {{ _("This means that the build won't be installable from this repository anymore.") }}
-       </p>
-
-       {% if not build.state in ("obsolete", "broken") %}
-               <p>
-                       {{ _("If you consider this build being obsolete or broken, please don't forget to mark it so.") }}
-               </p>
-       {% end %}
-{% end block %}
-
-{% block submit_text %}{{ _("Unpush") }}{% end block %}
index dd5620d511240184034ff01e5f8de400367930e2..fd6e6dab15feb1a4800a634b870b92756eadc765 100644 (file)
@@ -38,7 +38,6 @@ class Application(tornado.web.Application):
                        ui_modules = {
                                "Highlight"          : ui_modules.HighlightModule,
                                "Text"               : ui_modules.TextModule,
-                               "Modal"              : ui_modules.ModalModule,
 
                                # Bugs
                                "BugsList"           : bugs.ListModule,
index 5ebbc6153c4adcd33552d7b5ba08227388b5c023..308a15d523d0734224f92798bbb038e0c15da712 100644 (file)
@@ -71,13 +71,6 @@ class CommitMessageModule(UIModule):
                return self.render_string("modules/commit-message.html", commit=commit)
 
 
-class ModalModule(UIModule):
-       def render(self, what, **kwargs):
-               what = "modules/modal-%s.html" % what
-
-               return self.render_string(what, **kwargs)
-
-
 class JobsStatusModule(UIModule):
        def render(self, build):
                return self.render_string("modules/jobs/status.html",