Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
Merge pull request #346 from UW-Madison-DoIT/refactor-templates
Browse files Browse the repository at this point in the history
MUMMNG-2017: Make list-of-links widget type, LOL
  • Loading branch information
jhanstra committed Nov 5, 2015
2 parents d6d2906 + 424de69 commit 700a4a4
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 1 deletion.
13 changes: 13 additions & 0 deletions angularjs-portal-home/src/main/webapp/css/widget.less
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,17 @@ weather {
.scroll-widget {
max-height: 210px;
overflow-y: scroll;
}
.lol {
.v-center {
position:relative;
top:50px;
}
.link-icon {
font-weight:600;
}
.link-icon i {
color:@color1;
padding-right:10px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ define(['angular', 'jquery'], function(angular, $) {
return "GENERIC";
} else if('rss' === portlet.widgetType) {
return "RSS";
} else if('list-of-links' === portlet.widgetType) {
return "LOL";
} else {
return "WIDGET";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
define(['angular'], function(angular){

var app = angular.module('my-app.layout.widget.controllers', []);

app.controller('OptionLinkController', ['$scope', 'layoutService', function($scope, layoutService){

var configInit = function(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ define(['angular', 'require'], function(angular, require) {
}
});

app.directive('lol', function () {
return {
restrict: 'E',
scope: {
portlet: '=app',
config: '=config'
},
templateUrl: require.toUrl('./partials/lol.html')
}
});

/**
<rss></rss> is an rss widget card that will show your info in a view
app : A layout portlet object from uPortal
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<div class='widget-body lol'>
<div ng-show="config.links.length == 1">
<div class='col-xs-6 col-xs-offset-3 v-center center' ng-repeat='item in config.links'>
<circle-button data-href='{{item.href}}' data-target='{{item.target}}' data-fa-icon='{{item.icon}}' data-disabled='false' data-title='{{item.title}}'></circle-button>
</div>
</div>
<div ng-show="config.links.length == 2">
<div class='col-xs-6 v-center center' ng-repeat='item in config.links'>
<circle-button data-href='{{item.href}}' data-target='{{item.target}}' data-fa-icon='{{item.icon}}' data-disabled='false' data-title='{{item.title}}'></circle-button>
</div>
</div>
<div ng-show="config.links.length == 3">
<div ng-repeat="item in config.links">
<div class='col-xs-6 center' ng-class="{'col-xs-offset-3':($index==2)}">
<circle-button data-href='{{item.href}}' data-target='{{item.target}}' data-fa-icon='{{item.icon}}' data-disabled='false' data-title='{{item.title}}'></circle-button>
</div>
</div>
</div>
<div ng-show="config.links.length == 4">
<div class='col-xs-6 center' ng-repeat='item in config.links'>
<circle-button data-href='{{item.href}}' data-target='{{item.target}}' data-fa-icon='{{item.icon}}' data-disabled='false' data-title='{{item.title}}'></circle-button>
</div>
</div>
<div ng-show="config.links.length > 4">
<ul class="widget-list">
<li ng-repeat='item in config.links | limitTo: 7' class="link-icon">
<i class="fa {{item.icon}}"></i><a href="{{item.href}}" target="{{item.target}}">{{item.title}}</a>
</li>
</ul>
</div>
</div>
<a class="btn btn-default launch-app-button" href="{{portlet.url}}" target="_blank">{{config.launchText}}</a>
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ <h4 id="appTitle_portlet.title-{{::portlet.nodeId}}" aria-labelledby="appTitle_p
<div ng-if="'RSS' === widgetCtrl.portletType(portlet)">
<rss app="portlet" config="portlet.widgetConfig"></rss>
</div>

<div ng-if="'LOL' === widgetCtrl.portletType(portlet)">
<lol app="portlet" config="portlet.widgetConfig"></lol>
</div>

<div ng-if="'GENERIC' === widgetCtrl.portletType(portlet)">
<div ng-controller="GenericWidgetController as genericWidgetCtrl">
Expand Down

0 comments on commit 700a4a4

Please sign in to comment.