defmodule ShardWeb.DirectoryController do
use ShardWeb, :controller
def view_pub(conn, %{"owner" => owner, "name" => name}) do
owner = Base.decode16! owner
shard = %SApp.Directory.Manifest{public: true, owner: owner, name: name}
pid = Shard.Manager.find_or_start shard
render conn, "view.html",
public: true,
shard: shard,
pid: pid,
owner: owner,
name: name
end
def view_priv(conn, %{"owner" => owner, "name" => name}) do
owner = Base.decode16! owner
shard = %SApp.Directory.Manifest{public: false, owner: owner, name: name}
pid = Shard.Manager.find_or_start shard
render conn, "view.html",
public: false,
shard: shard,
pid: pid,
owner: owner,
name: name
end
end