Skip to content

Commit

Permalink
formatting bar and commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
smpallen99 committed Apr 13, 2018
1 parent 8269f81 commit 8b3b229
Show file tree
Hide file tree
Showing 17 changed files with 141 additions and 11 deletions.
14 changes: 14 additions & 0 deletions assets/css/framework.css

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions assets/css/wiki.scss
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ aside.side-nav {
border: 1px solid #dfe2e5;
margin-bottom: 1rem;
}
.flex-nav-container {
padding: 6px 10px 0;
background: #f6f8fa;
border-radius: 3px 3px 0 0;
border: 1px solid #dfe2e5;
margin-bottom: 1rem;
}
.nav.nav-tabs {
li.nav-item {
display: block;
Expand Down Expand Up @@ -181,6 +188,9 @@ section.page-container.page-static {
border-radius: 5px;
.commit-entry {
padding-bottom: 5px;
.message {
padding: 8px 0 4px 0px;
}
&.author {
margin-top: 10px;
}
Expand Down Expand Up @@ -247,6 +257,7 @@ form.wiki-page {
}
}
}

.gollum-editor-function-bar {
.gollum-editor-format-selector {
label { font-weight: 600 !important; }
Expand Down
Binary file added assets/static/images/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/vendor/application.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/vendor/frameworks.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/vendor/wiki.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/one_wiki/lib/one_wiki/models/page.ex
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ defmodule OneWiki.Page do
defp create_file(user, page, action \\ :added) do
contents = page.body
repo = Git.new OneWiki.pages_path()
message = "'#{page.title}' #{action} by @#{user.username}"
message = page.commit_message || "'#{page.title}' #{action} by @#{user.username}"
path = Path.join(OneWiki.pages_path(), page.id)
with :ok <- File.write(path, contents),
{:ok, _} <- Git.add(repo, page.id),
Expand Down
2 changes: 1 addition & 1 deletion plugins/one_wiki/lib/one_wiki_web/channels/wiki_channel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ defmodule OneWikiWeb.WikiChannel do
|> IO.inspect(label: "html")

html = """
<div class="markdown-body version-preview">
<div class="markdown-body version-preview wiki">
<header>
#{page.title}
<a href="#" rebel-click="close_file_preview" rebel-channel="wiki">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
= form_for @changeset, "#", rebel_opts, fn f ->
input(type="hidden" name="flex-id" value="wiki_info")
= hidden_input f, :id
ul.nav.nav-tabs#infoTab role="tablist"
li.nav-item
a.nav-link.active.show#info-tab data-toggle="tab" href="#info" role="tab" aria-controls="info" aria-selected="true"
= ~g(Page Info)
li.nav-item
a.nav-link#history-tab data-toggle="tab" href="#history" role="tab" aria-controls="history" aria-selected="false"
= ~g(Page History)
.flex-nav-container
ul.nav.nav-tabs#infoTab role="tablist"
li.nav-item
a.nav-link.active.show#info-tab data-toggle="tab" href="#info" role="tab" aria-controls="info" aria-selected="true"
= ~g(Page Info)
li.nav-item
a.nav-link#history-tab data-toggle="tab" href="#history" role="tab" aria-controls="history" aria-selected="false"
= ~g(Page History)
.tab-content#infoTabContent
.tab-pane.fade.active.show#info role="tabpanel" aria-labelledby="info-tab"
ul.list.clearfix
Expand All @@ -41,7 +42,7 @@
.commit-entry
.date = commit.date
.commit-entry
.message = commit.message
.message: i = commit.message
nav
button type="submit" style="display:none"
button.button.primary title="#{~g(Edit Page)}" rebel-click="edit_page" rebel-channel="wiki" data-id="#{@page.id}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ section.page-container.page-home.page-static
h2
span.room-title = @title
.content.wiki-content
= render "form.html", title: @title, body: @body, action: :update_page, submit: ~g(Save page changes), id: @id, format: @format
= render "form.html", title: @title, body: @body, action: :update, submit: ~g(Save page changes), id: @id, format: @format
13 changes: 13 additions & 0 deletions plugins/one_wiki/lib/one_wiki_web/templates/page/facebox.html.eex
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="facebox" id="facebox" style="display:none;">
<div class="facebox-popup">
<div class="facebox-content" role="dialog" aria-labelledby="facebox-header" aria-describedby="facebox-description">
</div>
<button type="button" class="facebox-close js-facebox-close" aria-label="Close modal">
<svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"></path></svg>
</button>
</div>
</div>
<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0">
<div class="Popover-message Popover-message--bottom-left Popover-message--large Box box-shadow-large" style="width:360px;">
</div>
</div>
44 changes: 44 additions & 0 deletions plugins/one_wiki/lib/one_wiki_web/templates/page/tool_bar.html.eex
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<div id="gollum-editor-function-bar" class="gollum-editor-function-bar clearfix active">
<div id="gollum-editor-function-buttons" class="gollum-editor-function-buttons">
<%= render("tool_bar_grp_1.html", []) %>
<%= render("tool_bar_grp_2.html", []) %>
<%= render("tool_bar_grp_3.html", []) %>
<%= render("tool_bar_grp_4.html", []) %>
<button type="button" id="function-help" class="btn btn-sm function-button" aria-label="Help" title="Help" tabindex="-1" data-dismiss-help-url="/wiki/help" data-dismiss-help-authenticity-token="gL+lZ4lXNTM21wQqnXigTfRvknxXm43YhQaqOM321XD/ltROYxW5M0oBidgCZ/SXaw61l/0h7cthv2suDKf+Ig==">
<svg class="octicon octicon-question" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M6 10h2v2H6v-2zm4-3.5C10 8.64 8 9 8 9H6c0-.55.45-1 1-1h.5c.28 0 .5-.22.5-.5v-1c0-.28-.22-.5-.5-.5h-1c-.28 0-.5.22-.5.5V7H4c0-1.5 1.5-3 3-3s3 1 3 2.5zM7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7z"></path></svg>
</button>
</div>
<div id="gollum-editor-format-selector" class="gollum-editor-format-selector">
<label for="wiki_format">Edit mode:</label>
<select name="wiki[format]" id="wiki_format" class="form-select select select-sm"><option value="asciidoc">AsciiDoc</option>
<option value="creole">Creole</option>
<option value="markdown">Markdown</option>
<option value="mediawiki">MediaWiki</option>
<option value="org">Org-mode</option>
<option value="pod">Pod</option>
<option value="rdoc">RDoc</option>
<option value="textile">Textile</option>
<option value="rest">reStructuredText</option>
</select>
</div>
</div>
<div id="gollum-editor-help" class="gollum-editor-help" style="display: none;">
<ul id="gollum-editor-help-parent" class="gollum-editor-help-parent">
<li>
<a href="#" rel="0" class="selected">Block Elements</a></li><li><a href="#" rel="1">Span Elements</a></li><li><a href="#" rel="2">Miscellaneous</a>
</li>
</ul>
<ul id="gollum-editor-help-list" class="gollum-editor-help-list">
<li>
<a href="#" rel="0:0" class="selected">Paragraphs &amp; Breaks</a></li><li><a href="#" rel="0:1">Headers</a></li><li><a href="#" rel="0:2">Blockquotes</a>
</li>
<li>
<a href="#" rel="0:3">Lists</a></li><li><a href="#" rel="0:4">Code Blocks</a></li><li><a href="#" rel="0:5">Horizontal Rules</a>
</li>
</ul>
<div id="gollum-editor-help-wrapper" class="gollum-editor-help-wrapper">
<div id="gollum-editor-help-content" class="gollum-editor-help-content">
<p>To create a paragraph, simply create a block of text that is not separated by one or more blank lines. Blocks of text separated by one or more blank lines will be parsed as paragraphs.</p><p>If you want to create a line break, end a line with two or more spaces, then hit Return/Enter.</p>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div class="BtnGroup">
<button type="button" id="function-h1" class="btn btn-sm BtnGroup-item function-button" title="Header 1" tabindex="-1">
<b>h1</b>
</button>
<button type="button" id="function-h2" class="btn btn-sm BtnGroup-item function-button" title="Header 2" tabindex="-1">
<b>h2</b>
</button>
<button type="button" id="function-h3" class="btn btn-sm BtnGroup-item function-button" title="Header 3" tabindex="-1">
<b>h3</b>
</button>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="BtnGroup">
<button type="button" id="function-link" class="btn btn-sm BtnGroup-item function-button" aria-label="Add link" title="Link" tabindex="-1">
<svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>
</button>
<button type="button" id="function-image" class="btn btn-sm BtnGroup-item function-button" aria-label="Add image" title="Image" tabindex="-1">
<svg class="octicon octicon-file-media" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M6 5h2v2H6V5zm6-.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v11l3-5 2 4 2-2 3 3V5z"></path></svg>
</button>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div class="BtnGroup">
<button type="button" id="function-bold" class="btn btn-sm BtnGroup-item function-button" aria-label="Add bold text" title="Bold" tabindex="-1">
<b>B</b>
</button>
<button type="button" id="function-italic" class="btn btn-sm BtnGroup-item function-button" aria-label="Add italic text" title="Italic" tabindex="-1">
<em>i</em>
</button>
<button type="button" id="function-code" class="btn btn-sm BtnGroup-item function-button" aria-label="Insert code" title="Code" tabindex="-1">
<svg class="octicon octicon-code" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z"></path></svg>
</button>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div class="BtnGroup">
<button type="button" id="function-ul" class="btn btn-sm BtnGroup-item function-button" aria-label="Add unordered list" title="Unordered List" tabindex="-1">
<svg class="octicon octicon-list-unordered" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M2 13c0 .59 0 1-.59 1H.59C0 14 0 13.59 0 13c0-.59 0-1 .59-1h.81c.59 0 .59.41.59 1H2zm2.59-9h6.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1H4.59C4 2 4 2.41 4 3c0 .59 0 1 .59 1zM1.41 7H.59C0 7 0 7.41 0 8c0 .59 0 1 .59 1h.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1h.01zm0-5H.59C0 2 0 2.41 0 3c0 .59 0 1 .59 1h.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1h.01zm10 5H4.59C4 7 4 7.41 4 8c0 .59 0 1 .59 1h6.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1h.01zm0 5H4.59C4 12 4 12.41 4 13c0 .59 0 1 .59 1h6.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1h.01z"></path></svg>
</button>
<button type="button" id="function-ol" class="btn btn-sm BtnGroup-item function-button" aria-label="Add ordered list" title="Ordered List" tabindex="-1">
<svg class="octicon octicon-list-ordered" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 13c0 .59 0 1-.59 1H4.59C4 14 4 13.59 4 13c0-.59 0-1 .59-1h6.81c.59 0 .59.41.59 1H12zM4.59 4h6.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1H4.59C4 2 4 2.41 4 3c0 .59 0 1 .59 1zm6.81 3H4.59C4 7 4 7.41 4 8c0 .59 0 1 .59 1h6.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1zM2 1h-.72c-.3.19-.58.25-1.03.34V2H1v2.14H.16V5H3v-.86H2V1zm.25 8.13c-.17 0-.45.03-.66.06.53-.56 1.14-1.25 1.14-1.89C2.71 6.52 2.17 6 1.37 6c-.59 0-.97.2-1.38.64l.58.58c.19-.19.38-.38.64-.38.28 0 .48.16.48.52 0 .53-.77 1.2-1.7 2.06V10h3l-.09-.88h-.66l.01.01zm-.08 3.78v-.03c.44-.19.64-.47.64-.86 0-.7-.56-1.11-1.44-1.11-.48 0-.89.19-1.28.52l.55.64c.25-.2.44-.31.69-.31.27 0 .42.13.42.36 0 .27-.2.44-.86.44v.75c.83 0 .98.17.98.47 0 .25-.23.38-.58.38-.28 0-.56-.14-.81-.38l-.48.66c.3.36.77.56 1.41.56.83 0 1.53-.41 1.53-1.16 0-.5-.31-.81-.77-.94v.01z"></path></svg>
</button>
<button type="button" id="function-blockquote" class="btn btn-sm BtnGroup-item function-button" aria-label="Insert blockquote" title="Blockquote" tabindex="-1">
<svg class="octicon octicon-quote" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M6.16 3.5C3.73 5.06 2.55 6.67 2.55 9.36c.16-.05.3-.05.44-.05 1.27 0 2.5.86 2.5 2.41 0 1.61-1.03 2.61-2.5 2.61-1.9 0-2.99-1.52-2.99-4.25 0-3.8 1.75-6.53 5.02-8.42L6.16 3.5zm7 0c-2.43 1.56-3.61 3.17-3.61 5.86.16-.05.3-.05.44-.05 1.27 0 2.5.86 2.5 2.41 0 1.61-1.03 2.61-2.5 2.61-1.89 0-2.98-1.52-2.98-4.25 0-3.8 1.75-6.53 5.02-8.42l1.14 1.84h-.01z"></path></svg>
</button>
<button type="button" id="function-hr" class="btn btn-sm BtnGroup-item function-button" aria-label="Insert horizontal rule" title="Horizontal Rule" tabindex="-1">
<svg class="octicon octicon-horizontal-rule" viewBox="0 0 10 16" version="1.1" width="10" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M1 7h2v2h1V3H3v3H1V3H0v6h1V7zm9 2V7H9v2h1zm0-3V4H9v2h1zM7 6V4h2V3H6v6h1V7h2V6H7zm-7 7h10v-2H0v2z"></path></svg>
</button>
</div>

0 comments on commit 8b3b229

Please sign in to comment.