railswiki 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fac3bb7e81e4bc436af9326b3d3b2c7e46cfe60d
4
- data.tar.gz: 986be9fde65e494e6ccd557bd684a0b73bdb7ef4
2
+ SHA256:
3
+ metadata.gz: ba3c0c507eb34d5333d70a52ee587e1a98a590e8dbdaef6a09c48f4ee1e199c3
4
+ data.tar.gz: 79d1bfe9a57da232402b6917f33e9067f36b601c3ae52db889d1edcd21055011
5
5
  SHA512:
6
- metadata.gz: 0606ea2b84434e1a22088f65176567bf5abd6d6cfc12f9e585f10dc5f0ffbae81ee1956dfd0b5485be7236df85aa55ad96224fb58a33643d953782357a96f2ba
7
- data.tar.gz: bb83be8972e87d27f5682e434b6d39c4b83e13e61fb1b71519f8adb3d9755b06ba42ca8f41f7384bd153d6bee986d8ca2e6665773b034fda9171a9fcb214698d
6
+ metadata.gz: 640e5e924abafc37337175587cfb06df8c70fd9e67388afc77442e42c985f8c97be7ba282be7ace5e5d2e3d97abf47bb837beffc53ed63aa8663e7d19a18ba3e
7
+ data.tar.gz: e3e4bc4cb7767e20230f9c4d5e54a712641fe3e7f51d9ec3c686050b208a0dc6e4062a5bd924650a67f72230345f1d5dd861d262366793108a9d44573cbefc44
@@ -3,7 +3,7 @@ require "email_validator"
3
3
  module Railswiki
4
4
  class Invite < ApplicationRecord
5
5
  belongs_to :inviting_user, class_name: "User"
6
- belongs_to :invited_user, class_name: "User"
6
+ belongs_to :invited_user, class_name: "User", optional: true
7
7
 
8
8
  validates :email, presence: true, uniqueness: true, email: true
9
9
  validates :inviting_user, presence: true
@@ -17,7 +17,7 @@
17
17
 
18
18
  <%= render partial: "shared/meta" %>
19
19
  </head>
20
- <body>
20
+ <body id="<%= prettify_slug(@page.title) if @page.present? && @page.title.present? %>">
21
21
 
22
22
  <%= render partial: "shared/layout" %>
23
23
 
@@ -23,7 +23,7 @@
23
23
  <% if user_can?(:see_page_author) %>
24
24
  <td><%= user_link history.author %></td>
25
25
  <% end %>
26
- <td><%= link_to "json", history_path(history, format: :json) %></td>
26
+ <td><%= link_to "json", history_path(history, format: :json, data: { turbolinks: false }) %></td>
27
27
  <td><%= link_to 'Destroy', history, method: :delete, data: { confirm: 'Are you sure?' } if user_can?(:delete_history) %></td>
28
28
  </tr>
29
29
  <% end %>
@@ -2,7 +2,7 @@
2
2
 
3
3
  <h1>
4
4
  <%= link_to @history.page.title, wiki_path(@history.page) %>
5
- <small><%= link_to ".json", history_path(@history, format: :json) %></small>
5
+ <small><%= link_to ".json", history_path(@history, format: :json), data: { turbolinks: false } %></small>
6
6
  as at <%= time_ago @history.created_at %></h1>
7
7
 
8
8
  <div class="wiki-content">
@@ -3,7 +3,7 @@
3
3
  <h1>
4
4
  History of
5
5
  <%= link_to @page.title, wiki_path(@page) %>
6
- <small><%= link_to ".json", page_history_path(@page, format: :json) %></small>
6
+ <small><%= link_to ".json", page_history_path(@page, format: :json), data: { turbolinks: false } %></small>
7
7
  </h1>
8
8
 
9
9
  <%= render "shared/histories", histories: @page.histories %>
@@ -23,7 +23,7 @@
23
23
  <% if user_can?(:see_page_author) %>
24
24
  <td class="author">by <%= user_link page.author %></td>
25
25
  <% end %>
