Packages
torch
0.1.0
6.0.0
5.6.0
5.5.0
5.4.0
5.3.2
5.3.1
5.2.0
5.1.2
5.1.1
5.1.0
5.0.0
5.0.0-rc.4
5.0.0-rc.3
5.0.0-rc.2
5.0.0-rc.1
5.0.0-rc.0
4.3.2
4.3.1
4.3.0
4.2.1
4.2.0
retired
4.1.0
4.0.0
4.0.0-rc.0
3.9.1
3.9.0
3.8.0
3.7.1
3.7.0-rc.0
3.6.4
3.6.3
3.6.2
3.6.1
3.6.0
3.5.0
3.4.1
3.4.0
3.3.1
3.3.0
3.2.1
3.2.0
3.1.0
3.0.0
2.1.0
2.0.0
2.0.0-rc.3
2.0.0-rc.2
2.0.0-rc.1
1.0.0-rc.6
1.0.0-rc.5
1.0.0-rc.4
1.0.0-rc.3
1.0.0-rc.2
1.0.0-rc.1
0.2.0-rc.5
0.2.0-rc.4
0.2.0-rc.3
0.2.0-rc.2
0.2.0-rc.1
0.1.0
Rapid admin generator for Phoenix
Current section
Files
Jump to
Current section
Files
lib/mix/tasks/torch.install.ex
defmodule Mix.Tasks.Torch.Install do
@moduledoc """
Installs all the files Torch needs to run within the context of your
Phoenix application.
## Example
mix torch.install
"""
use Mix.Task
def run(_args) do
Mix.Torch.copy_from [:torch], "priv/templates/eex", "", [], [
{:eex, "layout.html.eex", "web/templates/layout/admin.html.eex"}
]
Mix.Torch.copy_from [:torch], "priv/templates/sass", "", [], [
{:text, "_variables.scss", "web/static/css/_admin_variables.scss"}
]
Mix.shell.info """
#{hr}
#{IO.ANSI.yellow}TORCH INSTALLED!#{IO.ANSI.reset}
#{hr}
There are three final steps you must complete manually:
1. Import the CSS styles. If you want to use the SASS styles, you should
update your app.scss file to look like this:
@import "admin_variables";
@import "../../../node_modules/torch/web/static/css/torch";
Torch also provides a precompiled CSS file in `priv/static/css/torch.css`
if you are not using SASS.
2. Import the Javascript in your `app.js` file. Requires that your `package.json`
has been updated as described in the README.
import 'torch'
3. Add an admin scope to your router in `router.ex`:
scope "/admin", #{Mix.Torch.base}, as: :admin do
pipe_through :browser
end
With those steps complete, you can generate admin controllers with `torch.gen.html`.
"""
end
defp hr do
for _ <- 1..80, into: "", do: "\u{1F525}"
end
end