-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into aackerman/code-of-conduct-agreement
- Loading branch information
Showing
16 changed files
with
149 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
class Admin::MarkdownContentsController < Admin::AdminController | ||
load_resource | ||
respond_to :html | ||
|
||
def create | ||
@markdown_content.attributes = markdown_content_params | ||
@markdown_content.save! | ||
redirect_to admin_markdown_content_path(@markdown_content) | ||
end | ||
|
||
def update | ||
@markdown_content.update(markdown_content_params) | ||
redirect_to admin_markdown_content_path(@markdown_content) | ||
end | ||
|
||
def index; end | ||
def show; end | ||
def edit; end | ||
|
||
def markdown_content_params | ||
params.require(:markdown_content).permit(:name, :slug, :markdown) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class MarkdownContent < ActiveRecord::Base | ||
validates :slug, presence: true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<%= semantic_form_for([:admin, @markdown_content]) do |f| %> | ||
<div> | ||
<%= f.semantic_errors %> | ||
</div> | ||
<div> | ||
<%= f.inputs do %> | ||
<%= f.input :name %> | ||
<%= f.input :slug %> | ||
<%= f.input :markdown, as: :text, input_html: { class: 'full-width' } %> | ||
<% end %> | ||
</div> | ||
<div> | ||
<%= f.actions %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<p><%= link_to 'Create new markdown content', new_admin_markdown_content_path %></p> | ||
|
||
<% @markdown_contents.map do |mc| %> | ||
<p>Slug <%= mc.slug %></p> | ||
<%= link_to 'View', [:admin, mc] %> | ||
<%= link_to 'Edit', [:edit, :admin, mc] %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<%= semantic_form_for([:admin, @markdown_content]) do |f| %> | ||
<div> | ||
<%= f.semantic_errors %> | ||
</div> | ||
<div> | ||
<%= f.inputs do %> | ||
<%= f.input :name %> | ||
<%= f.input :slug %> | ||
<%= f.input :markdown, as: :text, input_html: { class: 'full-width' } %> | ||
<% end %> | ||
</div> | ||
<div> | ||
<%= f.actions %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<h2>Name</h1> | ||
<p><%= @markdown_content.name %></p> | ||
|
||
<h2>Slug</h2> | ||
<p><%= @markdown_content.slug %></p> | ||
|
||
<h2>Rendered Markdown</h2> | ||
<div> | ||
<%= markdown @markdown_content.markdown, trusted: true =%> | ||
</div> | ||
|
||
<%= link_to 'Edit', [:edit, :admin, @markdown_content] %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class CreateMarkdownContents < ActiveRecord::Migration[5.2] | ||
def change | ||
create_table :markdown_contents do |t| | ||
t.string :name, null: false | ||
t.string :slug, null: false, index: { unique: true } | ||
t.string :markdown, null: false | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
35 changes: 35 additions & 0 deletions
35
src/db/migrate/20190713173911_create_homepage_summary_markdown.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
class CreateHomepageSummaryMarkdown < ActiveRecord::Migration[5.2] | ||
def up | ||
mc = MarkdownContent.new({ | ||
name: 'Homepage Summary', | ||
slug: 'homepage-summary', | ||
markdown: <<~EOF | ||
### How long are sessions? | ||
Sessions can be at most **50 minutes** long. If you need extra time, there will be empty small breakout rooms available. | ||
### What kind of sessions are OK? | ||
If you're interested in a topic, chances are others are too. Types of sessions could include **presentations** (on a programming language, cool project, marketing, music, or anything else), **panel discussions**, **hackfests**, or **meetups**. | ||
**What's not OK?** Minnebar is not a forum for advertisements or snake oil sales. | ||
If you've got an idea for a session and you want to run it by us, email casey@minnestar.org or support@minnestar.org. | ||
### No Spectators, Only Participants | ||
The first rule of Minnebar is **No Spectators, Only Participants**. We encourage everyone to participate in the event by presenting, hosting a discussion, or even just participating in discussions and Q&A. Come ready to engage with your peers, share something you know, and learn something new! | ||
### Sessions from Past Events | ||
All demos and sessions from past minne✱ events have been imported into our [wiki](http://wiki.minnestar.org/). Take a stroll down memory lane with [Minnebar 1](http://wiki.minnestar.org/wiki/MinneBar_1)... and everything in between. | ||
EOF | ||
}) | ||
mc.save! | ||
end | ||
|
||
def down | ||
mc = MarkdownContent.find_by_slug('homepage-summary') | ||
mc.destroy! | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters