diff --git a/README.md b/README.md index 6a4c606..efc091b 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ _If you are having problems, view `README_INSTALL.md` for manual instructions._ ```elixir def deps do - [{:thesis, "~> 0.3.2"}] + [{:thesis, "~> 0.3.3"}] end def application do diff --git a/README_INSTALL.md b/README_INSTALL.md index b5871ca..d645419 100644 --- a/README_INSTALL.md +++ b/README_INSTALL.md @@ -6,7 +6,7 @@ For automatic setup, see `README.md`. ```elixir def deps do - [{:thesis, "~> 0.3.2"}] + [{:thesis, "~> 0.3.3"}] end def application do diff --git a/doc/404.html b/doc/404.html index e33581d..99551ae 100644 --- a/doc/404.html +++ b/doc/404.html @@ -5,7 +5,7 @@ - 404 — thesis v0.3.2 + 404 — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

diff --git a/doc/Mix.Tasks.Thesis.Install.html b/doc/Mix.Tasks.Thesis.Install.html index e61e71f..1d49810 100644 --- a/doc/Mix.Tasks.Thesis.Install.html +++ b/doc/Mix.Tasks.Thesis.Install.html @@ -5,7 +5,7 @@ - thesis.install — thesis v0.3.2 + thesis.install — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 mix thesis.install

diff --git a/doc/Thesis.Auth.html b/doc/Thesis.Auth.html index db80d5a..05089f7 100644 --- a/doc/Thesis.Auth.html +++ b/doc/Thesis.Auth.html @@ -5,7 +5,7 @@ - Thesis.Auth — thesis v0.3.2 + Thesis.Auth — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.Auth behaviour

@@ -125,14 +125,14 @@

page_is_editable?(arg0) whether to load and display the Thesis editor and also whether to allow updates to Thesis.Page and Thesis.PageContent areas.

Typical example:

-
defmodule MyApp.ThesisAuth do
+
defmodule MyApp.ThesisAuth do
   @behaviour Thesis.Auth
 
-  def page_is_editable?(conn) do
+  def page_is_editable?(conn) do
     conn
-    |> MyApp.AuthController.current_user_is_admin?(conn)
-  end
-end
+
|> MyApp.AuthController.current_user_is_admin?(conn) + end +end
diff --git a/doc/Thesis.Backup.html b/doc/Thesis.Backup.html index 2321e96..97bb19b 100644 --- a/doc/Thesis.Backup.html +++ b/doc/Thesis.Backup.html @@ -5,7 +5,7 @@ - Thesis.Backup — thesis v0.3.2 + Thesis.Backup — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.Backup

diff --git a/doc/Thesis.Controller.Plug.html b/doc/Thesis.Controller.Plug.html index cd5c07d..4731079 100644 --- a/doc/Thesis.Controller.Plug.html +++ b/doc/Thesis.Controller.Plug.html @@ -5,7 +5,7 @@ - Thesis.Controller.Plug — thesis v0.3.2 + Thesis.Controller.Plug — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.Controller.Plug

diff --git a/doc/Thesis.Controller.html b/doc/Thesis.Controller.html index 009a918..01efe89 100644 --- a/doc/Thesis.Controller.html +++ b/doc/Thesis.Controller.html @@ -5,7 +5,7 @@ - Thesis.Controller — thesis v0.3.2 + Thesis.Controller — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.Controller

@@ -67,16 +67,16 @@

Provides a plug that preloads any Thesis content for a page. Typically, you'll add this to your web/web.ex file, under the controller function:

-
def controller do
-  quote do
+
def controller do
+  quote do
     use Phoenix.Controller
     use Thesis.Controller
     # ...
-  end
-end
+
end +end

If you'd prefer to only use Thesis in certain controllers, remove it from web/web.ex and add it to the specific controllers by doing this:

-
defmodule MyApp.MyController do
+
defmodule MyApp.MyController do
   use Thesis.Controller
   # ...
diff --git a/doc/Thesis.EctoStore.html b/doc/Thesis.EctoStore.html index f3c2f27..4c7ee2a 100644 --- a/doc/Thesis.EctoStore.html +++ b/doc/Thesis.EctoStore.html @@ -5,7 +5,7 @@ - Thesis.EctoStore — thesis v0.3.2 + Thesis.EctoStore — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.EctoStore

@@ -171,7 +171,7 @@

backups(page_slug)

