Blame view

controllets/cocreation-paper-card-controllet/cocreation-paper-card-controllet.html 4.57 KB
97f5fe0e   Andrea Petta   cocreation paper ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
  <link rel="import" href="../../bower_components/polymer/polymer.html"/>
  <link rel="import" href="../../bower_components/paper-card/paper-card.html"/>
  <link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html"/>
  <link rel="import" href="../../bower_components/paper-button/paper-button.html"/>
  <link rel="import" href="../../bower_components/iron-icon/iron-icon.html"/>
  <link rel="import" href="../../bower_components/iron-collapse/iron-collapse.html"/>
  
  
  <dom-module id="cocreation-paper-card-controllet">
  
      <template>
          <style>
  
              iron-icon{
                  padding-left: 5px;
                  padding-right: 5px;
                  --iron-icon-height: 16px;
                  --iron-icon-width: 16px;
              }
  
              iron-icon.icon-from{
                  --iron-icon-fill-color : #000000;
              }
  
              iron-icon.icon-to{
                  --iron-icon-fill-color : #ff0000;
              }
  
              paper-card.cocreation {
                  width: 310px;
              }
  
              .from, .to {
                  font-size: 13px;
                  color: #CCCCCC;
              }
  
              .rate-content {
                  @apply(--layout-flex);
                  float: left;
                  width: 100%;
              }
  
              .rate-header { @apply(--paper-font-headline); }
              .rate-name { color: var(--paper-grey-600); margin: 10px 0; }
  
              paper-icon-button.rate-icon {
                  --iron-icon-fill-color: white;
                  --iron-icon-stroke-color: var(--paper-grey-600);
              }
  
              .collapse-content {
                  width: 200px;
                  padding: 15px;
              }
  
              iron-collapse.iron-collapse-over
              {
                  position: absolute;
                  left: -1px;
                  margin:0;
                  padding:0;
                  z-index:10;
                  background-color: #FFFFFF;
                  border: solid 1px #E6E6E6;
                  border-top: none !important;
                  min-width: 310px;
                  min-height: 188px;
              }
          </style>
  
  
          <paper-card class="cocreation">
              <div class="rate-content">
                  <div class="card-content">
                      <div class="rate-header">{{name}}</div>
                      <div class="rate-name">{{owner}}</div>
                      <div>
                          <iron-icon class="icon-from" icon="alarm"></iron-icon>
                          <span class="from">{{from}}</span>
                          <iron-icon class="icon-to" icon="alarm-off"></iron-icon>
                          <span class="to">{{to}}</span>
                      </div>
                  </div>
                  <div class="card-actions">
13c53ccd   Luigi Serra   cards updates
86
                      <paper-button on-click="_onExplore">Explore</paper-button>
97f5fe0e   Andrea Petta   cocreation paper ...
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
                      <paper-icon-button icon="expand-less" on-click="_toggle" style="float:right;">
                      </paper-icon-button>
                      <iron-collapse class="iron-collapse-over" id="more_info" no-animation>
                          <div class="collapse-content">
                              {{goal}}
                          </div>
                      </iron-collapse>
                  </div>
              </div>
          </paper-card>
  
      </template>
  
      <script src="../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>
  
      <script>
          Polymer({
              is: "cocreation-paper-card-controllet",
  
              properties: {
                  name:{
                      type: String,
                      value: "text"
                  },
                  owner:{
                      type: String,
                      value: "text"
                  },
                  from:{
                      type: String,
                      value: "text"
                  },
                  to:{
                      type: String,
                      value: "text"
                  },
                  goal:{
                      type: String,
                      value: "text"
                  },
13c53ccd   Luigi Serra   cards updates
127
128
129
130
                  roomUrl: {
                      type: String,
                      value: undefined
                  }
97f5fe0e   Andrea Petta   cocreation paper ...
131
132
133
134
135
136
137
138
139
140
              },
  
              attached: function(){
              },
  
              _toggle: function(){
                  var moreInfo = this.$.more_info;
                  var iconButton = Polymer.dom(event).localTarget;
                  iconButton.icon = moreInfo.opened ? 'expand-less' : 'expand-more';
                  moreInfo.toggle();
13c53ccd   Luigi Serra   cards updates
141
142
143
144
              },
  
              _onExplore: function(e){
                  window.location = this.roomUrl;
97f5fe0e   Andrea Petta   cocreation paper ...
145
146
147
148
149
150
              }
  
          })
      </script>
  
  </dom-module>