]> git.lizzy.rs Git - cheatdb.git/commitdiff
Promote webhooks in release creation page
authorrubenwardy <rw@rubenwardy.com>
Sat, 25 Jan 2020 01:29:55 +0000 (01:29 +0000)
committerrubenwardy <rw@rubenwardy.com>
Sat, 25 Jan 2020 01:29:55 +0000 (01:29 +0000)
app/templates/packages/release_new.html
app/templates/packages/view.html

index 9392ff66b5c698efb962d0d3d425d6d22993c9fe..9a95530bdff64f029d4119616cffb85d8cb72481 100644 (file)
@@ -5,6 +5,24 @@
 {% endblock %}
 
 {% block content %}
+       <p class="alert alert-info mb-4">
+               <a class="float-right btn btn-sm btn-info" href="{{ url_for('flatpage', path='help/release_webhooks') }}">{{ _("Learn more") }}</a>
+               {% if package.author == current_user and package.checkPerm(current_user, "APPROVE_RELEASE") and package.getIsOnGitHub() %}
+                       <a class="float-right btn btn-sm btn-info mr-2" href="{{ url_for('github.setup_webhook', pid=package.id) }}">{{ _("Setup webhook") }}</a>
+                       <i class="fas fa-info mr-2"></i>
+
+                       {{ _("Set up a webhook on GitHub to create releases automatically.") }}
+               {% elif package.repo %}
+                       <i class="fas fa-info mr-2"></i>
+
+                       {{ _("You can create releases automatically when you push commits or tags to your repository.") }}
+               {% else %}
+                       <i class="fas fa-info mr-2"></i>
+
+                       {{ _("Using git will allow you to create releases automatically when you push code or tags.") }}
+               {% endif %}
+       </p>
+
        {% from "macros/forms.html" import render_field, render_submit_field, render_radio_field %}
        <form method="POST" action="" enctype="multipart/form-data">
                {{ form.hidden_tag() }}
index 9dce0d44ccf51403c2b0ddca25eacb880ba083b0..77b84da21aef690e076a624062b1106ab0d01867 100644 (file)
                                </ul>
                        </div>
 
-                       {% if package.author == current_user and package.checkPerm(current_user, "APPROVE_RELEASE") and package.getIsOnGitHub() %}
-                       <p class="small text-centered">
-                               <a href="{{ url_for('github.setup_webhook', pid=package.id) }}">
-                                       Set up a webhook
-                               </a>
-                               to create releases automatically.
-                       </p>
-                       {% endif %}
-
                        <div class="card my-4">
                                <div class="card-header">
                                        {% if package.approved and package.checkPerm(current_user, "CREATE_THREAD") %}