Skip to content

Commit

Permalink
wIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen committed Sep 25, 2018
1 parent faafa1b commit a058dc7
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 21 deletions.
10 changes: 4 additions & 6 deletions spec/dummy/app/views/alchemy/elements/_article_view.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<%- cache(element) do -%>
<%= element_view_for(element) do |el| -%>
<% if element.has_ingredient?(:intro) %>
<div class="intro"><%= el.render :intro %></div>
<% end %>
<h1 class="headline"><%= el.render :headline %></h1>
<%= el.render :image, size: "450x1000", crop: true %>
<%= element_view_for(element, class: 'blog-post') do |el| -%>
<h2 class="blog-post-title"><%= el.render :headline %></h2>
<p class="blog-post-meta"><%= el.render :intro %></p>
<%= el.render :text %>
<%= el.render :image, size: "450x1000", crop: true %>
<%- end -%>
<%- end -%>
14 changes: 14 additions & 0 deletions spec/dummy/app/views/alchemy/navigation/_link.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<% if page.redirects_to_external? %>
<%= link_to(
h(page.name),
page.external_urlname,
target: configuration(:open_external_links_in_new_tab) ? '_blank' : nil,
class: external_page_css_class(page)
) %>
<% else %>
<%= link_to(
h(page.name),
@preview_mode ? 'javascript: void(0)' : show_alchemy_page_path(page),
class: (page_active?(page) ? 'active text-muted' : 'text-muted')
) %>
<% end %>
7 changes: 7 additions & 0 deletions spec/dummy/app/views/alchemy/navigation/_renderer.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% if pages.present? %>
<nav class="nav justify-content-between">
<% pages.each do |page| %>
<%= render options[:navigation_link_partial], page: page, options: options %>
<% end %>
</nav>
<% end %>
64 changes: 49 additions & 15 deletions spec/dummy/app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<%= render "alchemy/pages/meta_data" %>
<%= stylesheet_link_tag 'application' %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
<div id="navigation">
<%= render_navigation(:all_sub_menues => true) %>
</div>
<%= render "alchemy/edit_mode" %>
</body>
<!doctype html>
<html lang="<%= @page.language_code %>">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="<%= @page.meta_description %>">
<meta name="keywords" content="<%= @page.meta_keywords %>">
<meta name="author" content="<%= @page.creator.try(:fullname) %>">
<link rel="icon" href="/favicon.ico">
<title><%= @page.title %></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>

<body>
<div class="container">
<header class="blog-header py-3">
<div class="row flex-nowrap justify-content-between align-items-center">
<div class="col-4 pt-1">
</div>
<div class="col-4 text-center">
<a class="blog-header-logo text-dark" href="#">AlchemyCMS Demo</a>
</div>
<div class="col-4 d-flex justify-content-end align-items-center">
</div>
</div>
</header>

<div class="nav-scroller py-1 mb-2">
<%= render_navigation %>
</div>
</div>

<main role="main" class="container">
<div class="row">
<div class="col-md-8 blog-main">
<%= yield %>
</div>
</div>
</main>

<footer class="blog-footer">
<p>Blog template built for <a href="https://getbootstrap.com/">Bootstrap</a> by <a href="https://twitter.com/mdo">@mdo</a>.</p>
<p>
<a href="#">Back to top</a>
</p>
</footer>
<%= render 'alchemy/preview_mode_code' %>
<%= render 'alchemy/menubar' %>
</body>
</html>
4 changes: 4 additions & 0 deletions spec/dummy/config/alchemy/elements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
contents:
- name: image
type: EssencePicture
settings:
size: 1200x600
crop: true

- name: headline
contents:
Expand Down Expand Up @@ -113,6 +116,7 @@
type: EssenceRichtext

- name: slide
compact: true
contents:
- name: picture
type: EssencePicture
Expand Down

0 comments on commit a058dc7

Please sign in to comment.