Skip to content

Commit

Permalink
Merge pull request #613 from pooza/3_0_6
Browse files Browse the repository at this point in the history
3.0.6
  • Loading branch information
pooza committed Aug 25, 2019
2 parents c0c294d + 23d8583 commit de5258a
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 41 deletions.
28 changes: 15 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,25 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actionpack (5.2.3)
actionview (= 5.2.3)
activesupport (= 5.2.3)
actionpack (6.0.0)
actionview (= 6.0.0)
activesupport (= 6.0.0)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.3)
activesupport (= 5.2.3)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (6.0.0)
activesupport (= 6.0.0)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activesupport (5.2.3)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activesupport (6.0.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.1, >= 2.1.8)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
amazon-ecs (2.6.0)
Expand Down Expand Up @@ -112,15 +113,15 @@ GEM
dry-equalizer (~> 0.2, >= 0.2.2)
dry-inflector (~> 0.1, >= 0.1.2)
dry-logic (~> 1.0, >= 1.0.2)
dry-validation (1.3.0)
dry-validation (1.3.1)
concurrent-ruby (~> 1.0)
dry-container (~> 0.7, >= 0.7.1)
dry-core (~> 0.4)
dry-equalizer (~> 0.2)
dry-initializer (~> 3.0)
dry-schema (~> 1.0, >= 1.3.1)
erubi (1.8.0)
et-orbi (1.2.1)
et-orbi (1.2.2)
tzinfo
eventmachine (1.2.7)
faraday (0.15.4)
Expand Down Expand Up @@ -187,7 +188,7 @@ GEM
public_suffix (3.1.1)
raabro (1.1.6)
rack (2.0.7)
rack-protection (2.0.5)
rack-protection (2.0.7)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
Expand Down Expand Up @@ -244,10 +245,10 @@ GEM
rufus-scheduler (~> 3.2)
sidekiq (>= 3)
tilt (>= 1.4.0)
sinatra (2.0.5)
sinatra (2.0.7)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.5)
rack-protection (= 2.0.7)
tilt (~> 2.0)
syslog-logger (1.6.8)
test-unit (3.3.3)
Expand All @@ -265,6 +266,7 @@ GEM
unf_ext (0.0.7.6)
unicode (0.4.4.4)
unicode-display_width (1.6.0)
zeitwerk (2.1.9)

PLATFORMS
ruby
Expand Down
2 changes: 1 addition & 1 deletion config/application.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package:
version: 3.0.5
version: 3.0.6
url: https://github.com/pooza/mulukhiya-toot-proxy
authors:
- Tatsuya Koishi
Expand Down
2 changes: 1 addition & 1 deletion lib/mulukhiya_toot_proxy/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Server < Ginseng::Web::Sinatra
return @renderer.to_s
end

get '/api/v2/search' do
get %r{/api/v[12]/search} do
params[:limit] = @config['/mastodon/search/limit']
@results.response = @mastodon.search(params[:q], params)
@message = @results.response.parsed_response.with_indifferent_access
Expand Down
Binary file added public/mulukhiya/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 18 additions & 16 deletions views/app_auth.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@
</head>
<body>
<header><%= MulukhiyaTootProxy::Package.full_name %></header>
<h2>アプリケーションの認証</h2>
<form method="POST" action="/mulukhiya/app/auth">
<ol>
<li><a href="<%= params[:oauth_url] %>" target="_blank">認証コードを取得</a></li>
<li>
取得した認証コードを↓に貼り付けて…
<input type="text" name="code" placeholder="認証コード" maxlength="64" class="code"><br>
<% if params.dig(:errors, :code) %>
<span class="alert"><%= params[:errors][:code].join %></span>
<% end %>
</li>
<li>
<button id="submit_button">認証する</button>
</li>
</ol>
</form>
<main>
<h2>アプリケーションの認証</h2>
<form method="POST" action="/mulukhiya/app/auth">
<ol>
<li><a href="<%= params[:oauth_url] %>" target="_blank">認証コードを取得</a></li>
<li>
取得した認証コードを↓に貼り付けて…
<input type="text" name="code" placeholder="認証コード" maxlength="64" class="code"><br>
<% if params.dig(:errors, :code) %>
<span class="alert"><%= params[:errors][:code].join %></span>
<% end %>
</li>
<li>
<button id="submit_button">認証する</button>
</li>
</ol>
</form>
</main>
</body>
</html>
20 changes: 11 additions & 9 deletions views/app_auth_result.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@
</head>
<body>
<header><%= MulukhiyaTootProxy::Package.full_name %></header>
<h2>アプリケーションの認証</h2>
<% if params[:status].to_i < 400 %>
<p><a href="/web/getting-started">タイムライン画面</a>に戻って、以下を<%= MulukhiyaTootProxy::Config.instance['/mastodon/toot/label'] %>してください。</p>
<textarea id="toot_text" class="toot"><%= YAML.dump({'command' => 'user_config', 'webhook' => {'token' => params[:result][:access_token]}}) %></textarea>
<button id="copy_button">クリップボードにコピー</button>
<% else %>
<p class="alert">エラー(<%= params[:status] %></p>
<% end %>
<p><a href="/mulukhiya/app/auth">戻る</p>
<main>
<h2>アプリケーションの認証</h2>
<% if params[:status].to_i < 400 %>
<p><a href="/web/getting-started">タイムライン画面</a>に戻って、以下を<%= MulukhiyaTootProxy::Config.instance['/mastodon/toot/label'] %>してください。</p>
<textarea id="toot_text" class="toot"><%= YAML.dump({'command' => 'user_config', 'webhook' => {'token' => params[:result][:access_token]}}) %></textarea>
<button id="copy_button">クリップボードにコピー</button>
<% else %>
<p class="alert">エラー(<%= params[:status] %></p>
<% end %>
<p><a href="/mulukhiya/app/auth">戻る</p>
</main>
</body>
</html>
9 changes: 8 additions & 1 deletion views/default.sass
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
body
width: 780px
margin: auto
font-size: 1.2em
font-family: serif
background: url(/mulukhiya/logo.jpg) no-repeat
background-position: right
-webkit-text-size-adjust: 100%

h1,h2,h3,h4,h5,h6
margin: 0.5em
font-family: sans-serif

header
Expand All @@ -14,10 +18,13 @@ header
color: white
text-align: right

form
main
border: 1px solid black
margin: 6px 0
padding: 6px
border-radius: 10px
background: white
opacity: 0.95

pre
border: 1px solid black
Expand Down

0 comments on commit de5258a

Please sign in to comment.