Retrieves all backups for a given slug. Returns the backup.

-
backups(slug)
+
backups(slug)

Callback implementation for Thesis.Store.backups/1.

@@ -261,7 +261,7 @@

restore(id)

Retrieves a given backup (identified by its id). Returns the backup.

-
restore(backup_id)
+
restore(backup_id)

Callback implementation for Thesis.Store.restore/1.

diff --git a/doc/Thesis.File.html b/doc/Thesis.File.html index f447a04..6368b14 100644 --- a/doc/Thesis.File.html +++ b/doc/Thesis.File.html @@ -5,7 +5,7 @@ - Thesis.File — thesis v0.3.2 + Thesis.File — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.File

diff --git a/doc/Thesis.Notifications.html b/doc/Thesis.Notifications.html index 9a202e1..037e296 100644 --- a/doc/Thesis.Notifications.html +++ b/doc/Thesis.Notifications.html @@ -5,7 +5,7 @@ - Thesis.Notifications — thesis v0.3.2 + Thesis.Notifications — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.Notifications

@@ -149,16 +149,16 @@

notifications_from_host_app(acc, conn, notifications)

Adds notifications provided by the host app to the accumulator.

-
iex> notifications_from_host_app(%{"page-settings" => []}, nil, [page_settings: ["notif"]])
-%{"page-settings" => ["notif"]}
-iex> notifications_from_host_app(%{"page-settings" => []}, nil, [page_settings: :invalid])
-%{"page-settings" => []}
-iex> notifications_from_host_app(%{"page-settings" => ["notif1"]}, nil, [page_settings: ["notif2"]])
-%{"page-settings" => ["notif2", "notif1"]}
-iex> notifications_from_host_app(%{"other" => [], "add-page" => ["notif"]}, nil, [other: ["notif"]])
-%{"other" => ["notif"], "add-page" => ["notif"]}
-iex> notifications_from_host_app(%{"other" => []}, nil, nil)
-%{"other" => []}
+
iex> notifications_from_host_app(%{"page-settings" => []}, nil, [page_settings: ["notif"]])
+%{"page-settings" => ["notif"]}
+iex> notifications_from_host_app(%{"page-settings" => []}, nil, [page_settings: :invalid])
+%{"page-settings" => []}
+iex> notifications_from_host_app(%{"page-settings" => ["notif1"]}, nil, [page_settings: ["notif2"]])
+%{"page-settings" => ["notif2", "notif1"]}
+iex> notifications_from_host_app(%{"other" => [], "add-page" => ["notif"]}, nil, [other: ["notif"]])
+%{"other" => ["notif"], "add-page" => ["notif"]}
+iex> notifications_from_host_app(%{"other" => []}, nil, nil)
+%{"other" => []}
@@ -193,17 +193,17 @@

verify_notifications_structure(conn, notifications)

Verifies that the notifications provided by the host app are in the correct format.

-
iex> verify_notifications_structure(nil, [:invalid])
+
iex> verify_notifications_structure(nil, [:invalid])
 false
-iex> verify_notifications_structure(nil, %{})
+iex> verify_notifications_structure(nil, %{})
 false
-iex> verify_notifications_structure(nil, %{invalid_key: []})
+iex> verify_notifications_structure(nil, %{invalid_key: []})
 false
-iex> verify_notifications_structure(nil, %{add_page: "invalid value"})
+iex> verify_notifications_structure(nil, %{add_page: "invalid value"})
 false
-iex> verify_notifications_structure(nil, %{add_page: ["notif", "notif", :atom]})
+iex> verify_notifications_structure(nil, %{add_page: ["notif", "notif", :atom]})
 false
-iex> verify_notifications_structure(nil, [add_page: [], page_settings: ["notif"]])
+iex> verify_notifications_structure(nil, [add_page: [], page_settings: ["notif"]])
 false

diff --git a/doc/Thesis.Page.html b/doc/Thesis.Page.html index fd2a215..ac7c7d0 100644 --- a/doc/Thesis.Page.html +++ b/doc/Thesis.Page.html @@ -5,7 +5,7 @@ - Thesis.Page — thesis v0.3.2 + Thesis.Page — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.Page

@@ -175,11 +175,11 @@

redirected?(arg1)

Returns whether the page redirects to another page.

Examples:

-
iex> Thesis.Page.redirected?(%Thesis.Page{slug: "", redirect_url: nil})
+
iex> Thesis.Page.redirected?(%Thesis.Page{slug: "", redirect_url: nil})
 false
