Changeset 85251 in webkit


Ignore:
Timestamp:
Apr 28, 2011 3:59:11 PM (13 years ago)
Author:
eric@webkit.org
Message:

2011-04-28 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

EWS bubbles should show "submit to ews" button if they've not been processed
https://bugs.webkit.org/show_bug.cgi?id=59751

  • QueueStatusServer/handlers/statusbubble.py:
  • QueueStatusServer/handlers/submittoews.py:
  • QueueStatusServer/templates/statusbubble.html:
  • QueueStatusServer/templates/submittoews.html:
Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r85247 r85251  
     12011-04-28  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        EWS bubbles should show "submit to ews" button if they've not been processed
     6        https://bugs.webkit.org/show_bug.cgi?id=59751
     7
     8        * QueueStatusServer/handlers/statusbubble.py:
     9        * QueueStatusServer/handlers/submittoews.py:
     10        * QueueStatusServer/templates/statusbubble.html:
     11        * QueueStatusServer/templates/submittoews.html:
     12
    1132011-04-28  Eric Seidel  <eric@webkit.org>
    214
  • trunk/Tools/QueueStatusServer/handlers/statusbubble.py

    r85247 r85251  
    4949        return bubble
    5050
    51     def get(self, attachment_id):
    52         attachment = Attachment(int(attachment_id))
     51    def _have_ews_status_for(self, attachment, queue):
     52        return bool(queue.is_ews() and (attachment.position_in_queue(queue) or attachment.status_for_queue(queue)))
     53
     54    def get(self, attachment_id_string):
     55        attachment_id = int(attachment_id_string)
     56        attachment = Attachment(attachment_id)
    5357        # Show all queue positions, even the commit-queue.
    5458        bubbles = [self._build_bubble(queue, attachment) for queue in Queue.all() if queue.is_ews() or attachment.position_in_queue(queue)]
     59        # If all EWS queues have no position and no status we show a "submit to ews" button.
     60        have_ews_status_or_position = reduce(operator.or_, map(lambda queue: self._have_ews_status_for(attachment, queue), Queue.all()))
    5561        template_values = {
    5662            "bubbles": bubbles,
     63            "attachment_id": attachment_id,
     64            "show_submit_to_ews": not have_ews_status_or_position,
    5765        }
    5866        self.response.out.write(template.render("templates/statusbubble.html", template_values))
  • trunk/Tools/QueueStatusServer/handlers/submittoews.py

    r70171 r85251  
    6363        attachment = Attachment(attachment_id)
    6464        self._add_attachment_to_ews_queues(attachment)
     65        if self.request.get("next_action") == "return_to_bubbles":
     66            self.redirect("/status-bubble/%s" % attachment_id)
  • trunk/Tools/QueueStatusServer/templates/statusbubble.html

    r85247 r85251  
    6868<body>
    6969<div id="bubbleContainer">
     70{% if show_submit_to_ews %}
     71  <form name="submit_to_ews" enctype="multipart/form-data" method="post" action="/submit-to-ews">
     72    <input type="hidden" name="attachment_id" value="{{ attachment_id }}">
     73    <input type="hidden" name="next_action" value="return_to_bubbles">
     74    <input class="status" type="submit" value="Submit for EWS analysis">
     75  </form>
     76{% else %}
    7077  {% for bubble in bubbles %}
    7178  <a class="status {{ bubble.state }}"
     
    8188  </a>
    8289  {% endfor %}
     90{% endif %}
    8391</div>
    8492</body>
  • trunk/Tools/QueueStatusServer/templates/submittoews.html

    r76655 r85251  
    11<form name="submit_to_ews" enctype="multipart/form-data" method="post">
    2 Attachment id of patch to submit: <input name="attachment_id"><input type="submit" value="Submit for EWS Processing"></div>
     2Attachment id of patch to submit: <input name="attachment_id"><input type="submit" value="Submit for EWS Processing">
    33</form>
Note: See TracChangeset for help on using the changeset viewer.