homeland-wiki 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/assets/javascripts/homeland/wiki/application.coffee +21 -17
- data/app/assets/stylesheets/homeland/wiki/application.scss +3 -1
- data/app/views/homeland/wiki/admin/pages/_form.html.erb +27 -10
- data/app/views/homeland/wiki/pages/_form.html.erb +27 -11
- data/app/views/homeland/wiki/pages/_sidebar.html.erb +3 -3
- data/app/views/homeland/wiki/pages/comments.html.erb +4 -5
- data/app/views/homeland/wiki/pages/edit.html.erb +3 -3
- data/app/views/homeland/wiki/pages/index.html.erb +3 -2
- data/app/views/homeland/wiki/pages/new.html.erb +3 -3
- data/app/views/homeland/wiki/pages/recent.html.erb +5 -6
- data/app/views/homeland/wiki/pages/show.html.erb +6 -7
- data/lib/homeland/wiki/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e1a080891632677ec4ff8f22586b7de379135cfb600e3cd3a81b82b60d9fa779
|
4
|
+
data.tar.gz: 84886ed59a8da4472e7076760b56885669f3f0992befbe630ddddf8aa75e00bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12f51ec3a5690418e0497d768c4c6df915a1d82f8240b81f63eb0c2dd468c199a7818e822f885a831451ebd22eaf7245f07fd92a9af93356b182a49f5eac12e1
|
7
|
+
data.tar.gz: fa72b3fff5b49096097ac11a520380644ba332f4bf7264a37e5fe2a580cb4bdc2d8903843f4a2adc4414b6dd31f5e72cf6f26ce9da72c67763b12e8f4987bfe2
|
@@ -5,29 +5,33 @@
|
|
5
5
|
window.WikiView = Backbone.View.extend
|
6
6
|
el: "body"
|
7
7
|
events:
|
8
|
-
"click .editor-toolbar .
|
9
|
-
"click .editor-toolbar .preview a": "togglePreviewView"
|
8
|
+
"click .editor-toolbar .preview": "togglePreviewView"
|
10
9
|
|
11
10
|
initialize: (opts) ->
|
12
11
|
@parentView = window._appView
|
13
|
-
$("<div id='preview' class='markdown form-control'></div>").insertAfter(
|
12
|
+
$("<div id='preview' class='markdown form-control'></div>").insertAfter($("#page_body"))
|
13
|
+
$("#preview").hide()
|
14
14
|
window._editor = new Editor()
|
15
15
|
|
16
|
-
toggleEditView: (e) ->
|
17
|
-
$(e.target).parent().addClass('active')
|
18
|
-
$('.preview a').parent().removeClass('active')
|
19
|
-
$('#preview').hide()
|
20
|
-
$('#page_body').show()
|
21
|
-
false
|
22
|
-
|
23
16
|
togglePreviewView: (e) ->
|
24
|
-
$(
|
25
|
-
$(
|
26
|
-
|
27
|
-
$(
|
28
|
-
|
29
|
-
|
30
|
-
|
17
|
+
textarea = $("#page_body")
|
18
|
+
preview_box = $("#preview")
|
19
|
+
|
20
|
+
if $(e.target).hasClass("active")
|
21
|
+
$(e.target).removeClass("active")
|
22
|
+
preview_box.hide()
|
23
|
+
textarea.show()
|
24
|
+
else
|
25
|
+
$(e.target).addClass("active")
|
26
|
+
preview_box.show()
|
27
|
+
preview_box.css("height", textarea.height())
|
28
|
+
textarea.hide()
|
29
|
+
this.preview(preview_box, textarea.val())
|
30
|
+
return false
|
31
|
+
|
32
|
+
preview: (preview_box, val) ->
|
33
|
+
$.post '/wiki/preview', { body: val }, (data)->
|
34
|
+
preview_box.html(data)
|
31
35
|
false
|
32
36
|
false
|
33
37
|
|
@@ -11,10 +11,11 @@
|
|
11
11
|
}
|
12
12
|
|
13
13
|
.page-detail {
|
14
|
-
.
|
14
|
+
.card-header {
|
15
15
|
padding: 15px;
|
16
16
|
h1 { font-size: 20px; color: #111; margin: 0; margin-bottom: 6px;}
|
17
17
|
}
|
18
|
+
|
18
19
|
.info {
|
19
20
|
text-align:right;
|
20
21
|
padding:10px;
|
@@ -24,6 +25,7 @@
|
|
24
25
|
border-radius: 3px 3px 0 0;
|
25
26
|
margin-bottom:20px;
|
26
27
|
}
|
28
|
+
|
27
29
|
.editors {
|
28
30
|
h3 { font-size:14px; color:#999;}
|
29
31
|
.media-object { display: inline; }
|
@@ -1,12 +1,29 @@
|
|
1
|
-
<%=
|
1
|
+
<%= form_for [:admin, @page] do |f| %>
|
2
2
|
<%= render "shared/error_messages", target: @page %>
|
3
|
-
|
4
|
-
|
5
|
-
<%= f.
|
6
|
-
<%= f.
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
3
|
+
|
4
|
+
<div class="form-group form-check">
|
5
|
+
<%= f.check_box :locked, class: "form-check-input" %>
|
6
|
+
<%= f.label :locked, class: "form-check-label" %>
|
7
|
+
<div class="form-text">锁定后,前台非管理员将无法修改。</div>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="form-group">
|
11
|
+
<%= f.label :slug %>
|
12
|
+
<%= f.text_field :slug, class: "form-control" %>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="form-group">
|
16
|
+
<%= f.label :title %>
|
17
|
+
<%= f.text_field :title, class: "form-control" %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="form-group">
|
21
|
+
<%= f.label :body %>
|
22
|
+
<%= f.text_area :body, class: "form-control", rows: 30 %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="form-actions">
|
26
|
+
<%= f.submit t("common.save"), class: "btn btn-primary", 'data-disable-with' => t("common.saving") %>
|
27
|
+
<%= link_to "取消", admin_pages_path, class: "btn btn-outline-primary" %>
|
28
|
+
</div>
|
12
29
|
<% end %>
|
@@ -1,25 +1,41 @@
|
|
1
|
-
<%=
|
1
|
+
<%= form_for @page do |f| %>
|
2
2
|
<%= render "shared/error_messages", target: @page %>
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
<div class="form-group">
|
5
|
+
<%= f.label :slug %>
|
6
|
+
<%= f.text_field :slug, class: "form-control" %>
|
7
|
+
<div class="form-text">
|
8
|
+
<%= Setting.base_url %>/wiki/:slug
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="form-group">
|
13
|
+
<%= f.label :title %>
|
14
|
+
<%= f.text_field :title, class: "form-control" %>
|
15
|
+
</div>
|
6
16
|
|
7
17
|
<div class="edit-tools">
|
8
18
|
<%= render "/shared/editor_toolbar" %>
|
9
19
|
</div>
|
10
20
|
|
11
21
|
<div class="form-group">
|
12
|
-
<%= f.text_area :body, rows: 30, class:
|
13
|
-
|
14
|
-
|
15
|
-
|
22
|
+
<%= f.text_area :body, rows: 30, class: "form-control topic-editor" %>
|
23
|
+
|
24
|
+
<div class="form-text">
|
25
|
+
请使用 Markdown 格式编写,可以试试用 <a href="https://www.typora.io" target="_blank">Typora</a> 这个 App 来编写。
|
26
|
+
</div>
|
16
27
|
</div>
|
17
28
|
|
18
|
-
<% if
|
19
|
-
|
29
|
+
<% if !@page.new_record? %>
|
30
|
+
<div class="form-group">
|
31
|
+
<%= f.label :change_desc %>
|
32
|
+
<%= f.text_area :change_desc, class: "form-control", rows: 2 %>
|
33
|
+
<div class="form-text"><%= t("pages.describe_this_time_change") %></div>
|
34
|
+
</div>
|
20
35
|
<% end %>
|
21
|
-
|
36
|
+
|
37
|
+
<div class="form-actions">
|
22
38
|
<%= f.submit t("common.save"), class: "btn btn-primary", 'data-disable-with' => t("common.saving") %>
|
23
|
-
<%= link_to t("common.cancel"), pages_path, class: "btn btn-
|
39
|
+
<%= link_to t("common.cancel"), pages_path, class: "btn btn-outline-primary" %>
|
24
40
|
</div>
|
25
41
|
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<div class="sidebar wiki-sidebar col-sm-3">
|
2
|
-
<div class="
|
3
|
-
<div class="
|
1
|
+
<div class="sidebar wiki-sidebar col-sm-3 hide-ios">
|
2
|
+
<div class="card">
|
3
|
+
<div class="card-body">
|
4
4
|
<strong>导航</strong>
|
5
5
|
<ul>
|
6
6
|
<li><a href="/wiki">首页</a></li>
|
@@ -1,12 +1,11 @@
|
|
1
1
|
<% title_tag [t('pages.comments'), @page.title].join(' · ') %>
|
2
2
|
|
3
3
|
<div class="row">
|
4
|
-
|
5
|
-
|
6
|
-
</div>
|
4
|
+
<%= render 'sidebar' %>
|
5
|
+
|
7
6
|
<div class="col-md-9">
|
8
|
-
<div class="
|
9
|
-
<div id="comments" class="
|
7
|
+
<div class="card">
|
8
|
+
<div id="comments" class="card-body">
|
10
9
|
《<%= link_to @page.title, page_path(@page.slug) %>》 - <%= t('pages.comments') %>
|
11
10
|
</div>
|
12
11
|
</div>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<% title_tag t("pages.edit_page") %>
|
2
2
|
|
3
|
-
<div class="
|
4
|
-
<div class="
|
5
|
-
<div class="
|
3
|
+
<div class="card">
|
4
|
+
<div class="card-header"><%= t("pages.edit_page") %></div>
|
5
|
+
<div class="card-body">
|
6
6
|
<%= render "form" %>
|
7
7
|
</div>
|
8
8
|
</div>
|
@@ -2,10 +2,11 @@
|
|
2
2
|
|
3
3
|
<div class="row">
|
4
4
|
<%= render 'sidebar' %>
|
5
|
+
|
5
6
|
<% if !turbolinks_app? %>
|
6
7
|
<div class="col-md-9">
|
7
|
-
<div class="
|
8
|
-
<div class="
|
8
|
+
<div class="card">
|
9
|
+
<div class="card-body">
|
9
10
|
<%= raw Setting.wiki_index_html %>
|
10
11
|
</div>
|
11
12
|
</div>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<% title_tag t("pages.edit_page") %>
|
2
2
|
|
3
|
-
<div class="
|
4
|
-
<div class="
|
5
|
-
<div class="
|
3
|
+
<div class="card">
|
4
|
+
<div class="card-header"><%= t("pages.new_page")%></div>
|
5
|
+
<div class="card-body">
|
6
6
|
<%= render "form" %>
|
7
7
|
</div>
|
8
8
|
</div>
|
@@ -1,13 +1,12 @@
|
|
1
1
|
<% title_tag t('pages.wiki_index') %>
|
2
2
|
|
3
3
|
<div class="row">
|
4
|
-
|
5
|
-
|
6
|
-
</div>
|
4
|
+
<%= render 'sidebar' %>
|
5
|
+
|
7
6
|
<div class="col-md-9">
|
8
|
-
<div class="
|
9
|
-
<div class="
|
10
|
-
<div class="
|
7
|
+
<div class="card">
|
8
|
+
<div class="card-header hide-ios"><%= t('pages.wiki_index') %></div>
|
9
|
+
<div class="card-body">
|
11
10
|
<ul>
|
12
11
|
<% @pages.each do |item| %>
|
13
12
|
<li><%= page_title_tag(item) %></li>
|
@@ -1,13 +1,12 @@
|
|
1
1
|
<% title_tag @page.title %>
|
2
2
|
|
3
3
|
<div class="row">
|
4
|
-
|
5
|
-
|
6
|
-
</div>
|
4
|
+
<%= render 'sidebar' %>
|
5
|
+
|
7
6
|
<div class="col-md-9 page-detail">
|
8
|
-
<div class="
|
7
|
+
<div class="card">
|
9
8
|
<% if !@page.locked or admin? %>
|
10
|
-
<div class="
|
9
|
+
<div class="card-header">
|
11
10
|
<h1><%= @page.title %></h1>
|
12
11
|
<div class="infos">
|
13
12
|
<%= link_to comments_page_path(@page.slug) do %>
|
@@ -22,13 +21,13 @@
|
|
22
21
|
|
23
22
|
<% end %>
|
24
23
|
|
25
|
-
<div class="
|
24
|
+
<div class="card-body markdown markdown-toc">
|
26
25
|
<article>
|
27
26
|
<%= @page.body_html %>
|
28
27
|
</article>
|
29
28
|
</div>
|
30
29
|
|
31
|
-
<div class="
|
30
|
+
<div class="card-footer editors clearfix">
|
32
31
|
<div class="heading">
|
33
32
|
<%= t("pages.wiki_page_contributors")%>
|
34
33
|
<span class="pull-right"><%= social_share_button_tag h("#{@page.title} via: @#{Setting.twitter_id} ") %></span>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: homeland-wiki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Griffin Qiu
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-04-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.6
|
91
|
+
rubygems_version: 2.7.6
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Display Wiki channel in navbar for wike pages.
|