| Index: appengine/sheriff_o_matic/ui/ct-alert-card.html
|
| diff --git a/appengine/sheriff_o_matic/ui/ct-alert-card.html b/appengine/sheriff_o_matic/ui/ct-alert-card.html
|
| index 9b7120c61eaf9824cafdbac7d10f0355c1209f2b..8efb9c6b8b0e620bf721886fa31722b9d74c57b8 100644
|
| --- a/appengine/sheriff_o_matic/ui/ct-alert-card.html
|
| +++ b/appengine/sheriff_o_matic/ui/ct-alert-card.html
|
| @@ -2,13 +2,33 @@
|
| Copyright 2015 The Chromium Authors. All rights reserved.
|
| Use of this source code is governed by a BSD-style license that can be
|
| found in the LICENSE file.
|
| --->
|
| -<link rel="import" href="ct-alert-extension.html">
|
| +--><html><head><link rel="import" href="ct-alert-extension.html">
|
| <link rel="import" href="ct-alert-card-buttons.html">
|
| <link rel="import" href="ct-user-prefs.html">
|
| -<polymer-element name="ct-alert-card" attributes="alert tree">
|
| - <template>
|
| - <style>
|
| + <!--
|
| + TODO(polyup): unable to infer path to components
|
| + directory. This import path is probably incomplete.
|
| + -->
|
| + <link rel="import" href="iron-flex-layout/iron-flex-layout.html">
|
| +<dom-module id="ct-alert-card">
|
| + <style>
|
| + /* TODO(polyup): For speed, consider reworking these styles with .classes
|
| + and #ids rather than [attributes].
|
| + */
|
| + [layout] {
|
| + @apply(--layout);
|
| + }
|
| + [layout][horizontal] {
|
| + @apply(--layout-horizontal);
|
| + }
|
| + [layout][vertical] {
|
| + @apply(--layout-vertical);
|
| + }
|
| + [layout][flex] {
|
| + @apply(--layout-flex);
|
| + }
|
| + </style>
|
| + <style>
|
| :host {
|
| display: block;
|
| }
|
| @@ -25,39 +45,54 @@ found in the LICENSE file.
|
| margin: 0.5em;
|
| }
|
| </style>
|
| + <template>
|
| <ct-user-prefs id="userPrefs"></ct-user-prefs>
|
| - <div horizontal layout>
|
| + <div horizontal="" layout="">
|
| <ct-alert-card-buttons bug="{{ bug }}" alert="{{ alert }}" tree="{{ tree }}"></ct-alert-card-buttons>
|
| - <div flex vertical layout class='severity-{{ alert.severity }}'>
|
| - <div class='title'>
|
| - {{ alert.title }}
|
| + <div flex="" vertical="" layout="" class$="{{computeClass(alert)}}">
|
| + <div class="title">
|
| + <span>{{ alert.title }}</span>
|
| </div>
|
| - <div class='links'>
|
| - <template repeat="{{ link in alert.links }}">
|
| - <a href="{{ {url: link.href, useUber: $.userPrefs.values.useUberchromegw} | rewriteUrl }}" target="{{ $.userPrefs.values.linkTarget }}">{{ link.title }}</a>
|
| + <div class="links">
|
| + <template is="dom-repeat" items="{{alert.links}}" as="link">
|
| + <a target="{{ $.userPrefs.values.linkTarget }}" href$="{{computeHref($, link)}}">{{ link.title }}</a>
|
| </template>
|
| </div>
|
| - <div class='since'>
|
| + <div class="since">
|
| </div>
|
| - <div class='body'>
|
| - {{ alert.body }}
|
| + <div class="body">
|
| + <span>{{ alert.body }}</span>
|
| </div>
|
| </div>
|
| - <div if='{{ alert.type }}'>
|
| + <div if="{{ alert.type }}">
|
| <ct-alert-extension extension="{{ alert.extension }}" type="{{ alert.type }}"></ct-alert-extension>
|
| </div>
|
| </div>
|
| </template>
|
| <script>
|
| - Polymer({
|
| - rewriteUrl: function(props) {
|
| - if (this.$ && this.$.userPrefs) {
|
| - return this.$.userPrefs.rewriteUrl(props.url);
|
| + Polymer({
|
| + is: 'ct-alert-card',
|
| + properties: {
|
| + alert: { notify: true },
|
| + tree: { notify: true }
|
| + },
|
| + rewriteUrl: function (props) {
|
| + if (this.$ && this.$.userPrefs) {
|
| + return this.$.userPrefs.rewriteUrl(props.url);
|
| + }
|
| + return props.url;
|
| + },
|
| + computeClass: function (alert) {
|
| + return 'severity-' + alert.severity;
|
| + },
|
| + computeHref: function ($, link) {
|
| + return this.rewriteUrl({
|
| + url: link.href,
|
| + useUber: $.userPrefs.values.useUberchromegw
|
| + });
|
| }
|
| - return props.url;
|
| - },
|
| - });
|
| + });
|
| </script>
|
| -</polymer-element>
|
| +</dom-module>
|
|
|
|
|
|
|