forked from masak/proto
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Rudimentary working app
- Loading branch information
1 parent
666c188
commit e4c1974
Showing
14 changed files
with
245 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| use strict; | ||
| use Module::Build; | ||
|
|
||
| my $build = Module::Build->new( | ||
| dist_name => 'mojo-app::perl6.modules.org', | ||
| dist_author => 'Perl 6 Hackers', | ||
| license => 'perl', | ||
| create_makefile_pl => 'passthrough', | ||
|
|
||
| dist_version => '0.1', | ||
|
|
||
| # and now the list of perl module dependencies | ||
| requires => { | ||
| 'Mojolicious' => '6.29', | ||
| 'Mojolicious::Plugin::AssetPack' => '0.68', | ||
| 'Mojolicious::Plugin::Bootstrap3' => '3.3505', | ||
| 'Package::Alias' => '0.13', | ||
| 'SQL::Translator' => '0.11021', | ||
| 'DBIx::Class' => '0.082820', | ||
| 'Test::Mojo::WithRoles' => '0.02', | ||
| 'Test::Mojo::Role::ElementCounter' => '1.001005', | ||
| 'Test::Mojo::Role::SubmitForm' => '1.001007', | ||
| } | ||
| ); | ||
| $build->create_build_script; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/usr/bin/env perl | ||
|
|
||
| use FindBin; | ||
| BEGIN { unshift @INC, "$FindBin::Bin/../lib" } | ||
|
|
||
| require Mojolicious::Commands; | ||
| Mojolicious::Commands->start_app('ModulesPerl6'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| package ModulesPerl6; | ||
|
|
||
| # TODO: figure out where to secretly store secrets file on the final server | ||
| use constant SECRETS_FILE => '/tmp/secrets'; | ||
|
|
||
| use Mojo::Base 'Mojolicious'; | ||
|
|
||
| use Mojo::Util qw/slurp/; | ||
| use ModulesPerl6::Model::Dists; | ||
|
|
||
| sub startup { | ||
| my $self = shift; | ||
|
|
||
| # SETUP | ||
| $self->config(hypnotoad => {listen => ['http://*:3333']}); | ||
| $self->moniker('ModulesPerl6'); | ||
| $self->secrets([ | ||
| -r SECRETS_FILE ? slurp SECRETS_FILE : 'Perl 6 is awesome!' | ||
| ]); | ||
|
|
||
| # ASSETS | ||
| $self->plugin(bootstrap3 => | ||
| theme => { cerulean => 'https://bootswatch.com/cerulean/_bootswatch.scss' } | ||
| ); | ||
| $self->asset('app.css' => '/sass/main.scss'); | ||
| $self->asset('app.js' => '/js/main.js' ); | ||
|
|
||
| # HELPERS | ||
| $self->helper( dists => sub { | ||
| state $dists = ModulesPerl6::Model::Dists->new; | ||
| }); | ||
| $self->helper( items_in => sub { | ||
| my ( $c, $what ) = @_; | ||
| return unless defined $what; | ||
| $what = $c->stash($what) // [] unless ref $what; | ||
| return @$what; | ||
| }); | ||
|
|
||
| # ROUTES | ||
| my $r = $self->routes; | ||
| $r->get('/' )->to('root#index'); | ||
| $r->get('/q/:term' )->to('root#index'); | ||
| $r->any('/dist/:dist')->to('root#dist'); | ||
| } | ||
|
|
||
| 1; | ||
|
|
||
| # ABSTRACT: make dzil happy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package ModulesPerl6::Controller::Root; | ||
|
|
||
| use Mojo::Base 'Mojolicious::Controller'; | ||
|
|
||
| sub index { | ||
| my $self = shift; | ||
|
|
||
| $self->stash( dists => $self->dists->find ); | ||
| } | ||
| 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,3 @@ use base qw/DBIx::Class::Schema/; | |
| __PACKAGE__->load_namespaces; | ||
|
|
||
| 1; | ||
|
|
||
| __END__ | ||
|
|
||
| need SQL::Translator >= 0.11018 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #!/bin/sh | ||
| morbo -w lib -w bin -w templates -w public -l http://*:3333 bin/ModulesPerl6.pl |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
|
|
||
| body { | ||
| /* Original vector bg pic is at: | ||
| http://zoffix.com/new/modules.perl6.org.bg.eps | ||
| */ | ||
| background: url(/pics/bg.jpg) no-repeat center top fixed; | ||
| background-size: 100% auto; | ||
| } | ||
|
|
||
| header { | ||
| margin-top: 20px; | ||
|
|
||
| .panel-body { | ||
| /*background: #80B5FF;*/ | ||
| } | ||
|
|
||
| #logo { | ||
| margin-top: -60px; | ||
| margin-right: -40px; | ||
| } | ||
| } | ||
|
|
||
| @media (max-width: 665px) { | ||
| header #logo { | ||
| margin: 0; | ||
| } | ||
| } | ||
|
|
||
| .panel h1 { | ||
| font-size: 200%; | ||
| } | ||
|
|
||
| /* Bootstrap amendments */ | ||
|
|
||
| .btn .glyphicon { | ||
| padding-right: .5em; | ||
| } | ||
|
|
||
| .suckin-btm { | ||
| padding-bottom: 5px; | ||
| } | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
|
||
| <title>Perl 6 Modules Directory</title> | ||
| <link href="http://perl6.org/favicon.ico" rel="shortcut icon"> | ||
| %= asset "cerulean.css"; | ||
| %= asset "app.css"; | ||
| </head> | ||
| <body> | ||
| <div class="container"> | ||
| <%= content %> | ||
| <footer class="panel panel-default"> | ||
| <div class="panel-body suckin-btm"> | ||
| <p>For feedback and patches, please contact us through the | ||
| <a href="https://perl6.org/community/irc">#perl6 IRC | ||
| channel</a>, or send an email to the perl6-compiler@perl.org mailing | ||
| list. | ||
| </p> | ||
| <p class="text-muted"> | ||
| <small> | ||
| This page is generated from the files in the | ||
| <a href="http://github.com/perl6/modules.perl6.org/" | ||
| >modules.perl6.org repository</a>. | ||
| <a href="http://modules.perl6.org/log/update.log" | ||
| class="btn btn-primary btn-sm"> | ||
| <i class="glyphicon glyphicon-log-in"></i> | ||
| view build log</a> | ||
| </small> | ||
| </p> | ||
| </div> | ||
| </footer> | ||
| </div> | ||
|
|
||
| %= asset "bootstrap.js" | ||
| %= asset "app.js"; | ||
| </body> | ||
| </html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| % layout 'default'; | ||
|
|
||
| <header class="panel panel-primary lead"> | ||
| <div class="panel-heading"> | ||
| <h1 class="panel-title">Perl 6 Modules</h1> | ||
| </div> | ||
| <div class="panel-body suckin-btm"> | ||
| <img src="/content-pics/camelia-logo.png" id="logo" alt="»ö«" | ||
| class="pull-right"> | ||
| <p>Below you can find a list of the 443 known Perl 6 modules. All of them | ||
| have been working on <a href="http://rakudo.org/">Rakudo</a> at | ||
| some point. | ||
| These modules can be installed with <a href="https://github.com/tadzik/panda/">panda</a>, a module management tool | ||
| that comes with <a href="http://rakudo.org/how-to-get-rakudo/">Rakudo | ||
| Star</a>. | ||
| </p> | ||
| <p>If you want to contribute your own module, please read | ||
| <a href="http://doc.perl6.org/language/modules">this guide</a>. | ||
| Missing a module you can't live without? Consider adding it | ||
| to the <a href="https://github.com/perl6/perl6-most-wanted/blob/master/most-wanted/modules.md">Most Wanted Modules</a> | ||
| file in the Most Wanted repository. | ||
| </p> | ||
| </div> | ||
| </header> | ||
|
|
||
| <div class="panel panel-default"> | ||
| <div class="panel-heading"> | ||
| <h2 class="panel-title">Project List</h2> | ||
| </div> | ||
| <div class="panel-body table-responsive"> | ||
| <table class="table table-condensed"> | ||
| <thead> | ||
| <th>Name</th> | ||
| <th>Description</th> | ||
| <th>Author</th> | ||
| <th>Kwalitee</th> | ||
| <th>Travis</th> | ||
| <th>Stars</th> | ||
| <th>Issues</th> | ||
| <th>Updated</th> | ||
| </thead> | ||
| <tbody> | ||
| % for my $dist ( items_in 'dists' ) { | ||
| <tr> | ||
| <td><a href="<%= $dist->{url} %>"><%= $dist->{name} %></a></td> | ||
| <td><%= $dist->{description} %></td> | ||
| <td><%= $dist->{author_id} %></td> | ||
| <td><%= $dist->{kwalitee} %>%</td> | ||
| <td class="travis travis-<%= $dist->{travis_status} %>" | ||
| ><%= $dist->{travis_status} %></td> | ||
| <td><%= $dist->{stars} %></td> | ||
| <td><%= $dist->{issues} %></td> | ||
| <td><%= $dist->{date_updated} %></td> | ||
| </tr> | ||
| % } | ||
| </tbody> | ||
| </table> | ||
| </div> | ||
| </div> |