Changeset 56753 in webkit


Ignore:
Timestamp:
Mar 29, 2010 5:34:42 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-29 Victor Wang <victorw@chromium.org>

Reviewed by Adam Barth.

Add sign in/out link to TestResults appengine

Add a link to main menu for sign in/out to this appengine.
People signed in with admin privilege could perform
actions that are only allowed to admins like deleting files.

https://bugs.webkit.org/show_bug.cgi?id=36767

  • TestResultServer/handlers/menu.py:
  • TestResultServer/stylesheets/menu.css: (.sign):
  • TestResultServer/templates/menu.html:
Location:
trunk/WebKitTools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r56748 r56753  
     12010-03-29  Victor Wang  <victorw@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Add sign in/out link to TestResults appengine
     6
     7        Add a link to main menu for sign in/out to this appengine.
     8        People signed in with admin privilege could perform
     9        actions that are only allowed to admins like deleting files.
     10
     11        https://bugs.webkit.org/show_bug.cgi?id=36767
     12
     13        * TestResultServer/handlers/menu.py:
     14        * TestResultServer/stylesheets/menu.css:
     15        (.sign):
     16        * TestResultServer/templates/menu.html:
     17
    1182010-03-29  Eric Seidel  <eric@webkit.org>
    219
  • trunk/WebKitTools/TestResultServer/handlers/menu.py

    r56635 r56753  
    2727# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828
     29from google.appengine.api import users
    2930from google.appengine.ext import webapp
    3031from google.appengine.ext.webapp import template
     
    4243class Menu(webapp.RequestHandler):
    4344    def get(self):
     45        user = users.get_current_user()
     46        if user:
     47            user_email = user.email()
     48            login_text = "Sign out"
     49            login_url = users.create_logout_url(self.request.uri)
     50        else:
     51            user_email = ""
     52            login_text = "Sign in"
     53            login_url = users.create_login_url(self.request.uri)
     54
    4455        template_values = {
     56            "user_email": user_email,
     57            "login_text": login_text,
     58            "login_url": login_url,
    4559            "menu": menu,
    4660        }
  • trunk/WebKitTools/TestResultServer/stylesheets/menu.css

    r55960 r56753  
    2121  background-color: #EEE;
    2222}
     23.login {
     24  font-size: 8pt;
     25  text-align: right;
     26  width: 100%;
     27}
     28
  • trunk/WebKitTools/TestResultServer/templates/menu.html

    r55960 r56753  
    33<head>
    44<title>Test Result Server</title>
     5<table class=login>
     6    <tr>
     7        <td>
     8            {% if user_email %}
     9            <span>{{ user_email }}</span>
     10            {% endif %}
     11            <span><a href="{{ login_url }}">{{ login_text }}</a></span>
     12        </td>
     13    </tr>
     14</table>
    515<link type="text/css" rel="stylesheet" href="/stylesheets/menu.css" />
    616</head>
Note: See TracChangeset for help on using the changeset viewer.