-iex> Thesis.Page.redirected?(%Thesis.Page{slug: "", redirect_url: ""})
+iex> Thesis.Page.redirected?(%Thesis.Page{slug: "", redirect_url: ""})
 false
-iex> Thesis.Page.redirected?(%Thesis.Page{slug: "", redirect_url: "/asdf"})
+iex> Thesis.Page.redirected?(%Thesis.Page{slug: "", redirect_url: "/asdf"})
 true
diff --git a/doc/Thesis.PageContent.html b/doc/Thesis.PageContent.html index 6d5936d..360f52b 100644 --- a/doc/Thesis.PageContent.html +++ b/doc/Thesis.PageContent.html @@ -5,7 +5,7 @@ - Thesis.PageContent — thesis v0.3.2 + Thesis.PageContent — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.PageContent

@@ -190,18 +190,18 @@

find(contents, page_id, name)

Selects the right page content from a list.

-
iex> foo = [%Thesis.PageContent{id: 1, page_id: nil, name: "Test"},%Thesis.PageContent{id: 2, page_id: 1, name: "Test"},%Thesis.PageContent{id: 3, page_id: 2, name: "Test"},%Thesis.PageContent{id: 4, page_id: nil, name: "Test2"},%Thesis.PageContent{id: 5, page_id: 1, name: "Test2"}]
-iex> Thesis.PageContent.find(foo, nil, "Test").id == 1
+
iex> foo = [%Thesis.PageContent{id: 1, page_id: nil, name: "Test"},%Thesis.PageContent{id: 2, page_id: 1, name: "Test"},%Thesis.PageContent{id: 3, page_id: 2, name: "Test"},%Thesis.PageContent{id: 4, page_id: nil, name: "Test2"},%Thesis.PageContent{id: 5, page_id: 1, name: "Test2"}]
+iex> Thesis.PageContent.find(foo, nil, "Test").id == 1
 true
-iex> Thesis.PageContent.find(foo, 1, "Test").id == 2
+iex> Thesis.PageContent.find(foo, 1, "Test").id == 2
 true
-iex> Thesis.PageContent.find(foo, 2, "Test").id == 3
+iex> Thesis.PageContent.find(foo, 2, "Test").id == 3
 true
-iex> Thesis.PageContent.find(foo, nil, "Test2").id == 4
+iex> Thesis.PageContent.find(foo, nil, "Test2").id == 4
 true
-iex> Thesis.PageContent.find(foo, 1, "Test2").id == 5
+iex> Thesis.PageContent.find(foo, 1, "Test2").id == 5
 true
-iex> Thesis.PageContent.find(foo, 1, "Test7")
+iex> Thesis.PageContent.find(foo, 1, "Test7")
 nil
@@ -220,9 +220,9 @@

Doctests:

-
iex> m = %Thesis.PageContent{meta: ~S({"test":"Thing", "test2":"123"})}
-iex> Thesis.PageContent.meta_attributes(m)
-%{test: "Thing", test2: "123"}
+
iex> m = %Thesis.PageContent{meta: ~S({"test":"Thing", "test2":"123"})}
+iex> Thesis.PageContent.meta_attributes(m)
+%{test: "Thing", test2: "123"}
@@ -240,8 +240,8 @@

Doctests:

-
iex> m = %{test: "Thing", test2: "123"}
-iex> Thesis.PageContent.meta_serialize(m)
+
iex> m = %{test: "Thing", test2: "123"}
+iex> Thesis.PageContent.meta_serialize(m)
 ~S({"test2":"123","test":"Thing"})
diff --git a/doc/Thesis.Render.html b/doc/Thesis.Render.html index dcc51ac..bdca5be 100644 --- a/doc/Thesis.Render.html +++ b/doc/Thesis.Render.html @@ -5,7 +5,7 @@ - Thesis.Render — thesis v0.3.2 + Thesis.Render — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.Render

diff --git a/doc/Thesis.RepoUploader.html b/doc/Thesis.RepoUploader.html index ea13d30..5b36ba0 100644 --- a/doc/Thesis.RepoUploader.html +++ b/doc/Thesis.RepoUploader.html @@ -5,7 +5,7 @@ - Thesis.RepoUploader — thesis v0.3.2 + Thesis.RepoUploader — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.RepoUploader

