Changesets can be listed by changeset number.
The Git repository is here.
Changeset 110
Hub integration - see also Changeset #107 and Changeset #108.
- Comitted by: adh
- Date: Monday October 23 18:24:11 2006 (over 18 years ago)
Affected files:
- rool/rails/i2/trunk/app/views/versions/new.rhtml (diff)
- rool/rails/i2/trunk/app/controllers/application.rb (diff)
- rool/rails/i2/trunk/app/controllers/versions_controller.rb (diff)
- rool/rails/i2/trunk/app/views/layouts/application.rhtml (diff)
- rool/rails/i2/trunk/config/environment.rb (diff)
rool/rails/i2/trunk/app/views/versions/new.rhtml:
prev. | current | |
<p> | ||
<%= submit_tag "Save" %> as | ||
17 | | |
18 | | |
17 | <% if hubssolib_current_user.roles.to_authenticated_roles.includes? [:admin, :webmaster, :privileged] -%> | |
18 | <%= text_field_tag :author_name, @author_name %> | |
19 | <% else -%> | |
20 | <%= hidden_field_tag :author_name, @author_name %><b><%= @author_name %></b> | |
21 | <% end -%> | |
or <%= link_to("Cancel", page_url(:page_title => @page)) %> | ||
</p> | ||
</td> |
rool/rails/i2/trunk/app/controllers/application.rb:
prev. | current | |
class ApplicationController < ActionController::Base | ||
2 | ||
3 | # Hub single sign-on support. | |
4 | ||
5 | require 'hub_sso_lib' | |
6 | include HubSsoLib::Core | |
7 | before_filter :hubssolib_update_state | |
8 | ||
protected | ||
def find_book | ||
@book = Book.find_by_url_name(params[:book_url_name]) |
rool/rails/i2/trunk/app/controllers/versions_controller.rb:
prev. | current | |
class VersionsController < ApplicationController | ||
2 | ||
3 | # Action permissions for this class as a class variable, exposed | |
4 | # to the public through a class method. | |
5 | ||
6 | @@hubssolib_permissions = HubSsoLib::Permissions.new({ | |
7 | :new => [ :admin, :webmaster, :privileged, :normal ], | |
8 | :create => [ :admin, :webmaster, :privileged, :normal ] | |
9 | }) | |
10 | ||
11 | def VersionsController.hubssolib_permissions | |
12 | @@hubssolib_permissions | |
13 | end | |
14 | ||
cache_sweeper :page_sweeper, :only => [ :create ] | ||
3 | ||
before_filter :find_book | ||
def show | ||
... | ... | |
@page = @book.find_or_build_page(params[:page_title]) | ||
@version = @page.find_or_build_version(params[:version_number]) | ||
end | ||
16 | | |
17 | | |
28 | ||
29 | @author_name = hubssolib_unique_name | |
end | ||
def create | ||
... | ... | |
version.save | ||
end | ||
28 | | |
29 | ||
redirect_to page_url(:page_title => @page) | ||
end | ||
end |
rool/rails/i2/trunk/app/views/layouts/application.rhtml:
prev. | current | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
4 | | |
4 | <title>RISC OS Open: <%= page_title %></title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<%= auto_discovery_link_tag(:rss, feed_url) %> | ||
... | ... | |
<table width="85%" cellspacing="0" cellpadding="0" align="center"> | ||
<tr valign="top" align="left"> | ||
<td width="75%"> | ||
21 | <%= hubssolib_flash_tags %> | |
22 | ||
<div id="Container"> | ||
<div id="Content"> | ||
25 | ||
<h2 id="pageName"><%= page_heading %></h2> | ||
<div class="navigation"> |
rool/rails/i2/trunk/config/environment.rb:
prev. | current | |
# Location of application relative to document root in terms of | ||
# URLs (i.e. according to the web server configuration, not the | ||
# filesystem location). | ||
13 | ||
PATH_PREFIX = '/rails/i2' | ||
Rails::Initializer.run do |config| | ||
... | ... | |
# See Rails::Configuration for more options | ||
end | ||
53 | ||
54 | # Application configuration - use a unique session cookie | |
55 | ||
56 | ActionController::Base.session_options[:session_key] = 'i2app_session_id' |