Skip to content

Commit

Permalink
Revert "Revert "AO3-4555 Update phrase app intergration""
Browse files Browse the repository at this point in the history
  • Loading branch information
zz9pzza committed May 14, 2016
1 parent e9850f0 commit cbe3b2a
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 45 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ gem 'globalize', '~> 3.1.0'
gem "rack-dev-mark"

#Phrase-app
gem 'phrase'
gem 'phraseapp-in-context-editor-ruby'

# For URL mangling
gem 'addressable'
Expand Down
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,11 @@ GEM
mimemagic (= 0.3.0)
permit_yo (2.1.4)
activesupport (~> 3.0)
phrase (0.4.33)
i18n
json
rainbow
phraseapp-in-context-editor-ruby (1.0.4)
i18n (~> 0.7)
json (~> 1.8)
phraseapp-ruby (~> 1.2)
phraseapp-ruby (1.2.4)
pickle (0.5.1)
cucumber (>= 0.8)
rake
Expand Down Expand Up @@ -252,7 +253,6 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rainbow (2.0.0)
raindrops (0.11.0)
rake (10.5.0)
rdoc (3.12.2)
Expand Down Expand Up @@ -436,7 +436,7 @@ DEPENDENCIES
nokogiri (>= 1.6.6.2)
paperclip
permit_yo
phrase
phraseapp-in-context-editor-ruby
pickle
pry (~> 0.10.3)
rack-dev-mark
Expand Down
7 changes: 0 additions & 7 deletions app/views/layouts/_phraseapp.html.erb

This file was deleted.

4 changes: 2 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
</title>

<%= render :partial => 'layouts/includes' %>
<%= render 'layouts/phraseapp' %>
<%= phraseapp_in_context_editor_js %>
</head>

<body class="<%= logged_in? ? 'logged-in' : 'logged-out' %>">
<body class="<%= logged_in? ? 'logged-in' : 'logged-out' %>" <%= PhraseApp::InContextEditor.enabled? ? "data-no-turbolink" : "" %>>
<div id="outer" class="wrapper">
<ul id="skiplinks"><li><a href="#main"><%= ts('Main Content') %></a></li></ul>
<%= render :partial => 'layouts/header' %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/home.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<meta name="distribution" content="GLOBAL" />
<meta name="classification" content="transformative works" />
<meta name="author" content="Organization for Transformative Works" />
<%= render 'layouts/phraseapp' %>
<%= phraseapp_in_context_editor_js %>
<title>
<% if defined?(@page_title) %>
<%= @page_title %>
Expand All @@ -29,7 +29,7 @@
<%= render 'layouts/includes' %>
</head>

<body id="home">
<body id="home" <%= PhraseApp::InContextEditor.enabled? ? "data-no-turbolink" : "" %>>
<div id="outer" class="wrapper">
<ul id="skiplinks"><li><a href="#main"><%= ts("Main Content") %></a></li><li><a href="#signup"><%= ts("Sign Up") %></a></li></ul>

Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/session.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%= render 'layouts/phraseapp' %>
<%= phraseapp_in_context_editor_js %>
<title>
<% if defined?(@page_title) %>
<%= @page_title %>
Expand All @@ -20,7 +20,7 @@
</title>
<%= render :partial => 'layouts/includes' %>
</head>
<body>
<body <%= PhraseApp::InContextEditor.enabled? ? "data-no-turbolink" : "" %>>
<%= render :partial => 'layouts/header' %>
<!-- BEGIN main -->
<div id="main" class="<%= controller.controller_name + '-' + controller.action_name %> system session region">
Expand Down
25 changes: 0 additions & 25 deletions config/initializers/phrase.rb

This file was deleted.

31 changes: 31 additions & 0 deletions config/initializers/phraseapp_in_context_editor.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
PhraseApp::InContextEditor.configure do |config|
# Enable or disable the In-Context-Editor in general
if ENV['AO3_PHRASE_APP'] == 'true' || ArchiveConfig.PHRASEAPP_ENABLE == 'true' then
config.enabled = true
else
config.enabled = false
end

# Fetch your project id after creating your first project
# in Translation Center.
# You can find the project id in your project settings
# page (https://phraseapp.com/projects)
config.project_id = "47f2a1b0cf81df327878c6d89cee7af3"

# You can create and manage access tokens in your profile settings
# in Translation Center or via the Authorizations API
# (http://docs.phraseapp.com/api/v2/authorizations/).
config.access_token = ArchiveConfig.PHRASEAPP_TOKEN

# Configure an array of key names that should not be handled
# by the In-Context-Editor.
config.ignored_keys = ["number.*", "breadcrumb.*"]

# PhraseApp uses decorators to generate a unique identification key
# in context of your document. However, this might result in conflicts
# with other libraries (e.g. client-side template engines) that use a similar syntax.
# If you encounter this problem, you might want to change this decorator pattern.
# More information: http://docs.phraseapp.com/guides/in-context-editor/configure/
# config.prefix = "{{__"
# config.suffix = "__}}"
end

0 comments on commit cbe3b2a

Please sign in to comment.