diff --git a/doc/Thesis.Router.html b/doc/Thesis.Router.html index 36b194d..d78df16 100644 --- a/doc/Thesis.Router.html +++ b/doc/Thesis.Router.html @@ -5,7 +5,7 @@ - Thesis.Router — thesis v0.3.2 + Thesis.Router — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.Router

@@ -68,16 +68,16 @@

editor client as well as static assets.

Typically, you'll add this to your web/web.ex file, under the router function:

-
def router do
-  quote do
+
def router do
+  quote do
     use Phoenix.Router
     use Thesis.Router
     # ...
-  end
-end
+
end +end

If you'd prefer, you can remove it from web/web.ex and add it to the router yourself:

-
defmodule MyApp.Router do
+
defmodule MyApp.Router do
   use Thesis.Router
   # ...
diff --git a/doc/Thesis.S3Uploader.html b/doc/Thesis.S3Uploader.html index 89208e0..09bd190 100644 --- a/doc/Thesis.S3Uploader.html +++ b/doc/Thesis.S3Uploader.html @@ -5,7 +5,7 @@ - Thesis.S3Uploader — thesis v0.3.2 + Thesis.S3Uploader — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.S3Uploader

diff --git a/doc/Thesis.Store.html b/doc/Thesis.Store.html index 6ffca1d..dab9e05 100644 --- a/doc/Thesis.Store.html +++ b/doc/Thesis.Store.html @@ -5,7 +5,7 @@ - Thesis.Store — thesis v0.3.2 + Thesis.Store — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.Store behaviour

@@ -153,7 +153,7 @@

backups(arg0)

Retrieves all backups for a given slug. Returns the backup.

-
backups(slug)
+
backups(slug)
@@ -171,7 +171,7 @@

delete(%{})

Deletes the given page (identified by its slug). Returns {:ok, page} or {:error, changeset}.

-
delete(%{"slug" => "/asdf"})
+
delete(%{"slug" => "/asdf"})

@@ -222,7 +222,7 @@

restore(arg0)

Retrieves a given backup (identified by its id). Returns the backup.

-
restore(backup_id)
+
restore(backup_id)

@@ -241,7 +241,7 @@

update(%{}, map)

Updates the given page (identified by its slug) with the given map of string keys and Thesis.PageContent structs. Returns {:ok, page} or {:error, changeset}.

-
update(%{"slug" => "/"}, %{"Heading" => "My Heading Content"})
+
update(%{"slug" => "/"}, %{"Heading" => "My Heading Content"})

diff --git a/doc/Thesis.Uploader.html b/doc/Thesis.Uploader.html index 0f4c468..91949d3 100644 --- a/doc/Thesis.Uploader.html +++ b/doc/Thesis.Uploader.html @@ -5,7 +5,7 @@ - Thesis.Uploader — thesis v0.3.2 + Thesis.Uploader — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.Uploader behaviour

diff --git a/doc/Thesis.Utilities.html b/doc/Thesis.Utilities.html index 37d3e2f..8f4cd89 100644 --- a/doc/Thesis.Utilities.html +++ b/doc/Thesis.Utilities.html @@ -5,7 +5,7 @@ - Thesis.Utilities — thesis v0.3.2 + Thesis.Utilities — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.Utilities

@@ -144,11 +144,11 @@

normalize_path(path)

Takes a URL and strips unnecessary characters.

iex> import Thesis.Utilities
-iex> normalize_path("//ignite//foo")
+iex> normalize_path("//ignite//foo")
 "/ignite/foo"
-iex> normalize_path("/ignite/foo/")
+iex> normalize_path("/ignite/foo/")
 "/ignite/foo"
-iex> normalize_path("/")
+iex> normalize_path("/")
 "/"
@@ -164,11 +164,11 @@

parameterize(str)

Removes special characters, keeps dashes and underscores, and replaces spaces with dashes. Also downcases the entire string.

iex> import Thesis.Utilities
-iex> parameterize("Jamon is so cool!")
+iex> parameterize("Jamon is so cool!")
 "jamon-is-so-cool"
-iex> parameterize("%#d50SDF dfsJ FDS  lkdsf f dfka   a")
+iex> parameterize("%#d50SDF dfsJ FDS  lkdsf f dfka   a")
 "d50sdf-dfsj-fds--lkdsf-f-dfka---a"
