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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Highlighting elements example</title> | |
</head> | |
<body> |
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
defmodule Myproject.LayoutView do | |
use Myproject.Web, :view | |
defp render_flash(type, message) do | |
~E""" | |
<div class="alert alert-<%= type %>" role="alert"> | |
<%= message %> | |
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
<span aria-hidden="true">×</span> | |
</button> |
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
def view do | |
quote do | |
use Phoenix.View, root: "web/templates" | |
# Import convenience functions from controllers | |
import Phoenix.Controller, only: [get_csrf_token: 0, get_flash: 2, get_flash: 1, view_module: 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
<body> | |
<nav class="navbar navbar-toggleable-sm navbar-inverse bg-primary mb-3"> | |
<div class="container"> | |
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> | |
<span class="navbar-toggler-icon"></span> | |
</button> | |
<%= link "Myproject", to: page_path(@conn, :index), class: "navbar-brand" %> | |
<div class="collapse navbar-collapse" id="navbarSupportedContent"> | |
<ul class="navbar-nav ml-auto"> | |
<li><a href="/" class="nav-link">Button</a></li> |
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
const CopyWebpackPlugin = require("copy-webpack-plugin"); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const webpack = require('webpack'); | |
module.exports = { | |
entry: ['bootstrap-loader', './web/static/js/app.js'], | |
output: { | |
path: "./priv/static/dist", | |
filename: "app.js" | |
}, |
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
module.exports = { | |
plugins: [ | |
require('postcss-flexbugs-fixes'), | |
require('autoprefixer')({ | |
browsers: [ | |
// Stolen from: https://github.com/twbs/bootstrap/blob/v4-dev/grunt/postcss.js | |
// Official browser support policy: | |
// https://v4-alpha.getbootstrap.com/getting-started/browsers-devices/#supported-browsers | |
// | |
'Chrome >= 35', // Exact version number here is kinda arbitrary |
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
logLevel: debug | |
bootstrapVersion: 4 | |
extractStyles: true | |
useFlexbox: true | |
styleLoaders: | |
- style-loader | |
- css-loader?-autoprefixer | |
- resolve-url-loader?sourceMap | |
- postcss-loader?sourceMap | |
- sass-loader?sourceMap |
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
<!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"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<title>Hello Myproject!</title> |
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
config :myproject, Myproject.Endpoint, | |
http: [port: 4000], | |
debug_errors: true, | |
code_reloader: true, | |
check_origin: false, | |
watchers: [node: ["node_modules/webpack/bin/webpack.js", "--watch-stdin", "--progress", "--color", | |
cd: Path.expand("../", __DIR__)]] |
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
{ | |
"repository": {}, | |
"license": "MIT", | |
"scripts": { | |
"deploy": "webpack -p", | |
"watch": "webpack --watch-stdin --progress --color" | |
}, | |
"dependencies": { | |
"phoenix": "file:deps/phoenix", | |
"phoenix_html": "file:deps/phoenix_html" |
NewerOlder