]> git.openstreetmap.org Git - rails.git/blob - app/views/site/_potlatch2.html.erb
Refactor the welcome page to use the bootstrap grid and alert box
[rails.git] / app / views / site / _potlatch2.html.erb
1 <%= javascript_include_tag "edit/potlatch2" %>
2
3 <div id="map">
4   <% session[:token] = current_user.tokens.create.token unless session[:token] && UserToken.find_by(:token => session[:token]) -%>
5   <% data = { :token => session[:token] } -%>
6   <% data[:lat] = @lat if @lat -%>
7   <% data[:lon] = @lon if @lon -%>
8   <% data[:zoom] = @zoom if @zoom -%>
9   <% if Settings.key?(:potlatch2_key) %>
10   <% token = current_user.access_token(Settings.potlatch2_key) %>
11   <% data[:token] = token.token -%>
12   <% data[:token_secret] = token.secret -%>
13   <% data[:consumer_key] = token.client_application.key -%>
14   <% data[:consumer_secret] = token.client_application.secret -%>
15   <% end %>
16   <% data[:locale] = Locale.list(Potlatch2::LOCALES.keys).preferred(preferred_languages).to_s -%>
17   <% data[:locale_path] = asset_path("potlatch2/locales/#{Potlatch2::LOCALES[data[:locale]]}.swf") -%>
18   <%= content_tag :div, t("site.edit.flash_player_required_html"), :id => "potlatch", :data => data %>
19 </div>