-iex> parameterize(:this_is_a_test)
+iex> parameterize(:this_is_a_test)
 "this-is-a-test"
@@ -183,9 +183,9 @@

random_string(length)

Generates a random string of letters of a given length.

iex> import Thesis.Utilities
-iex> String.length(random_string(15))
+iex> String.length(random_string(15))
 15
-iex> random_string(15) != random_string(15)
+iex> random_string(15) != random_string(15)
 true
@@ -200,11 +200,11 @@

random_string(length, atom)

Generates a random string of digits of a given length.

iex> import Thesis.Utilities
-iex> String.length(random_string(15, :numeric))
+iex> String.length(random_string(15, :numeric))
 15
-iex> random_string(15, :numeric) != random_string(15, :numeric)
+iex> random_string(15, :numeric) != random_string(15, :numeric)
 true
-iex> String.to_integer(random_string(15, :numeric)) > 0
+iex> String.to_integer(random_string(15, :numeric)) > 0
 true
@@ -219,9 +219,9 @@

to_s(arg)

Shorthand to_string.

iex> import Thesis.Utilities
-iex> to_s(000001)
+iex> to_s(000001)
 "1"
-iex> to_s(123)
+iex> to_s(123)
 "123"
@@ -236,9 +236,9 @@

typeof(x)

Returns the data type for the provided data using guard functions.

iex> import Thesis.Utilities
-iex> typeof(000001)
+iex> typeof(000001)
 "integer"
-iex> typeof([1,2,3])
+iex> typeof([1,2,3])
 "list"
diff --git a/doc/Thesis.View.html b/doc/Thesis.View.html index d47413f..7bc0f03 100644 --- a/doc/Thesis.View.html +++ b/doc/Thesis.View.html @@ -5,7 +5,7 @@ - Thesis.View — thesis v0.3.2 + Thesis.View — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis.View

@@ -68,15 +68,15 @@

function. Look at individual function documentation to learn more about them.

Typically, you'll add this to your web/web.ex file, under the view function:

-
def view do
-  quote do
+
def view do
+  quote do
     use Thesis.View
     # ...
-  end
-end
+
end +end

If you'd prefer, you can remove it from web/web.ex and add it to your views yourself:

-
defmodule MyApp.MyView do
+
defmodule MyApp.MyView do
   use Thesis.View
   # ...
@@ -182,14 +182,14 @@

Examples

-
<%= content(@conn, "Title", :text, do: "Default Title") %>
-<%= content(@conn, "Description", :html) do %>
+
<%= content(@conn, "Title", :text, do: "Default Title") %>
+<%= content(@conn, "Description", :html) do %>
   <p>Default description</p>
   <p>Another paragraph</p>
-<% end %>
-<%= content(@conn, "Description", :html, classes: "more classes") do %>
+<% end %>
+<%= content(@conn, "Description", :html, classes: "more classes") do %>
   <p>Default description</p>
-<% end %>
+
<% end %>
@@ -222,8 +222,8 @@

current_page(conn)

Returns the current page as a Thesis.Page{} struct.

-
iex> Thesis.View.current_page(%Plug.Conn{request_path: "/test"})
-%Thesis.Page{slug: "/test"}
+
iex> Thesis.View.current_page(%Plug.Conn{request_path: "/test"})
+%Thesis.Page{slug: "/test"}

@@ -249,14 +249,14 @@

Examples

-
<%= global_content(@conn, "Title", :text, do: "Default Title") %>
-<%= global_content(@conn, "Description", :html) do %>
+
<%= global_content(@conn, "Title", :text, do: "Default Title") %>
+<%= global_content(@conn, "Description", :html) do %>
   <p>Default description</p>
   <p>Another paragraph</p>
-<% end %>
-<%= global_content(@conn, "Description", :html, classes: "more classes") do %>
+<% end %>
+<%= global_content(@conn, "Description", :html, classes: "more classes") do %>
   <p>Default description</p>
-<% end %>
+
<% end %>
@@ -286,13 +286,13 @@

page_description(conn, default)

Outputs the page title or a provided default.

Doctests:

-
iex> page = %Thesis.Page{description: "Test Description"}
-iex> conn = %Plug.Conn{assigns: %{thesis_page: page}}
-iex> Thesis.View.page_description(conn, "Default Description")
+
iex> page = %Thesis.Page{description: "Test Description"}
+iex> conn = %Plug.Conn{assigns: %{thesis_page: page}}
+iex> Thesis.View.page_description(conn, "Default Description")
 "Test Description"
