Browse Source

Aktueller Stand

master
Christian Aust 1 year ago
parent
commit
fc327bd981
39 changed files with 305 additions and 114 deletions
  1. +1
    -0
      .gitignore
  2. +1
    -0
      Gemfile
  3. +3
    -0
      Gemfile.lock
  4. BIN
      app/assets/images/bg-masthead.jpg
  5. +10
    -5
      app/assets/stylesheets/bootstrap.scss
  6. +12
    -2
      app/assets/stylesheets/grayscale.scss
  7. +16
    -4
      app/assets/stylesheets/grayscale/_about.scss
  8. +1
    -1
      app/assets/stylesheets/grayscale/_buttons.scss
  9. +1
    -1
      app/assets/stylesheets/grayscale/_contact.scss
  10. +18
    -3
      app/assets/stylesheets/grayscale/_masthead.scss
  11. +1
    -1
      app/assets/stylesheets/grayscale/_navbar.scss
  12. +1
    -1
      app/assets/stylesheets/grayscale/_signup.scss
  13. +0
    -2
      app/controllers/visitors_controller.rb
  14. +3
    -0
      app/helpers/application_helper.rb
  15. +28
    -0
      app/views/comfy/blog/posts/index.html.haml
  16. +22
    -0
      app/views/comfy/blog/posts/index.rss.builder
  17. +8
    -0
      app/views/comfy/blog/posts/show.html.haml
  18. +0
    -23
      app/views/layouts/_navigation.html.erb
  19. +13
    -0
      app/views/layouts/_navigation.html.haml
  20. +6
    -25
      app/views/layouts/application.html.haml
  21. +0
    -7
      app/views/pages/about.html.erb
  22. +0
    -1
      app/views/visitors/index.html.erb
  23. +2
    -2
      config/initializers/comfortable_mexican_sofa.rb
  24. +9
    -0
      config/initializers/comfy_blog.rb
  25. +3
    -0
      config/routes.rb
  26. +22
    -0
      db/cms_seeds/daemsing/layouts/info/content.html
  27. +21
    -0
      db/cms_seeds/daemsing/layouts/startseite/content.html
  28. +11
    -0
      db/cms_seeds/daemsing/pages/index/band/content.html
  29. +15
    -0
      db/cms_seeds/daemsing/pages/index/content.html
  30. +19
    -0
      db/cms_seeds/daemsing/pages/index/info/content.html
  31. BIN
      db/cms_seeds/daemsing/pages/index/info/microphone.png
  32. +24
    -0
      db/migrate/20190810152727_create_blog.rb
  33. +18
    -1
      db/schema.rb
  34. +0
    -16
      spec/features/visitors/about_page_spec.rb
  35. +0
    -16
      spec/features/visitors/home_page_spec.rb

+ 1
- 0
.gitignore View File

@ -54,6 +54,7 @@ rerun.txt
pickle-email-*.html
.zeus.sock
/node_modules/
/storage
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:

+ 1
- 0
Gemfile View File

@ -12,6 +12,7 @@ gem 'bootsnap', '>= 1.1.0', require: false
gem 'haml-rails'
gem 'comfortable_mexican_sofa', '~> 2.0.0'
gem 'comfy_blog', '~> 2.0.0'
gem 'kaminari'
group :development do

+ 3
- 0
Gemfile.lock View File

@ -70,6 +70,8 @@ GEM
rails (>= 5.2.0)
rails-i18n (>= 5.0.0)
sassc-rails (>= 2.0.0)
comfy_blog (2.0.7)
comfortable_mexican_sofa (>= 2.0.14)
comfy_bootstrap_form (4.0.6)
rails (>= 5.0.0)
concurrent-ruby (1.1.5)
@ -251,6 +253,7 @@ DEPENDENCIES
binding_of_caller
bootsnap (>= 1.1.0)
comfortable_mexican_sofa (~> 2.0.0)
comfy_blog (~> 2.0.0)
database_cleaner
factory_bot_rails
faker

BIN
app/assets/images/bg-masthead.jpg View File

Before After
Width: 1900  |  Height: 1188  |  Size: 213 KiB Width: 1900  |  Height: 1188  |  Size: 296 KiB

+ 10
- 5
app/assets/stylesheets/bootstrap.scss View File

