├── Procfile ├── assets ├── css │ ├── alert.scss │ ├── app.scss │ ├── navbar.scss │ ├── phoenix.scss │ ├── home.scss │ └── sidebar.scss ├── static │ ├── favicon.ico │ ├── images │ │ └── phoenix.png │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── robots.txt │ └── grapejs │ │ └── grapesjs-blocks-basic.min.js ├── package.json ├── js │ ├── app.js │ └── socket.js └── brunch-config.js ├── lib ├── cms_web │ ├── views │ │ ├── session_view.ex │ │ ├── layout_view.ex │ │ ├── admin │ │ │ ├── home_view.ex │ │ │ ├── page_view.ex │ │ │ └── post_view.ex │ │ ├── page_view.ex │ │ ├── error_view.ex │ │ └── error_helpers.ex │ ├── templates │ │ ├── admin │ │ │ ├── post │ │ │ │ ├── new.html.eex │ │ │ │ ├── edit.html.eex │ │ │ │ ├── form.html.eex │ │ │ │ └── index.html.eex │ │ │ └── home │ │ │ │ └── index.html.eex │ │ ├── layout │ │ │ ├── sidebar.html.eex │ │ │ ├── app.html.eex │ │ │ └── navbar.html.eex │ │ ├── page │ │ │ ├── show.html.eex │ │ │ └── index.html.eex │ │ └── session │ │ │ └── new.html.eex │ ├── plugs │ │ ├── auth_ensure.ex │ │ ├── sidebar.ex │ │ ├── error_handler.ex │ │ └── auth.ex │ ├── controllers │ │ ├── page_controller.ex │ │ ├── admin │ │ │ ├── home_controller.ex │ │ │ └── post_controller.ex │ │ └── sessions_controller.ex │ ├── uploaders │ │ └── cover.ex │ ├── gettext.ex │ ├── router.ex │ ├── channels │ │ └── user_socket.ex │ └── endpoint.ex ├── cms.ex ├── cms │ ├── repo.ex │ ├── auth │ │ ├── guardian.ex │ │ ├── user.ex │ │ └── accounts.ex │ ├── application.ex │ └── content │ │ ├── blog.ex │ │ └── post_schema.ex └── cms_web.ex ├── test ├── test_helper.exs ├── cms_web │ ├── views │ │ ├── page_view_test.exs │ │ ├── layout_view_test.exs │ │ └── error_view_test.exs │ ├── controllers │ │ └── page_controller_test.exs │ ├── auth │ │ └── user_test.exs │ └── content │ │ └── post_test.exs └── support │ ├── factory │ ├── post.ex │ └── user.ex │ ├── channel_case.ex │ ├── conn_case.ex │ └── data_case.ex ├── .formatter.exs ├── priv ├── repo │ ├── migrations │ │ ├── 20180913105953_create_users.exs │ │ └── 20180917063454_create_posts.exs │ └── seeds.exs └── gettext │ ├── en │ └── LC_MESSAGES │ │ └── errors.po │ └── errors.pot ├── config ├── test.exs ├── config.exs ├── dev.exs └── prod.exs ├── README.md ├── .gitignore ├── mix.exs └── mix.lock /Procfile: -------------------------------------------------------------------------------- 1 | web: MIX_ENV=prod mix phx.server -------------------------------------------------------------------------------- /assets/css/alert.scss: -------------------------------------------------------------------------------- 1 | .alert { 2 | position: fixed; 3 | right: 20px; 4 | } -------------------------------------------------------------------------------- /assets/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramansah/cms/HEAD/assets/static/favicon.ico -------------------------------------------------------------------------------- /lib/cms_web/views/session_view.ex: -------------------------------------------------------------------------------- 1 | defmodule CmsWeb.SessionView do 2 | use CmsWeb, :view 3 | end -------------------------------------------------------------------------------- /test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | 3 | Ecto.Adapters.SQL.Sandbox.mode(Cms.Repo, :manual) 4 | -------------------------------------------------------------------------------- /lib/cms_web/views/layout_view.ex: -------------------------------------------------------------------------------- 1 | defmodule CmsWeb.LayoutView do 2 | use CmsWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /lib/cms_web/views/admin/home_view.ex: -------------------------------------------------------------------------------- 1 | defmodule CmsWeb.Admin.HomeView do 2 | use CmsWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /assets/static/images/phoenix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramansah/cms/HEAD/assets/static/images/phoenix.png -------------------------------------------------------------------------------- /assets/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramansah/cms/HEAD/assets/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /test/cms_web/views/page_view_test.exs: -------------------------------------------------------------------------------- 1 | defmodule CmsWeb.PageViewTest do 2 | use CmsWeb.ConnCase, async: true 3 | end 4 | -------------------------------------------------------------------------------- /test/cms_web/views/layout_view_test.exs: -------------------------------------------------------------------------------- 1 | defmodule CmsWeb.LayoutViewTest do 2 | use CmsWeb.ConnCase, async: true 3 | end 4 | -------------------------------------------------------------------------------- /assets/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramansah/cms/HEAD/assets/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /assets/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramansah/cms/HEAD/assets/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /assets/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramansah/cms/HEAD/assets/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /assets/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramansah/cms/HEAD/assets/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /lib/cms_web/templates/admin/post/new.html.eex: -------------------------------------------------------------------------------- 1 |
<%= @post.user.name %>
14 |<%= post_excerpt(post) %>
14 || Total Posts | 21 |<%= @context.total_posts %> | 22 |
| Published Posts | 25 |<%= @context.published_posts %> | 26 |
| Drafts | 29 |<%= @context.draft_posts %> | 30 |
| Post Title | 6 |Author | 7 |Created | 8 |Published | 9 |Actions | 10 | 11 | 12 | <%= for post <- @posts do %> 13 |
|---|---|---|---|---|
| <%= post.title %> | 15 |<%= post.user.name %> | 16 |<%= format_date(post) %> | 17 |<%= published_status(post) %> | 18 |19 | <%= link("View", to: page_path(@conn, :show, post), class: "btn btn-sm btn-secondary") %> 20 | <%= link("Modify", to: admin_post_path(@conn, :edit, post), class: "btn btn-sm btn-info") %> 21 | <%= if post.published do %> 22 | <%= link("Unpublish", to: admin_post_publish_path(@conn, :publish, post.slug), data: [confirm: "Are you sure?"], class: "btn btn-sm btn-warning") %> 23 | <% else %> 24 | <%= link("Publish", to: admin_post_publish_path(@conn, :publish, post.slug), class: "btn btn-sm btn-success") %> 25 | <%= link("Delete", method: :delete, to: admin_post_path(@conn, :delete, post), data: [confirm: "Are you sure?"], class: "btn btn-sm btn-danger") %> 26 | <% end %> 27 | | 28 |
<%= get_flash(@conn, :info) %>
20 |<%= get_flash(@conn, :error) %>
21 | 22 |