module System.Apotiki.Templates where import Data.List (unlines) -- -- I am NOT proud of this heredoc implementation. -- detailsHtml = unlines [ "
", "
", " Package: {{repo[arch][name]['Package']}}", "
", "
", "
", "
Package
", "
{{repo[arch][name]['Package']}}
", "
", "
", "
Version
", "
{{repo[arch][name]['Version']}}
", "
", "
", "
Architecture
", "
{{repo[arch][name]['Architecture']}}
", "
", "
", "
Maintainer
", "
{{repo[arch][name]['Maintainer']}}
", "
", "
", "
License
", "
{{repo[arch][name]['License']}}
", "
", "
", "
Installed Size
", "
{{repo[arch][name]['Installed-Size']}}
", "
", "
", "
Priority
", "
{{repo[arch][name]['Priority']}}
", "
", "
", "
Depends
", "
{{repo[arch][name]['Depends']}}
", "
", "
", "
Homepage
", " ", "
", "
", "
Vendor
", "
{{repo[arch][name]['Vendor']}}
", "
", "
", "
Section
", "
{{repo[arch][name]['Section']}}
", "
", "
", "
Description
", "
", "
",
                        "      
", "
", "
", "
" ] indexHtml = unlines [ "", "", "", " ", " apotiki debian repository", " ", " ", " ", " ", " ", " ", "", " ", "
", "
", "
", " apotiki", "
", "
", " ", "
", "
", "
", " ", "
", "
", "
", " ", "
", "
", "
", " ", " ", " ", "" ] postHtml = unlines [ "", "", " ", " apotiki debian repository", " ", " ", " ", " ", "
", "
", "
", " apotiki", "
", "
", " ", "
", "
", "
", "
", "
", "
", "
", "
", "

Package

", "
", "
", "
", "
", " ", " ", "

", " Package file will overwrite any previous versions.", "

", "
", " ", "
", "
", "
", "
", "
", "
", " ", ""] listingHtml = unlines [ "
", " ", "
", "
", "
", "

Package listing

", "
", "
", "
", " ", "
", "
", "
", "
", " ", "
", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "
PackageVersionArchitecture
{{pkg['Package']}}{{pkg['Version']}}{{pkg['Architecture']}}
", "
", "
" ] jsApp = unlines [ "var app = angular.module('repo', ['ngRoute']);", "app.controller('Apotiki', function($scope, $routeParams, $location, $http) {", "$scope.repolist = []; $scope.repo = {};", "$scope.refresh = function(){$http.get('/repo').success(function(data){$scope.repo=data;for(var k in data){for (var subk in data[k]){$scope.repolist.push(data[k][subk]);}}});};", "if ($routeParams.name) { $scope.name = $routeParams.name; }", "if ($routeParams.arch) { $scope.arch = $routeParams.arch; }", "$scope.refresh();});", "app.config(function($routeProvider) {", " $routeProvider", " .when('/repo', {templateUrl: 'listing.html', controller: 'Apotiki'})", " .when('/repo/:arch/:name', {templateUrl: 'details.html', controller: 'Apotiki'})", " .when('/post', {templateUrl: 'post.html'})", " .otherwise({redirectTo: '/repo'});});" ]