Création initiale du projet Amber
This commit is contained in:
0
src/assets/fonts/.gitkeep
Normal file
0
src/assets/fonts/.gitkeep
Normal file
0
src/assets/images/.gitkeep
Normal file
0
src/assets/images/.gitkeep
Normal file
BIN
src/assets/images/logo.png
Normal file
BIN
src/assets/images/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
23
src/assets/javascripts/main.js
Normal file
23
src/assets/javascripts/main.js
Normal file
@ -0,0 +1,23 @@
|
||||
import Amber from 'amber'
|
||||
|
||||
if (!Date.prototype.toGranite) {
|
||||
(function() {
|
||||
|
||||
function pad(number) {
|
||||
if (number < 10) {
|
||||
return '0' + number;
|
||||
}
|
||||
return number;
|
||||
}
|
||||
|
||||
Date.prototype.toGranite = function() {
|
||||
return this.getUTCFullYear() +
|
||||
'-' + pad(this.getUTCMonth() + 1) +
|
||||
'-' + pad(this.getUTCDate()) +
|
||||
' ' + pad(this.getUTCHours()) +
|
||||
':' + pad(this.getUTCMinutes()) +
|
||||
':' + pad(this.getUTCSeconds()) ;
|
||||
};
|
||||
|
||||
}());
|
||||
}
|
117
src/assets/stylesheets/main.scss
Normal file
117
src/assets/stylesheets/main.scss
Normal file
@ -0,0 +1,117 @@
|
||||
$font-stack: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
$background-color: #f4994b;
|
||||
$nav-item-color: #ffe4cd;
|
||||
|
||||
/*
|
||||
* Globals
|
||||
*/
|
||||
body {
|
||||
font-family: $font-stack;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
h1, .h1,
|
||||
h2, .h2,
|
||||
h3, .h3,
|
||||
h4, .h4,
|
||||
h5, .h5,
|
||||
h6, .h6 {
|
||||
margin-top: 0;
|
||||
font-family: $font-stack;
|
||||
font-weight: normal;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/*
|
||||
* Override Bootstrap's default container.
|
||||
*/
|
||||
@media (min-width: 1200px) {
|
||||
.container {
|
||||
width: 970px;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Masthead for nav
|
||||
*/
|
||||
.masthead {
|
||||
background-color: $background-color;
|
||||
-webkit-box-shadow: inset 0 -2px 5px rgba(0,0,0,.1);
|
||||
box-shadow: inset 0 -2px 5px rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
/* Nav links */
|
||||
.nav-item {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
font-weight: 500;
|
||||
color: $nav-item-color;
|
||||
}
|
||||
.nav-item:hover,
|
||||
.nav-item:focus {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Active state gets a caret at the bottom */
|
||||
.nav .active {
|
||||
color: #fff;
|
||||
}
|
||||
.nav .active:after {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-left: -5px;
|
||||
vertical-align: middle;
|
||||
content: " ";
|
||||
border-right: 5px solid transparent;
|
||||
border-bottom: 5px solid;
|
||||
border-left: 5px solid transparent;
|
||||
}
|
||||
|
||||
.main {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
#logo {
|
||||
background-color: $background-color;
|
||||
background-image: url("../images/logo.png");
|
||||
background-size:contain;
|
||||
width: 200px;
|
||||
height:278px;
|
||||
}
|
||||
|
||||
/* Hide logo in small screens */
|
||||
@media (max-width: 767px) {
|
||||
#logo {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.table td, .table th {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.alert {
|
||||
margin-top: 1em;
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// For Navigation pulling right
|
||||
.nav-item-auth {
|
||||
&.nav-item-auth-signout, &.nav-item-auth-signup {
|
||||
order: 9999;
|
||||
}
|
||||
|
||||
&.nav-item-auth-profile, &.nav-item-auth-signin {
|
||||
order: 9990;
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
3
src/cdj_carnetdejeu.cr
Normal file
3
src/cdj_carnetdejeu.cr
Normal file
@ -0,0 +1,3 @@
|
||||
require "../config/*"
|
||||
|
||||
Amber::Server.start
|
6
src/controllers/application_controller.cr
Normal file
6
src/controllers/application_controller.cr
Normal file
@ -0,0 +1,6 @@
|
||||
require "jasper_helpers"
|
||||
|
||||
class ApplicationController < Amber::Controller::Base
|
||||
include JasperHelpers
|
||||
LAYOUT = "application.slang"
|
||||
end
|
5
src/controllers/home_controller.cr
Normal file
5
src/controllers/home_controller.cr
Normal file
@ -0,0 +1,5 @@
|
||||
class HomeController < ApplicationController
|
||||
def index
|
||||
render("index.slang")
|
||||
end
|
||||
end
|
2
src/locales/en.yml
Normal file
2
src/locales/en.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
welcome_to_amber: "Welcome to Amber Framework!"
|
9
src/views/home/index.slang
Normal file
9
src/views/home/index.slang
Normal file
@ -0,0 +1,9 @@
|
||||
.row
|
||||
#logo
|
||||
.col-sm-12.col-md-6
|
||||
h2 = t "welcome_to_amber"
|
||||
p Thank you for trying out the Amber Framework. We are working hard to provide a super fast and reliable framework that provides all the productivity tools you are used to without sacrificing the speed.
|
||||
.list-group
|
||||
a.list-group-item.list-group-item-action target="_blank" href="https://docs.amberframework.org" Getting Started with Amber Framework
|
||||
a.list-group-item.list-group-item-action target="_blank" href="https://github.com/veelenga/awesome-crystal" List of Awesome Crystal projects and shards
|
||||
a.list-group-item.list-group-item-action target="_blank" href="https://crystalshards.xyz" What's hot in Crystal right now
|
2
src/views/layouts/_nav.slang
Normal file
2
src/views/layouts/_nav.slang
Normal file
@ -0,0 +1,2 @@
|
||||
- active = context.request.path == "/" ? "active" : ""
|
||||
a class="nav-item #{active}" href="/" Home
|
32
src/views/layouts/application.slang
Normal file
32
src/views/layouts/application.slang
Normal file
@ -0,0 +1,32 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title Cdj Carnetdejeu using Amber
|
||||
meta charset="utf-8"
|
||||
meta http-equiv="X-UA-Compatible" content="IE=edge"
|
||||
meta name="viewport" content="width=device-width, initial-scale=1"
|
||||
link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"
|
||||
link rel="stylesheet" href="/dist/main.bundle.css"
|
||||
link rel="apple-touch-icon" href="/favicon.png"
|
||||
link rel="icon" href="/favicon.png"
|
||||
link rel="icon" type="image/x-icon" href="/favicon.ico"
|
||||
|
||||
body
|
||||
.masthead
|
||||
.container
|
||||
nav.nav
|
||||
== render(partial: "layouts/_nav.slang")
|
||||
.container
|
||||
.row
|
||||
.col-sm
|
||||
- flash.each do |key, value|
|
||||
div class="alert alert-#{key}"
|
||||
p = flash[key]
|
||||
.row
|
||||
.col-sm-12.main
|
||||
== content
|
||||
|
||||
script src="https://code.jquery.com/jquery-3.3.1.min.js"
|
||||
script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"
|
||||
script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"
|
||||
script src="/dist/main.bundle.js"
|
Reference in New Issue
Block a user