Browse Source

Advertise github service hook a bit better

Jordi Boggiano 13 years ago
parent
commit
d97b11e273

+ 3 - 7
app/Resources/FOSUserBundle/views/Profile/show.html.twig

@@ -12,13 +12,9 @@
         {% if app.user.apiToken %}
             <h1>Your API Token</h1>
             <p><pre><code>{{ app.user.apiToken }}</code></pre></p>
-            <p>
-            You can use your API token to interact with the Packagist API.
-            </p>
-            <p>Your <a href="http://help.github.com/post-receive-hooks/">GitHub Post-Receive URL</a> is:</p>
-            <p>
-            <pre><code>{{ url('github_postreceive', { 'username': app.user.username, 'apiToken': app.user.apiToken }) }}</code></pre>
-            </p>
+            <p>You can use your API token to interact with the Packagist API.</p>
+            <h1>GitHub Service Hook</h1>
+            <p>Enabling the Packagist service hook ensures that your package will always be updated instantly when you push to GitHub. To do so you can go to your GitHub repository, click the "Admin" button, then "Service Hooks". Pick "Packagist" in the list, and add your API token (see above), plus your Packagist username if it is not the same as on GitHub. Check the "Active" box and submit the form.</p>
         {% endif %}
 
         <h1>Your packages</h1>

+ 11 - 0
src/Packagist/WebBundle/Resources/public/css/main.css

@@ -415,6 +415,17 @@ form ul {
   float: left;
   margin-right: 20px;
 }
+.package .warning {
+  clear: both;
+  border: 1px solid #800;
+  background: #fee;
+  text-align: center;
+  padding: 5px;
+  margin: 20px 0;
+  -webkit-border-radius: 3px;
+  -moz-border-radius: 3px;
+  border-radius: 3px;
+}
 .package .tags {
   line-height: 34px;
 }

+ 4 - 2
src/Packagist/WebBundle/Resources/views/About/about.html.twig

@@ -76,9 +76,11 @@ v2.0.4-p1
 
         <h1>Update Schedule</h1>
 
-        <p>New packages will be crawled <strong>within ten minutes</strong> unless you add the GitHub service hook. To do so you can go to your GitHub repository, click the "Admin" button, then "Service Hooks". Pick Packagist in the list, and add the API key you will find on your <a href="{{ path('fos_user_profile_show') }}">profile</a>, plus your Packagist username if it's not the same as on GitHub.</p>
+        <p>New packages will be crawled <strong>immediately</strong> after submission if you have JS enabled.</p>
 
-        <p>Existing packages will be crawled <strong>every hour</strong>. When the GitHub is enabled packages are only crawled once a week unless the GitHub hook triggers crawling. You can also trigger a manual build on your package page if you are logged-in.</p>
+        <p>Existing packages without auto-updating (GitHub hook) will be crawled <strong>once a day</strong> for updates. When the GitHub hook is enabled packages are crawled whenever you push, or at least once a week in case the crawl failed. You can also trigger a manual update on your package page if you are logged-in as a maintainer.</p>
+
+        <p>It is highly recommended to set up the <strong>GitHub service hook</strong> for all your packages. This reduces the load on our side, and ensures your package is updated almost instantly. To do so you can go to your GitHub repository, click the "Admin" button, then "Service Hooks". Pick "Packagist" in the list, and add the API key you will find on your <a href="{{ path('fos_user_profile_show') }}">profile</a>, plus your Packagist username if it is not the same as on GitHub. Check the "Active" box and submit the form.</p>
 
         <p>The search index is updated <strong>every five minutes</strong>. It will index (or reindex) any package that has been crawled since the last time the search indexer ran.</p>
 

+ 7 - 0
src/Packagist/WebBundle/Resources/views/Web/viewPackage.html.twig

@@ -35,6 +35,13 @@
                 </p>
             {% endif %}
 
+            {% if not package.autoUpdated
+                and app.user and package.maintainers.contains(app.user)
+                and "//github.com/" in package.repository
+            %}
+                <p class="warning">This package is not auto-updated. Go and set up the <a href="{{ path('fos_user_profile_show') }}">GitHub Service Hook</a> for Packagist so that it gets updated whenever you push!</p>
+            {% endif %}
+
             <p class="description">{{ package.description }}</p>
             <p class="details">
                 <span>Maintainer{{ package.maintainers|length > 1 ? 's' : '' }}:</span>

+ 1 - 1
src/Packagist/WebBundle/Resources/views/layout.html.twig

@@ -17,7 +17,7 @@
         <script src="{{ asset('bundles/packagistweb/js/html5.js') }}"></script>
         <![endif]-->
 
-        <link rel="stylesheet" href="{{ asset('bundles/packagistweb/css/main.css?v=4') }}" />
+        <link rel="stylesheet" href="{{ asset('bundles/packagistweb/css/main.css?v=5') }}" />
         <link rel="stylesheet" href="{{ asset('css/humane/jackedup.css?v=2') }}" />
 
         {# {% stylesheets