Skip to content

Commit

Permalink
[WebUI IntelliHome#7] Modified components
Browse files Browse the repository at this point in the history
  • Loading branch information
skullbocks committed Jul 27, 2014
1 parent 87bb247 commit e51c877
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 60 deletions.
2 changes: 0 additions & 2 deletions assets/templates/components/list_tiles.html.ep
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
% my $tiles_per_row=4;
% my $rows= ceil((scalar @$tiles)/$tiles_per_row);
% my @items=@$tiles;
<div class="row">
% foreach my $tile (@items) {
Expand Down
28 changes: 14 additions & 14 deletions assets/templates/components/menu.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,35 @@
<div class="navbar-collapse collapse navbar-responsive-collapse" id="navbar-main">
<ul class="nav navbar-nav">
<li><%= link_to Home => 'index' %></li>
% if (@rooms) {
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" id="themes">
Rooms
<span class="caret" />
</a>
<ul class="dropdown-menu room-menu" role="menu" aria-labelledby="themes">
% foreach (@rooms) {
<li>
%= link_to $_ => '#' => (id => $_ ) => (class => 'room')
</li>
% }
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" id="themes" >
Another Menu<span class="caret" />
</a>
<ul class="dropdown-menu room-menu" role="menu" aria-labelledby="themes" style="height: auto; max-height: 200px;">
<li>
<a href='#' > Item 1</a>
</li>
<li>
<a href='#' > Item 2</a>
</li>
</ul>
</li>
% }
</ul>

<form class="navbar-form navbar-right" action="/search/" method="GET">
<div class="form-group">
<input type="text" name="term" placeholder="Search" class="form-control">
</div>
<button type="submit" class="btn btn-success">Search</button>
</form>
% #<ul class="nav navbar-nav navbar-right">
% # if ($logged == 1) {
% #= include 'components/userpanel'
% #} else {
% # <li><a href="login/">Login</a></li>
% #}
% #</ul>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion assets/templates/components/scripts.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script>
$(document).ready(function() {
// IE8 compatibility of pseudo-class
$('#iso .row').first().css({margin:'0'});
$('.iso .row').first().css({margin:'0'});
});
</script>
<![endif]-->
57 changes: 14 additions & 43 deletions assets/templates/components/show_tiles.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<div class="col-md-12">
<div class="row">
<header class="col-md-8 pull-right">
<a class="thumbnail" id="<%= '/command/'.$tile->title.'&'.join('&', $tile->params) %>" href="#">
<a class="thumbnail command" data-post="<%= '/command/'.$tile->title %>" href="#" <% # TODO add param to toggle 'data-value="join("&", $tile->params) "' %>>
%= tag h2 => (id => $tile->id), (class => 'tile-heading') => $tile->title
</a>
</header>
<div class="col-md-4 pull-left">
<a class="thumbnail" id="<%= '/command/'.$tile->title.'&'.join('&', $tile->params) %>" href="#">
<a class="thumbnail command" data-post="<%= '/command/'.$tile->title %>" href="#" <% # TODO add param to toggle 'data-value="join("&", $tile->params) "' %>>
%= image $tile->image => (class => 'img-responsive img-rounded') , alt => $tile->title, itemprop => "image"
</a>
</div>
Expand All @@ -20,47 +20,18 @@
% } else {
% # Tiles Grid
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3">
<div class="tile_detail box-shadow">
<div class="caption">
<div class="container col-lg-12 col-md-12 col-xs-12">
<div class="row">
<div class="container">
<h4 itemprop="name">
% if ($tile->type eq "toggle"){
<a id="<%= '/command/'.$tile->title.'&'.join('&', $tile->params) %>" href="#">
<%= $tile->title =%>
</a>
% } else {
<a href="<%= '/tile-detail/'.$tile->title %>">
<%= $tile->title =%>
</a>
%}
</h4>
</div>
</div>
<div class="row">
<div class="col-md-6 pull-right">
<div class="row">
<div class="col-lg-12 col-md-12 col-xs-12">
<span class="pull-left">
% if ($tile->type ne "toggle"){
<span class="glyphicon glyphicon-share-alt" />
% } elsif ($tile->type eq "toggle" && $tile->status == "0")
<span class="glyphicon glyphicon-remove-circle" />
% } else {
<span class="glyphicon glyphicon-ok-circle" />
% }
</span>
</div>
</div>
</div>
</div>
</div>
% if(defined $tile->picture()) {
%= image '/thumb/'.$tile->title.'.jpg' => (class => 'img-responsive') , width=> '260px', alt => $tile->title, itemprop => "image"
% } else {
%= image '/thumb/no-image.jpg' => (class => 'img-responsive') , width=> '260px', alt => $tile->title, itemprop => "image"
% }
% my $class = "tile-default tile-detail";
% my $data-post = "/tile-detail/".$tile->title;
% if ($tile->toggle == 1) {
% $class = "tile-toggle command";
% $class .= (exists $tile->status && $tile->status == 1) ? "tile-status-on";
% $data-post = "/command/".$tile->title;
% }
<div <%= 'class="tile-item clickable '.$class.'" data-room="'.$tile->room.'" data-tag="'.$tile->tag.'" data-post="$data-post"' %>>
<h3 class="name"><%= $tile->title %></h3>
<p class="symbol"><% #glipycon light-bulb %></p>
<p class="pin-number"><%= $tile->gpio %></p>
<p class="tile-room"><%= $tile->room %></p>
</div>
</div>
% }

0 comments on commit e51c877

Please sign in to comment.