@ -2,12 +2,17 @@
// Do not use *= require in Sass or your other stylesheets will not be able to access the Bootstrap mixins and variables.
@import "bootstrap/scss/bootstrap";
// make all images responsive by default
img {
@extend .img-fluid;
margin: 0 auto;
body {
position: relative;
}
// override for the 'Home' navigation link
.navbar-brand {
font-size: inherit;
font-family: 'Nunito Sans', sans-serif;
font-weight: 300 !important;
text-transform: uppercase;
span {
font-weight: 900 !important;
}
}

+ 12
- 2
app/assets/stylesheets/grayscale.scss View File

@ -1,3 +1,5 @@
$primary: #0A0074;
@import 'grayscale/variables';
@import 'grayscale/mixins';
@import 'grayscale/navbar';
@ -9,8 +11,12 @@
@import 'grayscale/contact';
body {
font-family: 'Nunito';
letter-spacing: 0.0625em;
font-family: 'Domine', serif;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Nunito Sans', sans-serif;
font-weight: 300;
}
a {
@ -37,3 +43,7 @@ a {
footer {
padding: 5rem 0;
}
.band-section {
padding: 10rem 0;
}

+ 16
- 4
app/assets/stylesheets/grayscale/_about.scss View File

@ -1,7 +1,19 @@
.about-section {
padding-top: 10rem;
background: linear-gradient(to bottom, $black 0%,#{fade-out($black, .1)} 75%,#{fade-out($black, .2)} 100%);
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities/text";
.info-section {
padding-top: 4rem;
background: linear-gradient(
to bottom,
$black 0%,
#{fade-out($black, .1)} 75%,
#{fade-out($black, .2)} 100%
);
p {
margin-bottom: 5rem;
@extend .text-white-50;
margin-bottom: 2rem;
}
}

+ 1
- 1
app/assets/stylesheets/grayscale/_buttons.scss View File

@ -1,7 +1,7 @@
.btn {
box-shadow: 0 .1875rem .1875rem 0 rgba(0,0,0,.1) !important;
padding: 1.25rem 2rem;
font-family: 'Varela Round';
font-family: 'Nunito Sans', sans-serif;
font-size: 80%;
text-transform: uppercase;
letter-spacing: .15rem;

+ 1
- 1
app/assets/stylesheets/grayscale/_contact.scss View File

@ -5,7 +5,7 @@
border-bottom: 0.25rem solid $primary;
h4 {
font-size: 0.8rem;
font-family: 'Varela Round';
font-family: 'Nunito Sans', sans-serif;
text-transform: uppercase;
letter-spacing: 0.15rem;
}

+ 18
- 3
app/assets/stylesheets/grayscale/_masthead.scss View File

@ -4,38 +4,53 @@
height: auto;
min-height: 35rem;
padding: 15rem 0;
background: linear-gradient(to bottom, #{fade-out($black, .7)} 0%,#{fade-out($black, .3)} 75%,$black 100%), url(asset_path('bg-masthead.jpg'));
background:
linear-gradient(
to bottom,
#{fade-out($black, .9)} 0%,
#{fade-out($black, .3)} 75%,
$black 100%),
url(asset_path('bg-masthead.jpg')
);
background-position: center;
background-repeat: no-repeat;
background-attachment: scroll;
background-size: cover;
h1 {
font-family: 'Varela Round';
font-family: 'Nunito Sans', sans-serif;
font-size: 2.5rem;
line-height: 2.5rem;
letter-spacing: 0.8rem;
background: -webkit-linear-gradient(fade-out(white, 0.1), fade-out(white, 1));
font-weight: 900;
padding-top: 1em;
background: -webkit-linear-gradient(fade-out(white, 0.1), fade-out(white, 0.8));
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
}
h2 {
max-width: 20rem;
font-size: 1rem;
}
@media(min-width: 768px) {
h1 {
font-size: 4rem;
line-height: 4rem;
}
}
@media(min-width: 992px) {
height: 100vh;
padding: 0;
h1 {
font-size: 6.5rem;
line-height: 6.5rem;
letter-spacing: 0.8rem;
}
h2 {
max-width: 30rem;
font-size: 1.25rem;

+ 1
- 1
app/assets/stylesheets/grayscale/_navbar.scss View File

@ -1,5 +1,5 @@
#mainNav {
min-height: 56px;
min-height: 88px;
background-color: $white;
.navbar-toggler {
font-size: 80%;

+ 1
- 1
app/assets/stylesheets/grayscale/_signup.scss View File

@ -10,7 +10,7 @@
box-shadow: 0 0.1875rem 0.1875rem 0 rgba(0,0,0,.1) !important;
padding: 1.25rem 2rem;
height: auto;
font-family: 'Varela Round';
font-family: 'Nunito Sans', sans-serif;
font-size: 80%;
text-transform: uppercase;
letter-spacing: 0.15rem;

+ 0
- 2
app/controllers/visitors_controller.rb View File

@ -1,2 +0,0 @@
class VisitorsController < ApplicationController
end

+ 3
- 0
app/helpers/application_helper.rb View File

@ -1,2 +1,5 @@
module ApplicationHelper
def cms_page(attr)
@cms_page.send(attr)
end
end

+ 28
- 0
app/views/comfy/blog/posts/index.html.haml View File

@ -0,0 +1,28 @@
.container
.row
.col-md-8
%h1 Blog Posts
- @blog_posts.each do |post|
%h2
= link_to post.title, comfy_blog_post_path(@cms_site.path, post.year, post.month, post.slug)
.date
= post.published_at.to_s(:db)
= comfy_paginate @blog_posts
.col-md-4
%h3 Archive
- dates_with_counts = @cms_site.blog_posts.published.group(:year, :month).order(year: :desc, month: :desc).count
- dates_with_counts.each do |(year, month), count|
%li
- date = [I18n.t("date.month_names")[month.to_i], year].join(" ")
- site_path = @cms_site.url(relative: true)
= link_to date, comfy_blog_posts_of_month_path(site_path, year: year, month: month)
%small (#{count})
%h3 Tags
- Comfy::Cms::Category.of_type('Comfy::Blog::Post').all.each do |tag|
= link_to tag.label, category: tag.label

+ 22
- 0
app/views/comfy/blog/posts/index.rss.builder View File

@ -0,0 +1,22 @@
# frozen_string_literal: true
xml.instruct! :xml, version: "1.0"
xml.rss version: "2.0" do
xml.channel do
xml.title "My Blog"
xml.description "My Blog Description"
xml.link comfy_blog_posts_url(@cms_site.path)
@blog_posts.each do |post|
url = comfy_blog_post_url(@cms_site.path, post.year, post.month, post.slug)
xml.item do
xml.title post.title
xml.description "blog post content"
xml.pubDate post.published_at.to_s(:rfc822)
xml.link url
xml.guid url
end
end
end
end

+ 8
- 0
app/views/comfy/blog/posts/show.html.haml View File

@ -0,0 +1,8 @@
%h1= @cms_post.title
%p
- label = Comfy::Blog::Post.human_attribute_name(:published_on)
- time = @cms_post.published_at.to_formatted_s(:short)
= "#{label}: #{time}"
= @cms_post.content_cache.html_safe

+ 0
- 23
app/views/layouts/_navigation.html.erb View File

@ -1,23 +0,0 @@
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="#page-top">Start Bootstrap</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
Menu
<i class="fas fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#projects">Projects</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#signup">Contact</a>
</li>
</ul>
</div>
</div>
</nav>

+ 13
- 0
app/views/layouts/_navigation.html.haml View File

@ -0,0 +1,13 @@
/ Navigation
%nav#mainNav.navbar.navbar-expand-lg.navbar-light.fixed-top
.container
%a.navbar-brand.js-scroll-trigger{ href: "#page-top" } <span>Däm</span>sing
%button.navbar-toggler.navbar-toggler-right{ type: "button", data:{ target:'#navbarResponsive', toggle:'collapse' }, aria:{ controls:'navbarResponsive', expanded:'false', label:'Navigation umschalten' } }
Menu
%i.fas.fa-bars
#navbarResponsive.collapse.navbar-collapse
%ul.navbar-nav.ml-auto
- @cms_page.children.published.each do |page|
%li.nav-item
= link_to page.label, "\##{page.slug}", class:'nav-link js-scroll-trigger'

+ 6
- 25
app/views/layouts/application.html.haml View File

@ -4,31 +4,16 @@
%meta{ name: "viewport", content: "width=device-width, initial-scale=1.0, shrink-to-fit=no" }
%title= @cms_page.present? ? @cms_page.label : 'Dämsing'
%meta{ name: "description", content: cms_fragment_content('meta-description') }
= stylesheet_link_tag '//fonts.googleapis.com/css?family=Varela+Round', '//fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i', 'application', media: 'all'
= stylesheet_link_tag 'https://fonts.googleapis.com/css?family=Domine:400,700|Nunito+Sans:300,400,900&display=swap', 'application', media: 'all'
= csrf_meta_tags
%body#page-top
= render 'layouts/navigation'
/ Header
%header.masthead
.container.d-flex.h-100.align-items-center
.mx-auto.text-center
%h1.mx-auto.my-0.text-uppercase Grayscale
%h2.text-white-50.mx-auto.mt-2.mb-5 A free, responsive, one page Bootstrap theme created by Start Bootstrap.
%a.btn.btn-primary.js-scroll-trigger{:href => "#about"} Get Started
= yield
/ About Section
%section#about.about-section.text-center
.container
.row
.col-lg-8.mx-auto
%h2.text-white.mb-4 Built with Bootstrap 4
%p.text-white-50
Grayscale is a free Bootstrap theme created by Start Bootstrap. It can be yours right now, simply download the template on
= succeed "." do
%a{:href => "http://startbootstrap.com/template-overviews/grayscale/"} the preview page
= image_tag 'ipad.png', class:'img-fluid'
- @cms_page.children.published.each do |page|
!= render inline: page.content_cache
/ Projects Section
%section#projects.projects-section.bg-light
@ -106,7 +91,7 @@
.social.d-flex.justify-content-center
%a.mx-2{:href => "#"}
%i.fab.fa-twitter
%a.mx-2{:href => "#"}
%a.mx-2{:href => "https://www.facebook.com/Daemsing/"}
%i.fab.fa-facebook-f
%a.mx-2{:href => "#"}
%i.fab.fa-github
@ -114,10 +99,6 @@
/ Footer
%footer.bg-black.small.text-center.text-white-50
.container
Copyright © Your Website 2019
Copyright © Dämsing 2019
%main{ role: "main" }
= render 'layouts/messages'
= yield
= javascript_include_tag 'application'

+ 0
- 7
app/views/pages/about.html.erb View File

@ -1,7 +0,0 @@
<% content_for :title do %>About<% end %>
<h3>About the Website</h3>
<p>
This web application was created with
<%= link_to('Rails Composer', 'http://railsapps.github.io/rails-composer/') %>
from the <%= link_to('RailsApps project', 'http://railsapps.github.io/') %>.
</p>

+ 0
- 1
app/views/visitors/index.html.erb View File

@ -1 +0,0 @@
<h3>Welcome</h3>

+ 2
- 2
config/initializers/comfortable_mexican_sofa.rb View File

@ -2,7 +2,7 @@
ComfortableMexicanSofa.configure do |config|
# Title of the admin area
# config.cms_title = 'ComfortableMexicanSofa CMS Engine'
config.cms_title = 'Admin Bereich'
# Controller that is inherited from CmsAdmin::BaseController
# config.admin_base_controller = 'ApplicationController'
@ -60,7 +60,7 @@ ComfortableMexicanSofa.configure do |config|
# By default you cannot have irb code inside your layouts/pages/snippets.
# Generally this is to prevent putting something like this:
# <% User.delete_all %> but if you really want to allow it...
# config.allow_erb = false
config.allow_erb = true
# Whitelist of all helper methods that can be used via {{cms:helper}} tag. By default
# all helpers are allowed except `eval`, `send`, `call` and few others. Empty array

+ 9
- 0
config/initializers/comfy_blog.rb View File

@ -0,0 +1,9 @@
# frozen_string_literal: true
ComfyBlog.configure do |config|
# application layout to be used to index blog posts
# config.app_layout = 'comfy/blog/application'
# Number of posts per page. Default is 10
# config.posts_per_page = 10
end

+ 3
- 0
config/routes.rb View File

@ -1,6 +1,9 @@
Rails.application.routes.draw do
comfy_route :blog_admin, path: "/admin"
comfy_route :cms_admin, path: "/admin"
comfy_route :blog, path: "/blog"
# Ensure that this route is defined last
comfy_route :cms, path: "/"
root to: 'comfy/cms/content#show'
end

+ 22
- 0
db/cms_seeds/daemsing/layouts/info/content.html View File

@ -0,0 +1,22 @@
[attributes]
---
label: Info
app_layout: application
position: 0
[content]
<section id='info' class="info-section text-center">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
<h2 class="text-white mb-4">{{ cms:text header }}</h2>
{{ cms:wysiwyg content }}
{{ cms:file image, as:'image', class:'img-fluid' }}
</div>
</div>
</div>
</section>
[js]
[css]

+ 21
- 0
db/cms_seeds/daemsing/layouts/startseite/content.html View File

@ -0,0 +1,21 @@
[attributes]
---
label: Startseite
app_layout: application
position: 0
[content]
<header class="masthead">
<div class="container d-flex h-100 align-items-center">
<div class="mx-auto text-center">
<h1 class="mx-auto my-0 text-uppercase">{{ cms:text title }}</h1>
<h2 class="text-white-50 mx-auto mt-2 mb-5">{{ cms:text content }}</h2>
<a href="#info" class="btn btn-primary js-scroll-trigger">{{ cms:text button }}</a>
</div>
</div>
</header>
[js]
[css]

+ 11
- 0
db/cms_seeds/daemsing/pages/index/band/content.html View File

@ -0,0 +1,11 @@
[attributes]
---
label: Band
layout: startseite
target_page:
categories: []
is_published: true
position: 1
[wysiwyg content]
<p>Nobs, Jürgen, Herbert, Chris & Hans</p>

+ 15
- 0
db/cms_seeds/daemsing/pages/index/content.html View File

@ -0,0 +1,15 @@
[attributes]
---
label: Willkommen
layout: startseite
target_page:
categories: []
is_published: true
position: 0
[text content]
Daemsing ist eine Rock Band aus Köln.
[text title]
Rocque de Cologne
[text button]
Weiter lesen

+ 19
- 0
db/cms_seeds/daemsing/pages/index/info/content.html View File

@ -0,0 +1,19 @@
[attributes]
---
label: Info
layout: info
target_page:
categories: []
is_published: true
position: 0
[wysiwyg content]
<p>Dämsing ist eine <strong>neue erfrischende Rockband aus Köln</strong>, die ihren eigenen ganz individuellen Stil kreiert. Die einzelnen Musiker haben jahrelange Erfahrung in unterschiedlichen Bands und Stilrichtungen. Hierbei entsteht ein unverwechselbarer einmaliger Sound.</p><p>Dämsing singt in kölscher Sprache und die Texte beschäftigen sich mit Alltagsthemen aber auch mit sozialkritischen Inhalten. Von seichten Tönen (Leenchen) bis hin zu Mid Tempo Nummern (Lääve am Affjrund) bis hin zu härter, lauter, schneller (Die Naach) ist für jeden Geschmack etwas dabei.</p><p>Dämsing freut sich bei den kommenden Live Auftritten die neuen Songs präsentieren zu können.<br></p>
[text title]
[text header]
Über die Band
[text button]
[file image]
microphone.png

BIN
db/cms_seeds/daemsing/pages/index/info/microphone.png View File

Before After
Width: 1650  |  Height: 466  |  Size: 396 KiB

+ 24
- 0
db/migrate/20190810152727_create_blog.rb View File

@ -0,0 +1,24 @@
class CreateBlog < ActiveRecord::Migration[5.2]
LIMIT = 16777215
def change
create_table :comfy_blog_posts do |t|
t.integer :site_id, null: false
t.string :title, null: false
t.string :slug, null: false
t.integer :layout_id
t.text :content_cache, limit: LIMIT
t.integer :year, null: false, limit: 4
t.integer :month, null: false, limit: 2
t.boolean :is_published, null: false, default: true
t.datetime :published_at, null: false
t.timestamps
t.index [:site_id, :is_published]
t.index [:year, :month, :slug]
t.index [:created_at]
end
end
end

+ 18
- 1
db/schema.rb View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_08_09_093743) do
ActiveRecord::Schema.define(version: 2019_08_10_152727) do
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
@ -33,6 +33,23 @@ ActiveRecord::Schema.define(version: 2019_08_09_093743) do
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
create_table "comfy_blog_posts", force: :cascade do |t|
t.integer "site_id", null: false
t.string "title", null: false
t.string "slug", null: false
t.integer "layout_id"
t.text "content_cache", limit: 16777215
t.integer "year", limit: 4, null: false
t.integer "month", limit: 2, null: false
t.boolean "is_published", default: true, null: false
t.datetime "published_at", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["created_at"], name: "index_comfy_blog_posts_on_created_at"
t.index ["site_id", "is_published"], name: "index_comfy_blog_posts_on_site_id_and_is_published"
t.index ["year", "month", "slug"], name: "index_comfy_blog_posts_on_year_and_month_and_slug"
end
create_table "comfy_cms_categories", force: :cascade do |t|
t.integer "site_id", null: false
t.string "label", null: false

+ 0
- 16
spec/features/visitors/about_page_spec.rb View File

@ -1,16 +0,0 @@
# Feature: 'About' page
# As a visitor
# I want to visit an 'about' page
# So I can learn more about the website
feature 'About page' do
# Scenario: Visit the 'about' page
# Given I am a visitor
# When I visit the 'about' page
# Then I see "About the Website"
scenario 'Visit the about page' do
visit 'pages/about'
expect(page).to have_content 'About the Website'
end
end

+ 0
- 16
spec/features/visitors/home_page_spec.rb View File

@ -1,16 +0,0 @@
# Feature: Home page
# As a visitor
# I want to visit a home page
# So I can learn more about the website
feature 'Home page' do
# Scenario: Visit the home page
# Given I am a visitor
# When I visit the home page
# Then I see "Welcome"
scenario 'visit the home page' do
visit root_path
expect(page).to have_content 'Welcome'
end
end

Loading…
Cancel
Save