26
- <td class="json"><%= link_to "json", wiki_path(page, format: :json) %></td>
26
+ <td class="json"><%= link_to "json", wiki_path(page, format: :json), data: { turbolinks: false } %></td>
27
27
  <% if is_special_page?(page) || user_can?(:special_pages) %>
28
28
  <td><%= link_to 'Edit', edit_page_path(page) if user_can?(:edit_page) %></td>
29
29
  <td><%= link_to 'Destroy', page, method: :delete, data: { confirm: 'Are you sure?' } if user_can?(:delete_page) %></td>
@@ -7,7 +7,7 @@
7
7
  <% else %>
8
8
  <%= link_to 'History', page_history_path(@page), class: "history" if user_can?(:history_page) %>
9
9
  <%= link_to 'Edit', edit_page_path(@page), class: "edit" if user_can?(:edit_page) %>
10
- <%= link_to ".json", wiki_path(@page, format: :json), class: "json" %>
10
+ <%= link_to ".json", wiki_path(@page, format: :json), class: "json", data: { turbolinks: false } %>
11
11
  <% end %>
12
12
  </small>
13
13
 
@@ -23,7 +23,7 @@
23
23
  <td><%= user.role %></td>
24
24
  <td><%= link_to 'Show', user %></td>
25
25
  <td><%= link_to 'Edit', edit_user_path(user) if user_can?(:edit_user) %></td>
26
- <td><%= link_to "json", user_path(user, format: :json) %></td>
26
+ <td><%= link_to "json", user_path(user, format: :json), data: { turbolinks: false } %></td>
27
27
  <td><%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } if user_can?(:delete_user) %></td>
28
28
  </tr>
29
29
  <% end %>
@@ -3,7 +3,7 @@
3
3
  <p>
4
4
  <strong>Name:</strong>
5
5
  <%= @user.name %>
6
- <%= link_to "json", user_path(@user, format: :json) %>
6
+ <%= link_to "json", user_path(@user, format: :json), data: { turbolinks: false } %>
7
7
  </p>
8
8
 
9
9
  <p>
@@ -1,6 +1,6 @@
1
- <nav>
1
+ <nav class="menu">
2
2
  <%= link_to "New page", new_page_path if user_can?(:create_page) %>
3
- <%= link_to "Pages", pages_path if user_can?(:list_pages) %>
3
+ <%= link_to "Pages", pages_path, class: "pages" if user_can?(:list_pages) %>
4
4
  <%= link_to "Histories", histories_path if user_can?(:list_histories) %>
5
5
  <%= link_to "Users", users_path if user_can?(:list_users) %>
6
6
  <%= link_to "Invites", invites_path if user_can?(:list_invites) %>
@@ -10,6 +10,6 @@
10
10
  <%= link_to current_user.name, current_user %>
11
11
  <%= link_to "Sign out", logout_path %>
12
12
  <% else %>
13
- <%= link_to "Sign in with Google", main_app.login_path %>
13
+ <%= link_to "Sign in with Google", main_app.login_path, class: "login" %>
14
14
  <% end %>
15
15
  </nav>
@@ -1,5 +1,6 @@
1
- class AddLowercaseTitleToPage < ActiveRecord::Migration[5.0]
2
- def change
3
- add_column :railswiki_pages, :lowercase_title, :string, null: false, unique: true
4
- end
5
- end
1
+ class AddLowercaseTitleToPage < ActiveRecord::Migration[5.0]
2
+ def change
3
+ # We need to have a default value for new columns even if they are NOT NULL
4
+ add_column :railswiki_pages, :lowercase_title, :string, null: false, unique: true, default: "should not be set"
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module Railswiki
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railswiki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jevon Wright
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-18 00:00:00.000000000 Z
11
+ date: 2018-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
248
  version: '0'
249
249
  requirements: []
250
250
  rubyforge_project:
251
- rubygems_version: 2.5.2
251
+ rubygems_version: 2.7.6
252
252
  signing_key:
253
253
  specification_version: 4
254
254
  summary: A wiki engine in Rails 5.