-iex> page = %Thesis.Page{}
-iex> conn = %Plug.Conn{assigns: %{thesis_page: page}}
-iex> Thesis.View.page_description(conn, "Default Description")
+iex> page = %Thesis.Page{}
+iex> conn = %Plug.Conn{assigns: %{thesis_page: page}}
+iex> Thesis.View.page_description(conn, "Default Description")
 "Default Description"

@@ -307,13 +307,13 @@

page_title(conn, default)

Outputs the page title or a provided default.

Doctests:

-
iex> page = %Thesis.Page{title: "Test Title"}
-iex> conn = %Plug.Conn{assigns: %{thesis_page: page}}
-iex> Thesis.View.page_title(conn, "Default Title")
+
iex> page = %Thesis.Page{title: "Test Title"}
+iex> conn = %Plug.Conn{assigns: %{thesis_page: page}}
+iex> Thesis.View.page_title(conn, "Default Title")
 "Test Title"
-iex> page = %Thesis.Page{}
-iex> conn = %Plug.Conn{assigns: %{thesis_page: page}}
-iex> Thesis.View.page_title(conn, "Default Title")
+iex> page = %Thesis.Page{}
+iex> conn = %Plug.Conn{assigns: %{thesis_page: page}}
+iex> Thesis.View.page_title(conn, "Default Title")
 "Default Title"
@@ -334,16 +334,16 @@

thesis_editor(conn) current user, and then renders the editor, style tag, and bootstrap js.

If not editable, simply returns an empty string.

Doctests:

-
iex> {:safe, editor} = Thesis.View.thesis_editor(%Plug.Conn{assigns: %{thesis_editable: true}})
-iex> String.contains?(editor, "/thesis/thesis.css")
+
iex> {:safe, editor} = Thesis.View.thesis_editor(%Plug.Conn{assigns: %{thesis_editable: true}})
+iex> String.contains?(editor, "/thesis/thesis.css")
 true
-iex> String.contains?(editor, "thesis-container")
+iex> String.contains?(editor, "thesis-container")
 true
-iex> String.contains?(editor, "<script>")
+iex> String.contains?(editor, "<script>")
 true
 
-iex> Thesis.View.thesis_editor(%Plug.Conn{assigns: %{thesis_editable: false}})
-{:safe, ""}
+
iex> Thesis.View.thesis_editor(%Plug.Conn{assigns: %{thesis_editable: false}}) +{:safe, ""}
diff --git a/doc/Thesis.html b/doc/Thesis.html index 00f6302..efcef4f 100644 --- a/doc/Thesis.html +++ b/doc/Thesis.html @@ -5,7 +5,7 @@ - Thesis — thesis v0.3.2 + Thesis — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 Thesis

diff --git a/doc/api-reference.html b/doc/api-reference.html index c571a15..3bf5fb1 100644 --- a/doc/api-reference.html +++ b/doc/api-reference.html @@ -5,7 +5,7 @@ - API Reference — thesis v0.3.2 + API Reference — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

@@ -59,7 +59,7 @@

- thesis v0.3.2 + thesis v0.3.3 API Reference

diff --git a/doc/index.html b/doc/index.html index b51d7cc..b7c8bb1 100644 --- a/doc/index.html +++ b/doc/index.html @@ -2,7 +2,7 @@ - thesis v0.3.2 — Documentation + thesis v0.3.3 — Documentation diff --git a/doc/search.html b/doc/search.html index b685c1c..3bcd401 100644 --- a/doc/search.html +++ b/doc/search.html @@ -5,7 +5,7 @@ - Search — thesis v0.3.2 + Search — thesis v0.3.3 @@ -29,7 +29,7 @@

thesis

diff --git a/mix.exs b/mix.exs index 7d6cd0b..12ae90d 100644 --- a/mix.exs +++ b/mix.exs @@ -1,6 +1,6 @@ defmodule Thesis.Mixfile do use Mix.Project - @version "0.3.2" # REMEMBER TO UPDATE package.json and both READMEs! + @version "0.3.3" # REMEMBER TO UPDATE package.json and both READMEs! def project do [ diff --git a/package.json b/package.json index dc203d2..85e8de5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "thesis", - "version": "0.3.2", + "version": "0.3.3", "repository": {}, "license": "MIT", "devDependencies": {