Changesets can be listed by changeset number.
The Git repository is here.
Changeset 193
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.
Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Comitted by: rool
- Date: Wednesday April 04 18:51:02 2007 (over 17 years ago)
Affected files:
- rool/rails/typo/trunk/vendor/plugins/haml/
- rool/rails/typo/trunk/vendor/plugins/haml/bin/
- rool/rails/typo/trunk/vendor/plugins/haml/lib/
- rool/rails/typo/trunk/vendor/plugins/haml/lib/haml/
- rool/rails/typo/trunk/app/views/admin/shared/
- rool/rails/typo/trunk/lang/
- rool/rails/typo/trunk/public/files/
- rool/rails/typo/trunk/public/stylesheets/textmate/
- rool/rails/typo/trunk/spec/
- rool/rails/typo/trunk/spec/controllers/
- rool/rails/typo/trunk/spec/fixtures/
- rool/rails/typo/trunk/spec/helpers/
- rool/rails/typo/trunk/spec/models/
- rool/rails/typo/trunk/tmp/pids/
- rool/rails/typo/trunk/vendor/cached_model/
- rool/rails/typo/trunk/vendor/cached_model/lib/
- rool/rails/typo/trunk/vendor/cached_model/test/
- rool/rails/typo/trunk/vendor/memcache-client/
- rool/rails/typo/trunk/vendor/memcache-client/lib/
- rool/rails/typo/trunk/vendor/memcache-client/test/
- rool/rails/typo/trunk/vendor/plugins/action_view_patch/
- rool/rails/typo/trunk/vendor/plugins/action_view_patch/lib/
- rool/rails/typo/trunk/vendor/plugins/action_view_patch/test/
- rool/rails/typo/trunk/vendor/plugins/aimpresence_sidebar/
- rool/rails/typo/trunk/vendor/plugins/aimpresence_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/aimpresence_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/aimpresence_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/amazon_sidebar/
- rool/rails/typo/trunk/vendor/plugins/amazon_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/amazon_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/archives_sidebar/
- rool/rails/typo/trunk/vendor/plugins/archives_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/archives_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/archives_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/audioscrobbler_sidebar/
- rool/rails/typo/trunk/vendor/plugins/audioscrobbler_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/audioscrobbler_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/audioscrobbler_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/backpack_sidebar/
- rool/rails/typo/trunk/vendor/plugins/backpack_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/backpack_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/backpack_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/category_sidebar/
- rool/rails/typo/trunk/vendor/plugins/category_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/category_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/category_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/delicious_sidebar/
- rool/rails/typo/trunk/vendor/plugins/delicious_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/delicious_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/delicious_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/flickr_sidebar/
- rool/rails/typo/trunk/vendor/plugins/flickr_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/flickr_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/flickr_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/fortythree_sidebar/
- rool/rails/typo/trunk/vendor/plugins/fortythree_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/fortythree_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/fortythree_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/fortythreeplaces_sidebar/
- rool/rails/typo/trunk/vendor/plugins/fortythreeplaces_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/fortythreeplaces_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/fortythreeplaces_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/haml/lib/haml/helpers/
- rool/rails/typo/trunk/vendor/plugins/haml/test/
- rool/rails/typo/trunk/vendor/plugins/haml/test/mocks/
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/
- rool/rails/typo/trunk/vendor/plugins/haml/test/rhtml/
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/
- rool/rails/typo/trunk/vendor/plugins/localization/
- rool/rails/typo/trunk/vendor/plugins/localization/lib/
- rool/rails/typo/trunk/vendor/plugins/magnolia_sidebar/
- rool/rails/typo/trunk/vendor/plugins/magnolia_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/magnolia_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/magnolia_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/recent_comments_sidebar/
- rool/rails/typo/trunk/vendor/plugins/recent_comments_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/recent_comments_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/recent_comments_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/static_sidebar/
- rool/rails/typo/trunk/vendor/plugins/static_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/static_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/tada_sidebar/
- rool/rails/typo/trunk/vendor/plugins/tada_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/tada_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/tada_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/tag_sidebar/
- rool/rails/typo/trunk/vendor/plugins/tag_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/tag_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/tag_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/technorati_sidebar/
- rool/rails/typo/trunk/vendor/plugins/technorati_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/technorati_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/technorati_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_amazon/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_amazon/lib/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_amazon/tasks/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_amazon/test/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_code/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_code/lib/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_code/tasks/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_code/test/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_flickr/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_flickr/lib/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_flickr/tasks/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_flickr/test/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_htmlfilter/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_htmlfilter/lib/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_htmlfilter/tasks/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_htmlfilter/test/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_lightbox/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_lightbox/lib/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_lightbox/tasks/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_lightbox/test/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_markdown/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_markdown/lib/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_markdown/tasks/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_markdown/test/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_none/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_none/lib/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_none/tasks/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_none/test/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_smartypants/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_smartypants/lib/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_smartypants/tasks/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_smartypants/test/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_sparkline/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_sparkline/lib/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_sparkline/tasks/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_sparkline/test/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile/lib/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile/tasks/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile/test/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile_and_markdown/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile_and_markdown/lib/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile_and_markdown/tasks/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile_and_markdown/test/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_tmcode/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_tmcode/lib/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_tmcode/tasks/
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_tmcode/test/
- rool/rails/typo/trunk/vendor/plugins/upcoming_sidebar/
- rool/rails/typo/trunk/vendor/plugins/upcoming_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/upcoming_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/upcoming_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/xbox_sidebar/
- rool/rails/typo/trunk/vendor/plugins/xbox_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/xbox_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/xbox_sidebar/views/
- rool/rails/typo/trunk/vendor/plugins/xml_sidebar/
- rool/rails/typo/trunk/vendor/plugins/xml_sidebar/lib/
- rool/rails/typo/trunk/vendor/plugins/xml_sidebar/test/
- rool/rails/typo/trunk/vendor/plugins/xml_sidebar/views/
- rool/rails/typo/trunk/CHANGES-4.1
- rool/rails/typo/trunk/README.SIDEBARS
- rool/rails/typo/trunk/TODO-4.1
- rool/rails/typo/trunk/app/models/categorization.rb
- rool/rails/typo/trunk/app/models/content_state/ham.rb
- rool/rails/typo/trunk/app/models/content_state/just_marked_as_ham.rb
- rool/rails/typo/trunk/app/models/content_state/just_marked_as_spam.rb
- rool/rails/typo/trunk/app/models/content_state/just_presumed_ham.rb
- rool/rails/typo/trunk/app/models/content_state/just_withdrawn.rb
- rool/rails/typo/trunk/app/models/content_state/presumed_ham.rb
- rool/rails/typo/trunk/app/models/content_state/presumed_spam.rb
- rool/rails/typo/trunk/app/models/content_state/spam.rb
- rool/rails/typo/trunk/app/models/content_state/unclassified.rb
- rool/rails/typo/trunk/app/models/content_state/withdrawn.rb
- rool/rails/typo/trunk/app/models/feedback.rb
- rool/rails/typo/trunk/app/models/notification.rb
- rool/rails/typo/trunk/app/views/admin/shared/_edit.rhtml
- rool/rails/typo/trunk/app/views/articles/read_and_comment.rhtml
- rool/rails/typo/trunk/app/views/layouts/minimal.rhtml
- rool/rails/typo/trunk/db/migrate/048_remove_count_caching.rb
- rool/rails/typo/trunk/db/migrate/049_move_feedback_to_new_state_machine.rb
- rool/rails/typo/trunk/db/migrate/050_add_status_confirmed_field_to_content.rb
- rool/rails/typo/trunk/db/migrate/051_fix_canonical_server_url.rb
- rool/rails/typo/trunk/db/migrate/052_remove_cached_html.rb
- rool/rails/typo/trunk/db/migrate/053_promote_canonical_server_url.rb
- rool/rails/typo/trunk/db/migrate/054_upgrade_sidebar_objects.rb
- rool/rails/typo/trunk/db/migrate/055_link_sidebars_to_blog.rb
- rool/rails/typo/trunk/db/migrate/056_create_notifications.rb
- rool/rails/typo/trunk/db/migrate/057_add_categorization_model.rb
- rool/rails/typo/trunk/db/migrate/058_separate_entries_and_feedback.rb
- rool/rails/typo/trunk/db/migrate/059_cleanup_feedback_table.rb
- rool/rails/typo/trunk/db/migrate/060_cleanup_contents_table.rb
- rool/rails/typo/trunk/db/migrate/061_convert_title_prefix_setting.rb
- rool/rails/typo/trunk/lang/fr_FR.rb
- rool/rails/typo/trunk/lib/generators/sidebar/templates/Rakefile
- rool/rails/typo/trunk/lib/generators/sidebar/templates/content.rhtml
- rool/rails/typo/trunk/lib/generators/sidebar/templates/init.rb
- rool/rails/typo/trunk/lib/generators/sidebar/templates/sidebar.rb
- rool/rails/typo/trunk/lib/generators/sidebar/templates/unit_test.rb
- rool/rails/typo/trunk/lib/memory_profiler.rb
- rool/rails/typo/trunk/lib/route_cache.rb
- rool/rails/typo/trunk/lib/sidebars/consolidated_plugin.rb
- rool/rails/typo/trunk/lib/typo_deprecated.rb
- rool/rails/typo/trunk/public/.htaccess
- rool/rails/typo/trunk/public/images/bracket.gif
- rool/rails/typo/trunk/public/images/cancel.png
- rool/rails/typo/trunk/public/images/checked.png
- rool/rails/typo/trunk/public/images/edit.png
- rool/rails/typo/trunk/public/images/help.png
- rool/rails/typo/trunk/public/images/show.png
- rool/rails/typo/trunk/public/javascripts/codecollapse.js
- rool/rails/typo/trunk/public/stylesheets/codecollapse.css
- rool/rails/typo/trunk/public/stylesheets/minimal.css
- rool/rails/typo/trunk/public/stylesheets/textmate/dawn.css
- rool/rails/typo/trunk/public/stylesheets/textmate/iplastic.css
- rool/rails/typo/trunk/public/stylesheets/textmate/space_cadet.css
- rool/rails/typo/trunk/public/stylesheets/textmate/textmate.css
- rool/rails/typo/trunk/public/stylesheets/textmate/twilight.css
- rool/rails/typo/trunk/script/process/inspector
- rool/rails/typo/trunk/spec/controllers/accounts_controller_spec.rb
- rool/rails/typo/trunk/spec/controllers/articles_controller_spec.rb
- rool/rails/typo/trunk/spec/fixtures/articles_tags.yml
- rool/rails/typo/trunk/spec/fixtures/blacklist_patterns.yml
- rool/rails/typo/trunk/spec/fixtures/blogs.yml
- rool/rails/typo/trunk/spec/fixtures/categories.yml
- rool/rails/typo/trunk/spec/fixtures/categorizations.yml
- rool/rails/typo/trunk/spec/fixtures/contents.yml
- rool/rails/typo/trunk/spec/fixtures/feedback.yml
- rool/rails/typo/trunk/spec/fixtures/notifications.yml
- rool/rails/typo/trunk/spec/fixtures/page_caches.yml
- rool/rails/typo/trunk/spec/fixtures/redirects.yml
- rool/rails/typo/trunk/spec/fixtures/resources.yml
- rool/rails/typo/trunk/spec/fixtures/sidebars.yml
- rool/rails/typo/trunk/spec/fixtures/tags.yml
- rool/rails/typo/trunk/spec/fixtures/text_filters.yml
- rool/rails/typo/trunk/spec/fixtures/triggers.yml
- rool/rails/typo/trunk/spec/fixtures/users.yml
- rool/rails/typo/trunk/spec/fixtures/whiteboards.yml
- rool/rails/typo/trunk/spec/helpers/admin_base_helper_spec.rb
- rool/rails/typo/trunk/spec/models/amazon_sidebar_spec.rb
- rool/rails/typo/trunk/spec/models/audioscrobbler_spec.rb
- rool/rails/typo/trunk/spec/models/blog_spec.rb
- rool/rails/typo/trunk/spec/models/cache_support_spec.rb
- rool/rails/typo/trunk/spec/models/category_spec.rb
- rool/rails/typo/trunk/spec/models/configuration_spec.rb
- rool/rails/typo/trunk/spec/models/content_state_spec.rb
- rool/rails/typo/trunk/spec/models/delegate_to_content_state_spec.rb
- rool/rails/typo/trunk/spec/models/delicious_spec.rb
- rool/rails/typo/trunk/spec/models/flickr_spec.rb
- rool/rails/typo/trunk/spec/models/metafragment_spec.rb
- rool/rails/typo/trunk/spec/models/page_cache_spec.rb
- rool/rails/typo/trunk/spec/models/page_spec.rb
- rool/rails/typo/trunk/spec/models/ping_spec.rb
- rool/rails/typo/trunk/spec/models/redirect_spec.rb
- rool/rails/typo/trunk/spec/models/resource_spec.rb
- rool/rails/typo/trunk/spec/models/static_sidebar_spec.rb
- rool/rails/typo/trunk/spec/models/tag_spec.rb
- rool/rails/typo/trunk/spec/models/text_filter_spec.rb
- rool/rails/typo/trunk/spec/models/theme_spec.rb
- rool/rails/typo/trunk/spec/models/trackback_spec.rb
- rool/rails/typo/trunk/spec/models/trigger_spec.rb
- rool/rails/typo/trunk/spec/models/user_spec.rb
- rool/rails/typo/trunk/test/fixtures/categorizations.yml
- rool/rails/typo/trunk/test/fixtures/feedback.yml
- rool/rails/typo/trunk/test/unit/amazon_sidebar_test.rb
- rool/rails/typo/trunk/test/unit/cache_support_test.rb
- rool/rails/typo/trunk/test/unit/content_state/feedback_states_test.rb
- rool/rails/typo/trunk/test/unit/notification_test.rb
- rool/rails/typo/trunk/test/unit/static_sidebar_test.rb
- rool/rails/typo/trunk/themes/risc_os_open/views/shared/fixed_footer.rhtml
- rool/rails/typo/trunk/themes/risc_os_open/views/shared/fixed_header.rhtml
- rool/rails/typo/trunk/themes/risc_os_open/views/shared/fixed_sidebar.rhtml
- rool/rails/typo/trunk/vendor/cached_model/History.txt
- rool/rails/typo/trunk/vendor/cached_model/LICENSE.txt
- rool/rails/typo/trunk/vendor/cached_model/Manifest.txt
- rool/rails/typo/trunk/vendor/cached_model/README.txt
- rool/rails/typo/trunk/vendor/cached_model/Rakefile
- rool/rails/typo/trunk/vendor/cached_model/lib/cached_model.rb
- rool/rails/typo/trunk/vendor/cached_model/test/test_cached_model.rb
- rool/rails/typo/trunk/vendor/memcache-client/History.txt
- rool/rails/typo/trunk/vendor/memcache-client/LICENSE.txt
- rool/rails/typo/trunk/vendor/memcache-client/Manifest.txt
- rool/rails/typo/trunk/vendor/memcache-client/README.txt
- rool/rails/typo/trunk/vendor/memcache-client/Rakefile
- rool/rails/typo/trunk/vendor/memcache-client/lib/memcache.rb
- rool/rails/typo/trunk/vendor/memcache-client/lib/memcache_util.rb
- rool/rails/typo/trunk/vendor/memcache-client/test/test_mem_cache.rb
- rool/rails/typo/trunk/vendor/plugins/action_view_patch/Rakefile
- rool/rails/typo/trunk/vendor/plugins/action_view_patch/init.rb
- rool/rails/typo/trunk/vendor/plugins/action_view_patch/lib/action_view_patch.rb
- rool/rails/typo/trunk/vendor/plugins/action_view_patch/test/action_view_patch_test.rb
- rool/rails/typo/trunk/vendor/plugins/aimpresence_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/aimpresence_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/aimpresence_sidebar/lib/aimpresence_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/aimpresence_sidebar/test/aimpresence_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/aimpresence_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/amazon_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/amazon_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/archives_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/archives_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/archives_sidebar/lib/archives_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/archives_sidebar/test/archives_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/archives_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/audioscrobbler_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/audioscrobbler_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/audioscrobbler_sidebar/lib/audioscrobbler.rb
- rool/rails/typo/trunk/vendor/plugins/audioscrobbler_sidebar/lib/audioscrobbler_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/audioscrobbler_sidebar/test/audioscrobbler_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/audioscrobbler_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/backpack_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/backpack_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/backpack_sidebar/lib/backpack.rb
- rool/rails/typo/trunk/vendor/plugins/backpack_sidebar/lib/backpack_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/backpack_sidebar/test/backpack_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/backpack_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/category_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/category_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/category_sidebar/lib/category_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/category_sidebar/test/category_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/category_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/delicious_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/delicious_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/delicious_sidebar/lib/delicious.rb
- rool/rails/typo/trunk/vendor/plugins/delicious_sidebar/lib/delicious_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/delicious_sidebar/test/delicious_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/delicious_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/flickr_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/flickr_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/flickr_sidebar/lib/flickr.rb
- rool/rails/typo/trunk/vendor/plugins/flickr_sidebar/lib/flickr_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/flickr_sidebar/test/flickr_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/flickr_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/fortythree_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/fortythree_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/fortythree_sidebar/lib/fortythree.rb
- rool/rails/typo/trunk/vendor/plugins/fortythree_sidebar/lib/fortythree_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/fortythree_sidebar/test/fortythree_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/fortythree_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/fortythreeplaces_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/fortythreeplaces_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/fortythreeplaces_sidebar/lib/fortythree.rb
- rool/rails/typo/trunk/vendor/plugins/fortythreeplaces_sidebar/lib/fortythreeplaces_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/fortythreeplaces_sidebar/test/fortythreeplaces_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/fortythreeplaces_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/haml/MIT-LICENSE
- rool/rails/typo/trunk/vendor/plugins/haml/REFERENCE
- rool/rails/typo/trunk/vendor/plugins/haml/Rakefile
- rool/rails/typo/trunk/vendor/plugins/haml/VERSION
- rool/rails/typo/trunk/vendor/plugins/haml/bin/haml
- rool/rails/typo/trunk/vendor/plugins/haml/init.rb
- rool/rails/typo/trunk/vendor/plugins/haml/lib/haml/buffer.rb
- rool/rails/typo/trunk/vendor/plugins/haml/lib/haml/engine.rb
- rool/rails/typo/trunk/vendor/plugins/haml/lib/haml/helpers.rb
- rool/rails/typo/trunk/vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb
- rool/rails/typo/trunk/vendor/plugins/haml/lib/haml/template.rb
- rool/rails/typo/trunk/vendor/plugins/haml/test/benchmark.rb
- rool/rails/typo/trunk/vendor/plugins/haml/test/engine_test.rb
- rool/rails/typo/trunk/vendor/plugins/haml/test/helper_test.rb
- rool/rails/typo/trunk/vendor/plugins/haml/test/mocks/article.rb
- rool/rails/typo/trunk/vendor/plugins/haml/test/profile.rb
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/content_for_layout.xhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/eval_suppressed.xhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/helpers.xhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/helpful.xhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/just_stuff.xhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/list.xhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/original_engine.xhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/partials.xhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/silent_script.xhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/standard.xhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/tag_parsing.xhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/very_basic.xhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/results/whitespace_handling.xhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/rhtml/standard.rhtml
- rool/rails/typo/trunk/vendor/plugins/haml/test/runner.rb
- rool/rails/typo/trunk/vendor/plugins/haml/test/template_test.rb
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/_partial.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/_text_area.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/content_for_layout.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/eval_suppressed.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/helpers.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/helpful.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/just_stuff.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/list.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/original_engine.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/partialize.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/partials.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/silent_script.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/standard.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/tag_parsing.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/very_basic.haml
- rool/rails/typo/trunk/vendor/plugins/haml/test/templates/whitespace_handling.haml
- rool/rails/typo/trunk/vendor/plugins/localization/CHANGELOG
- rool/rails/typo/trunk/vendor/plugins/localization/README
- rool/rails/typo/trunk/vendor/plugins/localization/init.rb
- rool/rails/typo/trunk/vendor/plugins/localization/lib/localization.rb
- rool/rails/typo/trunk/vendor/plugins/magnolia_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/magnolia_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/magnolia_sidebar/lib/magnolia_aggregation.rb
- rool/rails/typo/trunk/vendor/plugins/magnolia_sidebar/lib/magnolia_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/magnolia_sidebar/test/magnolia_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/magnolia_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/recent_comments_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/recent_comments_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/recent_comments_sidebar/lib/recent_comments_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/recent_comments_sidebar/test/recent_comments_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/recent_comments_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/static_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/static_sidebar/lib/static_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/static_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/tada_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/tada_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/tada_sidebar/lib/tada.rb
- rool/rails/typo/trunk/vendor/plugins/tada_sidebar/lib/tada_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/tada_sidebar/test/tada_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/tada_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/tag_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/tag_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/tag_sidebar/lib/tag_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/tag_sidebar/test/tag_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/tag_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/technorati_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/technorati_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/technorati_sidebar/lib/technorati.rb
- rool/rails/typo/trunk/vendor/plugins/technorati_sidebar/lib/technorati_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/technorati_sidebar/test/technorati_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/technorati_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_amazon/README
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_amazon/Rakefile
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_amazon/init.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_amazon/install.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_amazon/lib/typo_textfilter_amazon.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_amazon/tasks/typo_textfilter_amazon_tasks.rake
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_amazon/test/typo_textfilter_amazon_test.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_code/README
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_code/Rakefile
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_code/init.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_code/install.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_code/lib/typo_textfilter_code.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_code/tasks/typo_textfilter_code_tasks.rake
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_code/test/typo_textfilter_code_test.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_flickr/README
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_flickr/Rakefile
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_flickr/init.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_flickr/install.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_flickr/lib/typo_textfilter_flickr.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_flickr/tasks/typo_textfilter_flickr_tasks.rake
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_flickr/test/typo_textfilter_flickr_test.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_htmlfilter/README
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_htmlfilter/Rakefile
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_htmlfilter/init.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_htmlfilter/install.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_htmlfilter/lib/typo_textfilter_htmlfilter.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_htmlfilter/tasks/typo_textfilter_htmlfilter_tasks.rake
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_htmlfilter/test/typo_textfilter_htmlfilter_test.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_lightbox/README
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_lightbox/Rakefile
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_lightbox/init.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_lightbox/install.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_lightbox/lib/typo_textfilter_lightbox.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_lightbox/tasks/typo_textfilter_lightbox_tasks.rake
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_lightbox/test/typo_textfilter_lightbox_test.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_markdown/README
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_markdown/Rakefile
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_markdown/init.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_markdown/install.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_markdown/tasks/typo_textfilter_markdown_tasks.rake
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_markdown/test/typo_textfilter_markdown_test.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_none/README
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_none/Rakefile
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_none/init.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_none/install.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_none/lib/typo_textfilter_none.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_none/tasks/typo_textfilter_none_tasks.rake
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_none/test/typo_textfilter_none_test.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_smartypants/README
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_smartypants/Rakefile
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_smartypants/init.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_smartypants/install.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_smartypants/lib/typo_textfilter_smartypants.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_smartypants/tasks/typo_textfilter_smartypants_tasks.rake
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_smartypants/test/typo_textfilter_smartypants_test.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_sparkline/README
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_sparkline/Rakefile
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_sparkline/init.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_sparkline/install.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_sparkline/lib/typo_textfilter_sparkline.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_sparkline/tasks/typo_textfilter_sparkline_tasks.rake
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_sparkline/test/typo_textfilter_sparkline_test.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile/README
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile/Rakefile
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile/init.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile/install.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile/lib/typo_textfilter_textile.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile/tasks/typo_textfilter_textile_tasks.rake
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile/test/typo_textfilter_textile_test.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile_and_markdown/README
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile_and_markdown/Rakefile
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile_and_markdown/init.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile_and_markdown/install.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile_and_markdown/lib/typo_textfilter_textile_and_markdown.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile_and_markdown/tasks/typo_textfilter_textile_and_markdown_tasks.rake
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_textile_and_markdown/test/typo_textfilter_textile_and_markdown_test.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_tmcode/README
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_tmcode/Rakefile
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_tmcode/init.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_tmcode/install.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_tmcode/lib/typo_textfilter_tmcode.rb
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_tmcode/tasks/typo_textfilter_tmcode_tasks.rake
- rool/rails/typo/trunk/vendor/plugins/typo_textfilter_tmcode/test/typo_textfilter_tmcode_test.rb
- rool/rails/typo/trunk/vendor/plugins/upcoming_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/upcoming_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/upcoming_sidebar/lib/upcoming.rb
- rool/rails/typo/trunk/vendor/plugins/upcoming_sidebar/lib/upcoming_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/upcoming_sidebar/test/upcoming_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/upcoming_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/xbox_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/xbox_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/xbox_sidebar/lib/xbox_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/xbox_sidebar/test/xbox_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/xbox_sidebar/views/content.rhtml
- rool/rails/typo/trunk/vendor/plugins/xml_sidebar/Rakefile
- rool/rails/typo/trunk/vendor/plugins/xml_sidebar/init.rb
- rool/rails/typo/trunk/vendor/plugins/xml_sidebar/lib/xml_sidebar.rb
- rool/rails/typo/trunk/vendor/plugins/xml_sidebar/test/xml_sidebar_test.rb
- rool/rails/typo/trunk/vendor/plugins/xml_sidebar/views/content.rhtml
- rool/rails/typo/trunk/MAINTAINERS (diff)
- rool/rails/typo/trunk/README (diff)
- rool/rails/typo/trunk/Rakefile (diff)
- rool/rails/typo/trunk/app/apis/blogger_service.rb (diff)
- rool/rails/typo/trunk/app/apis/meta_weblog_service.rb (diff)
- rool/rails/typo/trunk/app/apis/movable_type_service.rb (diff)
- rool/rails/typo/trunk/app/controllers/accounts_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/admin/blacklist_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/admin/cache_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/admin/comments_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/admin/content_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/admin/feedback_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/admin/general_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/admin/pages_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/admin/sidebar_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/admin/textfilters_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/admin/themes_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/admin/users_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/application.rb (diff)
- rool/rails/typo/trunk/app/controllers/articles_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/backend_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/content_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/live_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/redirect_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/textfilter_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/theme_controller.rb (diff)
- rool/rails/typo/trunk/app/controllers/xml_controller.rb (diff)
- rool/rails/typo/trunk/app/helpers/admin/base_helper.rb (diff)
- rool/rails/typo/trunk/app/helpers/admin/content_helper.rb (diff)
- rool/rails/typo/trunk/app/helpers/admin/feedback_helper.rb (diff)
- rool/rails/typo/trunk/app/helpers/admin/pages_helper.rb (diff)
- rool/rails/typo/trunk/app/helpers/application_helper.rb (diff)
- rool/rails/typo/trunk/app/helpers/articles_helper.rb (diff)
- rool/rails/typo/trunk/app/helpers/mail_helper.rb (diff)
- rool/rails/typo/trunk/app/helpers/sidebar_helper.rb (diff)
- rool/rails/typo/trunk/app/helpers/xml_helper.rb (diff)
- rool/rails/typo/trunk/app/models/article.rb (diff)
- rool/rails/typo/trunk/app/models/blog.rb (diff)
- rool/rails/typo/trunk/app/models/blog_sweeper.rb (diff)
- rool/rails/typo/trunk/app/models/category.rb (diff)
- rool/rails/typo/trunk/app/models/comment.rb (diff)
- rool/rails/typo/trunk/app/models/content.rb (diff)
- rool/rails/typo/trunk/app/models/content_state/base.rb (diff)
- rool/rails/typo/trunk/app/models/content_state/draft.rb (diff)
- rool/rails/typo/trunk/app/models/content_state/factory.rb (diff)
- rool/rails/typo/trunk/app/models/content_state/just_published.rb (diff)
- rool/rails/typo/trunk/app/models/content_state/new.rb (diff)
- rool/rails/typo/trunk/app/models/content_state/publication_pending.rb (diff)
- rool/rails/typo/trunk/app/models/content_state/published.rb (diff)
- rool/rails/typo/trunk/app/models/email_notifier.rb (diff)
- rool/rails/typo/trunk/app/models/notification_mailer.rb (diff)
- rool/rails/typo/trunk/app/models/page.rb (diff)
- rool/rails/typo/trunk/app/models/ping.rb (diff)
- rool/rails/typo/trunk/app/models/sidebar.rb (diff)
- rool/rails/typo/trunk/app/models/tag.rb (diff)
- rool/rails/typo/trunk/app/models/text_filter.rb (diff)
- rool/rails/typo/trunk/app/models/theme.rb (diff)
- rool/rails/typo/trunk/app/models/trackback.rb (diff)
- rool/rails/typo/trunk/app/models/user.rb (diff)
- rool/rails/typo/trunk/app/views/accounts/login.rhtml (diff)
- rool/rails/typo/trunk/app/views/accounts/logout.rhtml (diff)
- rool/rails/typo/trunk/app/views/accounts/signup.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/base/_recent_comments.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/base/_recent_trackbacks.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/blacklist/_blacklist_patterns.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/blacklist/_form.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/blacklist/_quick_post.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/blacklist/destroy.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/blacklist/edit.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/blacklist/list.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/cache/list.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/categories/_categories.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/categories/_form.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/categories/_quick_post.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/categories/destroy.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/categories/edit.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/categories/list.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/categories/reorder.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/categories/show.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/comments/_form.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/comments/comments.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/comments/destroy.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/comments/edit.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/comments/list.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/comments/new.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/comments/show.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/content/_articles.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/content/_attachment.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/content/_form.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/content/_pages.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/content/_quick_post.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/content/_show_categories.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/content/_show_resources.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/content/destroy.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/content/edit.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/content/list.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/content/new.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/content/preview.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/content/show.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/feedback/_item.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/feedback/list.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/general/index.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/general/update_database.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/pages/_form.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/pages/_pages.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/pages/_quick_post.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/pages/destroy.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/pages/edit.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/pages/list.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/pages/new.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/pages/preview.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/pages/show.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/resources/_itunes_category_edit.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/resources/_metadata_add.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/resources/_metadata_edit.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/resources/_mime_edit.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/resources/_pages.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/resources/_resources.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/resources/destroy.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/resources/list.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/resources/new.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/sidebar/_active.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/sidebar/_availables.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/sidebar/_publish.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/sidebar/_target.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/sidebar/index.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/textfilters/_form.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/textfilters/_macros.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/textfilters/_textfilters.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/textfilters/destroy.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/textfilters/edit.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/textfilters/list.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/textfilters/macro_help.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/textfilters/new.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/textfilters/show.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/textfilters/show_help.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/themes/index.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/trackbacks/_form.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/trackbacks/destroy.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/trackbacks/edit.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/trackbacks/list.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/trackbacks/new.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/trackbacks/show.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/users/_form.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/users/_user.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/users/destroy.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/users/edit.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/users/list.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/users/new.rhtml (diff)
- rool/rails/typo/trunk/app/views/admin/users/show.rhtml (diff)
- rool/rails/typo/trunk/app/views/articles/_article.rhtml (diff)
- rool/rails/typo/trunk/app/views/articles/_comment.rhtml (diff)
- rool/rails/typo/trunk/app/views/articles/_comment_box.rhtml (diff)
- rool/rails/typo/trunk/app/views/articles/_trackback.rhtml (diff)
- rool/rails/typo/trunk/app/views/articles/archives.rhtml (diff)
- rool/rails/typo/trunk/app/views/articles/comment_preview.rhtml (diff)
- rool/rails/typo/trunk/app/views/articles/groupings.rhtml (diff)
- rool/rails/typo/trunk/app/views/articles/index.rhtml (diff)
- rool/rails/typo/trunk/app/views/articles/read.rhtml (diff)
- rool/rails/typo/trunk/app/views/articles/view_page.rhtml (diff)
- rool/rails/typo/trunk/app/views/layouts/administration.rhtml (diff)
- rool/rails/typo/trunk/app/views/live/search.rhtml (diff)
- rool/rails/typo/trunk/app/views/notification_mailer/_mail_footer.rhtml (diff)
- rool/rails/typo/trunk/app/views/notification_mailer/article.rhtml (diff)
- rool/rails/typo/trunk/app/views/notification_mailer/comment.rhtml (diff)
- rool/rails/typo/trunk/app/views/settings/done.rhtml (diff)
- rool/rails/typo/trunk/app/views/settings/install.rhtml (diff)
- rool/rails/typo/trunk/app/views/shared/_search.rhtml (diff)
- rool/rails/typo/trunk/app/views/sidebar/_sidebar.rhtml (diff)
- rool/rails/typo/trunk/app/views/xml/_atom10_item_article.rxml (diff)
- rool/rails/typo/trunk/app/views/xml/_atom10_item_comment.rxml (diff)
- rool/rails/typo/trunk/app/views/xml/_atom10_item_trackback.rxml (diff)
- rool/rails/typo/trunk/app/views/xml/_googlesitemap_item_article.rxml (diff)
- rool/rails/typo/trunk/app/views/xml/_googlesitemap_item_category.rxml (diff)
- rool/rails/typo/trunk/app/views/xml/_googlesitemap_item_page.rxml (diff)
- rool/rails/typo/trunk/app/views/xml/_googlesitemap_item_tag.rxml (diff)
- rool/rails/typo/trunk/app/views/xml/_itunes_item_resource.rxml (diff)
- rool/rails/typo/trunk/app/views/xml/_rss20_item_article.rxml (diff)
- rool/rails/typo/trunk/app/views/xml/_rss20_item_comment.rxml (diff)
- rool/rails/typo/trunk/app/views/xml/atom10_feed.rxml (diff)
- rool/rails/typo/trunk/app/views/xml/itunes_feed.rxml (diff)
- rool/rails/typo/trunk/app/views/xml/rsd.rxml (diff)
- rool/rails/typo/trunk/app/views/xml/rss20_feed.rxml (diff)
- rool/rails/typo/trunk/bin/typo (diff)
- rool/rails/typo/trunk/config/boot.rb (diff)
- rool/rails/typo/trunk/config/environment.rb (diff)
- rool/rails/typo/trunk/config/environments/production.rb (diff)
- rool/rails/typo/trunk/config/environments/test.rb (diff)
- rool/rails/typo/trunk/config/routes.rb (diff)
- rool/rails/typo/trunk/db/migrate/046_fixup_forthcoming_publications.rb (diff)
- rool/rails/typo/trunk/db/schema.mysql.sql (diff)
- rool/rails/typo/trunk/db/schema.postgresql.sql (diff)
- rool/rails/typo/trunk/db/schema.rb (diff)
- rool/rails/typo/trunk/db/schema.sqlite.sql (diff)
- rool/rails/typo/trunk/db/schema.sqlserver.sql (diff)
- rool/rails/typo/trunk/db/schema_version (diff)
- rool/rails/typo/trunk/doc/Installer.txt (diff)
- rool/rails/typo/trunk/lib/email_notify.rb (diff)
- rool/rails/typo/trunk/lib/generators/sidebar/sidebar_generator.rb (diff)
- rool/rails/typo/trunk/lib/jabber_notify.rb (diff)
- rool/rails/typo/trunk/lib/rails_patch/active_record.rb (diff)
- rool/rails/typo/trunk/lib/sidebars/component_plugin.rb (diff)
- rool/rails/typo/trunk/lib/sidebars/plugin.rb (diff)
- rool/rails/typo/trunk/lib/spam_protection.rb (diff)
- rool/rails/typo/trunk/lib/tasks/release.rake (diff)
- rool/rails/typo/trunk/lib/text_filter_plugin.rb (diff)
- rool/rails/typo/trunk/lib/typo_version.rb (diff)
- rool/rails/typo/trunk/public/500.html (diff)
- rool/rails/typo/trunk/public/dispatch.rb (diff)
- rool/rails/typo/trunk/public/images/delete.png
- rool/rails/typo/trunk/public/javascripts/controls.js (diff)
- rool/rails/typo/trunk/public/javascripts/dragdrop.js (diff)
- rool/rails/typo/trunk/public/javascripts/effects.js (diff)
- rool/rails/typo/trunk/public/javascripts/prototype.js (diff)
- rool/rails/typo/trunk/public/javascripts/typo.js (diff)
- rool/rails/typo/trunk/public/stylesheets/administration.css (diff)
- rool/rails/typo/trunk/test/fixtures/blogs.yml (diff)
- rool/rails/typo/trunk/test/fixtures/contents.yml (diff)
- rool/rails/typo/trunk/test/fixtures/sidebars.yml (diff)
- rool/rails/typo/trunk/test/functional/accounts_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/admin/article_preview_test.rb (diff)
- rool/rails/typo/trunk/test/functional/admin/blacklist_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/admin/categories_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/admin/comments_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/admin/content_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/admin/feedback_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/admin/general_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/admin/pages_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/admin/resources_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/admin/textfilters_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/admin/themes_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/admin/trackbacks_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/admin/users_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/articles_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/backend_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/redirect_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/textfilter_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/theme_controller_test.rb (diff)
- rool/rails/typo/trunk/test/functional/xml_controller_test.rb (diff)
- rool/rails/typo/trunk/test/mocks/test/xmlrpc_mock.rb (diff)
- rool/rails/typo/trunk/test/mocks/themes/azure/layouts/default.rhtml (diff)
- rool/rails/typo/trunk/test/test_helper.rb (diff)
- rool/rails/typo/trunk/test/unit/article_test.rb (diff)
- rool/rails/typo/trunk/test/unit/blog_test.rb (diff)
- rool/rails/typo/trunk/test/unit/category_test.rb (diff)
- rool/rails/typo/trunk/test/unit/comment_test.rb (diff)
- rool/rails/typo/trunk/test/unit/content_state/factory_test.rb (diff)
- rool/rails/typo/trunk/test/unit/magnolia_test.rb (diff)
- rool/rails/typo/trunk/test/unit/page_test.rb (diff)
- rool/rails/typo/trunk/test/unit/ping_test.rb (diff)
- rool/rails/typo/trunk/test/unit/sidebar_test.rb (diff)
- rool/rails/typo/trunk/test/unit/tag_test.rb (diff)
- rool/rails/typo/trunk/test/unit/text_filter_test.rb (diff)
- rool/rails/typo/trunk/test/unit/theme_test.rb (diff)
- rool/rails/typo/trunk/test/unit/trackback_test.rb (diff)
- rool/rails/typo/trunk/test/unit/user_test.rb (diff)
- rool/rails/typo/trunk/themes/azure/layouts/default.rhtml (diff)
- rool/rails/typo/trunk/themes/risc_os_open/layouts/default.rhtml (diff)
- rool/rails/typo/trunk/themes/scribbish/layouts/default.rhtml (diff)
- rool/rails/typo/trunk/themes/scribbish/stylesheets/content.css (diff)
- rool/rails/typo/trunk/themes/scribbish/views/articles/_article.rhtml (diff)
- rool/rails/typo/trunk/themes/scribbish/views/articles/_comment.rhtml (diff)
- rool/rails/typo/trunk/themes/scribbish/views/articles/_comment_form.rhtml (diff)
- rool/rails/typo/trunk/themes/scribbish/views/articles/_search.rhtml (diff)
- rool/rails/typo/trunk/themes/scribbish/views/articles/comment_preview.rhtml (diff)
- rool/rails/typo/trunk/themes/scribbish/views/articles/index.rhtml (diff)
- rool/rails/typo/trunk/themes/scribbish/views/articles/read.rhtml (diff)
- rool/rails/typo/trunk/vendor/akismet/akismet.rb (diff)
- rool/rails/typo/trunk/vendor/flickr/flickr.rb (diff)
- rool/rails/typo/trunk/vendor/plugins/expiring_action_cache/lib/actionparamcache.rb (diff)
rool/rails/typo/trunk/MAINTAINERS:
prev. | current | |
blog: http://kevin.sb.org | ||
irc: Eridius | ||
24 | ||
25 | ||
26 | ||
27 | ||
28 | ||
29 | ||
30 | ||
24 | Frédéric de Villamil <frederic@de-villamil.com> | |
25 | blog: http://fredericdevillamil.com | |
26 | irc: neuro` |
rool/rails/typo/trunk/README:
prev. | current | |
Currently you need all of those things to get typo to run: | ||
* Ruby 1.8.4 or higher | ||
16 | | |
16 | * Rails 1.2.x | |
* A database. Typo supports MySQL, PostgreSQL, and SQLite. | ||
* Ruby drivers for your database. | ||
* For best performance, you should have a web server running either |
rool/rails/typo/trunk/Rakefile:
prev. | current | |
require 'rake/testtask' | ||
require 'rake/rdoctask' | ||
10 | ||
11 | require 'tasks/rails' |
rool/rails/typo/trunk/app/apis/blogger_service.rb:
prev. | current | |
:lastname => "", | ||
:nickname => username, | ||
:email => "", | ||
58 | | |
58 | :url => this_blog.base_url | |
) | ||
end | ||
def getUsersBlogs(appkey, username, password) | ||
[BloggerStructs::Blog.new( | ||
64 | | |
65 | | |
64 | :url => this_blog.base_url, | |
65 | :blogid => this_blog.id, | |
:blogName => this_blog.blog_name | ||
)] | ||
end |
rool/rails/typo/trunk/app/apis/meta_weblog_service.rb:
prev. | current | |
resource = Resource.create(:filename => data['name'], :mime => data['type'], :created_at => Time.now) | ||
resource.write_to_disk(data['bits']) | ||
152 | | |
152 | MetaWeblogStructs::Url.new("url" => this_blog.file_url(resource.filename)) | |
end | ||
def article_dto_from(article) | ||
... | ... | |
:description => article.body, | ||
:title => article.title, | ||
:postid => article.id.to_s, | ||
160 | | |
161 | | |
162 | | |
160 | :url => article.permalink_url(only_path=false), | |
161 | :link => article.permalink_url(only_path=false), | |
162 | :permaLink => article.permalink_url(only_path=false), | |
:categories => article.categories.collect { |c| c.name }, | ||
:mt_text_more => article.extended.to_s, | ||
:mt_excerpt => article.excerpt.to_s, | ||
... | ... | |
protected | ||
177 | | |
178 | | |
179 | | |
180 | | |
181 | | |
182 | | |
183 | | |
184 | | |
185 | | |
186 | | |
187 | | |
188 | | |
189 | ||
190 | | |
191 | | |
192 | | |
193 | ||
def pub_date(time) | ||
time.strftime "%a, %e %b %Y %H:%M:%S %Z" | ||
end |
rool/rails/typo/trunk/app/apis/movable_type_service.rb:
prev. | current | |
end | ||
def getCategoryList(blogid, username, password) | ||
87 | | |
87 | Category.find(:all).collect do |c| | |
MovableTypeStructs::CategoryList.new( | ||
:categoryId => c.id, | ||
:categoryName => c.name | ||
... | ... | |
end | ||
def getPostCategories(postid, username, password) | ||
96 | | |
96 | this_blog.articles.find(postid).categorizations.collect do |c| | |
MovableTypeStructs::CategoryPerPost.new( | ||
98 | | |
99 | | |
98 | :categoryName => c.category.name, | |
99 | :categoryId => c.category_id.to_i, | |
:isPrimary => c.is_primary.to_i | ||
) | ||
end | ||
... | ... | |
for c in categories | ||
category = Category.find(c['categoryId']) | ||
111 | | |
111 | article.categories.push_with_attributes(category, :is_primary => c['isPrimary'] || 0) | |
end | ||
article.save | ||
end |
rool/rails/typo/trunk/app/controllers/accounts_controller.rb:
prev. | current | |
end | ||
def signup | ||
22 | | |
22 | unless User.count.zero? | |
23 | redirect_to :action => 'login' | |
24 | return | |
25 | end | |
@user = User.new(params[:user]) | ||
rool/rails/typo/trunk/app/controllers/admin/blacklist_controller.rb:
prev. | current | |
end | ||
def list | ||
8 | | |
8 | @blacklist_patterns = BlacklistPattern.find :all | |
end | ||
def show |
rool/rails/typo/trunk/app/controllers/admin/cache_controller.rb:
prev. | current | |
expire_fragment(/.*/) | ||
flash[:notice] = 'Cache was cleared' | ||
17 | | |
17 | redirect_to :controller => '/admin/general' | |
end | ||
def sweep_html | ||
21 | | |
22 | | |
23 | | |
24 | | |
25 | | |
21 | expire_fragment(/^contents_html.*/) | |
flash[:notice] = 'HTML was cleared' | ||
28 | | |
24 | redirect_to :controller => '/admin/general' | |
end | ||
end |
rool/rails/typo/trunk/app/controllers/admin/comments_controller.rb:
prev. | current | |
if request.post? and @comment.save | ||
# We should probably wave a spam filter over this, but for now, just mark it as published. | ||
23 | | |
23 | @comment.mark_as_ham! | |
flash[:notice] = 'Comment was successfully created.' | ||
redirect_to :action => 'show', :id => @comment.id | ||
end |
rool/rails/typo/trunk/app/controllers/admin/content_controller.rb:
prev. | current | |
1 | require 'base64' | |
2 | ||
class Admin::ContentController < Admin::BaseController | ||
def index | ||
list | ||
... | ... | |
end | ||
def list | ||
8 | | |
9 | | |
10 | | |
11 | | |
10 | now = Time.now | |
11 | count = this_blog.articles.count | |
12 | @articles_pages = Paginator.new(self, count, 15, params[:id]) | |
13 | @articles = this_blog.articles.find(:all, :limit => 15, :order => 'id DESC', | |
14 | :offset => @articles_pages.current.offset) | |
setup_categories | ||
@article = this_blog.articles.build(params[:article]) | ||
end | ||
def show | ||
17 | | |
20 | @article = this_blog.articles.find(params[:id]) | |
setup_categories | ||
@resources = Resource.find(:all, :order => 'created_at DESC') | ||
end | ||
... | ... | |
def edit; new_or_edit; end | ||
def destroy | ||
26 | | |
29 | @article = this_blog.articles.find(params[:id]) | |
if request.post? | ||
@article.destroy | ||
redirect_to :action => 'list' | ||
... | ... | |
end | ||
def category_add; do_add_or_remove_fu; end | ||
34 | | |
alias_method :resource_add, :category_add | ||
alias_method :resource_remove, :category_add | ||
40 | def category_remove | |
41 | @article = this_blog.articles.find(params[:id]) | |
42 | @category = @article.categories.find(params['category_id']) | |
43 | setup_categories | |
44 | @article.categorizations.delete(@article.categorizations.find_by_category_id(params['category_id'])) | |
45 | @article.save | |
46 | render :partial => 'show_categories' | |
47 | end | |
48 | ||
def preview | ||
39 | | |
40 | | |
41 | | |
50 | headers["Content-Type"] = "text/html; charset=utf-8" | |
51 | @article = this_blog.articles.build | |
52 | @article.attributes = params[:article] | |
53 | set_article_author | |
54 | data = render_to_string(:layout => "minimal") | |
55 | data = Base64.encode64(data).gsub("\n", '') | |
56 | data = "data:text/html;charset=utf-8;base64,#{data}" | |
57 | render :text => data | |
end | ||
def attachment_box_add | ||
45 | | |
61 | render :update do |page| | |
62 | page["attachment_add_#{params[:id]}"].remove | |
63 | page.insert_html :bottom, 'attachments', | |
64 | :partial => 'admin/content/attachment', | |
65 | :locals => { :attachment_num => params[:id], :hidden => true } | |
66 | page.visual_effect(:toggle_appear, "attachment_#{params[:id]}") | |
67 | end | |
end | ||
48 | | |
49 | | |
50 | | |
51 | ||
def attachment_save(attachment) | ||
begin | ||
Resource.create(:filename => attachment.original_filename, | ||
... | ... | |
def do_add_or_remove_fu | ||
attrib, action = params[:action].split('_') | ||
68 | | |
86 | @article = this_blog.articles.find(params[:id]) | |
self.send("#{attrib}=", self.class.const_get(attrib.classify).find(params["#{attrib}_id"])) | ||
send("setup_#{attrib.pluralize}") | ||
@article.send(attrib.pluralize).send(real_action_for(action), send(attrib)) | ||
... | ... | |
def new_or_edit | ||
get_or_build_article | ||
params[:article] ||= {} | ||
81 | ||
82 | ||
83 | ||
84 | | |
99 | ||
100 | @article.attributes = params[:article] | |
setup_categories | ||
@selected = @article.categories.collect { |c| c.id } | ||
if request.post? | ||
... | ... | |
end | ||
def set_article_categories | ||
124 | | |
125 | | |
140 | @article.categorizations.clear | |
141 | if params[:categories] | |
142 | Category.find(params[:categories]).each do |cat| | |
143 | @article.categories << cat | |
144 | end | |
145 | end | |
@selected = params[:categories] || [] | ||
end | ||
def get_or_build_article | ||
@article = case params[:action] | ||
when 'new' | ||
132 | | |
133 | | |
134 | | |
135 | | |
136 | | |
152 | returning(this_blog.articles.build) do |art| | |
153 | art.allow_comments = this_blog.default_allow_comments | |
154 | art.allow_pings = this_blog.default_allow_pings | |
155 | art.published = true | |
156 | end | |
when 'edit' | ||
this_blog.articles.find(params[:id]) | ||
else |
rool/rails/typo/trunk/app/controllers/admin/feedback_controller.rb:
prev. | current | |
1 | require 'comment' | |
2 | require 'trackback' | |
3 | ||
class Admin::FeedbackController < Admin::BaseController | ||
5 | ||
def index | ||
3 | | |
7 | conditions = ['blog_id = :blog_id', {:blog_id => Blog.default.id}] | |
if params[:search] | ||
6 | | |
7 | | |
8 | | |
10 | conditions.first << ' and (url like :pattern or author like :pattern or title like :pattern or ip like :pattern or email like :pattern)' | |
11 | conditions.last.merge!(:pattern => "%#{params[:search]}%") | |
end | ||
if params[:published] == 'f' | ||
12 | | |
13 | | |
15 | conditions.first << ' and (published = :published)' | |
16 | conditions.last.merge!(:published => false) | |
end | ||
16 | | |
17 | | |
19 | if params[:confirmed] == 'f' | |
20 | conditions.first << ' AND (status_confirmed = :status_confirmed)' | |
21 | conditions.last.merge!(:status_confirmed => false) | |
22 | end | |
23 | ||
24 | @pages, @feedback = paginate(:feedback, | |
25 | :order => 'feedback.created_at desc', | |
:conditions => conditions, | ||
:per_page => 40) | ||
20 | | |
28 | ||
render_action 'list' | ||
end | ||
23 | | |
31 | ||
def delete | ||
if request.post? | ||
26 | | |
27 | | |
28 | | |
34 | begin | |
35 | Feedback.destroy(params[:id]) | |
flash[:notice] = "Deleted" | ||
30 | | |
37 | rescue ActiveRecord::RecordNotFound | |
flash[:notice] = "Not found" | ||
end | ||
end | ||
redirect_to :action => 'index', :page => params[:page], :search => params[:search] | ||
end | ||
36 | | |
43 | ||
def bulkops | ||
38 | | |
39 | | |
ids = (params[:feedback_check]||{}).keys.map(&:to_i) | ||
41 | | |
46 | ||
case params[:commit] | ||
when 'Delete Checked Items' | ||
count = 0 | ||
ids.each do |id| | ||
46 | | |
51 | count += Feedback.delete(id) ## XXX Should this be #destroy? | |
end | ||
flash[:notice] = "Deleted #{count} item(s)" | ||
49 | | |
54 | ||
55 | # Sweep cache | |
56 | PageCache.sweep_all | |
57 | expire_fragment(/.*/) | |
58 | when 'Mark Checked Items as Ham' | |
ids.each do |id| | ||
51 | | |
52 | | |
53 | | |
54 | | |
60 | feedback = Feedback.find(id) | |
61 | feedback.mark_as_ham! | |
end | ||
56 | | |
57 | | |
63 | flash[:notice]= "Marked #{ids.size} item(s) as Ham" | |
64 | when 'Mark Checked Items as Spam' | |
ids.each do |id| | ||
59 | | |
60 | | |
61 | | |
62 | | |
66 | feedback = Feedback.find(id) | |
67 | feedback.mark_as_spam! | |
end | ||
64 | | |
69 | flash[:notice]= "Marked #{ids.size} item(s) as Spam" | |
70 | when 'Confirm Classification of Checked Items' | |
71 | ids.each do |id| | |
72 | Feedback.find(id).confirm_classification! | |
73 | end | |
74 | flash[:notice] = "Confirmed classification of #{ids.size} item(s)" | |
else | ||
flash[:notice] = "Not implemented" | ||
end |
rool/rails/typo/trunk/app/controllers/admin/general_controller.rb:
prev. | current | |
class Admin::GeneralController < Admin::BaseController | ||
def index | ||
3 | | |
4 | | |
3 | if this_blog.base_url.blank? | |
4 | this_blog.base_url = blog_base_url | |
end | ||
@page_cache_size = PageCache.count | ||
end | ||
... | ... | |
def update | ||
if request.post? | ||
Blog.transaction do | ||
33 | | |
33 | params[:setting].each { |k,v| this_blog.send("#{k.to_s}=", v) } | |
this_blog.save | ||
flash[:notice] = 'config updated.' | ||
end |
rool/rails/typo/trunk/app/controllers/admin/pages_controller.rb:
prev. | current | |
1 | require 'base64' | |
2 | ||
class Admin::PagesController < Admin::BaseController | ||
def index | ||
list | ||
... | ... | |
end | ||
def preview | ||
45 | | |
47 | headers["Content-Type"] = "text/html; charset=utf-8" | |
@page = this_blog.pages.build(params[:page]) | ||
47 | | |
49 | data = render_to_string(:layout => "minimal") | |
50 | data = Base64.encode64(data).gsub("\n", '') | |
51 | data = "data:text/html;charset=utf-8;base64,#{data}" | |
52 | render :text => data | |
end | ||
49 | ||
end |
rool/rails/typo/trunk/app/controllers/admin/sidebar_controller.rb:
prev. | current | |
class Admin::SidebarController < Admin::BaseController | ||
def index | ||
3 | | |
4 | | |
5 | | |
3 | @available = available | |
# Reset the staged position based on the active position. | ||
7 | | |
8 | | |
9 | | |
10 | | |
5 | Sidebar.delete_all(['blog_id = ? and active_position is null', | |
6 | this_blog.id]) | |
7 | @active = this_blog.sidebars | |
flash[:sidebars] = @active.map {|sb| sb.id } | ||
12 | | |
end | ||
def set_active | ||
# Get all available plugins | ||
18 | | |
19 | | |
14 | klass_for = available.inject({}) do |hash, klass| | |
15 | hash.merge({ klass.short_name => klass }) | |
end | ||
# Get all already active plugins | ||
activemap = flash[:sidebars].inject({}) do |h, sb_id| | ||
sb = Sidebar.find(sb_id.to_i) | ||
24 | | |
20 | sb ? h.merge(sb.html_id => sb_id) : h | |
end | ||
# Figure out which plugins are referenced by the params[:active] array and | ||
# lay them out in a easy accessible sequential array | ||
flash[:sidebars] = params[:active].inject([]) do |array, name| | ||
30 | | |
31 | | |
32 | | |
26 | if klass_for.has_key?(name) | |
27 | @new_item = klass_for[name].create!(:blog => this_blog) | |
@target = name | ||
array << @new_item.id | ||
elsif activemap.has_key?(name) | ||
... | ... | |
def publish | ||
Sidebar.transaction do | ||
position = 0 | ||
53 | | |
54 | | |
48 | params[:configure] ||= { } | |
49 | this_blog.sidebars.update_all('active_position = null') | |
flash[:sidebars].each do |id| | ||
56 | | |
57 | | |
51 | sidebar = Sidebar.find(id) | |
52 | sb_attribs = params[:configure][id.to_s] || {} | |
53 | # If it's a checkbox and unchecked, convert the 0 to false | |
54 | # This is ugly. Anyone have an improvement? | |
55 | sidebar.fields.each do |field| | |
56 | sb_attribs[field.key] = field.canonicalize(sb_attribs[field.key]) | |
57 | end | |
58 | ||
59 | sidebar.update_attributes(:config => sb_attribs, | |
60 | :active_position => position) | |
position += 1 | ||
end | ||
60 | | |
63 | Sidebar.delete_all(['blog_id = ? and active_position is null', | |
64 | this_blog.id]) | |
end | ||
index | ||
end | ||
... | ... | |
end | ||
def available | ||
71 | | |
75 | ::Sidebar.available_sidebars | |
end | ||
helper_method :available | ||
end |
rool/rails/typo/trunk/app/controllers/admin/textfilters_controller.rb:
prev. | current | |
end | ||
def preview | ||
75 | | |
75 | headers["Content-Type"] = "text/html; charset=utf-8" | |
@textfilter = params[:textfilter] | ||
render :layout => false | ||
end | ||
... | ... | |
@filterparams = Hash.new | ||
@filterdescriptions = Hash.new | ||
@filterhelp = Hash.new | ||
93 | @filteroptions = Hash.new | |
(types['macropre']+types['macropost']+types['postprocess']).each do |f| | ||
f.default_config.each do |key,value| | ||
@filterparams[key] = value[:default] | ||
@filterdescriptions[key] = value[:description] | ||
@filterhelp[key] = value[:help] | ||
100 | @filteroptions[key] = value[:options] | |
end | ||
end | ||
rool/rails/typo/trunk/app/controllers/admin/themes_controller.rb:
prev. | current | |
def index | ||
@themes = Theme.find_all | ||
@themes.each do |theme| | ||
6 | | |
6 | theme.description_html = TextFilter.filter_text(this_blog, theme.description, nil, [:markdown,:smartypants]) | |
end | ||
@active = this_blog.current_theme | ||
end |
rool/rails/typo/trunk/app/controllers/admin/users_controller.rb:
prev. | current | |
end | ||
def list | ||
9 | | |
9 | @users = User.find :all | |
end | ||
def show | ||
13 | | |
13 | @user = User.find(params[:id], :include => [ :articles ]) | |
14 | @articles = @user.articles | |
end | ||
def new |
rool/rails/typo/trunk/app/controllers/application.rb:
prev. | current | |
# Standard Typo gubbins follows, including its own admin login system. | ||
include LoginSystem | ||
15 | before_filter :reset_local_cache, :fire_triggers | |
16 | after_filter :reset_local_cache | |
16 | | |
17 | | |
18 | | |
18 | # Extra filter to prime URL writing so that it doesn't make invalid | |
19 | # assumptions about protocol or port | |
20 | | |
21 | before_filter :prime_url_writer | |
protected | ||
25 | def prime_url_writer | |
26 | $url_writer_request_information = request; | |
27 | end | |
28 | ||
def fire_triggers | ||
Trigger.fire | ||
end | ||
28 | | |
29 | | |
30 | | |
31 | | |
32 | | |
33 | | |
34 | | |
33 | def reset_local_cache | |
34 | CachedModel.cache_reset | |
35 | session[:user].reload if session[:user] | |
end | ||
37 | | |
38 | | |
39 | | |
40 | ||
38 | # Axe? | |
def server_url | ||
42 | | |
40 | this_blog.base_url | |
end | ||
def cache | ||
$cache ||= SimpleCache.new 1.hour | ||
end | ||
49 | | |
50 | | |
51 | | |
52 | | |
47 | @@blog_id_for = Hash.new | |
54 | | |
55 | | |
56 | | |
57 | | |
58 | ||
49 | # The Blog object for the blog that matches the current request. This is looked | |
50 | # up using Blog.find_blog and cached for the lifetime of the controller instance; | |
51 | # generally one request. | |
def this_blog | ||
60 | | |
53 | @blog ||= if @@blog_id_for[blog_base_url] | |
54 | Blog.find(@@blog_id_for[blog_base_url]) | |
55 | else | |
56 | returning(Blog.find_blog(blog_base_url)) do |blog| | |
57 | @@blog_id_for[blog_base_url] = blog.id | |
58 | end | |
59 | end | |
end | ||
helper_method :this_blog | ||
63 | # The base URL for this request, calculated by looking up the URL for the main | |
64 | # blog index page. This is matched with Blog#base_url to determine which Blog | |
65 | # is supposed to handle this URL | |
66 | def blog_base_url | |
67 | url_for(:controller => '/articles').gsub(%r{/$},'') | |
68 | end | |
69 | ||
def self.include_protected(*modules) | ||
modules.reverse.each do |mod| | ||
included_methods = mod.public_instance_methods.reject do |meth| |
rool/rails/typo/trunk/app/controllers/articles_controller.rb:
prev. | current | |
class ArticlesController < ContentController | ||
2 | ||
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
14 | | |
15 | | |
16 | | |
17 | | |
18 | | |
19 | ||
before_filter :verify_config | ||
layout :theme_layout, :except => [:comment_preview, :trackback] | ||
cache_sweeper :blog_sweeper | ||
26 | | |
8 | cached_pages = [:index, :read, :permalink, :category, :find_by_date, :archives, :view_page, :tag, :author] | |
# If you're really memory-constrained, then consider replacing | ||
# caches_action_with_params with caches_page | ||
caches_action_with_params *cached_pages | ||
30 | | |
12 | session :new_session => false | |
verify(:only => [:nuke_comment, :nuke_trackback], | ||
:session => :user, :method => :post, | ||
:render => { :text => 'Forbidden', :status => 403 }) | ||
18 | @@hubssolib_permissions = HubSsoLib::Permissions.new({ | |
19 | :read_and_comment => [ :admin, :webmaster, :privileged, :normal ] | |
20 | }) | |
21 | ||
22 | def ArticlesController.hubssolib_permissions | |
23 | @@hubssolib_permissions | |
24 | end | |
25 | ||
def index | ||
# On Postgresql, paginate's default count is *SLOW*, because it does a join against | ||
# all of the eager-loaded tables. I've seen it take up to 7 seconds on my test box. | ||
# | ||
# So, we're going to use the older Paginator class and manually provide a count. | ||
# This is a 100x speedup on my box. | ||
42 | | |
43 | | |
44 | | |
45 | | |
46 | | |
47 | | |
48 | | |
49 | | |
50 | | |
51 | | |
52 | | |
53 | | |
32 | now = Time.now | |
33 | count = this_blog.articles.count(:conditions => ['published = ? AND contents.published_at < ?', | |
34 | true, now]) | |
35 | @pages = Paginator.new self, count, this_blog.limit_article_display, params[:page] | |
36 | @articles = this_blog.published_articles.find( :all, | |
37 | :offset => @pages.current.offset, | |
38 | :limit => @pages.items_per_page, | |
39 | :conditions => ['contents.published_at < ?', now] ) | |
end | ||
def search | ||
... | ... | |
display_article { this_blog.published_articles.find(params[:id]) } | ||
end | ||
66 | def read_and_comment | |
67 | display_article(nil, 'read_and_comment') { | |
68 | this_blog.published_articles.find(params[:id]) | |
69 | } | |
70 | end | |
71 | ||
def permalink | ||
display_article(this_blog.published_articles.find_by_permalink(*params.values_at(:year, :month, :day, :title))) | ||
end | ||
... | ... | |
# Receive comments to articles | ||
def comment | ||
108 | | |
100 | unless request.xhr? || this_blog.sp_allow_non_ajax_comments | |
render_error("non-ajax commenting is disabled") | ||
return | ||
end | ||
113 | | |
114 | | |
115 | | |
116 | ||
unless hubssolib_logged_in? | ||
render_error("You are not logged in; you cannot comment on articles") | ||
return | ||
... | ... | |
if request.post? | ||
begin | ||
124 | | |
125 | | |
@article = this_blog.published_articles.find(params[:id]) | ||
113 | params[:comment].merge!({:ip => request.remote_ip, | |
114 | :published => true, | |
115 | :user => session[:user], | |
116 | :user_agent => request.env['HTTP_USER_AGENT'], | |
117 | :referrer => request.env['HTTP_REFERER'], | |
118 | :permalink => @article.permalink_url}) | |
@comment = @article.comments.build(params[:comment]) | ||
128 | | |
129 | ||
130 | | |
131 | | |
132 | | |
133 | | |
134 | ||
135 | | |
136 | | |
137 | | |
138 | | |
139 | ||
120 | @comment.author ||= 'Anonymous' | |
@comment.save! | ||
141 | ||
122 | add_to_cookies(:typoapp_author, @comment.author) | |
add_to_cookies(:typoapp_url, @comment.url) | ||
143 | | |
set_headers | ||
render :partial => "comment", :object => @comment | ||
... | ... | |
end | ||
end | ||
218 | | |
198 | def display_article(article = nil, action = 'read') | |
begin | ||
@article = block_given? ? yield : article | ||
@comment = Comment.new | ||
@page_title = @article.title | ||
auto_discovery_feed :type => 'article', :id => @article.id | ||
224 | | |
204 | render :action => action | |
rescue ActiveRecord::RecordNotFound, NoMethodError => e | ||
error("Post not found...") | ||
end | ||
... | ... | |
end | ||
def set_headers | ||
237 | | |
217 | headers["Content-Type"] = "text/html; charset=utf-8" | |
end | ||
def list_groupings(klass) | ||
... | ... | |
def render_grouping(klass) | ||
return list_groupings(klass) unless params[:id] | ||
249 | | |
229 | @page_title = "#{klass.to_s.underscore} #{params[:id]}" | |
@articles = klass.find_by_permalink(params[:id]).articles.find_already_published rescue [] | ||
auto_discovery_feed :type => klass.to_s.underscore, :id => params[:id] | ||
render_paginated_index("Can't find posts with #{klass.to_prefix} '#{h(params[:id])}'") | ||
... | ... | |
def render_paginated_index(on_empty = "No posts found...") | ||
return error(on_empty) if @articles.empty? | ||
258 | | |
238 | @pages = Paginator.new self, @articles.size, this_blog.limit_article_display, params[:page] | |
start = @pages.current.offset | ||
stop = (@pages.current.next.offset - 1) rescue @articles.size | ||
# Why won't this work? @articles.slice!(start..stop) |
rool/rails/typo/trunk/app/controllers/backend_controller.rb:
prev. | current | |
session :off | ||
web_service_dispatching_mode :layered | ||
6 | web_service_exception_reporting false | |
7 | ||
web_service(:metaWeblog) { MetaWeblogService.new(self) } | ||
web_service(:mt) { MovableTypeService.new(self) } | ||
web_service(:blogger) { BloggerService.new(self) } |
rool/rails/typo/trunk/app/controllers/content_controller.rb:
prev. | current | |
end | ||
include LoginSystem | ||
22 | | |
22 | # model :user | |
helper :theme | ||
before_filter :auto_discovery_defaults | ||
... | ... | |
def auto_discovery_defaults | ||
@auto_discovery_url_rss = | ||
51 | | |
51 | request.instance_variable_get(:@auto_discovery_url_rss) | |
@auto_discovery_url_atom = | ||
53 | | |
53 | request.instance_variable_get(:@auto_discovery_url_atom) | |
unless @auto_discovery_url_rss && @auto_discovery_url_atom | ||
auto_discovery_feed(:type => 'feed') | ||
56 | | |
57 | | |
58 | | |
59 | | |
56 | request.instance_variable_set(:@auto_discovery_url_rss, | |
57 | @auto_discovery_url_rss) | |
58 | request.instance_variable_set(:@auto_discovery_url_atom, | |
59 | @auto_discovery_url_atom) | |
end | ||
end | ||
rool/rails/typo/trunk/app/controllers/live_controller.rb:
prev. | current | |
def search | ||
@search = params[:q] | ||
@articles = Article.search(@search) | ||
7 | | |
7 | headers["Content-Type"] = "text/html; charset=utf-8" | |
end | ||
end |
rool/rails/typo/trunk/app/controllers/redirect_controller.rb:
prev. | current | |
class RedirectController < ContentController | ||
2 | session :off | |
3 | ||
def redirect | ||
r = Redirect.find_by_from_path(params[:from]) | ||
... | ... | |
path = url_root + path unless url_root.nil? or path[0,url_root.length] == url_root | ||
redirect_to path | ||
else | ||
13 | | |
15 | render :text => "Page not found", :status => 404 | |
end | ||
end | ||
end |
rool/rails/typo/trunk/app/controllers/textfilter_controller.rb:
prev. | current | |
end | ||
end | ||
20 | ||
21 | | |
22 |
rool/rails/typo/trunk/app/controllers/theme_controller.rb:
prev. | current | |
session :off | ||
def stylesheets | ||
6 | | |
6 | render_theme_item(:stylesheets, params[:filename], 'text/css; charset=utf-8') | |
end | ||
def javascript | ||
10 | | |
10 | render_theme_item(:javascript, params[:filename], 'text/javascript; charset=utf-8') | |
end | ||
def images | ||
... | ... | |
private | ||
26 | | |
27 | | |
28 | | |
26 | def render_theme_item(type, file, mime = nil) | |
27 | mime ||= mime_for(file) | |
28 | if file.split(%r{[\\/]}).include?("..") | |
29 | render :text => "Not Found", :status => 404 | |
30 | return | |
31 | end | |
32 | send_file(this_blog.current_theme.path + "/#{type}/#{file}", | |
33 | :type => mime, :disposition => 'inline', :stream => false) | |
end | ||
def mime_for(filename) |
rool/rails/typo/trunk/app/controllers/xml_controller.rb:
prev. | current | |
def feed | ||
@items = Array.new | ||
@format = params[:format] | ||
17 | @blog = this_blog | |
if @format == 'atom03' | ||
19 | | |
20 | headers["Status"] = "301 Moved Permanently" | |
return redirect_to(:format=>'atom') | ||
end | ||
@feed_title = this_blog.blog_name | ||
24 | | |
25 | @link = this_blog.base_url | |
@format = NORMALIZED_FORMAT_FOR[@format] | ||
... | ... | |
return | ||
end | ||
33 | | |
34 | headers["Content-Type"] = "#{CONTENT_TYPE_FOR[@format]}; charset=utf-8" | |
if respond_to?("prep_#{params[:type]}") | ||
self.send("prep_#{params[:type]}") | ||
... | ... | |
protected | ||
68 | | |
69 | def fetch_items(association, order='published_at DESC', limit=nil) | |
if association.instance_of?(Symbol) | ||
association = this_blog.send(association) | ||
end | ||
... | ... | |
def prep_article | ||
article = this_blog.articles.find(params[:id]) | ||
92 | | |
93 | fetch_items(article.comments, 'published_at DESC', 25) | |
@items.unshift(article) | ||
@feed_title << ": #{article.title}" | ||
95 | | |
96 | @link = article.permalink_url | |
end | ||
def prep_category | ||
category = Category.find_by_permalink(params[:id]) | ||
fetch_items(category.articles) | ||
@feed_title << ": Category #{category.name}" | ||
102 | | |
103 | | |
103 | @link = category.permalink_url | |
end | ||
def prep_tag | ||
tag = Tag.find_by_name(params[:id]) | ||
fetch_items(tag.articles) | ||
@feed_title << ": Tag #{tag.display_name}" | ||
110 | | |
111 | | |
110 | @link = tag.permalink_url | |
end | ||
def prep_sitemap | ||
... | ... | |
@items += Category.find_all_with_article_counters(1000) | ||
@items += Tag.find_all_with_article_counters(1000) | ||
end | ||
120 | ||
end |
rool/rails/typo/trunk/app/helpers/admin/base_helper.rb:
prev. | current | |
module Admin::BaseHelper | ||
2 | include ActionView::Helpers::DateHelper | |
4 | def state_class(item) | |
5 | item.state.memento.underscore.sub(/.*\//, '') | |
6 | end | |
7 | ||
def render_flash | ||
output = [] | ||
... | ... | |
output = [] | ||
for key,value in @tasks | ||
17 | | |
18 | | |
22 | output << "<a href=\"#{value}\">#{key}</a>" | |
23 | end if @tasks | |
20 | | |
25 | output.join("<br />\n") | |
end | ||
def current_user_notice | ||
... | ... | |
def tab(label, options = {}) | ||
if controller.controller_name =~ /#{options[:controller].split('/').last}/ | ||
33 | | |
38 | content_tag :li, link_to(label, options, {"class"=> ""}), {"class"=> ""} | |
else | ||
content_tag :li, link_to(label, options) | ||
end | ||
... | ... | |
end | ||
def link_to_show(record) | ||
52 | | |
57 | link_to image_tag('go.png'), :action => 'show', :id => record.id | |
end | ||
def link_to_edit(record) | ||
56 | | |
61 | link_to image_tag('edit.png', :alt => "edit", :title => "Edit content"), :action => 'edit', :id => record.id | |
end | ||
def link_to_destroy(record) | ||
60 | | |
65 | link_to image_tag('delete.png', :alt => "delete", :title => "Delete content"), :action => 'destroy', :id => record.id | |
end | ||
def text_filter_options | ||
... | ... | |
def task_edit_resource_mime(title,id) | ||
link_to_function(title, toggle_effect('edit-resource-mime-' + id.to_s, 'Effect.BlindUp', "duration:0.4", "Effect.BlindDown", "duration:0.4")) | ||
end | ||
129 | ||
130 | def time_delta_from_now_in_words(timestamp) | |
131 | distance_of_time_in_words_to_now(timestamp) + ((Time.now < timestamp) ? ' from now' : ' ago') | |
132 | end | |
end |
rool/rails/typo/trunk/app/helpers/admin/content_helper.rb:
prev. | current | |
module Admin::ContentHelper | ||
2 | include ArticlesHelper | |
3 | ||
4 | def contents | |
5 | [@article] | |
6 | end | |
7 | ||
end |
rool/rails/typo/trunk/app/helpers/admin/feedback_helper.rb:
prev. | current | |
module Admin::FeedbackHelper | ||
def link_to_article_edit(article) | ||
3 | | |
3 | link_to truncate(article.title, 60), :controller => '/admin/content', :action => 'edit', :id => article.id | |
end | ||
5 | | |
5 | ||
def task_showmod(title) | ||
7 | | |
8 | | |
7 | content_tag :li, | |
8 | link_to(title, :published => (title =~ /spam/ ? 'f' : ''), | |
9 | :confirmed => (title =~ /unconfirmed/ ? 'f' : ''), | |
10 | :search => params[:search]) | |
11 | end | |
end |
rool/rails/typo/trunk/app/helpers/admin/pages_helper.rb:
prev. | current | |
module Admin::PagesHelper | ||
2 | include ArticlesHelper | |
3 | ||
4 | def contents | |
5 | [@page] | |
6 | end | |
end |
rool/rails/typo/trunk/app/helpers/application_helper.rb:
prev. | current | |
require 'digest/sha1' | ||
module ApplicationHelper | ||
5 | | |
6 | | |
7 | | |
5 | # Override the default ActionController#url_for. | |
6 | def url_for(options = { }) | |
7 | # this_blog.url_for doesn't do relative URLs. | |
8 | # if options.kind_of? Hash | |
9 | # unless options[:controller] | |
10 | # options[:controller] = params[:controller] | |
11 | # end | |
12 | # end | |
9 | | |
10 | | |
14 | # this_blog.url_for(options) | |
15 | super(options) | |
end | ||
13 | | |
14 | | |
15 | | |
16 | ||
17 | | |
18 | | |
19 | | |
20 | ||
21 | | |
22 | | |
23 | | |
24 | ||
25 | | |
26 | | |
27 | | |
28 | ||
29 | | |
30 | | |
31 | | |
32 | | |
33 | ||
18 | # Basic english pluralizer. | |
19 | # Axe? | |
def pluralize(size, word) | ||
case size | ||
36 | | |
22 | when 0 then "no #{word.pluralize}" | |
when 1 then "1 #{word}" | ||
38 | | |
24 | else "#{size} #{word.pluralize}" | |
end | ||
end | ||
28 | # Produce a link to the permalink_url of 'item'. | |
29 | def link_to_permalink(item, title, anchor=nil) | |
30 | anchor = "##{anchor}" if anchor | |
31 | "<a href=\"#{item.permalink_url}#{anchor}\">#{title}</a>" | |
32 | end | |
33 | ||
34 | # The '5 comments' link from the bottom of articles | |
def comments_link(article) | ||
43 | | |
44 | | |
36 | link_to_permalink(article,pluralize(article.published_comments.size, 'comment'),'comments') | |
end | ||
def trackbacks_link(article) | ||
48 | | |
49 | | |
40 | link_to_permalink(article,pluralize(article.published_trackbacks.size, 'trackback'),'trackbacks') | |
end | ||
def check_cache(aggregator, *args) | ||
... | ... | |
end | ||
def js_distance_of_time_in_words_to_now(date) | ||
58 | | |
59 | | |
49 | if date | |
50 | time = date.utc.strftime("%a, %d %b %Y %H:%M:%S GMT") | |
51 | else | |
52 | time = Time.now | |
53 | end | |
54 | "<span class=\"typo_date\" title=\"#{time}\">#{time}</span>" | |
end | ||
def meta_tag(name, value) | ||
... | ... | |
"$('#{domid}').style.display == 'none' ? new #{false_effect}('#{domid}', {#{false_opts}}) : new #{true_effect}('#{domid}', {#{true_opts}}); return false;" | ||
end | ||
74 | def markup_help_popup(markup, text) | |
75 | if markup and markup.commenthelp.size > 1 | |
76 | "<a href=\"#{url_for :controller => '/articles', :action => 'markup_help', :id => markup.id}\" onclick=\"return popup(this, 'Typo Markup Help')\">#{text}</a>" | |
77 | else | |
78 | '' | |
79 | end | |
80 | end | |
81 | ||
82 | # Deprecated helpers | |
83 | def server_url_for(options={}) | |
84 | typo_deprecated "Use url_for instead" | |
85 | url_for(options) | |
86 | end | |
87 | ||
88 | def config_value(name) | |
89 | typo_deprecated "Use this_blog.#{name} instead." | |
90 | this_blog.send(name) | |
91 | end | |
92 | ||
93 | def config | |
94 | typo_deprecated "Use this_blog.configname instead of config[:configname]" | |
95 | raise "Unimplemented" | |
96 | end | |
97 | ||
98 | def item_link(title, item, anchor=nil) | |
99 | typo_deprecated "Use link_to_permalink instead of item_link" | |
100 | link_to_permalink(item, title, anchor) | |
101 | end | |
102 | ||
103 | alias_method :article_link, :item_link | |
104 | alias_method :page_link, :item_link | |
105 | alias_method :comment_url_link, :item_link | |
106 | ||
107 | def url_of(item, only_path=true, anchor=nil) | |
108 | typo_deprecated "Use item.permalink_url instead" | |
109 | item.permalink_url | |
110 | end | |
111 | ||
112 | alias_method :trackback_url, :url_of | |
113 | alias_method :comment_url, :url_of | |
114 | alias_method :article_url, :url_of | |
115 | alias_method :page_url, :url_of | |
116 | ||
117 | def html(content, what = :all, deprecated = false) | |
118 | if deprecated | |
119 | msg = "use html(#{content.class.to_s.underscore}" + ((what == :all) ? "" : ", #{what.inspect}") + ")" | |
120 | typo_deprecated(msg) | |
121 | end | |
122 | ||
123 | content.html(what) | |
124 | end | |
125 | ||
def article_html(article, what = :all) | ||
80 | | |
127 | html(article, what, true) | |
end | ||
def comment_html(comment) | ||
84 | | |
131 | html(comment, :body, true) | |
end | ||
def page_html(page) | ||
88 | | |
135 | html(page, :body, true) | |
end | ||
91 | | |
138 | def strip_html(text) | |
139 | typo_deprecated "use text.strip_html" | |
text.strip_html | ||
end | ||
94 | | |
95 | | |
96 | | |
97 | | |
98 | | |
99 | | |
100 | | |
101 | | |
end |
rool/rails/typo/trunk/app/helpers/articles_helper.rb:
prev. | current | |
module ArticlesHelper | ||
2 | include SidebarHelper | |
3 | ||
def admin_tools_for(model) | ||
type = model.class.to_s.downcase | ||
tag = [] | ||
tag << content_tag("div", | ||
link_to_remote('nuke', { | ||
:url => { :action => "nuke_#{type}", :id => model }, | ||
8 | | |
10 | :complete => visual_effect(:puff, "#{type}-I#{model.id}", :duration => 0.6), | |
:confirm => "Are you sure you want to delete this #{type}?" | ||
}, :class => "admintools") << | ||
link_to('edit', { | ||
12 | | |
14 | :controller => "admin/#{type.pluralize}", | |
15 | :article_id => model.article.id, | |
:action => "edit", :id => model | ||
}, :class => "admintools"), | ||
:id => "admin_#{type}_#{model.id}", :style => "display: none") | ||
tag.join(" | ") | ||
end | ||
19 | | |
20 | | |
21 | | |
22 | | |
23 | | |
22 | def onhover_show_admin_tools(type, id = nil) | |
23 | tag = [] | |
24 | tag << %{ onmouseover="if (getCookie('typoapp_is_admin') == 'yes') { Element.show('admin_#{[type, id].compact.join('_')}'); }" } | |
25 | tag << %{ onmouseout="Element.hide('admin_#{[type, id].compact.join('_')}');" } | |
26 | tag | |
end | ||
25 | ||
28 | ||
def render_errors(obj) | ||
return "" unless obj | ||
tag = String.new | ||
... | ... | |
end | ||
def page_title | ||
47 | blog_name = this_blog.blog_name || "Typo" | |
if @page_title | ||
45 | | |
49 | # this is where the page title prefix (string) should go | |
50 | (this_blog.title_prefix == 1 ? blog_name + " : " : '') + @page_title + (this_blog.title_prefix == 2 ? " : " + blog_name : '') | |
else | ||
47 | | |
52 | blog_name | |
end | ||
end | ||
def page_header | ||
52 | | |
57 | page_header_includes = contents.collect { |c| c.whiteboard }.collect do |w| | |
58 | w.select {|k,v| k =~ /^page_header_/}.collect do |(k,v)| | |
59 | v = v.chomp | |
60 | # trim the same number of spaces from the beginning of each line | |
61 | # this way plugins can indent nicely without making ugly source output | |
62 | spaces = /\A[ \t]*/.match(v)[0].gsub(/\t/, " ") | |
63 | v.gsub!(/^#{spaces}/, ' ') # add 2 spaces to line up with the assumed position of the surrounding tags | |
64 | end | |
65 | end.flatten.uniq | |
( | ||
<<-HTML | ||
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||
#{ meta_tag 'ICBM', this_blog.geourl_location unless this_blog.geourl_location.empty? } | ||
57 | | |
70 | <link rel="EditURI" type="application/rsd+xml" title="RSD" href="#{ url_for :controller => 'xml', :action => 'rsd' }" /> | |
<link rel="alternate" type="application/atom+xml" title="Atom" href="#{ @auto_discovery_url_atom }" /> | ||
<link rel="alternate" type="application/rss+xml" title="RSS" href="#{ @auto_discovery_url_rss }" /> | ||
#{ javascript_include_tag "cookies" } | ||
#{ javascript_include_tag "prototype" } | ||
#{ javascript_include_tag "effects" } | ||
#{ javascript_include_tag "typo" } | ||
64 | | |
77 | #{ page_header_includes.join("\n") } | |
<script type="text/javascript">#{ @content_for_script }</script> | ||
HTML | ||
).chomp | ||
... | ... | |
end | ||
def category_links(article) | ||
80 | | |
81 | | |
82 | | |
83 | | |
93 | "Posted in " + article.categories.map { |c| link_to h(c.name), c.permalink_url, :rel => 'tag'}.join(", ") | |
end | ||
def tag_links(article) | ||
87 | | |
88 | | |
89 | | |
90 | | |
97 | "Tags " + article.tags.map { |tag| link_to tag.display_name, tag.permalink_url, :rel => "tag"}.sort.join(", ") | |
end | ||
def author_link(article) | ||
... | ... | |
def next_link(article) | ||
n = article.next | ||
105 | | |
112 | return n ? n.link_to_permalink("#{n.title} »") : '' | |
end | ||
def prev_link(article) | ||
p = article.previous | ||
110 | | |
117 | return p ? n.link_to_permalink("« #{p.title}") : '' | |
end | ||
113 | | |
114 | | |
115 | | |
116 | | |
117 | | |
118 | | |
119 | | |
120 | def render_to_string(*args, &block) | |
121 | controller.send(:render_to_string, *args, &block) | |
end | ||
# Generate the image tag for a commenters gravatar based on their email address | ||
... | ... | |
end | ||
def urlspec_for_grouping(grouping) | ||
146 | | |
148 | { :controller => "/articles", :action => grouping.class.to_prefix, :id => grouping.permalink } | |
end | ||
def title_for_grouping(grouping) | ||
... | ... | |
end | ||
def ul_tag_for(grouping_class) | ||
154 | | |
155 | | |
156 | case | |
157 | when grouping_class == Tag | |
%{<ul id="taglist" class="tags">} | ||
157 | | |
159 | when grouping_class == Category | |
%{<ul class="categorylist">} | ||
else | ||
'<ul>' |
rool/rails/typo/trunk/app/helpers/mail_helper.rb:
prev. | current | |
module MailHelper | ||
2 | | |
3 | | |
2 | # Mutter... ActionMailer doesn't do fragment caching. | |
3 | def html(content, what=:all) | |
4 | content.html(what) | |
end | ||
end | ||
rool/rails/typo/trunk/app/helpers/sidebar_helper.rb:
prev. | current | |
module SidebarHelper | ||
2 | def render_sidebars | |
3 | this_blog.sidebars.inject('') do |acc, sb| | |
4 | @sidebar = sb | |
5 | sb.parse_request(contents, params) | |
6 | controller.response.lifetime = sb.lifetime if sb.lifetime | |
7 | acc + render_sidebar(sb) | |
8 | end | |
9 | end | |
10 | ||
def render_sidebar(sidebar) | ||
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | ||
10 | | |
11 | | |
12 | | |
12 | if sidebar.view_root | |
13 | # Allow themes to override sidebar views | |
14 | view_root = File.expand_path(sidebar.view_root) | |
15 | rails_root = File.expand_path(RAILS_ROOT) | |
16 | if view_root =~ /^#{Regexp.escape(rails_root)}/ | |
17 | new_root = view_root[rails_root.size..-1] | |
18 | new_root.sub! %r{^/?vendor/}, "" | |
19 | new_root.sub! %r{/views}, "" | |
20 | new_root = File.join(this_blog.current_theme.path, "views", new_root) | |
21 | view_root = new_root if File.exists?(File.join(new_root, "content.rhtml")) | |
22 | end | |
23 | render_to_string(:file => "#{view_root}/content.rhtml", | |
24 | :locals => sidebar.to_locals_hash) | |
25 | else | |
26 | render_to_string(:partial => sidebar.content_partial, | |
27 | :locals => sidebar.to_locals_hash) | |
end | ||
end | ||
16 | | |
17 | | |
18 | | |
19 | | |
20 | | |
21 | | |
end |
rool/rails/typo/trunk/app/helpers/xml_helper.rb:
prev. | current | |
h(post.title) | ||
end | ||
10 | | |
11 | | |
12 | | |
13 | ||
14 | | |
15 | | |
16 | | |
17 | ||
def blog_title | ||
this_blog.blog_name || "Unnamed blog" | ||
end | ||
21 | | |
22 | | |
23 | | |
24 | | |
def collection_lastmod(collection) | ||
article_updated = collection.articles.find(:first, :order => 'updated_at DESC') | ||
... | ... | |
times.max.xmlschema | ||
end | ||
end | ||
40 | ||
41 | | |
42 | | |
43 | | |
end |
rool/rails/typo/trunk/app/models/article.rb:
prev. | current | |
content_fields :body, :extended | ||
9 | | |
10 | | |
11 | | |
9 | has_many :pings, :dependent => :destroy, :order => "created_at ASC" | |
10 | has_many :comments, :dependent => :destroy, :order => "created_at ASC" | |
11 | has_many :trackbacks, :dependent => :destroy, :order => "created_at ASC" | |
has_many :resources, :order => "created_at DESC", | ||
:class_name => "Resource", :foreign_key => 'article_id' | ||
14 | | |
14 | has_many :categorizations | |
15 | has_many :categories, :through => :categorizations, :uniq => true do | |
16 | def push_with_attributes(cat, join_attrs = { :is_primary => false }) | |
17 | Categorization.with_scope(:create => join_attrs) { self << cat } | |
18 | end | |
19 | end | |
has_and_belongs_to_many :tags, :foreign_key => 'article_id' | ||
belongs_to :user | ||
has_many :triggers, :as => :pending_item | ||
... | ... | |
self.title.gsub(/<[^>]*>/,'').to_url | ||
end | ||
25 | | |
26 | | |
30 | def permalink_url(anchor=nil, only_path=true) | |
31 | @cached_permalink_url ||= {} | |
32 | @cached_permalink_url["#{anchor}#{only_path}"] ||= blog.url_for( | |
33 | :year => published_at.year, | |
34 | :month => sprintf("%.2d", published_at.month), | |
35 | :day => sprintf("%.2d", published_at.day), | |
36 | :title => permalink, | |
37 | :anchor => anchor, | |
38 | :only_path => only_path, | |
39 | :controller => '/articles' | |
40 | ) | |
end | ||
43 | def trackback_url | |
44 | blog.url_for(:controller => "articles", :action =>"trackback", :id => id) | |
45 | end | |
46 | ||
47 | def feed_url(format = :rss20) | |
48 | blog.url_for(:controller => 'xml', :action => 'feed', :type => 'article', :format => format, :id => id) | |
49 | end | |
50 | ||
51 | def edit_url | |
52 | blog.url_for(:controller => "/admin/content", :action =>"edit", :id => id) | |
53 | end | |
54 | ||
55 | def delete_url | |
56 | blog.url_for(:controller => "/admin/content", :action =>"destroy", :id => id) | |
57 | end | |
58 | ||
def html_urls | ||
urls = Array.new | ||
31 | | |
61 | html.gsub(/<a [^>]*>/) do |tag| | |
if(tag =~ /href="([^"]+)"/) | ||
urls.push($1) | ||
end | ||
end | ||
37 | | |
67 | urls.uniq | |
end | ||
40 | | |
70 | def really_send_pings(serverurl = blog.base_url, articleurl = nil) | |
return unless blog.send_outbound_pings | ||
73 | articleurl ||= permalink_url(nil, false) | |
74 | ||
weblogupdatesping_urls = blog.ping_urls.gsub(/ +/,'').split(/[\n\r]+/) | ||
pingback_or_trackback_urls = self.html_urls | ||
... | ... | |
if weblogupdatesping_urls.include?(url) | ||
ping.send_weblogupdatesping(serverurl, articleurl) | ||
55 | | |
87 | elsif pingback_or_trackback_urls.include?(url) | |
ping.send_pingback_or_trackback(articleurl) | ||
end | ||
end | ||
59 | | |
91 | rescue Exception => e | |
92 | logger.error(e) | |
# in case the remote server doesn't respond or gives an error, | ||
# we should throw an xmlrpc error here. | ||
end | ||
... | ... | |
end | ||
def next | ||
71 | | |
72 | | |
104 | blog.articles.find(:first, :conditions => ['published_at > ?', published_at], | |
105 | :order => 'published_at asc') | |
end | ||
def previous | ||
76 | | |
77 | | |
109 | blog.articles.find(:first, :conditions => ['published_at < ?', published_at], | |
110 | :order => 'published_at desc') | |
end | ||
# Count articles on a certain date | ||
... | ... | |
User.find_boolean(:all, :notify_on_new_articles) | ||
end | ||
135 | | |
168 | def notify_user_via_email(user) | |
if user.notify_via_email? | ||
137 | | |
170 | EmailNotify.send_article(self, user) | |
end | ||
end | ||
141 | | |
174 | def notify_user_via_jabber(user) | |
if user.notify_via_jabber? | ||
JabberNotify.send_message(user, "New post", | ||
"A new message was posted to #{blog.blog_name}", | ||
145 | | |
178 | html(:body)) | |
end | ||
end | ||
... | ... | |
end | ||
end | ||
194 | def published_comments | |
195 | comments.select {|c| c.published?} | |
196 | end | |
197 | ||
198 | def published_trackbacks | |
199 | trackbacks.select {|c| c.published?} | |
200 | end | |
201 | ||
202 | # Bloody rails reloading. Nasty workaround. | |
203 | def body=(newval) | |
204 | if self[:body] != newval | |
205 | changed | |
206 | self[:body] = newval | |
207 | end | |
208 | self[:body] | |
209 | end | |
210 | ||
211 | def body_html | |
212 | typo_deprecated "Use html(:body)" | |
213 | html(:body) | |
214 | end | |
215 | ||
216 | def extended=(newval) | |
217 | if self[:extended] != newval | |
218 | changed | |
219 | self[:extended] = newval | |
220 | end | |
221 | self[:extended] | |
222 | end | |
223 | ||
224 | def extended_html | |
225 | typo_deprecated "Use html(:extended)" | |
226 | html(:extended) | |
227 | end | |
228 | ||
229 | def self.html_map(field=nil) | |
230 | html_map = { :body => true, :extended => true } | |
231 | if field | |
232 | html_map[field.to_sym] | |
233 | else | |
234 | html_map | |
235 | end | |
236 | end | |
237 | ||
238 | def content_fields | |
239 | [:body, :extended] | |
240 | end | |
241 | ||
protected | ||
163 | | |
244 | before_create :set_defaults, :create_guid | |
before_save :set_published_at | ||
after_save :keywords_to_tags | ||
247 | after_create :add_notifications | |
167 | | |
168 | | |
169 | | |
170 | | |
171 | | |
def set_published_at | ||
if self.published and self[:published_at].nil? | ||
self[:published_at] = self.created_at || Time.now | ||
... | ... | |
if self.attributes.include?("permalink") and self.permalink.blank? | ||
self.permalink = self.stripped_title | ||
end | ||
182 | | |
if blog && self.allow_comments.nil? | ||
self.allow_comments = blog.default_allow_comments | ||
end | ||
... | ... | |
if blog && self.allow_pings.nil? | ||
self.allow_pings = blog.default_allow_pings | ||
end | ||
190 | | |
266 | ||
true | ||
end | ||
def add_notifications | ||
195 | | |
196 | | |
197 | | |
198 | | |
199 | ||
self.notify_users = User.find_boolean(:all, :notify_on_new_articles) | ||
self.notify_users << self.user if (self.user.notify_watch_my_articles? rescue false) | ||
self.notify_users.uniq! | ||
end | ||
205 | | |
206 | | |
207 | | |
208 | ||
def self.time_delta(year, month = nil, day = nil) | ||
from = Time.mktime(year, month || 1, day || 1) | ||
... | ... | |
end | ||
def find_published(what = :all, options = {}) | ||
220 | | |
221 | | |
super(what, options) | ||
end | ||
rool/rails/typo/trunk/app/models/blog.rb:
prev. | current | |
# BlogRequest is a fake Request object, created so blog.url_for will work. | ||
2 | ||
class BlogRequest | ||
4 | | |
5 | | |
3 | ||
attr_accessor :protocol, :host_with_port, :path, :symbolized_path_parameters, :relative_url_root | ||
7 | | |
5 | ||
def initialize(root) | ||
@protocol = @host_with_port = @path = '' | ||
@symbolized_path_parameters = {} | ||
... | ... | |
end | ||
end | ||
15 | ||
13 | # The Blog class represents one blog. It stores most configuration settings | |
14 | # and is linked to most of the assorted content classes via has_many. | |
15 | # | |
16 | # Typo decides which Blog object to use by searching for a Blog base_url that | |
17 | # matches the base_url computed for each request. | |
18 | class Blog < CachedModel | |
include ConfigManager | ||
has_many :contents | ||
... | ... | |
has_many :comments | ||
has_many :pages, :order => "id DESC" | ||
has_many(:published_articles, :class_name => "Article", | ||
24 | | |
27 | :conditions => {:published => true}, | |
:include => [:categories, :tags], | ||
26 | | |
29 | :order => "contents.published_at DESC") do | |
def before(date = Time.now) | ||
find(:all, :conditions => ["contents.created_at < ?", date]) | ||
end | ||
... | ... | |
has_many :pages | ||
has_many :comments | ||
37 | has_many :sidebars, :order => 'active_position ASC' | |
serialize :settings, Hash | ||
# Description | ||
setting :blog_name, :string, 'My Shiny Weblog!' | ||
setting :blog_subtitle, :string, '' | ||
44 | setting :title_prefix, :integer, 0 | |
setting :geourl_location, :string, '' | ||
41 | | |
46 | setting :canonical_server_url, :string, '' # Deprecated | |
# Spam | ||
setting :sp_global, :boolean, false | ||
... | ... | |
setting :limit_rss_display, :integer, 10 | ||
setting :default_allow_pings, :boolean, false | ||
setting :default_allow_comments, :boolean, true | ||
72 | setting :default_moderate_comments, :boolean, false | |
setting :link_to_author, :boolean, false | ||
setting :show_extended_on_rss, :boolean, true | ||
setting :theme, :string, 'azure' | ||
... | ... | |
setting :jabber_address, :string, '' | ||
setting :jabber_password, :string, '' | ||
80 | | |
81 | | |
86 | def initialize(*args) | |
87 | super | |
88 | # Yes, this is weird - PDC | |
89 | begin | |
90 | self.settings ||= {} | |
91 | rescue Exception => e | |
92 | self.settings = {} | |
93 | end | |
end | ||
96 | # Find the Blog that matches a specific base URL. If no Blog object is found | |
97 | # that matches, then grab the default blog. If *that* fails, then create a new | |
98 | # Blog. The last case should only be used when Typo is first installed. | |
99 | def self.find_blog(base_url) | |
100 | (Blog.find_by_base_url(base_url) rescue nil)|| Blog.default || Blog.new | |
101 | end | |
102 | ||
103 | # The default Blog. This is the lowest-numbered blog, almost always id==1. | |
104 | def self.default | |
105 | find(:first, :order => 'id') | |
106 | end | |
107 | ||
def ping_article!(settings) | ||
settings[:blog_id] = self.id | ||
article_id = settings[:id] | ||
settings.delete(:id) | ||
trackback = published_articles.find(article_id).trackbacks.create!(settings) | ||
89 | ||
90 | | |
91 | | |
92 | | |
93 | | |
94 | | |
95 | | |
end | ||
98 | ||
115 | # Check that all required blog settings have a value. | |
def is_ok? | ||
settings.has_key?('blog_name') | ||
end | ||
103 | | |
104 | | |
120 | # The +Theme+ object for the current theme. | |
121 | def current_theme | |
122 | @cached_theme ||= Theme.find(theme) | |
end | ||
107 | | |
108 | | |
109 | | |
125 | # Generate a URL based on the +base_url+. This allows us to generate URLs | |
126 | # without needing a controller handy, so we can produce URLs from within models | |
127 | # where appropriate. | |
128 | # | |
129 | # It also uses our new RouteCache, so repeated URL generation requests should be | |
130 | # fast, as they bypass all of Rails' route logic. | |
131 | def url_for(options = {}, *extra_params) | |
132 | case options | |
133 | when String then options # They asked for 'url_for "/some/path"', so return it unedited. | |
134 | when Hash | |
135 | unless RouteCache[options] | |
136 | options.reverse_merge!(:only_path => true, :controller => '/articles', | |
137 | :action => 'permalink') | |
138 | # Remove internal semi-hack that valiantly attempts to isolate | |
139 | # code from needing a Controller but does so at the expense of | |
140 | # assuming protocol and port, based on the admin-set blog base | |
141 | # URL. Replace it with global (ugh) set in prime_url_writer, | |
142 | # a before_filter in application.rb. | |
143 | # | |
144 | # @url ||= ActionController::UrlRewriter.new(BlogRequest.new(self.base_url), {}) | |
145 | @url ||= ActionController::UrlRewriter.new($url_writer_request_information, {}) | |
146 | RouteCache[options] = @url.rewrite(options) | |
147 | end | |
111 | | |
112 | | |
149 | return RouteCache[options] | |
150 | else | |
151 | raise "Invalid URL in url_for: #{options.inspect}" | |
152 | end | |
end | ||
115 | | |
116 | | |
117 | | |
155 | # The URL for a static file. | |
156 | def file_url(filename) | |
157 | "#{base_url}/files/#{filename}" | |
end | ||
120 | | |
121 | | |
160 | # The base server URL. | |
161 | def server_url | |
162 | base_url | |
end | ||
124 | | |
125 | | |
126 | ||
127 | | |
128 | | |
165 | # Deprecated | |
166 | def canonical_server_url | |
167 | typo_deprecated "Use base_url instead" | |
168 | base_url | |
end | ||
131 | | |
132 | | |
133 | | |
134 | | |
135 | | |
171 | def [](key) # :nodoc: | |
172 | typo_deprecated "Use blog.#{key}" | |
173 | self.send(key) | |
end | ||
138 | | |
139 | | |
176 | def []=(key, value) # :nodoc: | |
177 | typo_deprecated "Use blog.#{key}=" | |
178 | self.send("#{key}=", value) | |
end | ||
142 | | |
143 | | |
181 | def has_key?(key) # :nodoc: | |
182 | typo_deprecated "Why?" | |
183 | self.class.fields.has_key?(key.to_s) | |
end | ||
146 | | |
147 | | |
186 | def find_already_published(content_type) # :nodoc: | |
187 | typo_deprecated "Use #{content_type}.find_already_published" | |
188 | self.send(content_type).find_already_published | |
end | ||
150 | | |
151 | | |
152 | | |
153 | | |
154 | | |
155 | | |
156 | | |
157 | | |
158 | | |
159 | | |
160 | | |
191 | def current_theme_path # :nodoc: | |
192 | typo_deprecated "use current_theme.path" | |
193 | Theme.themes_root + "/" + theme | |
end | ||
162 | ||
163 | | |
164 | | |
165 | | |
166 | | |
167 | | |
168 | | |
169 | | |
170 | ||
171 | | |
172 | | |
173 | | |
174 | | |
175 | | |
176 | | |
177 | | |
178 | ||
179 | | |
180 | ||
181 | | |
182 | | |
183 | | |
184 | | |
end | ||
rool/rails/typo/trunk/app/models/blog_sweeper.rb:
prev. | current | |
class BlogSweeper < ActionController::Caching::Sweeper | ||
2 | | |
2 | observe Article, Category, Feedback, Page, Blog, Sidebar, User | |
def after_save(record) | ||
5 | logger.info "Expiring #{record}, with controller: #{controller}" | |
expire_for(record) | ||
end | ||
def after_destroy(record) | ||
9 | | |
10 | expire_for(record, true) | |
end | ||
12 | | |
13 | def expire_for(record, destroying = false) | |
case record | ||
14 | | |
15 | | |
16 | | |
when Page | ||
18 | | |
16 | sweep_pages(record) | |
17 | when Content | |
18 | if record.invalidates_cache?(destroying) | |
19 | sweep_all | |
20 | end | |
21 | when Sidebar, Category | |
22 | sweep_articles | |
23 | sweep_pages(record) | |
24 | when Blog, User | |
25 | sweep_all | |
26 | end | |
27 | end | |
28 | ||
29 | def sweep_all | |
30 | PageCache.sweep_all | |
31 | expire_fragment(/.*/) | |
32 | end | |
33 | ||
34 | def sweep_articles | |
35 | PageCache.sweep('/articles/%') | |
36 | expire_fragment(%r{.*/articles/.*}) | |
37 | end | |
38 | ||
39 | def sweep_pages(record) | |
40 | PageCache.sweep("/pages/#{record.name rescue ''}.html") | |
expire_fragment(/.*\/pages\/.*/) | ||
expire_fragment(/.*\/view_page.*/) | ||
21 | | |
end | ||
44 | ||
45 | def logger | |
46 | @logger ||= RAILS_DEFAULT_LOGGER || Logger.new(STDERR) | |
47 | end | |
end |
rool/rails/typo/trunk/app/models/category.rb:
prev. | current | |
class Category < ActiveRecord::Base | ||
acts_as_list | ||
3 | | |
4 | | |
3 | has_many :categorizations | |
4 | has_many :articles, :through => :categorizations, | |
5 | :order => "published_at DESC, created_at DESC" | |
def self.find_all_with_article_counters(maxcount=nil) | ||
self.find_by_sql([%{ | ||
SELECT categories.id, categories.name, categories.permalink, categories.position, COUNT(articles.id) AS article_counter | ||
FROM #{Category.table_name} categories | ||
10 | | |
11 | LEFT OUTER JOIN #{Category.table_name_prefix}categorizations#{Category.table_name_suffix} articles_categories | |
ON articles_categories.category_id = categories.id | ||
LEFT OUTER JOIN #{Article.table_name} articles | ||
ON (articles_categories.article_id = articles.id AND articles.published = ?) | ||
... | ... | |
}, true]).each {|item| item.article_counter = item.article_counter.to_i } | ||
end | ||
20 | def self.find(*args) | |
21 | with_scope :find => {:order => 'position ASC'} do | |
22 | super | |
23 | end | |
24 | end | |
25 | ||
def self.find_by_permalink(*args) | ||
super || new | ||
end | ||
... | ... | |
def self.reorder(serialized_list) | ||
self.transaction do | ||
serialized_list.each_with_index do |cid,index| | ||
34 | | |
41 | find(cid).update_attribute "position", index | |
end | ||
end | ||
end | ||
... | ... | |
name | ||
end | ||
58 | def permalink_url(anchor=nil, only_path=true) | |
59 | blog = Blog.find(1) # remove me... | |
60 | ||
61 | blog.url_for( | |
62 | :controller => '/articles', | |
63 | :action => 'category', | |
64 | :id => permalink | |
65 | ) | |
66 | end | |
67 | ||
protected | ||
before_save :set_defaults |
rool/rails/typo/trunk/app/models/comment.rb:
prev. | current | |
require 'sanitize' | ||
require 'timeout' | ||
5 | ||
6 | | |
7 | ||
8 | | |
9 | ||
10 | | |
5 | class Comment < Feedback | |
6 | belongs_to :article | |
belongs_to :user | ||
12 | ||
8 | content_fields :body | |
validates_presence_of :author, :body | ||
14 | | |
15 | | |
11 | attr_accessor :user_agent | |
12 | attr_accessor :referrer | |
13 | attr_accessor :permalink | |
18 | | |
19 | | |
20 | | |
21 | ||
22 | | |
15 | def notify_user_via_email(user) | |
if user.notify_via_email? | ||
24 | | |
17 | EmailNotify.send_comment(self, user) | |
end | ||
end | ||
28 | | |
21 | def notify_user_via_jabber(user) | |
if user.notify_via_jabber? | ||
30 | | |
23 | JabberNotify.send_message(user, "New comment", "A new comment was posted to '#{article.title}' on #{blog.blog_name} by #{author}: | |
24 | #{body} (#{controller.url_for :anchor => 'comments', :action => 'read', :id => article.id})", self.body_html) | |
end | ||
end | ||
... | ... | |
users | ||
end | ||
40 | | |
41 | | |
34 | def default_text_filter | |
35 | blog.comment_text_filter.to_text_filter | |
end | ||
protected | ||
46 | | |
47 | | |
48 | | |
49 | | |
50 | | |
40 | def article_allows_feedback? | |
41 | return true if article.allow_comments? | |
42 | errors.add(:article, "Article is not open to comments") | |
43 | false | |
end | ||
53 | | |
54 | | |
46 | def originator | |
47 | author | |
end | ||
57 | | |
58 | | |
50 | def additional_akismet_options | |
51 | { :user_agent => user_agent, | |
52 | :referrer => referrer, | |
53 | :permalink => permalink } | |
end | ||
61 | | |
62 | | |
63 | ||
64 | | |
65 | | |
66 | | |
67 | | |
68 | | |
56 | def self.html_map(field=nil) | |
57 | html_map = { :body => true } | |
58 | if field | |
59 | html_map[field.to_sym] | |
60 | else | |
61 | html_map | |
end | ||
end | ||
72 | | |
73 | | |
74 | | |
65 | def content_fields | |
66 | [:body] | |
end | ||
76 | | |
77 | | |
78 | | |
79 | | |
80 | | |
81 | | |
82 | | |
83 | | |
84 | | |
end |
rool/rails/typo/trunk/app/models/content.rb:
prev. | current | |
composed_of :state, :class_name => 'ContentState::Factory', | ||
:mapping => %w{ state memento } | ||
14 | | |
15 | | |
16 | | |
14 | has_many :notifications, :foreign_key => 'content_id' | |
15 | has_many :notify_users, :through => :notifications, | |
16 | :source => 'notify_user', | |
17 | :uniq => true | |
19 | def notify_users=(collection) | |
20 | return notify_users.clear if collection.empty? | |
21 | self.class.transaction do | |
22 | self.notifications.clear | |
23 | collection.uniq.each do |u| | |
24 | self.notifications.build(:notify_user => u) | |
25 | end | |
26 | notify_users.target = collection | |
27 | end | |
28 | end | |
29 | ||
has_many :triggers, :as => :pending_item, :dependent => :delete_all | ||
before_save :state_before_save | ||
21 | | |
33 | after_save :post_trigger, :state_after_save | |
serialize :whiteboard | ||
@@content_fields = Hash.new | ||
@@html_map = Hash.new | ||
28 | | |
29 | | |
40 | def initialize(*args, &block) | |
41 | super(*args, &block) | |
set_default_blog | ||
end | ||
45 | def invalidates_cache?(on_destruction = false) | |
46 | if on_destruction | |
47 | just_changed_published_status? || published? | |
48 | else | |
49 | changed? && published? || just_changed_published_status? | |
50 | end | |
51 | end | |
52 | ||
def set_default_blog | ||
if self.blog_id == nil or self.blog_id == 0 | ||
self.blog = Blog.default | ||
... | ... | |
end | ||
class << self | ||
60 | # Quite a bit of this isn't needed anymore. | |
def content_fields(*attribs) | ||
@@content_fields[self] = ((@@content_fields[self]||[]) + attribs).uniq | ||
@@html_map[self] = nil | ||
... | ... | |
if self[field] != newval | ||
changed | ||
self[field] = newval | ||
48 | | |
49 | | |
50 | | |
51 | | |
end | ||
self[field] | ||
end | ||
unless self.method_defined?("#{field}_html") | ||
define_method("#{field}_html") do | ||
57 | | |
58 | | |
59 | | |
60 | | |
61 | | |
74 | typo_deprecated "Use html(:#{field})" | |
75 | html(field.to_sym) | |
end | ||
end | ||
end | ||
... | ... | |
@@html_map[self] = Hash.new | ||
instance = self.new | ||
@@content_fields[self].each do |attrib| | ||
72 | | |
86 | @@html_map[self][attrib] = true | |
end | ||
end | ||
if field | ||
... | ... | |
end | ||
def find_published(what = :all, options = {}) | ||
83 | | |
84 | | |
85 | | |
86 | | |
87 | | |
88 | | |
97 | with_scope(:find => {:order => default_order, :conditions => {:published => true}}) do | |
98 | find what, options | |
99 | end | |
end | ||
def default_order | ||
... | ... | |
find_published(what, options) | ||
end | ||
end | ||
117 | end | |
107 | | |
108 | | |
109 | | |
110 | | |
111 | | |
119 | def content_fields | |
120 | @@content_fields[self.class] | |
end | ||
def state_before_save | ||
115 | | |
124 | state.before_save(self) | |
end | ||
118 | | |
127 | def state_after_save | |
128 | state.after_save(self) | |
129 | end | |
120 | | |
121 | | |
122 | | |
123 | | |
124 | | |
131 | def html_map(field=nil) | |
132 | self.class.html_map(field) | |
end | ||
127 | | |
128 | | |
129 | | |
130 | | |
131 | | |
132 | | |
133 | | |
134 | | |
135 | def cache_key(field) | |
136 | id ? "contents_html/#{id}/#{field}" : nil | |
end | ||
137 | | |
138 | | |
139 | ||
140 | | |
141 | | |
142 | | |
143 | | |
139 | # Return HTML for some part of this object. It will be fetched from the | |
140 | # cache if possible, or regenerated if needed. | |
141 | def html(field = :all) | |
142 | if field == :all | |
143 | generate_html(:all, content_fields.map{|f| self[f].to_s}.join("\n\n")) | |
144 | elsif self.class.html_map(field) | |
145 | generate_html(field) | |
else | ||
145 | | |
147 | raise "Unknown field: #{field.inspect} in article.html" | |
end | ||
end | ||
149 | | |
150 | | |
151 | | |
152 | | |
153 | | |
154 | | |
151 | # Generate HTML for a specific field using the text_filter in use for this | |
152 | # object. The HTML is cached in the fragment cache, using the +ContentCache+ | |
153 | # object in @@cache. | |
154 | def generate_html(field, text = nil) | |
155 | text ||= self[field].to_s | |
156 | html = text_filter.filter_text_for_content(blog, text, self) | |
157 | html ||= text # just in case the filter puked | |
158 | html_postprocess(field,html).to_s | |
end | ||
161 | # Post-process the HTML. This is a noop by default, but Comment overrides it | |
162 | # to enforce HTML sanity. | |
163 | def html_postprocess(field,html) | |
164 | html | |
165 | end | |
166 | ||
def whiteboard | ||
self[:whiteboard] ||= Hash.new | ||
end | ||
171 | # The default text filter. Generally, this is the filter specified by blog.text_filter, | |
172 | # but comments may use a different default. | |
173 | def default_text_filter | |
174 | blog.text_filter.to_text_filter | |
175 | end | |
177 | # Grab the text filter for this object. It's either the filter specified by | |
178 | # self.text_filter_id, or the default specified in the blog object. | |
def text_filter | ||
163 | | |
164 | | |
165 | | |
166 | | |
167 | | |
180 | if self[:text_filter_id] && !self[:text_filter_id].zero? | |
181 | TextFilter.find(self[:text_filter_id]) | |
182 | else | |
183 | default_text_filter | |
184 | end | |
end | ||
187 | # Set the text filter for this object. | |
def text_filter=(filter) | ||
171 | | |
189 | returning(filter.to_text_filter) { |tf| self.text_filter_id = tf.id } | |
end | ||
192 | # Changing the title flags the object as changed | |
193 | def title=(new_title) | |
194 | if new_title == self[:title] | |
195 | self[:title] | |
196 | else | |
197 | self.changed | |
198 | self[:title] = new_title | |
199 | end | |
200 | end | |
201 | ||
202 | # FIXME -- this feels wrong. | |
def blog | ||
self[:blog] ||= blog_id.to_i.zero? ? Blog.default : Blog.find(blog_id) | ||
end | ||
207 | def state=(newstate) | |
208 | if state | |
209 | state.exit_hook(self, newstate) | |
210 | end | |
211 | @state = newstate | |
212 | self[:state] = newstate.memento | |
213 | newstate.enter_hook(self) | |
214 | @state | |
215 | end | |
216 | ||
def publish! | ||
self.published = true | ||
self.save! | ||
end | ||
def withdraw | ||
184 | | |
185 | | |
223 | state.withdraw(self) | |
end | ||
def withdraw! | ||
... | ... | |
self[:published_at] || self[:created_at] | ||
end | ||
244 | def published? | |
245 | state.published?(self) | |
246 | end | |
247 | ||
def just_published? | ||
state.just_published? | ||
end | ||
252 | def just_changed_published_status? | |
253 | state.just_changed_published_status? | |
254 | end | |
255 | ||
256 | def withdrawn? | |
257 | state.withdrawn? | |
258 | end | |
259 | ||
def publication_pending? | ||
state.publication_pending? | ||
end | ||
... | ... | |
state.after_save(self) | ||
end | ||
222 | | |
223 | | |
224 | | |
272 | def send_notification_to_user(user) | |
273 | notify_user_via_email(user) | |
274 | notify_user_via_jabber(user) | |
end | ||
227 | | |
228 | | |
277 | def send_notifications() | |
278 | state.send_notifications(self) | |
end | ||
230 | | |
231 | | |
232 | | |
233 | | |
234 | | |
235 | | |
236 | | |
237 | | |
238 | | |
239 | | |
240 | | |
241 | | |
242 | | |
244 | | |
245 | | |
281 | # deprecated | |
282 | def full_html | |
283 | typo_deprecated "use .html instead" | |
284 | html | |
285 | end | |
247 | | |
248 | | |
249 | | |
250 | | |
287 | end | |
252 | | |
253 | | |
254 | | |
255 | | |
256 | | |
257 | | |
258 | | |
259 | | |
260 | | |
289 | class Object | |
290 | def to_text_filter | |
291 | TextFilter.find_by_name(self.to_s) || TextFilter.find_by_name('none') | |
end | ||
262 | | |
263 | | |
264 | | |
265 | | |
266 | | |
267 | | |
268 | | |
269 | | |
270 | | |
271 | | |
272 | | |
273 | | |
274 | | |
275 | | |
276 | | |
end | ||
279 | ||
295 | class ContentTextHelpers | |
296 | include ActionView::Helpers::TagHelper | |
297 | include ActionView::Helpers::TextHelper | |
298 | end | |
299 |
rool/rails/typo/trunk/app/models/content_state/base.rb:
prev. | current | |
module ContentState | ||
2 | class StateError < StandardError | |
3 | end | |
4 | ||
5 | class StateNotSerializable < StateError | |
6 | end | |
7 | ||
8 | class InvalidMethodForState < StandardError | |
9 | end | |
10 | ||
class Base | ||
3 | | |
4 | ||
class << self | ||
def instance | ||
nil | ||
... | ... | |
self.class.to_s | ||
end | ||
24 | def exit_hook(content, target_state) | |
25 | logger.debug("#{content} leaving state #{self.memento}") | |
26 | end | |
27 | ||
28 | def enter_hook(content) | |
29 | logger.debug("#{content} entering state #{self.memento}") | |
30 | end | |
31 | ||
def before_save(content) | ||
18 | | |
true | ||
end | ||
22 | | |
36 | def after_save(content) | |
37 | true | |
38 | end | |
39 | ||
40 | def withdraw(content) | |
41 | end | |
42 | ||
43 | def mark_as_spam(content) | |
44 | content.state = Factory.new(:just_marked_as_spam) | |
45 | end | |
46 | ||
47 | def mark_as_ham(content) | |
48 | content.state = Factory.new(:just_marked_as_ham) | |
49 | end | |
50 | ||
51 | def published?(content) | |
false | ||
end | ||
... | ... | |
false | ||
end | ||
59 | def just_changed_published_status? | |
60 | false | |
61 | end | |
62 | ||
def draft? | ||
false | ||
end | ||
... | ... | |
false | ||
end | ||
71 | def withdrawn? | |
72 | false | |
73 | end | |
74 | ||
def after_save(content) | ||
true | ||
end | ||
... | ... | |
true | ||
end | ||
46 | | |
83 | def send_notifications(controller) | |
true | ||
end | ||
def send_pings(content) | ||
true | ||
end | ||
90 | ||
91 | def is_spam?(content) | |
92 | false | |
93 | end | |
94 | ||
95 | def status_confirmed?(content) | |
96 | false | |
97 | end | |
98 | ||
99 | def logger | |
100 | @logger ||= RAILS_DEFAULT_LOGGER || Logger.new(STDERR) | |
101 | end | |
102 | ||
103 | def confirm_classification(content) | |
104 | end | |
105 | ||
106 | def ==(other_state) | |
107 | self.class == other_state.class | |
108 | end | |
end | ||
end | ||
rool/rails/typo/trunk/app/models/content_state/draft.rb:
prev. | current | |
module ContentState | ||
class Draft < Base | ||
3 | | |
include Singleton | ||
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
13 | | |
5 | def enter_hook(content) | |
6 | super | |
content[:published] = false | ||
15 | | |
16 | | |
8 | content[:published_at] = nil | |
end | ||
def change_published_state(content, boolean) | ||
content[:published] = boolean | ||
21 | | |
13 | if boolean | |
content.state = JustPublished.instance | ||
end | ||
end |
rool/rails/typo/trunk/app/models/content_state/factory.rb:
prev. | current | |
module ContentState | ||
class Factory | ||
def self.new(state_name) | ||
4 | | |
4 | return ContentState::New.instance if !state_name || state_name.blank? | |
state_name = state_name.to_s.underscore | ||
unless state_name.rindex('/') | ||
state_name = 'content_state/' + state_name |
rool/rails/typo/trunk/app/models/content_state/just_published.rb:
prev. | current | |
module ContentState | ||
class JustPublished < Published | ||
3 | | |
include Singleton | ||
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
5 | # We need to save the state as 'Published', but we need after_save | |
6 | # to be handled by JustPublished. So, JustPublished tells Rails that | |
7 | # it's *actually* Published and all shall be well. | |
8 | def memento | |
9 | 'ContentState::Published' | |
end | ||
def just_published? | ||
true | ||
end | ||
18 | ||
19 | | |
20 | | |
21 | | |
16 | def just_changed_published_status? | |
true | ||
end | ||
25 | | |
26 | | |
27 | | |
28 | | |
29 | | |
30 | | |
20 | def published?(content) | |
21 | true | |
end | ||
33 | | |
34 | | |
35 | | |
24 | # def enter_hook(content) | |
25 | # super | |
26 | # end | |
37 | | |
28 | # def set_published_at(content, new_time) | |
29 | # super | |
30 | # end | |
31 | ||
32 | def send_notifications(content) | |
content.interested_users.each do |user| | ||
39 | | |
34 | content.send_notification_to_user(user) | |
end | ||
end | ||
def send_pings(content) | ||
content.really_send_pings | ||
end | ||
41 | ||
42 | def withdraw(content) | |
43 | content[:published_at] = nil | |
44 | content.state = Factory.new(:draft) | |
45 | end | |
end | ||
end |
rool/rails/typo/trunk/app/models/content_state/new.rb:
prev. | current | |
module ContentState | ||
class New < Base | ||
3 | | |
include Singleton | ||
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
13 | | |
5 | def enter_hook(content) | |
6 | super | |
content[:published] = false | ||
content[:published_at] = nil | ||
16 | | |
end | ||
def before_save(content) | ||
... | ... | |
def change_published_state(content, boolean) | ||
content[:published] = boolean | ||
26 | | |
18 | if boolean | |
content.state = JustPublished.instance | ||
end | ||
end |
rool/rails/typo/trunk/app/models/content_state/publication_pending.rb:
prev. | current | |
module ContentState | ||
class PublicationPending < Base | ||
3 | | |
include Singleton | ||
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
13 | | |
5 | def enter_hook(content) | |
6 | super | |
content[:published] = false if content.new_record? | ||
15 | | |
end | ||
18 | | |
19 | | |
20 | | |
10 | def change_published_state(content, published) | |
11 | content[:published] = published | |
12 | ||
13 | if published && content.published_at <= Time.now | |
content.state = JustPublished.instance | ||
end | ||
end | ||
... | ... | |
def post_trigger(content) | ||
Trigger.post_action(content.published_at, content, 'publish!') | ||
end | ||
35 | ||
36 | def withdraw(content) | |
37 | content[:published_at] = nil | |
38 | content.state = Draft.instance | |
39 | end | |
end | ||
end |
rool/rails/typo/trunk/app/models/content_state/published.rb:
prev. | current | |
module ContentState | ||
class Published < Base | ||
3 | | |
include Singleton | ||
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
11 | | |
5 | def published?(content) | |
true | ||
end | ||
15 | | |
16 | | |
9 | def enter_hook(content) | |
10 | super | |
11 | content[:published] = true | |
12 | content[:published_at] ||= Time.now | |
end | ||
def change_published_state(content, boolean) | ||
20 | | |
21 | | |
16 | if ! boolean | |
17 | content[:published] = false | |
content[:published_at] = nil | ||
23 | | |
19 | content.state = Factory.new(:just_withdrawn) | |
end | ||
end | ||
23 | def withdraw(content) | |
24 | content.state = Factory.new(:just_withdrawn) | |
25 | end | |
26 | ||
def set_published_at(content, new_time) | ||
content[:published_at] = new_time | ||
29 | | |
30 | | |
31 | | |
29 | return if new_time.nil? | |
30 | if new_time > Time.now | |
31 | content.state = PublicationPending.instance | |
end | ||
end | ||
end |
rool/rails/typo/trunk/app/models/email_notifier.rb:
prev. | current | |
class EmailNotifier < ActiveRecord::Observer | ||
observe Article, Comment | ||
3 | ||
3 | ||
def after_save(content) | ||
5 | | |
content.send_notifications | ||
true | ||
end |
rool/rails/typo/trunk/app/models/notification_mailer.rb:
prev. | current | |
class NotificationMailer < ActionMailer::Base | ||
helper :mail | ||
3 | ||
4 | | |
5 | | |
3 | ||
4 | def article(article, user) | |
5 | setup(user, article) | |
@subject = "[#{article.blog.blog_name}] New article: #{article.title}" | ||
@body[:article] = article | ||
end | ||
10 | | |
11 | | |
10 | def comment(comment, user) | |
11 | setup(user, comment) | |
@subject = "[#{comment.blog.blog_name}] New comment on #{comment.article.title}" | ||
@body[:article] = comment.article | ||
@body[:comment] = comment | ||
end | ||
def trackback(sent_at = Time.now) | ||
18 | | |
18 | setup(user, trackback) | |
@subject = "[#{trackback.blog.blog_name}] New trackback on #{trackback.article.title}" | ||
@body[:article] = trackback.article | ||
@body[:trackback] = trackback | ||
end | ||
private | ||
25 | | |
25 | def setup(user, content) | |
@body[:user] = user | ||
27 | | |
27 | @body[:blog] = content.blog | |
@recipients = user.email | ||
@from = content.blog.email_from | ||
@headers = {'X-Mailer' => "Typo #{TYPO_VERSION}"} |
rool/rails/typo/trunk/app/models/page.rb:
prev. | current | |
end | ||
def location(anchor=nil, only_path=true) | ||
13 | | |
14 | | |
13 | typo_deprecated "Use permalink_url" | |
14 | permalink_url(anchor, only_path) | |
end | ||
16 | ||
17 | def permalink_url(anchor=nil, only_path=true) | |
18 | blog.url_for( | |
19 | :controller => '/articles', | |
20 | :action => 'view_page', | |
21 | :name => name, | |
22 | :anchor => anchor, | |
23 | :only_path => only_path | |
24 | ) | |
25 | end | |
17 | | |
18 | ||
19 | | |
27 | def edit_url | |
28 | blog.url_for(:controller => "/admin/pages", :action =>"edit", :id => id) | |
29 | end | |
30 | ||
31 | def delete_url | |
32 | blog.url_for(:controller => "/admin/pages", :action =>"destroy", :id => id) | |
33 | end | |
end |
rool/rails/typo/trunk/app/models/ping.rb:
prev. | current | |
belongs_to :article | ||
class Pinger | ||
7 | attr_accessor :article | |
8 | attr_accessor :blog | |
9 | ||
def send_pingback_or_trackback | ||
begin | ||
@response = Net::HTTP.get_response(URI.parse(ping.url)) | ||
... | ... | |
@ping | ||
end | ||
42 | | |
43 | | |
44 | | |
45 | ||
46 | | |
47 | | |
48 | | |
49 | ||
def send_xml_rpc(*args) | ||
ping.send(:send_xml_rpc, *args) | ||
end | ||
... | ... | |
def initialize(origin_url, ping) | ||
@origin_url = origin_url | ||
@ping = ping | ||
81 | # Make sure these are fetched now for thread safety purposes. | |
82 | self.article = ping.article | |
83 | self.blog = article.blog | |
end | ||
end | ||
def send_pingback_or_trackback(origin_url) | ||
90 | | |
91 | | |
92 | | |
93 | | |
88 | Pinger.new(origin_url, self).send_pingback_or_trackback | |
end | ||
def send_trackback(trackback_url, origin_url) | ||
97 | | |
98 | | |
92 | trackback_uri = URI.parse(trackback_url) | |
100 | | |
101 | | |
102 | | |
103 | | |
94 | post = "title=#{CGI.escape(article.title)}" | |
95 | post << "&excerpt=#{CGI.escape(article.html(:body).strip_html[0..254])}" | |
96 | post << "&url=#{origin_url}" | |
97 | post << "&blog_name=#{CGI.escape(article.blog.blog_name)}" | |
105 | | |
106 | | |
107 | | |
108 | | |
109 | | |
99 | Net::HTTP.start(trackback_uri.host, trackback_uri.port) do |http| | |
100 | path = trackback_uri.path | |
101 | path += "?#{trackback_uri.query}" if trackback_uri.query | |
102 | http.post(path, post, 'Content-type' => 'application/x-www-form-urlencoded; charset=utf-8') | |
end | ||
111 | | |
end | ||
def send_weblogupdatesping(server_url, origin_url) | ||
115 | | |
116 | | |
117 | | |
118 | | |
107 | send_xml_rpc(self.url, "weblogUpdates.ping", article.blog.blog_name, | |
108 | server_url, origin_url) | |
end | ||
protected | ||
def send_xml_rpc(xml_rpc_url, name, *args) | ||
124 | | |
125 | | |
126 | | |
114 | begin | |
115 | server = XMLRPC::Client.new2(URI.parse(xml_rpc_url).to_s) | |
128 | | |
129 | | |
130 | | |
131 | | |
132 | | |
133 | | |
117 | begin | |
118 | result = server.call(name, *args) | |
119 | rescue XMLRPC::FaultException => e | |
logger.error(e) | ||
end | ||
122 | rescue Exception => e | |
123 | logger.error(e) | |
end | ||
137 | | |
end | ||
end |
rool/rails/typo/trunk/app/models/sidebar.rb:
prev. | current | |
class Sidebar < ActiveRecord::Base | ||
2 | ||
serialize :config | ||
3 | belongs_to :blog | |
5 | | |
6 | | |
5 | class Field | |
6 | attr_accessor :key | |
7 | attr_accessor :options | |
8 | attr_accessor :default | |
9 | include ApplicationHelper | |
10 | include ActionView::Helpers::TagHelper | |
11 | include ActionView::Helpers::FormTagHelper | |
12 | include ActionView::Helpers::FormOptionsHelper | |
13 | ||
14 | def initialize(key, default, options = { }) | |
15 | @key, @default, @options = key.to_s, default, options | |
16 | end | |
17 | ||
18 | def label | |
19 | options[:label] || key.humanize.gsub(/url/i, 'URL') | |
20 | end | |
21 | ||
22 | def label_html(sidebar) | |
23 | content_tag('label', label) | |
24 | end | |
25 | ||
26 | def input_html(sidebar) | |
27 | text_field_tag(input_name(sidebar), sidebar.config[key], options) | |
28 | end | |
29 | ||
30 | def line_html(sidebar) | |
31 | label_html(sidebar) + "<br />" + input_html(sidebar) + "<br />" | |
32 | end | |
33 | ||
34 | def input_name(sidebar) | |
35 | "configure[#{sidebar.id}][#{key}]" | |
36 | end | |
37 | ||
38 | def canonicalize(value) | |
39 | value | |
40 | end | |
41 | ||
42 | class SelectField < self | |
43 | def input_html(sidebar) | |
44 | select_tag(input_name(sidebar), | |
45 | options_for_select(options[:choices], sidebar.config[key]), | |
46 | options) | |
47 | end | |
48 | end | |
49 | ||
50 | class TextAreaField < self | |
51 | def input_html(sidebar) | |
52 | html_options = { "rows" => "10", "cols" => "30", "style" => "width:255px"}.update(options.stringify_keys) | |
53 | text_area_tag(input_name(sidebar), h(sidebar.config[key]), html_options) | |
54 | end | |
55 | end | |
56 | ||
57 | class RadioField < self | |
58 | def input_html(sidebar) | |
59 | options[:choices].collect do |choice| | |
60 | value = value_for(choice) | |
61 | radio_button_tag(input_name(sidebar), value, | |
62 | value == sidebar.config[key], options) + | |
63 | content_tag('label', label_for(choice)) | |
64 | end.join("<br />") | |
65 | end | |
66 | ||
67 | def label_for(choice) | |
68 | choice.is_a?(Array) ? choice.last : choice.to_s.humanize | |
69 | end | |
70 | ||
71 | def value_for(choice) | |
72 | choice.is_a?(Array) ? choice.first : choice | |
73 | end | |
74 | end | |
75 | ||
76 | class CheckBoxField < self | |
77 | def input_html(sidebar) | |
78 | check_box_tag(input_name(sidebar), 1, sidebar.config[key], options)+ | |
79 | hidden_field_tag(input_name(sidebar),0) | |
80 | end | |
81 | ||
82 | def line_html(sidebar) | |
83 | input_html(sidebar) + ' ' + label_html(sidebar) + '<br >' | |
84 | end | |
85 | ||
86 | def canonicalize(value) | |
87 | case value | |
88 | when "0" | |
89 | false | |
90 | else | |
91 | true | |
92 | end | |
93 | end | |
94 | end | |
95 | ||
96 | def self.build(key, default, options) | |
97 | field = class_for(options).new(key, default, options) | |
98 | end | |
99 | ||
100 | def self.class_for(options) | |
101 | case options[:input_type] | |
102 | when :text_area | |
103 | TextAreaField | |
104 | when :textarea | |
105 | TextAreaField | |
106 | when :radio | |
107 | RadioField | |
108 | when :checkbox | |
109 | CheckBoxField | |
110 | when :select | |
111 | SelectField | |
112 | else | |
113 | if options[:choices] | |
114 | SelectField | |
115 | else | |
116 | self | |
117 | end | |
118 | end | |
119 | end | |
end | ||
9 | | |
10 | | |
122 | class << self | |
123 | attr_accessor :view_root | |
124 | ||
125 | def find_all_visible | |
126 | find :all, :conditions => 'active_position is not null', :order => 'active_position' | |
127 | end | |
128 | ||
129 | def find_all_staged | |
130 | find :all, :conditions => 'staged_position is not null', :order => 'staged_position' | |
131 | end | |
132 | ||
133 | def purge | |
134 | delete_all('active_position is null and staged_position is null') | |
135 | end | |
136 | ||
137 | def setting(key, default=nil, options = { }) | |
138 | return if instance_methods.include?(key.to_s) | |
139 | fields << Field.build(key.to_s, default, options) | |
140 | fieldmap.update(key.to_s => fields.last) | |
141 | self.send(:define_method, key) do | |
142 | self.config[key.to_s] | |
143 | end | |
144 | self.send(:define_method, "#{key}=") do |newval| | |
145 | self.config[key.to_s] = newval | |
146 | end | |
147 | end | |
148 | ||
149 | def fieldmap | |
150 | @fieldmap ||= {} | |
151 | end | |
152 | ||
153 | def fields | |
154 | @fields ||= [] | |
155 | end | |
156 | ||
157 | def fields=(newval) | |
158 | @fields = newval | |
159 | end | |
160 | ||
161 | def description(desc = nil) | |
162 | if desc | |
163 | @description = desc | |
164 | else | |
165 | @description | |
166 | end | |
167 | end | |
168 | ||
169 | def lifetime(timeout = nil) | |
170 | if timeout | |
171 | @lifetime = timeout | |
172 | else | |
173 | @lifetime | |
174 | end | |
175 | end | |
176 | ||
177 | def short_name | |
178 | self.to_s.underscore.split(%r{_}).first | |
179 | end | |
180 | ||
181 | def display_name(new_dn = nil) | |
182 | @display_name = new_dn if new_dn | |
183 | @display_name || short_name.humanize | |
184 | end | |
185 | ||
186 | def available_sidebars | |
187 | Sidebar.subclasses.sort_by { |klass| klass.to_s } | |
188 | end | |
end | ||
13 | | |
14 | | |
191 | def initialize(*args, &block) | |
192 | super(*args, &block) | |
193 | self.class.fields.each do |field| | |
194 | unless config.has_key?(field.key) | |
195 | config[field.key] = field.default | |
196 | end | |
197 | end | |
end | ||
200 | ||
def publish | ||
self.active_position=self.staged_position | ||
end | ||
205 | def config | |
206 | self[:config] ||= { } | |
207 | end | |
208 | ||
def sidebar_controller | ||
@sidebar_controller ||= SidebarController.available_sidebars.find { |s| s.short_name == self.controller } | ||
end | ||
25 | | |
26 | | |
213 | def html_id | |
214 | short_name + '-' + id.to_s | |
end | ||
29 | | |
30 | | |
217 | def parse_request(contents, params) | |
end | ||
219 | ||
220 | def fields | |
221 | self.class.fields | |
222 | end | |
223 | ||
224 | def fieldmap(field = nil) | |
225 | if field | |
226 | self.class.fieldmap[field.to_s] | |
227 | else | |
228 | self.class.fieldmap | |
229 | end | |
230 | end | |
231 | ||
232 | def description | |
233 | self.class.description | |
234 | end | |
235 | ||
236 | def short_name | |
237 | self.class.short_name | |
238 | end | |
239 | ||
240 | def display_name | |
241 | self.class.display_name | |
242 | end | |
243 | ||
244 | def content_partial | |
245 | "/sidebars/#{short_name}/content" | |
246 | end | |
247 | ||
248 | def to_locals_hash | |
249 | fields.inject({ :sidebar => self }) do |hash, field| | |
250 | hash.merge(field.key => config[field.key]) | |
251 | end | |
252 | end | |
253 | ||
254 | def lifetime | |
255 | self.class.lifetime | |
256 | end | |
257 | ||
258 | def view_root | |
259 | self.class.view_root | |
260 | end | |
end | ||
262 |
rool/rails/typo/trunk/app/models/tag.rb:
prev. | current | |
end | ||
def self.to_prefix | ||
53 | | |
53 | 'tag' | |
end | ||
def published_articles | ||
... | ... | |
def permalink | ||
self.name | ||
end | ||
63 | ||
64 | def permalink_url(anchor=nil, only_path=true) | |
65 | blog = Blog.find(1) # remove me... | |
66 | ||
67 | blog.url_for( | |
68 | :controller => '/articles', | |
69 | :action => 'tag', | |
70 | :id => permalink | |
71 | ) | |
72 | end | |
73 | ||
end |
rool/rails/typo/trunk/app/models/text_filter.rb:
prev. | current | |
require 'net/http' | ||
2 | ||
4 | ||
3 | class TextFilter < CachedModel | |
serialize :filters | ||
serialize :params | ||
def self.available_filters | ||
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
14 | | |
15 | ||
16 | | |
8 | TextFilterPlugin.filter_map.values | |
end | ||
11 | TYPEMAP={TextFilterPlugin::Markup => "markup", | |
12 | TextFilterPlugin::MacroPre => "macropre", | |
13 | TextFilterPlugin::MacroPost => "macropost", | |
14 | TextFilterPlugin::PostProcess => "postprocess", | |
15 | TextFilterPlugin => "other"} | |
16 | ||
def self.available_filter_types | ||
filters=available_filters | ||
21 | | |
22 | | |
23 | | |
24 | | |
25 | | |
19 | @cached_filter_types ||= {} | |
27 | | |
28 | | |
29 | | |
30 | | |
31 | | |
21 | unless @cached_filter_types[filters] | |
22 | types={"macropre" => [], | |
23 | "macropost" => [], | |
24 | "markup" => [], | |
25 | "postprocess" => [], | |
26 | "other" => []} | |
33 | | |
28 | filters.each { |filter| types[TYPEMAP[filter.superclass]].push(filter) } | |
35 | | |
30 | @cached_filter_types[filters] = types | |
31 | end | |
32 | ||
33 | @cached_filter_types[filters] | |
end | ||
def self.filters_map | ||
39 | | |
37 | TextFilterPlugin.filter_map | |
end | ||
42 | | |
43 | ||
40 | def self.filter_text(blog, text, content, filters, filterparams={}) | |
map=TextFilter.filters_map | ||
45 | | |
filters.each do |filter| | ||
next if filter == nil | ||
begin | ||
50 | | |
51 | | |
52 | | |
46 | filter_class = map[filter.to_s] | |
47 | next unless filter_class | |
48 | text = filter_class.filtertext(blog, content, text, :filterparams => filterparams) | |
rescue => err | ||
logger.error "Filter #{filter} failed: #{err}" | ||
end | ||
... | ... | |
text | ||
end | ||
61 | | |
57 | def self.filter_text_by_name(blog, text, filtername) | |
f = TextFilter.find_by_name(filtername) | ||
63 | | |
59 | f.filter_text_for_content blog, text, nil | |
end | ||
66 | | |
67 | | |
68 | | |
69 | | |
70 | | |
62 | def filter_text_for_content(blog, text, content) | |
63 | self.class.filter_text(blog, text, content, | |
64 | [:macropre, markup, :macropost, filters].flatten, params) | |
end | ||
73 | | |
74 | | |
67 | def filter(text) | |
68 | typo_deprecated "What does this do?" | |
69 | self.class.filter(text,self.filters,self.params) | |
end | ||
def help | ||
... | ... | |
def commenthelp | ||
filter_map = TextFilter.filters_map | ||
96 | | |
help = [filter_map[markup]] | ||
filters.each { |f| help.push(filter_map[f.to_s]) } |
rool/rails/typo/trunk/app/models/theme.rb:
prev. | current | |
File.read("#{path}/about.markdown") rescue "### #{name}" | ||
end | ||
19 | # Find a theme, given the theme name | |
20 | def self.find(name) | |
21 | self.new(name,theme_path(name)) | |
22 | end | |
23 | ||
def self.themes_root | ||
RAILS_ROOT + "/themes" | ||
end | ||
28 | def self.theme_path(name) | |
29 | themes_root + "/" + name | |
30 | end | |
31 | ||
def self.theme_from_path(path) | ||
name = path.scan(/[-\w]+$/i).flatten.first | ||
self.new(name, path) |
rool/rails/typo/trunk/app/models/trackback.rb:
prev. | current | |
require_dependency 'spam_protection' | ||
3 | ||
4 | | |
5 | | |
6 | ||
3 | class Trackback < Feedback | |
4 | belongs_to :article | |
content_fields :excerpt | ||
8 | ||
9 | | |
validates_presence_of :title, :excerpt, :url | ||
11 | | |
13 | | |
14 | | |
15 | | |
16 | ||
def initialize(*args, &block) | ||
super(*args, &block) | ||
self.title ||= self.url | ||
self.blog_name ||= "" | ||
end | ||
23 | | |
24 | | |
25 | | |
14 | before_create :process_trackback | |
27 | | |
28 | | |
29 | ||
def make_nofollow | ||
31 | | |
32 | | |
33 | | |
17 | typo_deprecated 'Do it via postprocessing.' | |
end | ||
def process_trackback | ||
... | ... | |
end | ||
end | ||
43 | | |
44 | | |
45 | | |
46 | | |
47 | | |
48 | | |
49 | | |
50 | | |
27 | def article_allows_feedback? | |
28 | return true if article.allow_pings? | |
29 | errors.add(:article, 'Article is not pingable') | |
30 | false | |
end | ||
53 | | |
54 | | |
55 | | |
33 | def blog_allows_feedback? | |
34 | return true unless blog.global_pings_disable | |
35 | errors.add(:article, "Pings are disabled") | |
36 | false | |
end | ||
57 | | |
58 | | |
59 | | |
38 | ||
39 | def originator | |
40 | blog_name | |
end | ||
42 | ||
43 | def body | |
44 | excerpt | |
45 | end | |
46 | ||
47 | def body=(newval) | |
48 | self.excerpt = newval | |
49 | end | |
end | ||
rool/rails/typo/trunk/app/models/user.rb:
prev. | current | |
require 'digest/sha1' | ||
# this model expects a certain database layout and its based on the name/login pattern. | ||
4 | ||
5 | | |
6 | | |
7 | | |
4 | class User < CachedModel | |
5 | has_many :notifications, :foreign_key => 'notify_user_id' | |
6 | has_many :notify_contents, :through => :notifications, | |
7 | :source => 'notify_content', | |
8 | :uniq => true | |
has_many :articles, :order => 'created_at DESC' do | ||
def published | ||
... | ... | |
# @user = User.authenticate('bob', 'bobpass') | ||
# | ||
def self.authenticate(login, pass) | ||
25 | | |
26 | find(:first, | |
27 | :conditions => ["login = ? AND password = ?", login, sha1(pass)]) | |
end | ||
def self.authenticate?(login, pass) |
rool/rails/typo/trunk/app/views/accounts/login.rhtml:
prev. | current | |
1 | ||
1 | <% form_tag :action=> "login" do %> | |
<div title="Account login" id="loginform"> | ||
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
15 | | |
16 | | |
6 | <h3>Typo</h3> | |
18 | | |
19 | | |
8 | <div class="form admin"> | |
9 | <% if flash[:notice] %> | |
10 | <h4><%= flash[:notice] %></h4> | |
11 | <% end %> | |
12 | <ul> | |
13 | <li> | |
14 | <label for="user_login" class="block"><%= _('Username')%>:</label> | |
15 | <input type="text" name="user_login" id="user_login" size="20" value=""/> | |
16 | </li> | |
17 | <li> | |
18 | <label for="user_password" class="block"><%= _('Password') %>:</label> | |
19 | <input type="password" name="user_password" id="user_password" size="30"/> | |
20 | </li> | |
21 | </ul> | |
22 | <input type="submit" name="login" value= "<%= _('Login') %> »" class="primary" /> | |
23 | <p><%= link_to "« " + _('Back to the blog'), { :controller => '/articles' } %></p> | |
</div> | ||
</div> | ||
23 | ||
27 | <% end %> | |
rool/rails/typo/trunk/app/views/accounts/logout.rhtml:
prev. | current | |
1 | ||
1 | <h3><%= _("Logoff")%></h3> | |
<div class="memo"> | ||
<p> | ||
5 | | |
6 | | |
5 | <%= _("You are now logged out of the system") %>. | |
6 | <%= link_to _("Do you want to go to your blog?"), :controller => "articles" %> | |
</p> | ||
8 | | |
9 | | |
10 | | |
8 | ||
9 | <%= link_to "« " + _('Login'), :action => "login" %><br /> | |
10 | ||
</div> | ||
rool/rails/typo/trunk/app/views/accounts/signup.rhtml:
prev. | current | |
1 | ||
1 | <% form_tag :action=> "signup" do %> | |
<%= error_messages_for 'user' %><br/> | ||
<div title="Account signup" id="loginform"> | ||
6 | | |
6 | <h3><%= _('Signup') %></h3> | |
<div class="form"> | ||
8 | | |
8 | <label for="user_login"><%= _("Desired login") %>:</label><br/> | |
<%= text_field "user", "login", :size => 20 %><br/> | ||
11 | | |
11 | <label for="user_login"><%= _("Display name")%>:</label><br/> | |
<%= text_field "user", "name", :size => 30 %><br/> | ||
14 | | |
14 | <label for="user_login"><%= _("Email")%>:</label><br/> | |
<%= text_field "user", "email", :size => 30 %><br/> | ||
17 | | |
17 | <label for="user_password"><%= _("Choose password")%>:</label><br/> | |
<%= password_field "user", "password", :size => 30 %><br/> | ||
19 | | |
19 | <label for="user_password_confirmation"><%= _("Confirm password")%>:</label><br/> | |
<%= password_field "user", "password_confirmation", :size => 30 %><br/> | ||
21 | | |
21 | <input type="submit" value="<%= _('Signup') %>" class="primary" /> | |
</div> | ||
</div> | ||
25 | ||
25 | <% end %> | |
rool/rails/typo/trunk/app/views/admin/base/_recent_comments.rhtml:
prev. | current | |
1 | ||
1 | <h2><%= _("Recent comments")%></h2> | |
<ul class="recent"> | ||
<% for comment in Comment.find(:all, :limit => 5, :order => 'id DESC' ) %> | ||
<li> | ||
<h4><%= truncate(comment.author, 20) %></h4> | ||
6 | | |
6 | <div><%= link_to truncate(comment.body, 20), :controller => "/admin/comments", :action => "show", :id => comment.id, :article_id => comment.article_id %></div> | |
<p class="right"><%= time_ago_in_words(comment.created_at) %> ago</p> | ||
</li> | ||
<% end %> |
rool/rails/typo/trunk/app/views/admin/base/_recent_trackbacks.rhtml:
prev. | current | |
1 | ||
1 | <h2><%=_("Recent trackbacks")%></h2> | |
<ul class="recent"> | ||
<% for trackback in Trackback.find(:all, :limit => 5, :order => 'id DESC' ) %> | ||
<li> | ||
5 | | |
5 | <%= link_to truncate(trackback.excerpt, 20), :controller => "/admin/trackbacks", :action => "show", :id => trackback.id, :article_id => trackback.article_id %><br /> | |
by <%= truncate(trackback.blog_name, 20) %><br /> | ||
<%= time_ago_in_words(trackback.created_at) %> ago | ||
</li> |
rool/rails/typo/trunk/app/views/admin/blacklist/_blacklist_patterns.rhtml:
prev. | current | |
<table cellspacing="1" cellpadding="0"> | ||
<tr> | ||
3 | | |
4 | | |
5 | | |
6 | | |
3 | <th><%= _("Pattern") %></th> | |
4 | <th><%= _("Type") %></th> | |
5 | <th><%= _("Edit") %></th> | |
6 | <th><%= _("Delete")%></th> | |
</tr> | ||
<% for blacklist_pattern in @blacklist_patterns -%> | ||
<tr <%= alternate_class -%>> |
rool/rails/typo/trunk/app/views/admin/blacklist/_form.rhtml:
prev. | current | |
<%= error_messages_for 'blacklist_pattern' %> | ||
<!--[form:blacklist_pattern]--> | ||
<p> | ||
4 | | |
4 | <label for="blacklist_pattern_pattern"><%= _("Pattern")%>:</label> | |
<%= text_field 'blacklist_pattern', 'pattern' %> | ||
</p> | ||
<p> | ||
<% if @controller.action_name == "new" %> | ||
9 | | |
9 | <label for="blacklist_pattern_type"><%= _("Type")%>:</label> | |
<select name="blacklist_pattern[type]"> | ||
11 | | |
11 | <%= options_for_select [ [_('String'), 'StringPattern'], [_('Regex'), 'RegexPattern' ] ] %> | |
</select> | ||
<% end %> | ||
</p> |
rool/rails/typo/trunk/app/views/admin/blacklist/_quick_post.rhtml:
prev. | current | |
1 | ||
1 | <% form_tag :action=>"new" do %> | |
<p> | ||
4 | | |
4 | <label for="blacklist_pattern_pattern"><%= _("Pattern")%>:</label> | |
<%= text_field 'blacklist_pattern', 'pattern' %> | ||
</p> | ||
<p> | ||
8 | | |
8 | <label for="blacklist_pattern_type"><%= _("Type")%>:</label> | |
<select name="blacklist_pattern[type]"> | ||
10 | | |
10 | <%= options_for_select [ [_('String'), 'StringPattern'], [_('Regex'), 'RegexPattern' ] ] %> | |
</select> | ||
<div id="operations"> | ||
14 | | |
14 | <%= save(_("Add pattern")) %> <%= _("or")%> <a href="#" onclick="new Effect.BlindUp('quick-post', {duration: 0.4}); return false;" ><%= _("Cancel")%></a> | |
</div> | ||
16 | ||
16 | </p> | |
17 | <% end %> |
rool/rails/typo/trunk/app/views/admin/blacklist/destroy.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Blacklist Patterns') %> | |
<% content_for('tasks') do %> | ||
4 | | |
4 | <%= task_show _('Show this pattern'), @blacklist_pattern.id %> | |
<% end %> | ||
7 | | |
8 | | |
7 | <p><%= _("Are you sure you want to delete this item?")%></p> | |
8 | <% form_tag :action => "destroy", :id => @blacklist_pattern.id do %> | |
<%= confirm_delete %> | ||
10 | | |
11 | <% end %> |
rool/rails/typo/trunk/app/views/admin/blacklist/edit.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Blacklist Patterns') %> | |
3 | | |
4 | | |
5 | | |
6 | | |
3 | <% form_tag :action=>"edit", :id => @blacklist_pattern.id do %> | |
4 | ||
5 | <h3><%= _("Editing pattern")%></h3> | |
6 | <div class="form"> | |
<%= render_partial "form" %> | ||
</div> | ||
<div id="operations"> | ||
11 | | |
11 | <%= save %> or <%= cancel %> | |
</div> | ||
14 | | |
15 | <% end %> |
rool/rails/typo/trunk/app/views/admin/blacklist/list.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Blacklist Patterns') %> | |
<% content_for('tasks') do %> | ||
4 | | |
4 | <%= task_quickpost(_('Create new Blacklist')) %> | |
<% end %> | ||
<div id="quick-post" style="display:none;position:absolute;"> |
rool/rails/typo/trunk/app/views/admin/cache/list.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Cache') %> | |
<% content_for('tasks') do %> | ||
<%= task_sweep 'Empty Page Cache' %> | ||
<% end %> | ||
<div id="users"> | ||
7 | | |
7 | <p> <%= _("There are %d entries in the page cache", @page_cache_size) %></p> | |
</div> |
rool/rails/typo/trunk/app/views/admin/categories/_categories.rhtml:
prev. | current | |
<table> | ||
<tr> | ||
3 | | |
4 | | |
5 | | |
3 | <th><%= _("Category title")%></th> | |
4 | <th><%= _("Articles")%></th> | |
5 | <th><%= _("Delete")%></th> | |
</tr> | ||
<% for category in @categories -%> | ||
<tr <%= alternate_class -%> id="category_<%= category.id -%>"> |
rool/rails/typo/trunk/app/views/admin/categories/_form.rhtml:
prev. | current | |
<%= error_messages_for 'category' %> | ||
<!--[form:category]--> | ||
<p> | ||
4 | | |
4 | <label for="category_name"><%= _("Name")%>:</label> | |
<%= text_field 'category', 'name' %> | ||
</p> | ||
<!--[eoform:cateogry]--> | ||
rool/rails/typo/trunk/app/views/admin/categories/_quick_post.rhtml:
prev. | current | |
1 | ||
1 | <% form_tag :action=>"new" do %> | |
<p> | ||
4 | | |
5 | | |
4 | <label for="category_name"><%= _("Title")%>:</label><br/> | |
5 | <%= text_field 'category', 'name' %> | |
</p> | ||
<div id="operations"> | ||
9 | | |
9 | <%= save(_("Add category")) %> <%= _("or")%> <a href="#" onclick="new Effect.BlindUp('quick-post', {duration: 0.4}); return false;" ><%= _("Cancel")%></a> | |
</div> | ||
11 | ||
11 | <% end %> |
rool/rails/typo/trunk/app/views/admin/categories/destroy.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Categories') %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
4 | <%= task_show _('Show this category'), @category.id %> | |
5 | <% end %> | |
7 | | |
8 | | |
9 | | |
10 | | |
8 | <p><%= _("Are you sure you want to delete the category ")%> '<%= @category.name %>'?</p> | |
9 | <% form_tag :action => "destroy", :id => @category.id do %> | |
10 | <%= confirm_delete(_("Delete this category")) %> | |
11 | <% end %> |
rool/rails/typo/trunk/app/views/admin/categories/edit.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Categories') %> | |
3 | | |
4 | | |
5 | | |
3 | <% form_tag :action=>"edit", :id => @category.id do %> | |
4 | <h3><% _("Editing category")%></h3> | |
5 | <div class="form"> | |
<%= render_partial "form" %> | ||
</div> | ||
<div id="operations"> | ||
10 | | |
10 | <%= save %> or <%= cancel %> | |
</div> | ||
13 | | |
14 | <% end %> |
rool/rails/typo/trunk/app/views/admin/categories/list.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Manage Categories') %> | |
<% content_for('tasks') do -%> | ||
4 | | |
5 | | |
6 | | |
4 | <%= task_quickpost(_('Create new category')) -%> | |
5 | <li><%= link_to_remote(_('Reorder'), :update => 'category_container', :url => { :action => 'reorder' }) %></li> | |
6 | <li><%= link_to_remote(_('Sort alphabetically'), :update => 'category_container', :url => { :action => 'asort' }) -%></li> | |
7 | <%= tab _("Manage Articles"), :controller=>"content", :action=>"list"%> | |
8 | <%= tab _("Manage Pages"), :controller=>"pages", :action=>"list" %> | |
9 | <%= tab _("Manage Resources"), :controller=>"resources", :action=>"list" %> | |
<% end -%> | ||
<div id="quick-post" style="display:none;position:absolute;"> |
rool/rails/typo/trunk/app/views/admin/categories/reorder.rhtml:
prev. | current | |
<% end -%> | ||
</ul> | ||
7 | ||
7 | <%= link_to_remote _("(Done)"), :update => "category_container", :url => { :action => "category_container" } %> | |
<%= sortable_element "category_list", :url => { :action => "order" }, :complete => visual_effect(:highlight, "category_list") %> | ||
rool/rails/typo/trunk/app/views/admin/categories/show.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _("Articles in") + " #{h @category.name}" %> | |
<% content_for('tasks') do %> | ||
4 | | |
4 | <%= task_edit _('Edit this category'), @category.id %> | |
<% end %> | ||
7 | | |
7 | <% form_tag :action=>"new" do %> | |
<div class="list"> | ||
<table cellspacing="1" cellpadding="0"> | ||
<% for article in @category.articles -%> | ||
<tr <%= alternate_class -%>> | ||
12 | | |
12 | <td><%= image_tag 'checked.gif' %> <%= link_to h(article.title), :controller => "/admin/content", :action => "show", :id => article.id %></td> | |
<td><%= distance_of_time_in_words_to_now article.published_at %> ago</td> | ||
14 | | |
14 | <td><%= link_to pluralize(article.comments.size, 'comment'), :controller => '/admin/comments', :article_id => article, :action => 'list' %></td> | |
</tr> | ||
<% end -%> | ||
</table> | ||
</div> | ||
19 | <% end %> |
rool/rails/typo/trunk/app/views/admin/comments/_form.rhtml:
prev. | current | |
<%= error_messages_for 'comment' %> | ||
<!--[form:comment]--> | ||
<p> | ||
4 | | |
4 | <label for="comment_author"><%= _("Author")%>:</label><br/> | |
<%= text_field 'comment', 'author' %> | ||
</p> | ||
<p> | ||
8 | | |
8 | <label for="comment_url"><%= _("Url") %>:</label><br/> | |
<%= text_field 'comment', 'url' %> | ||
</p> | ||
<p> | ||
12 | | |
12 | <label for="comment_email"><%= _("Email")%>:</label><br/> | |
<%= text_field 'comment', 'email' %> | ||
</p> | ||
<p> | ||
16 | | |
16 | <label for="comment_body"><%= _("Body")%>:</label><br/> | |
<%= text_area 'comment', 'body' %> | ||
</p> | ||
<!--[eoform:comment]--> |
rool/rails/typo/trunk/app/views/admin/comments/comments.rhtml:
prev. | current | |
<% for comment in @comments %> | ||
2 | ||
2 | by <strong><%= comment.author %></strong> <%= _("on")%> <%= comment.created_at %> <%= link_to '[x]', :action => 'comment_destroy', :id => comment.id %> <br /> | |
<%= comment.body %><br /><br /> | ||
<% end %> |
rool/rails/typo/trunk/app/views/admin/comments/destroy.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _("Comments for") + " #{ link_to h(@article.title), :controller => '/admin/content', :action => 'show', :id => @article }" %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
4 | <%= task_show _('Show this comment'), @comment.id %> | |
5 | <% end %> | |
7 | | |
8 | | |
7 | <p><%= _("Are you sure you want to delete this item?")%></p> | |
8 | <% form_tag do %> | |
<%= hidden_field "comment", "id" %> | ||
<%= confirm_delete %> | ||
11 | | |
11 | <% end %> |
rool/rails/typo/trunk/app/views/admin/comments/edit.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _("Comments for") + " #{ link_to h(@article.title), :controller => '/admin/content', :action => 'show', :id => @article }" %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
4 | <li><%= link_to_permalink @comment, _('View comment on your blog') %></li> | |
5 | <% end %> | |
7 | | |
7 | <% form_tag :action=>"edit", :id => @comment.id do %> | |
9 | | |
10 | | |
9 | <h3><%= _("Editing comment")%></h3> | |
10 | <div class="form"> | |
<%= render_partial "form" %> | ||
</div> | ||
<div id="operations"> | ||
15 | | |
15 | <%= save %> or <%= cancel %> | |
</div> | ||
18 | | |
18 | <% end %> |
rool/rails/typo/trunk/app/views/admin/comments/list.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = "Comments for #{ link_to h(@article.title), :controller => '/admin/content', :action => 'show', :id => @article }" %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
4 | <%= task_new('Write a comment') %> | |
5 | <li><%= link_to _('Manage articles'), :controller => '/admin/content', :action => 'list' %></li> | |
<% end %> | ||
<div class="list"> | ||
<table> | ||
<tr> | ||
11 | | |
12 | | |
13 | | |
14 | | |
15 | | |
16 | | |
17 | | |
11 | <th><%= _("Author")%></th> | |
12 | <th><%= _("Email")%></th> | |
13 | <th><%= _("Body")%></th> | |
14 | <th><%= _("IP")%></th> | |
15 | <th><%= _("Posted date")%></th> | |
16 | <th><%= _("Edit")%></th> | |
17 | <th><%= _("Delete")%></th> | |
</tr> | ||
<% for comment in @comments -%> | ||
<tr> | ||
<td class="field"><%= image_tag 'checked.gif' %> <%=link_to_unless comment.url.blank?, h(comment.author), comment.url %></td> | ||
<td class="field"><%=h comment.email %></td> | ||
23 | | |
23 | <td class="field"><%=link_to truncate((comment.body).strip_html), :action => 'show', :id => comment.id %> <%= link_to_permalink comment,image_tag('go.png') %></td> | |
<td class="field"><%=h comment.ip %></td> | ||
<td class="field"><%=h distance_of_time_in_words_to_now(comment.created_at) %></td> | ||
<td class="operation"><%= link_to_edit comment %></td> |
rool/rails/typo/trunk/app/views/admin/comments/new.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _("Comments for") + " #{ link_to h(@article.title), :controller => '/admin/content', :action => 'show', :id => @article }" %> | |
3 | | |
4 | | |
5 | | |
3 | <h3><%= _("Creating comment")%></h3> | |
7 | | |
5 | <% form_tag :action=>"new" do %> | |
6 | ||
7 | <div class="form"> | |
<%= render_partial "form" %> | ||
</div> | ||
<div id="operations"> | ||
12 | | |
12 | <%= save %> or <%= cancel %> | |
</div> | ||
15 | | |
16 | <% end %> |
rool/rails/typo/trunk/app/views/admin/comments/show.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _("Comments for") + " #{ link_to h(@article.title), :controller => '/admin/content', :action => 'show', :id => @article }" %> | |
<div class="form"> | ||
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
4 | <label><%= _("Author")%>:</label> <span class="static"><%=h @comment.author %></span><br/> | |
5 | <label><%= _("URL")%>:</label> <span class="static"><%=h @comment.url %></span><br/> | |
6 | <label><%= _("Email")%>:</label> <span class="static"><%=h @comment.email %></span><br/> | |
7 | <label><%= _("Body")%>:</label> <span class="static"><%=h @comment.body %></span><br/> | |
8 | <label><%= _("IP")%>:</label> <span class="static"><%=h @comment.ip %></span><br/> | |
9 | <label><%= _("Posted date")%>:</label> <span class="static"><%=h @comment.created_at %></span><br/> | |
</div> |
rool/rails/typo/trunk/app/views/admin/content/_articles.rhtml:
prev. | current | |
<table cellspacing="1" cellpadding="0"> | ||
<tr> | ||
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
3 | <th><%= _("Post title")%></th> | |
4 | <th><%= _("Posted at")%></th> | |
5 | <th><%= _("Comments")%></th> | |
6 | <th><%= _("Trackbacks")%></th> | |
7 | <th><%= _("Status")%></th> | |
8 | <th colspan="3" style="text-align: center;">Action</th> | |
</tr> | ||
<% for article in @articles %> | ||
<tr <%= alternate_class %>> | ||
12 | | |
13 | | |
14 | | |
15 | | |
12 | <td> <%= link_to_permalink article, h(article.title) %></td> | |
13 | <td><%= article.published_at.strftime("%d/%m/%Y at %H:%M")%></td> | |
14 | <td><%= link_to _(pluralize(article.comments.size, 'comment')), :controller => '/admin/comments', :article_id => article, :action => 'list' %></td> | |
15 | <td><%= link_to _(pluralize(article.trackbacks.size, 'trackback')), :controller => '/admin/trackbacks', :article_id => article, :action => 'list' %></td> | |
16 | <td class="operation"><%= (article.published?) ? image_tag('checked.png', :alt => "online", :title => _("Online")) : image_tag('cancel.png', :alt => "offline", :title => _("Offline")) %></td> | |
17 | <td class="operation"><%= link_to image_tag('show.png', :alt => "View article", :title => "Preview article"), {:action => "show", :id => article.id} %></td> | |
<td class="operation"><%= link_to_edit article %></td> | ||
<td class="operation"><%= link_to_destroy article %></td> | ||
</tr> |
rool/rails/typo/trunk/app/views/admin/content/_attachment.rhtml:
prev. | current | |
1 | ||
2 | | |
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
14 | | |
15 | | |
16 | ||
17 | ||
1 | <div id="attachment_<%= attachment_num -%>"<% if hidden %> style="display: none;"<% end %>> | |
2 | <%= file_field 'attachments', "filename_#{attachment_num}" -%> | |
3 | <%= link_to_function(_("Remove"), | |
4 | update_page do |page| | |
5 | page << "if (confirm(_(Really delete attachment) +' #{attachment_num}?')){" | |
6 | page.visual_effect(:toggle_appear, "attachment_#{attachment_num}", :afterFinish => "function(obj){Element.remove(obj.element);}") | |
7 | page << "}" | |
8 | end) -%> | |
9 | <br /> | |
10 | </div> | |
11 | <div id="attachment_add_<%= attachment_num.succ %>"> | |
12 | <%= link_to_remote _('Add Another Attachment'), | |
13 | :url => { :action => "attachment_box_add", :id => attachment_num.succ }, | |
14 | :asynchronus => false -%> | |
15 | </div> | |
rool/rails/typo/trunk/app/views/admin/content/_form.rhtml:
prev. | current | |
<%= error_messages_for 'article' %> | ||
<!--[form:articles]--> | ||
3 | ||
4 | | |
5 | | |
6 | | |
7 | ||
8 | ||
9 | | |
10 | | |
11 | ||
12 | ||
13 | | |
14 | | |
15 | | |
16 | ||
17 | ||
18 | | |
19 | | |
20 | | |
21 | | |
22 | ||
23 | ||
24 | | |
25 | | |
26 | ||
27 | ||
28 | | |
29 | | |
30 | | |
31 | | |
3 | <fieldset class="set admin" style="display: block"> | |
4 | <legend><%=_("Article Body")%></legend> | |
5 | <iframe id="preview" class="post" style="display: none;"></iframe> | |
6 | <div style="width: 48%; float: left;"> | |
7 | <ul> | |
8 | <li> | |
9 | <label for="article_title" class="block">Title:</label> | |
10 | <%= text_field 'article', 'title', :style => 'width: 100%;' %> | |
11 | </li> | |
12 | <li> | |
13 | <label for="article_body"><%= _("Article Content")%>:</label> | |
14 | <%= markup_help_popup @article.text_filter, image_tag('help.png', :alt => "markup help", :title => "Markup Help") %> | |
15 | <%= text_area 'article', 'body', :rows => 25, :style => 'width: 100%;' %> | |
16 | </li> | |
17 | <li id="extended"<%- if @article.extended.blank? -%> style="display:none;"<%- end -%>> | |
18 | <label for="article_extended"><%= _("Extended Content")%>:</label> | |
19 | <%= text_area 'article', 'extended', :rows => 30, :style => 'width: 100%;' %> | |
20 | <%= link_to_function "Toggle Extended Content (+/-)",update_page { |page| page.visual_effect(:toggle_blind, "extended", :duration => 0.5) } %> | |
21 | </li> | |
22 | <li> | |
23 | <label for="categories" class="block"><%= _("Categories")%>:</label> | |
24 | <select id="categories" name="categories[]" multiple="multiple" size="10" style="width:250px;"> | |
25 | <%= options_from_collection_for_select(@categories, "id", "name", @selected) %> | |
26 | </select> | |
27 | </li> | |
28 | <li> | |
29 | <label for="article_keywords"><%= _("Tags")%>:</label> | |
30 | <%= text_field 'article', 'keywords', :style => 'width: 100%;' %> | |
31 | </li> | |
32 | </ul> | |
33 | <p class="r"><%= save(_("Save")) %> or <%= cancel %></p> | |
</div> | ||
33 | ||
35 | <br style ="clear: both"/> | |
36 | </fieldset> | |
35 | ||
36 | ||
37 | ||
38 | ||
39 | ||
40 | ||
41 | ||
42 | ||
43 | ||
38 | <fieldset class="set admin"> | |
39 | <legend><%= _("Article Attachments")%></legend> | |
40 | <div id="attachments"> | |
41 | <%= render :partial => 'admin/content/attachment', :locals => { :attachment_num => 1, :hidden => false } -%> | |
42 | </div> | |
43 | </fieldset> | |
45 | ||
46 | ||
47 | ||
48 | ||
49 | ||
50 | ||
45 | <fieldset class="set admin"> | |
46 | <legend><%= _("Article Options")%></legend> | |
47 | <ul> | |
48 | <li> | |
49 | <label for="article_permalink" class="float"><%= _("Permalink")%>:</label> | |
50 | <%= text_field 'article', 'permalink' %> | |
51 | </li> | |
52 | <li class="checkbox"> | |
53 | <label for="article_allow_comments" class="float"><%= _("Allow comments") %>: </label> | |
54 | <%= check_box 'article', 'allow_comments' %> | |
55 | </li> | |
56 | <li class="checkbox"> | |
57 | <label for="article_allow_pings" class="float"><%= _("Allow trackbacks")%>: </label> | |
58 | <%= check_box 'article', 'allow_pings' %> | |
59 | </li> | |
60 | <li> | |
61 | <label for="article_published" class="float"><%= _("Published")%>:</label> | |
62 | <%= check_box 'article', 'published' %> | |
63 | </li> | |
64 | <li> | |
65 | <label for="article_published_at" class="float"><%= _("Publish at")%>:</label> | |
66 | <%= datetime_select 'article', 'published_at', :include_blank => true %> | |
67 | </li> | |
68 | <li> | |
69 | <label for="article_text_filter" class="float"><%= _("Textfilter")%>: </label> | |
70 | <%= select 'article', 'text_filter', text_filter_options %> | |
71 | </li> | |
72 | </ul> | |
73 | </fieldset> | |
<!--[eoform:articles]--> |
rool/rails/typo/trunk/app/views/admin/content/_pages.rhtml:
prev. | current | |
1 | | |
1 | <%= link_to _("Previous page"), { :id => pages.current.previous } if pages.current.previous -%> | |
<%= pagination_links pages, :name => 'id' -%> | ||
3 | | |
3 | <%= link_to _("Next page"), { :id => pages.current.next } if pages.current.next -%> |
rool/rails/typo/trunk/app/views/admin/content/_quick_post.rhtml:
prev. | current | |
1 | | |
1 | <% form_tag :action=>"new" do %> | |
<p> | ||
3 | | |
3 | <label for="articles_title"><%= _("Title")%>:</label><br /> | |
<%= text_field 'article', 'title' %> | ||
</p> | ||
<p> | ||
<p> | ||
8 | | |
8 | <label for="categories[]"><%= _("Categories")%>:</label><br /> | |
<select name="categories[]" multiple="multiple" size="3" style="width:250px;"> | ||
<%= options_from_collection_for_select(@categories, "id", "name", @selected) %> | ||
</select> | ||
</p> | ||
<p> | ||
14 | | |
14 | <label for="articles_body"><%= _("Article")%>:</label><br /> | |
<%= text_area 'article', 'body', :rows => 10 %> | ||
</p> | ||
<div id="operations"> | ||
18 | | |
18 | <%= save(_("Save Post")) %> or <a href="#" onclick="new Effect.BlindUp('quick-post', {duration: 0.4}); return false;" >Cancel</a> | |
</div> | ||
20 | ||
20 | <% end %> |
rool/rails/typo/trunk/app/views/admin/content/_show_categories.rhtml:
prev. | current | |
1 | | |
1 | <h4><%= _("Currently this article is listed in following categories")%>:</h4> | |
<% for category in @article.categories %> | ||
<%= link_to_remote "- #{category.name}", :url => { :action => "category_remove", :id => @article.id, :category_id => category.id }, :update => 'categories' %><br/> | ||
<% end %> | ||
6 | | |
6 | <h4><%= _("You can add it to the following categories")%>:</h4> | |
<% for category in @categories - @article.categories %> | ||
<%= link_to_remote "+ #{category.name}", :url => { :action => "category_add", :id => @article.id, :category_id => category.id }, :update => 'categories' %><br/> | ||
<% end %> |
rool/rails/typo/trunk/app/views/admin/content/_show_resources.rhtml:
prev. | current | |
1 | | |
1 | <h4><%= _("Currently this article has the following resources")%></h4> | |
<% for resource in @article.resources %> | ||
<%= link_to_remote "- #{resource.filename}", :url => { :action => "resource_remove", :id => @article.id, :resource_id => resource.id}, :update => 'resources' %><br/> | ||
<% end %> | ||
6 | | |
6 | <h4><%= _("You can associate the following resources")%></h4> | |
<% for resource in @resources - @article.resources %> | ||
<%= link_to_remote "+ #{resource.filename}", :url => { :action => "resource_add", :id => @article.id, :resource_id => resource.id}, :update => 'resources' %><br/> | ||
<% end %> |
rool/rails/typo/trunk/app/views/admin/content/destroy.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Articles') %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
4 | <%= task_show _("Show this article"), @article.id %> | |
5 | <% end %> | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
7 | <p><%= _("Are you sure you want to delete this article")%> ( <%=h @article.title -%> )?</p> | |
8 | <% form_tag :controller => '/admin/content', :action => 'destroy' do %> | |
9 | <%= hidden_field_tag "id", @article.id %> | |
10 | <%= confirm_delete(_("Delete this article")) %> | |
11 | <% end %> |
rool/rails/typo/trunk/app/views/admin/content/edit.rhtml:
prev. | current | |
1 | | |
2 | | |
1 | <% @page_heading = _('Edit Article') %> | |
2 | ||
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
6 | | |
4 | <%= task_overview %> | |
5 | ||
6 | <li><%= link_to _('View article on your blog'), @article.permalink_url %></li> | |
7 | <% end %> | |
8 | | |
9 | | |
10 | ||
11 | | |
12 | | |
13 | | |
14 | | |
15 | | |
16 | | |
17 | ||
18 | | |
19 | | |
20 | | |
21 | ||
22 | | |
23 | ||
24 | | |
25 | | |
26 | | |
27 | | |
28 | | |
9 | <h3><%= _("Edit Article")%></h3> | |
10 | <%= render :partial => "admin/shared/edit", :locals => { :form_type => "article", :form_action => { :action => "edit", :id => @article } } %> |
rool/rails/typo/trunk/app/views/admin/content/list.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Manage Articles') %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
6 | | |
4 | <%= tab _("Manage Pages"), :controller=>"pages", :action=>"list" %> | |
5 | <%= tab _("Manage Categories"), :controller=>"categories", :action=>"index"%> | |
6 | <%= tab _("Manage Resources"), :controller=>"resources", :action=>"list" %> | |
<% end %> | ||
<div id="quick-navigate" style="display:none;position:absolute;"> | ||
<%= render :partial => 'admin/content/pages', :object => @articles_pages -%> |
rool/rails/typo/trunk/app/views/admin/content/new.rhtml:
prev. | current | |
1 | | |
1 | <% content_for('tasks') do %> | |
2 | <%= tab _("Write a Page"), :controller=>"pages", :action=>"new" %> | |
3 | <% end %> | |
3 | | |
5 | <% @page_heading = _('Write an Article') %> | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
14 | ||
15 | | |
16 | | |
17 | | |
18 | ||
19 | | |
20 | ||
21 | | |
22 | | |
23 | | |
24 | | |
25 | | |
26 | ||
27 | | |
7 | <%= render :partial => "admin/shared/edit", :locals => { :form_type => "article", :form_action => { :action => "new" } } %> |
rool/rails/typo/trunk/app/views/admin/content/preview.rhtml:
prev. | current | |
1 | ||
1 | <div class="post"> | |
2 | <h2><%= @article[:title] %></h2> | |
3 | <p class="auth"> | |
4 | <%_("Posted by")%> | |
5 | <%= author_link(@article) %> | |
6 | <%= js_distance_of_time_in_words_to_now @article[:published_at] %> | |
7 | </p> | |
3 | ||
9 | <%= @article.html %> | |
10 | </div> | |
rool/rails/typo/trunk/app/views/admin/content/show.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Preview Article') %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
4 | <%= task_edit _('Edit this article'), @article.id %> | |
5 | <li><%= link_to _('View article on your blog'), @article.permalink_url %></li> | |
6 | <%= task_overview %> | |
<% end %> | ||
<h3><%=h @article.title %></h3> | ||
<div class="form"> | ||
11 | | |
12 | | |
13 | | |
14 | | |
12 | <div><%= @article.html %></div> | |
13 | <p class="meta"><label><%= _("Posted date")%>:</label> <%=h @article.published_at.to_formatted_s(:long_weekday) %> by <%=h @article.author %></p> | |
14 | <p class="meta"><label><%= _("Last updated")%>:</label> <%=h @article.updated_at.to_formatted_s(:long_weekday) %></p> | |
15 | <p class="meta"><label><%= _("Online")%>:</label> <%=h (@article.published? ? "Yes" : "No") %></p> | |
</div> | ||
17 | | |
18 | <h3><%= _("Categories")%></h3> | |
<div id="categories" class="form"> | ||
<%= render :partial => 'show_categories' -%> | ||
</div> | ||
22 | | |
23 | <h3><%= _("Attachments")%></h3> | |
<div id="resources" class="form"> | ||
<%= render :partial => 'show_resources' -%> | ||
</div> |
rool/rails/typo/trunk/app/views/admin/feedback/_item.rhtml:
prev. | current | |
1 | ||
1 | <tr class="<%= state_class(item) %>"> | |
<td class="field"><input class= "feedback_check" type="checkbox" name="feedback_check[<%= item.id %>]"/></td> | ||
3 | | |
3 | <td class="operation"><%=h item.state %></td> | |
<td class="field"><%=h item.class %></td> | ||
<td class="field"><%= link_to_article_edit item.article %></td> | ||
<td class="field"> | ||
<%=h (item.author || '(unknown)').slice(0,40) %><br/> | ||
8 | | |
9 | | |
8 | <% if item.url -%> | |
9 | <%= link_to h(truncate(item.url.to_s)), item.url %><br/> | |
10 | <% end -%> | |
11 | <%=h item.email.to_s.slice(0,40) %> | |
</td> | ||
<td class="field"><%=h truncate(item.body,80)%></td> | ||
<td class="field"><%=h item.ip %></td> | ||
<td class="field"><%=h distance_of_time_in_words_to_now(item.created_at) %> ago</td> | ||
14 | | |
15 | ||
16 | <td class="operation"><%= link_to image_tag('delete.png'), {:action => 'delete', :id => item.id, :search => params[:search], :page => params[:page] }, :confirm => "Are you sure?", :method => :post %></td> | |
17 | </tr> |
rool/rails/typo/trunk/app/views/admin/feedback/list.rhtml:
prev. | current | |
1 | ||
1 | <% @page_heading = _("Comments and Trackbacks for") + " #{ this_blog.settings['blog_name'] }" %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | ||
4 | <%= task_showmod _('Limit to spam') %> | |
5 | <%= task_showmod _("Limit to unconfirmed") %> | |
6 | <%= task_showmod _('Limit to unconfirmed spam') %> | |
7 | <%= tab _("Blacklist"), :controller=>"blacklist", :action=>"index"%> | |
8 | <% end %> | |
7 | ||
8 | | |
9 | | |
10 | | |
10 | <div class="search"> | |
11 | <% form_tag({:action => 'index'}, :method => :get) do %> | |
12 | <label for="search"><%= _("Feedback Search")%>:</label><input type="text" id="feedback_search" name="search" value="<%=h params[:search] %>" size="15" /> | |
13 | <% end %> | |
</div> | ||
13 | ||
14 | | |
16 | <div class="list"> | |
17 | <% form_tag({:action => 'bulkops'}, :method => :post) do %> | |
<br/> | ||
<%= submit_tag "Delete Checked Items" %> | ||
17 | | |
18 | | |
20 | <%= submit_tag "Mark Checked Items as Ham" %> | |
21 | <%= submit_tag "Mark Checked Items as Spam" %> | |
22 | <%= submit_tag "Confirm Classification of Checked Items" %> | |
<%= hidden_field_tag "search", params[:search]%> | ||
<%= hidden_field_tag "page", params[:page]%> | ||
<table> | ||
<tr> | ||
25 | | |
26 | | |
27 | | |
28 | | |
29 | | |
30 | | |
31 | | |
32 | | |
33 | | |
29 | <th><input class="feedback_check" type="checkbox" name="checkall" id="checkall" onclick="check_all(this);"/></th> | |
30 | <th><%= _("Status")%></th> | |
31 | <th><%= _("Type")%></th> | |
32 | <th><%= _("Article")%></th> | |
33 | <th><%= _("Author")%></th> | |
34 | <th><%= _("Body")%></th> | |
35 | <th><%= _("IP")%></th> | |
36 | <th><%= _("Posted date")%></th> | |
37 | <th><%= _("Delete") %></th> | |
</tr> | ||
<%= render :partial => 'item', :collection => @feedback %> | ||
</table> | ||
<%= submit_tag "Delete Checked Items" %> | ||
38 | | |
39 | | |
40 | | |
42 | <%= submit_tag "Mark Checked Items as Ham" %> | |
43 | <%= submit_tag "Mark Checked Items as Spam" %> | |
44 | <%= submit_tag "Confirm Classification of Checked Items" %> | |
45 | <% end %> | |
</div> | ||
43 | ||
48 | <%= link_to _("Previous page"), { :page => @pages.current.previous, :search => params[:search] } if @pages.current.previous %> | |
<%= pagination_links(@pages, :params => {:search => params[:search]}) %> | ||
45 | ||
50 | <%= link_to _("Next page"), { :page => @pages.current.next, :search => params[:search] } if @pages.current.next %> | |
rool/rails/typo/trunk/app/views/admin/general/index.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Blog settings') %> | |
3 | | |
3 | <% form_tag :action => 'update' do %> | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
14 | | |
5 | <div class="tasks"> | |
6 | <h3><%= _("Which settings group would you like to edit")%>?</h3> | |
7 | <ul> | |
8 | <li><a href="#gensettings" onclick="new Effect.ScrollTo('gensettings'); return false"><%= _("General Settings")%></a></li> | |
9 | <li><a href="#read" onclick="new Effect.ScrollTo('read'); return false"><%= _("Read")%></a></li> | |
10 | <li><a href="#write" onclick="new Effect.ScrollTo('write'); return false"><%= _("Write")%></a></li> | |
11 | <li><a href="#discuss" onclick="new Effect.ScrollTo('discuss'); return false"><%= _("Discuss")%></a></li> | |
12 | <li><a href="#notification" onclick="new Effect.ScrollTo('notification'); return false"><%= _("Notification")%></a></li> | |
13 | <li><a href="#spam" onclick="new Effect.ScrollTo('spam'); return false"><%= _("Spam Protection")%></a></li> | |
14 | <li><a href="#resources" onclick="new Effect.ScrollTo('resources'); return false"><%= _("Resource Settings")%></a></li> | |
15 | <li><a href="#misc" onclick="new Effect.ScrollTo('misc'); return false"><%= _("Cache")%></a></li> | |
16 | </ul> | |
17 | <p style="clear:both;"></p> | |
</div> | ||
17 | | |
18 | | |
19 | | |
20 | | |
21 | | |
22 | | |
23 | | |
24 | | |
25 | | |
26 | | |
27 | | |
28 | | |
29 | | |
30 | | |
31 | | |
32 | | |
33 | | |
34 | | |
35 | | |
36 | | |
37 | | |
38 | | |
39 | | |
40 | | |
41 | | |
42 | | |
43 | | |
44 | | |
45 | | |
46 | | |
47 | | |
48 | | |
49 | | |
50 | | |
51 | | |
52 | | |
53 | | |
54 | | |
20 | <div class="admin"> | |
21 | <fieldset id="gensettings" class="set" style="margin-top:10px;"> | |
22 | <legend><%= _("General settings")%></legend> | |
56 | | |
24 | <ul> | |
25 | <li> | |
26 | <label for="blog_name" class="float"><%= _("Blog name")%>:</label> | |
27 | <input name="setting[blog_name]" id="blog_name" type="text" value="<%=h this_blog.blog_name %>" size="<%= this_blog.blog_name.length %>" /> | |
28 | </li> | |
29 | <li> | |
30 | <label class="float" for="blog_subtitle"><%= _("Blog subtitle")%>:</label> | |
31 | <input name="setting[blog_subtitle]" id="blog_subtitle" type="text" value="<%=h this_blog.blog_subtitle %>" size="<%= this_blog.blog_subtitle.length%>" /> | |
32 | </li> | |
33 | <li> | |
34 | <label class="float" for="base_url"><%= _("Blog URL")%>:</label> | |
35 | <input name="setting[base_url]" id="base_url" type="text" value="<%=h this_blog.base_url %>" size="<%= this_blog.base_url.length %> " /> | |
36 | </li> | |
37 | <li> | |
38 | <label class="float" for="geourl_location"><%= _("Latitude, Longitude")%>:</label> | |
39 | <input name="setting[geourl_location]" size="20" id="geourl_location" type="text" value="<%= this_blog.geourl_location %>" /> | |
40 | <span class="float"><%= _("Display")%> <a href="http://geourl.org"><%= _("your lattitude and longitude")%></a> (<%= _("exemple")%> <tt>47.774,-122.201</tt>)</span> | |
41 | </li> | |
42 | <li> | |
43 | <label class="float"><%= _("Show blog name")%>:</label> | |
44 | <input type="radio" name="setting[title_prefix]" value="1" id="blog_title_prefix_1" <%= 'checked="checked"' if this_blog.title_prefix == 1 %>/> | |
45 | <label for="blog_title_prefix_1"><%= _("At the beginning of page title")%></label> | |
46 | <span class="float"> | |
47 | <input type="radio" name="setting[title_prefix]" value="2" id="blog_title_prefix_2" <%= 'checked="checked"' if this_blog.title_prefix == 2 %>/> | |
48 | <label for="blog_title_prefix_2"><%= _("At the end of page title")%></label> | |
49 | </span> | |
50 | <span class="float"> | |
51 | <input type="radio" name="setting[title_prefix]" value="0" id="blog_title_prefix_0" <%= 'checked="checked"' if this_blog.title_prefix == 0 %>/> | |
52 | <label for="blog_title_prefix_0"><%= _("Don't show blog name in page title")%></label> | |
53 | </span> | |
54 | </li> | |
55 | </ul> | |
56 | <p class="r"><%= save(_("Save Settings")) %></p> | |
57 | </fieldset> | |
58 | | |
59 | | |
59 | <fieldset id="read" class="set"> | |
60 | <legend><%= _("Read")%></legend> | |
61 | | |
62 | <ul> | |
63 | <li> | |
64 | <label for="limit_article_display" class="float"><%= _("Display")%> </label> | |
65 | <input name="setting[limit_article_display]" size="4" id="limit_article_display" type="text" value="<%= this_blog.limit_article_display %>" /> | |
66 | <%= _("articles on my homepage by default")%> | |
67 | </li> | |
68 | <li> | |
69 | <label for="limit_rss_display" class="float"><%= _("Display")%> </label> | |
70 | <input name="setting[limit_rss_display]" size="4" id="limit_rss_display" type="text" value="<%= this_blog.limit_rss_display %>" /> | |
71 | <%= _("articles in my news feed by default")%>. | |
72 | </li> | |
73 | <li class="checkbox"> | |
74 | <label class="float" for="show_extended_on_rss"><%= _("Show full article on feed")%>:</label> | |
75 | <input name="setting[show_extended_on_rss]" id="show_extended_on_rss" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.show_extended_on_rss%> /> | |
76 | <input name="setting[show_extended_on_rss]" type="hidden" value="0" /> | |
77 | </li> | |
78 | </ul> | |
79 | <p class="r"><%= save(_("Save Settings")) %></p> | |
80 | </fieldset> | |
63 | | |
64 | | |
65 | | |
66 | | |
67 | | |
68 | | |
82 | <fieldset id="write" class="set"> | |
83 | <legend><%= _("Write")%></legend> | |
70 | | |
85 | <ul> | |
86 | <li> | |
87 | <label class="float" for="text_filter"><%= _("Article filter")%>:</label> | |
88 | <select name="setting[text_filter]" id="text_filter"> | |
89 | <%= options_for_select text_filter_options, TextFilter.find_by_name(this_blog.text_filter) %> | |
90 | </select> | |
91 | </li> | |
92 | <li> | |
93 | <label for="comment_text_filter" class="float"><%= _("Comments filter")%>:</label> | |
94 | <select name="setting[comment_text_filter]" id="comment_text_filter"> | |
95 | <%= options_for_select text_filter_options, TextFilter.find_by_name(this_blog.comment_text_filter) %> | |
96 | </select> | |
97 | </li> | |
98 | <li> | |
99 | <%= _("When publishing articles, Typo can send trackbacks to websites that you link to. This should be disabled for private blogs as it will leak non-public information to sites that you're discussing. For public blogs, there's no real point in disabling this.")%> | |
100 | </li> | |
101 | <li class="checkbox"> | |
102 | <label class="float" for="send_outbound_pings"><%= _("Send trackbacks")%>:</label> | |
103 | <input name="setting[send_outbound_pings]" id="send_outbound_pings" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.send_outbound_pings%> /> | |
104 | <input name="setting[send_outbound_pings]" type="hidden" value="0" /> | |
105 | </li> | |
106 | <li> | |
107 | <label class="float" for="ping_urls"><%= _("URLs to ping automatically")%>:</label> | |
108 | <textarea name="setting[ping_urls]" id="ping_urls" rows="5" cols="50"><%=h this_blog.ping_urls %></textarea> | |
109 | </li> | |
110 | </ul> | |
111 | <p class="r"><%= save(_("Save Settings")) %></p> | |
112 | </fieldset> | |
72 | | |
114 | <fieldset id="discuss" class="set"> | |
115 | <legend><%= _("Discuss")%></legend> | |
116 | <ul> | |
117 | <li> | |
118 | <%= _("This setting allows you to disable trackbacks for every article in your blog. It won't remove existing trackbacks, but it will prevent any further attempt to add a trackback anywhere on your blog.")%> | |
119 | </li> | |
120 | <li class="checkbox"> | |
121 | <label class="float" for="global_pings_disable"><%= _("Disable trackbacks site-wide")%>:</label> | |
122 | <input name="setting[global_pings_disable]" id="global_pings_disable" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.global_pings_disable%> /> | |
123 | <input name="setting[global_pings_disable]" type="hidden" value="0" /> | |
124 | </li> | |
125 | <li class="checkbox"> | |
126 | <label class="float" for="default_allow_pings"><%= _("Enable Trackbacks by default")%>:</label> | |
127 | <input name="setting[default_allow_pings]" id="default_allow_pings" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.default_allow_pings%> /> | |
128 | <input name="setting[default_allow_pings]" type="hidden" value="0" /> | |
129 | </li> | |
130 | <li><%= _("You can enable site wide comment moderation. If you do so, no comment or trackback will appear on your blog unless you validate it")%>.</li> | |
131 | <li class="checkbox"> | |
132 | <label class="float" for="default_moderate_comments"><%= _("Enable comments moderation")%>:</label> | |
133 | <input name="setting[default_moderate_comments]" id="default_moderate_comments" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.default_moderate_comments %> /> | |
134 | <input name="setting[default_moderate_comments]" type="hidden" value="0" /> | |
135 | </li> | |
136 | <li class="checkbox"> | |
137 | <label class="float" for="default_allow_comments"><%= _("Enable comments by default")%>:</label> | |
138 | <input name="setting[default_allow_comments]" id="default_allow_comments" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.default_allow_comments%> /> | |
139 | <input name="setting[default_allow_comments]" type="hidden" value="0" /> | |
140 | </li> | |
141 | <li class="checkbox"> | |
142 | <label class="float" for="link_to_author"><%= _("Show your email address") %>:</label> | |
143 | <input name="setting[link_to_author]" id="link_to_author" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.link_to_author%> /> | |
144 | <input name="setting[link_to_author]" type="hidden" value="0" /> | |
145 | </li> | |
146 | <li class="checkbox"> | |
147 | <label class="float" for="use_gravatar"><%= _("Enable gravatars")%>:</label> | |
148 | <input name="setting[use_gravatar]" id="use_gravatar" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.use_gravatar %> /> | |
149 | <input name="setting[use_gravatar]" type="hidden" value="0" /> | |
150 | </li> | |
151 | <li> | |
152 | <%= _("You can optionally disable non-Ajax comments. Typo will always use Ajax for comment submission if Javascript is enabled, so non-Ajax comments are either from spammers or users without Javascript.")%> | |
153 | </li> | |
154 | <li class="checkbox"> | |
155 | <label for="sp_allow_non_ajax_comments" class="float"><%= _("Allow non-ajax comments") %>:</label> | |
156 | <input name="setting[sp_allow_non_ajax_comments]" id="sp_allow_non_ajax_comments" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.sp_allow_non_ajax_comments%> /> | |
157 | <input name="setting[sp_allow_non_ajax_comments]" type="hidden" value="0" /> | |
158 | </li> | |
159 | <li> | |
160 | <label for="sp_article_auto_close" class="float"><%= _("Disable comments after")%></label> | |
161 | <input name="setting[sp_article_auto_close]" size="4" id="sp_article_auto_close" type="text" value="<%= this_blog.sp_article_auto_close %>" /> <%= _("days") %> | |
162 | <span class="float"><%= _("Set to 0 to never disable comments")%></span> | |
163 | </li> | |
164 | <li> | |
165 | <p><%= _("Typo will automatically reject comments and trackbacks which contain over a certain amount of links in them")%>.</p> | |
166 | <label class="float" for="sp_url_limit"><%= _("Max Links")%>:</label> | |
167 | <input name="setting[sp_url_limit]" size="4" id="sp_url_limit" type="text" value="<%= this_blog.sp_url_limit %>" /> | |
168 | <span class="float"><%= _("Set to 0 to never reject comments")%></span> | |
169 | </li> | |
170 | </ul> | |
74 | | |
75 | | |
76 | | |
77 | | |
172 | <p class="r"><%= save(_("Save Settings")) %></p> | |
173 | </fieldset> | |
79 | | |
175 | <fieldset id="notification" class="set"> | |
176 | <legend><%= _("Notification")%></legend> | |
177 | <ul> | |
178 | <li><%= _("Typo can notify you when new articles or comments are posted")%></li> | |
179 | <li> | |
180 | <label class="float" for="email_from"><%= _("Source Email")%>:</label> | |
181 | <input name="setting[email_from]" size="25" id="email_from" type="text" value="<%= this_blog.email_from %>" /> | |
182 | <span class="float"><%= _("Email address used by Typo to send notifications")%>.</span> | |
183 | </li> | |
184 | <li> | |
185 | <label for="jabber_address" class="float"><%=_("Jabber account")%>:</label> | |
186 | <input name="setting[jabber_address]" size="20" id="jabber_address" type="text" value="<%= this_blog.jabber_address %>" /> | |
187 | <span class="float"><%= _("Jabber account to use when sending Jabber notifications") %>.</span> | |
188 | </li> | |
189 | <li> | |
190 | <label class="float" for="jabber_password"><%= _("Jabber password")%>:</label> | |
191 | <input name="setting[jabber_password]" size="20" id="jabber_password" type="password" value="<%= this_blog.jabber_password %>" /> | |
192 | </li> | |
193 | </ul> | |
194 | <p class="r"><%= save(_("Save Settings")) %></p> | |
195 | </fieldset> | |
81 | | |
82 | | |
83 | | |
84 | | |
85 | | |
86 | | |
87 | | |
88 | | |
89 | | |
90 | | |
91 | | |
197 | <fieldset id="spam" class="set"> | |
198 | <legend><%= _("Spam protection")%></legend> | |
93 | | |
200 | <ul> | |
201 | <li><%= _("Enabling spam protection will make typo compare the IP address of posters as well as the contents of their posts against local and remote blacklists. Good defense against spam bots")%>.</li> | |
202 | <li class="checkbox"> | |
203 | <label for="sp_global" class="float"><%= _("Enable spam protection")%>:</label> | |
204 | <input name="setting[sp_global]" id="sp_global" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.sp_global%> /><input name="setting[sp_global]" type="hidden" value="0" /> | |
205 | </li> | |
206 | <li><%= _("Typo can (optionally) use the %s spam-filtering service. You need to register with Akismet and receive an API key before you can use their service. If you have an Akismet key, enter it here", '<a href="http://akismet.com">Akismet</a>')%> . | |
207 | </li> | |
208 | <li> | |
209 | <label class="float" for="sp_akismet_key"><%= _("Akismet Key")%>:</label> | |
210 | <input name="setting[sp_akismet_key]" id="sp_akismet_key" type="text" value="<%=h this_blog.sp_akismet_key %>" /> | |
211 | </li> | |
212 | </ul> | |
213 | <p class="r"><%= save(_("Save Settings")) %></p> | |
214 | </fieldset> | |
95 | | |
216 | <fieldset id="resources" class="set"> | |
217 | <legend><%= _("Resource Settings")%></legend> | |
218 | <ul> | |
219 | <li><%= _("The below settings act as defaults when you choose to publish an enclosure with iTunes metadata")%>.</li> | |
220 | <li> | |
221 | <label for="itunes_author" class="float"><%= _("Author")%>:</label> | |
222 | <input name="setting[itunes_author]" size="25" id="itunes_author" type="text" value="<%= this_blog.itunes_author %>" /> | |
223 | </li> | |
224 | <li> | |
225 | <label for="itunes_subtitle" class="float"><%= _("Subtitle")%>: <span class="mandatory">*</span></label> | |
226 | <input name="setting[itunes_subtitle]" size="25" id="itunes_subtitle" type="text" value="<%= this_blog.itunes_subtitle %>" /> | |
227 | </li> | |
228 | <li> | |
229 | <label class="float" for="itunes_summary"><%= _("Summary")%>: <span class="mandatory">*</span></label> | |
230 | <textarea name="setting[itunes_summary]" cols="40" rows="3"><%=h this_blog.itunes_summary %></textarea> | |
231 | <span class="float mandatory">* <%= _("Setting for channel")%></span> | |
232 | </li> | |
233 | <li> | |
234 | <label class="float" for="itunes_email"><%= _("Email")%>: <span class="mandatory">**</span></label> | |
235 | <input name="setting[itunes_email]" size="25" id="itunes_email" type="text" value="<%= this_blog.itunes_email %>" /> | |
236 | </li> | |
237 | <li> | |
238 | <label class="float" for="itunes_name"><%= _("Optional Name")%>: <span class="mandatory">**</span></label> | |
239 | <input name="setting[itunes_name]" size="25" id="itunes_name" type="text" value="<%= this_blog.itunes_name %>" /> | |
240 | <span class="float mandatory">** <%= _("Not published by Apple")%></span> | |
241 | </li> | |
242 | <li> | |
243 | <label class="float" for="itunes_copyright"><%= _("Copyright Information")%>:</label> | |
244 | <input name="setting[itunes_copyright]" size="25" id="itunes_copyright" type="text" value="<%= this_blog.itunes_copyright %>" /> | |
245 | </li> | |
246 | <li class="checkbox"> | |
247 | <label class="float" for="itunes_explicit"><%= _("Explicit")%>:</label> | |
248 | <input name="setting[itunes_explicit]" id="itunes_explicit" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.itunes_explicit%> /> | |
249 | <input name="setting[itunes_explicit]" type="hidden" value="0" /> | |
250 | </li> | |
251 | </ul> | |
252 | <p class="r"><%= save(_("Save Settings")) %></p> | |
253 | </fieldset> | |
97 | | |
98 | | |
99 | | |
100 | | |
101 | | |
102 | | |
103 | | |
255 | <fieldset id="misc" class="set"> | |
256 | <legend><%= _("Cache")%></legend> | |
257 | <ul> | |
258 | <li><%= link_to _('Empty Fragment Cache'), :controller => '/admin/cache', :action => 'sweep' %></li> | |
259 | <li><%= link_to _('Rebuild cached HTML'), :controller => '/admin/cache', :action => 'sweep_html' %></li> | |
260 | <p id="users"><%= _("There are %d entries in the cache", @page_cache_size) %></p> | |
261 | </ul> | |
262 | </fieldset> | |
105 | | |
106 | ||
107 | | |
108 | | |
109 | | |
110 | | |
111 | ||
112 | | |
264 | <div id="operations" class="tasks"> | |
265 | <%= save(_("Save Settings")) %> | |
</div> | ||
114 | ||
115 | ||
116 | | |
117 | | |
118 | | |
119 | | |
120 | | |
121 | | |
122 | | |
123 | | |
124 | | |
125 | | |
126 | | |
127 | | |
128 | | |
129 | | |
130 | | |
131 | | |
132 | | |
133 | ||
134 | | |
135 | | |
136 | | |
137 | | |
138 | | |
139 | | |
140 | | |
141 | | |
142 | | |
143 | | |
144 | | |
145 | | |
146 | | |
147 | | |
148 | | |
149 | | |
150 | | |
151 | ||
152 | ||
153 | | |
154 | | |
155 | | |
156 | | |
157 | | |
158 | | |
159 | | |
160 | | |
161 | | |
162 | | |
163 | | |
164 | | |
165 | | |
166 | | |
167 | | |
168 | | |
169 | | |
170 | | |
171 | | |
172 | | |
173 | | |
174 | | |
175 | | |
176 | | |
177 | | |
178 | | |
179 | | |
180 | | |
181 | | |
182 | | |
183 | | |
184 | | |
185 | | |
186 | | |
187 | | |
188 | | |
189 | | |
190 | | |
191 | | |
192 | | |
193 | | |
194 | | |
195 | | |
196 | | |
197 | | |
198 | | |
199 | | |
200 | | |
201 | | |
202 | | |
203 | | |
204 | ||
205 | | |
206 | | |
207 | | |
208 | | |
209 | | |
210 | | |
211 | | |
212 | | |
213 | | |
214 | ||
215 | | |
216 | | |
217 | | |
218 | | |
219 | | |
220 | | |
221 | | |
222 | | |
223 | | |
224 | | |
225 | | |
226 | | |
227 | ||
228 | | |
229 | | |
230 | | |
231 | | |
232 | | |
233 | | |
234 | | |
</div> | ||
236 | ||
237 | ||
238 | | |
239 | | |
240 | | |
241 | ||
242 | | |
268 | <% end %> |
rool/rails/typo/trunk/app/views/admin/general/update_database.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Database migration') %> | |
<div id="settings"> | ||
<div id="gensettings" class="set" style="margin-top:10px;"> | ||
6 | | |
6 | <h3><%= _("Information")%></h3> | |
<p> | ||
8 | | |
8 | <label><%= _("Current database version")%>:</label> | |
<span class="db_version"><%= @current_version %></span> | ||
</p> | ||
<p> | ||
12 | | |
12 | <label><%= _("New database version")%>:</label> | |
<span class="db_version"><%= @needed_version %></span> | ||
</p> | ||
<p> | ||
16 | | |
17 | | |
16 | <label><%= _("Your database supports migrations")%>:</label> | |
17 | <span class="db_version"><%= @support ? _('yes') : _('no') %></span> | |
</p> | ||
</div> | ||
20 | | |
21 | | |
20 | ||
21 | ||
<% unless @needed_migrations.blank? %> | ||
<div id="gensettings" class="set" style="margin-top:10px;"> | ||
24 | | |
24 | <h3><%= _("Needed migrations")%></h3> | |
<ul> | ||
<% for migration in @needed_migrations %> | ||
<li><%= migration.humanize %></li> | ||
28 | | |
28 | <% end %> | |
</ul> | ||
</div> | ||
<% end %> | ||
32 | | |
32 | ||
</div> | ||
36 | ||
36 | <% form_tag :action => 'migrate' do %> | |
<div id="operations" class="tasks"> | ||
<% if @current_version == @needed_version %> | ||
39 | | |
39 | <strong><%= _("You are up to date!")%></strong> | |
<% else %> | ||
41 | | |
41 | <%= save(_("Update database now")) %> <small><%= _("may take a moment")%></small> | |
<% end %> | ||
</div> | ||
44 | ||
44 | <% end %> |
rool/rails/typo/trunk/app/views/admin/pages/_form.rhtml:
prev. | current | |
<%= error_messages_for 'page' %> | ||
<!--[form:pages]--> | ||
3 | ||
4 | | |
5 | | |
6 | ||
7 | ||
8 | | |
9 | | |
10 | ||
11 | ||
12 | | |
13 | | |
14 | | |
15 | ||
3 | <fieldset class="set admin" style="display: block"> | |
4 | <legend><%= _("Page Body")%></legend> | |
5 | <iframe id="preview" class="post" style="display: none;"></iframe> | |
6 | <div style="width: 48%; float: left;"> | |
7 | <ul> | |
8 | <li> | |
9 | <label for="page_title" class="block"><%= _("Title")%>:</label> | |
10 | <%= text_field 'page', 'title', :size => 20, :style => "width: 100%;" %> | |
11 | </li> | |
12 | <li> | |
13 | <label for="page_name" class="block"><%= _("Location")%>:</label> | |
14 | /pages/ <%= text_field 'page', 'name', :size => 25 %> | |
15 | </li> | |
16 | <li> | |
17 | <label for="page_body"><%= _("Body")%>:</label> | |
18 | <%= markup_help_popup @page.text_filter, image_tag('help.png', :alt => " markup help", :title => "Markup help") %> | |
19 | <%= text_area 'page', 'body', :rows => 25, :style => 'width: 100%;' %> | |
20 | </li> | |
21 | </ul> | |
22 | <p class="r"><%= save(_("Save")) %> or <%= cancel %></p> | |
23 | </div> | |
24 | <br style="clear: both;" /> | |
25 | </fieldset> | |
17 | ||
18 | ||
27 | <fieldset class="set admin"> | |
28 | <legend><%= _("Page Options")%></legend> | |
29 | <ul> | |
30 | <li> | |
31 | <label for="page_text_filter" class="float"><%= _("Textfilter")%>: </label> | |
32 | <%= select 'page', 'text_filter', text_filter_options %> | |
33 | </li> | |
34 | </ul> | |
35 | </fieldset> | |
<!--[eoform:pages]--> |
rool/rails/typo/trunk/app/views/admin/pages/_pages.rhtml:
prev. | current | |
<table cellspacing="1" cellpadding="0"> | ||
<tr> | ||
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
3 | <th><%= _("Title")%></th> | |
4 | <th><%= _("Permalink")%></th> | |
5 | <th><%= _("Posted at")%></th> | |
6 | <th colspan="3"><%= _("Action")%></th> | |
7 | <th></th> | |
</tr> | ||
<% for page in @pages %> | ||
<tr <%= alternate_class %>> | ||
11 | | |
12 | | |
13 | | |
11 | <td> <%= link_to_permalink(page,page.title) %></td> | |
12 | <td>/pages/<%= page.name %></td> | |
13 | <td><%= page.created_at.strftime("%d/%m/%Y at %H:%M") %></td> | |
14 | <td class="operation"><%= link_to image_tag('show.png', :alt => "View article", :title => "Preview article"), {:action => "show", :id => page.id} %></td> | |
<td class="operation"><%= link_to_edit page %></td> | ||
<td class="operation"><%= link_to_destroy page %></td> | ||
</tr> |
rool/rails/typo/trunk/app/views/admin/pages/_quick_post.rhtml:
prev. | current | |
1 | ||
1 | <% form_tag :action=>"new" do %> | |
<p> | ||
<label for="page_title">Location:</label><br/> | ||
/pages/<%= text_field 'page', 'name', :size => 16 %> | ||
... | ... | |
<div id="operations"> | ||
<%= save("Save Post") %> or <a href="#" onclick="new Effect.BlindUp('quick-post', {duration: 0.4}); return false;" >Cancel</a> | ||
</div> | ||
21 | ||
21 | <% end %> |
rool/rails/typo/trunk/app/views/admin/pages/destroy.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = <%= _("Pages") %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
4 | <%= task_show _("Show this page"), @page.id %> | |
5 | <% end %> | |
7 | | |
8 | | |
7 | <p><%= _("Are you sure you want to delete the page")%> '<%= @page[:name] %>'?</p> | |
8 | <% form_tag :controller => '/admin/pages', :action => 'destroy' do %> | |
<%= hidden_field "page", "id" %> | ||
10 | | |
11 | | |
10 | <%= confirm_delete(_("Delete this page")) %> | |
11 | <% end %> |
rool/rails/typo/trunk/app/views/admin/pages/edit.rhtml:
prev. | current | |
1 | | |
2 | | |
1 | <% @page_heading = _('Pages') %> | |
2 | ||
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
6 | | |
4 | <%= task_new _('Create new page') %> | |
5 | <li><%= link_to _('View page on your blog'), @page.permalink_url %></li> | |
6 | <% end %> | |
8 | | |
9 | | |
10 | ||
11 | | |
12 | | |
13 | | |
14 | | |
15 | | |
16 | | |
17 | ||
18 | | |
19 | | |
20 | | |
21 | ||
22 | | |
23 | ||
24 | | |
25 | | |
26 | | |
27 | | |
28 | | |
8 | <h3><%= _("Editing page")%></h3> | |
9 | <%= render :partial => "admin/shared/edit", :locals => { :form_type => "page", :form_action => { :action => "edit", :id => @page } } %> |
rool/rails/typo/trunk/app/views/admin/pages/list.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Manage Pages') %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
4 | <%= tab _("Manage Articles"), :controller=>"content", :action=>"list"%> | |
5 | <%= tab _("Manage Categories"), :controller=>"categories", :action=>"index"%> | |
6 | <%= tab _("Manage Resources"), :controller=>"resources", :action=>"list" %> | |
<% end %> | ||
<div id="quick-post" style="display:none;position:absolute;"> |
rool/rails/typo/trunk/app/views/admin/pages/new.rhtml:
prev. | current | |
1 | | |
1 | <% content_for('tasks') do %> | |
2 | <%= tab _("Write an Article"), :controller=>"content", :action=>"new" %> | |
3 | <% end %> | |
3 | | |
5 | <% @page_heading = _('Write a Page') %> | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | ||
14 | | |
15 | | |
16 | | |
17 | ||
18 | | |
19 | ||
20 | | |
21 | | |
22 | | |
23 | | |
24 | | |
7 | <%= render :partial => "admin/shared/edit", :locals => { :form_type => "page", :form_action => { :action => "new" } } %> |
rool/rails/typo/trunk/app/views/admin/pages/preview.rhtml:
prev. | current | |
1 | ||
1 | <div><%= @page.html %></div> |
rool/rails/typo/trunk/app/views/admin/pages/show.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Pages') %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
4 | <%= task_edit _('Edit this page'), @page.id %> | |
5 | <li><%= link_to _('View page on your blog'), @page.permalink_url %></li> | |
<% end %> | ||
<h3><%=h @page.name %></h3> | ||
<div class="form"> | ||
11 | | |
12 | | |
11 | <div><%= @page.html %></div> | |
12 | <p class="meta"><%= _("Posted at") %>: <%=h @page.created_at %> <%= _("by")%> <%=h @page.user.name %></p> | |
<p>Lasted updated <%=h @page.updated_at %></p> | ||
</div> |
rool/rails/typo/trunk/app/views/admin/resources/_itunes_category_edit.rhtml:
prev. | current | |
<% | ||
2 | ||
3 | ||
2 | #Since the data is in yaml coming out of the DB it is converted here from | |
3 | #comparision. This is a hack to get things working. | |
unless categories.nil? | ||
selected = YAML::load(categories) | ||
else |
rool/rails/typo/trunk/app/views/admin/resources/_metadata_add.rhtml:
prev. | current | |
1 | ||
1 | <% form_tag({ :action => "update" }, :id => id, :enctype => "multipart/form-data") do %> | |
<div class="form"> | ||
3 | | |
4 | | |
5 | | |
3 | <b><%= _("Resource MetaData")%></b><br /> | |
4 | <input type="checkbox" name="resource[itunes_metadata]" value="1"><%= _("Set iTunes metadata for this enclosure")%></input><br /> | |
5 | <label for="resource_itunes_author_<%= id %>"><%= _("Author")%>:</label><br /> | |
<input name="resource[itunes_author]" size="25" id="resource_itunes_author_<%= id %>" type="text" value="<%= this_blog.itunes_author %>" /><br /> | ||
7 | | |
7 | <label for="resource_itunes_subtitle_<%= id %>"><%= _("Subtitle")%>:</label><br /> | |
<%= text_field 'resource', "itunes_subtitle", :id => "resource_itunes_subtitle_#{id}" %><br /> | ||
9 | | |
9 | <label for="resource_itunes_duration_<%= id %>"><%= _("Duration")%>:</label><br /> | |
<%= text_field 'resource', "itunes_duration", :id => "resource_itunes_duration_#{id}", "size" => 8 %> (HH:MM:SS)<br /> | ||
11 | | |
11 | <label for="resource_itunes_summary_<%= id %>"><%= _("Summary")%>:</label><br /> | |
<%= text_area 'resource', "itunes_summary", :id => "resource_itunes_summary_#{id}", :rows => 5 %><br /> | ||
13 | | |
13 | <label for="resource_itunes_category_<%= id %>"><%= _("Category")%>:</label><br /> | |
<%= render :partial => "itunes_category_add", :locals => { :id => id } %><br /> | ||
15 | | |
16 | | |
17 | | |
15 | <label for="resource_itunes_keywords_<%= id %>"><%= _("Key Words")%>:</label><br /> | |
16 | <%= text_field 'resource', "itunes_keywords", :id => "resource_itunes_keywords_#{id}" %><small>(<%= _("seperate with spaces")%>)</small><br /> | |
17 | <input name="resource[itunes_explicit]" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.itunes_explicit%>><%=_("Explicit")%></input><input name="resource[itunes_explicit]" type="hidden" value="0" /> | |
<br /> | ||
<input name="resource[id]" type="hidden" value="<%= id %>" /> | ||
20 | ||
20 | <%= save(_("Save")) %> <%= _("or")%> <a href="#" onclick="new Effect.BlindUp('add-resource-metadata-<%= id %>', {duration: 0.4}); return false;" ><%= _("Cancel")%></a> | |
</div> | ||
22 | ||
22 | <% end %> |
rool/rails/typo/trunk/app/views/admin/resources/_metadata_edit.rhtml:
prev. | current | |
1 | ||
1 | <% form_tag({ :action => "update" }, :id => id, :enctype => "multipart/form-data") do %> | |
<div class="form"> | ||
3 | | |
4 | | |
5 | | |
3 | <b><%= _("Resource MetaData")%></b><br /> | |
4 | <%= link_to _("Remove iTunes Metadata"), { :action => "remove_itunes_metadata", :id => resource.id}, :confirm => "Are you sure?"%><br /> | |
5 | <label for="resource_itunes_author_<%= id %>"><%= _("Author")%>:</label><br /> | |
<input name="resource[itunes_author]" size="25" id="resource_itunes_author_<%= id %>" type="text" value="<%=h resource.itunes_author %>" /><br /> | ||
7 | | |
7 | <label for="resource_itunes_subtitle_<%= id %>"><%= _("Subtitle")%>:</label><br /> | |
<input name="resource[itunes_subtitle]" size="25" id="resource_itunes_subtitle_<%= id %>" type="text" value="<%=h resource.itunes_subtitle %>" /><br /> | ||
9 | | |
9 | <label for="resource_itunes_duration_<%= id %>"><%= _("Duration")%>:</label><br /> | |
<input name="resource[itunes_duration]" size="8" id="resource_itunes_duration_<%= id %>" type="text" value="<%=h resource.itunes_duration %>" /><small>(HH:MM:SS)</small><br /> | ||
11 | | |
11 | <label for="resource_itunes_summary_<%= id %>"><%= _("Summary")%>:</label><br /> | |
<textarea name="resource[itunes_summary]" id="resource_itunes_summary_<%= id %>" rows="5" cols="35"><%=h resource.itunes_summary %></textarea><br /> | ||
13 | | |
13 | <label for="resource_itunes_category_<%= id %>"><%= _("Category")%>:</label><br /> | |
<%= render :partial => "itunes_category_edit", :locals => { :categories => resource.itunes_category, :id => id } %><br /> | ||
15 | | |
16 | | |
17 | | |
15 | <label for="resource_itunes_keywords_<%= id %>"><%= _("Key Words")%>:</label><br /> | |
16 | <input name="resource[itunes_keywords]" size="25" id="resource_itunes_keywords_<%= id %>" type="text" value="<%=h resource.itunes_keywords %>" /><small>(<%= _("seperate with spaces")%>)</small><br /> | |
17 | <input name="resource[itunes_explicit]" type="checkbox" value="1" <%= 'checked="checked"' if resource.itunes_explicit%>><%= _("Explicit")%></input><input name="resource[itunes_explicit]" type="hidden" value="0" /> | |
<br /> | ||
19 | | |
20 | ||
19 | <input name="resource[id]" type="hidden" value="<%= id %>" /> | |
20 | <%= save(<%=_("Save")) %> <%= _("or")> <a href="#" onclick="new Effect.BlindUp('edit-resource-metadata-<%= id %>', {duration: 0.4}); return false;" ><%= _("Cancel") %></a> | |
</div> | ||
22 | ||
22 | <% end %> |
rool/rails/typo/trunk/app/views/admin/resources/_mime_edit.rhtml:
prev. | current | |
1 | ||
1 | <% form_tag({ :action => "set_mime" }, :id => id, :enctype => "multipart/form-data") do %> | |
<div class="form"> | ||
3 | | |
3 | <label for="resource_mime_<%= id %>"><%=_("Content Type")%>:</label><br/> | |
<input name="resource[mime]" size="22" id="resource_mime_<%= id %>" type="text" value="<%=h mime %>" /><br /> | ||
5 | | |
6 | ||
5 | <input name="resource[id]" type="hidden" value="<%= id %>" /> | |
6 | <%= save(_("Save")) %> <%= _("or") %> <a href="#" onclick="new Effect.BlindUp('edit-resource-mime-<%= id %>', {duration: 0.4}); return false;" ><%= _("Cancel")%></a> | |
</div> | ||
8 | ||
8 | <% end %> |
rool/rails/typo/trunk/app/views/admin/resources/_pages.rhtml:
prev. | current | |
1 | | |
1 | <%= link_to <%= _("Previous page"), { :id => pages.current.previous } if pages.current.previous -%> | |
<%= pagination_links pages, :name => 'id' -%> | ||
3 | | |
3 | <%= link_to _("Next page"), { :id => pages.current.next } if pages.current.next -%> |
rool/rails/typo/trunk/app/views/admin/resources/_resources.rhtml:
prev. | current | |
<table cellspacing="1" cellpadding="0"> | ||
<tr> | ||
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
3 | <th><%= _("Filename")%> <small>(right-click for link)</small></th> | |
4 | <th><%= _("Content Type")%></th> | |
5 | <th><%= _("MetaData")%></th> | |
6 | <th><%= _("File Size")%></th> | |
7 | <th><%= _("Uploaded")%></th> | |
8 | <th><%= _("Delete")%></th> | |
</tr> | ||
<% blog_root = request.relative_url_root -%> | ||
<% for upload in resources -%> | ||
... | ... | |
</td> | ||
<% if upload.itunes_metadata? %> | ||
<td> | ||
22 | | |
22 | <%= task_edit_resource_metadata(_("Edit MetaData") + ' (+/-)', upload.id) %> | |
<div id="edit-resource-metadata-<%= upload.id%>" style="display:none;position:absolute;"> | ||
<%= render :partial => "metadata_edit" , :locals => {:id => upload.id, :resource => upload}%> | ||
</div> | ||
</td> | ||
<% else -%> | ||
<td> | ||
29 | | |
29 | <%= task_add_resource_metadata(_("Add MetaData") + ' (+/-)', upload.id) %> | |
<div id="add-resource-metadata-<%= upload.id%>" style="display:none;position:absolute;"> | ||
<%= render :partial => "metadata_add", :locals => {:id => upload.id} %> | ||
</div> |
rool/rails/typo/trunk/app/views/admin/resources/destroy.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('File Uploads') %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
4 | <%= task_new _('Upload a new File') %> | |
5 | <% end %> | |
7 | | |
8 | | |
7 | <p><%= _("Are you sure you want to delete this file")%> ( <%= @file.filename -%> )?</p> | |
8 | <% form_tag :action => 'destroy' do %> | |
<%= hidden_field "file", "id" %> | ||
10 | | |
11 | | |
10 | <%= confirm_delete(_("Delete this file from the webserver?")) %> | |
11 | <% end %> |
rool/rails/typo/trunk/app/views/admin/resources/list.rhtml:
prev. | current | |
1 | | |
2 | | |
1 | <% @page_heading = _('Manage Resources') %> | |
2 | <% @page_title = _('Upload a new File') %> | |
<% content_for('tasks') do %> | ||
4 | | |
4 | <%= task_new _('Upload a new Resource') %> | |
5 | <%= tab _("Manage Articles"), :controller=>"content", :action=>"list"%> | |
6 | <%= tab _("Manage Pages"), :controller=>"pages", :action=>"list" %> | |
7 | <%= tab _("Manage Categories"), :controller=>"categories", :action=>"list" %> | |
<% end %> | ||
<div class="list" id="resources"> |
rool/rails/typo/trunk/app/views/admin/resources/new.rhtml:
prev. | current | |
.progressBar .border { background-color: #fff; border: 1px solid #fff; width: 100%; } | ||
.progressBar .background { background-color: #333; height: 18px; width: 0%; } | ||
</style> | ||
5 | ||
5 | <% content_for('tasks') do %> | |
6 | <%= task_overview %> | |
7 | <% end %> | |
8 | ||
9 | <% @page_heading = _('Upload a File to your Site') %> | |
<%= form_tag_with_upload_progress({:action => 'upload'}, { :begin => "new Effect.Appear('status')", :finish => "$('message').innertHTML = arguments[0]" }) %> | ||
<label for="upload_filename">File:</label><br /><%= file_field 'upload', 'filename' -%><br /> | ||
8 | ||
12 | <%= submit_tag _('Upload') -%> | |
<div id='status' style="display: none"><%= upload_status_tag %></div> | ||
10 | ||
14 | </form> | |
<div id="message"><%= @message %></div> |
rool/rails/typo/trunk/app/views/admin/sidebar/_active.rhtml:
prev. | current | |
<div id="active_<%= active.html_id %>" class="dragitem"> | ||
2 | | |
3 | | |
2 | <h4 class="handle"><%= active.display_name %></h4> | |
3 | <p><%= active.description %></p> | |
<div class="space"> | ||
5 | | |
6 | | |
7 | | |
5 | <div><% active.class.fields.each do |row| -%> | |
6 | <%= row.line_html(active) %> | |
7 | <% end -%></div> | |
<%= link_to_remote('remove', | ||
:url => {:action => 'remove', :id => active.id, | ||
:element => "active_#{active.html_id}"}, |
rool/rails/typo/trunk/app/views/admin/sidebar/_availables.rhtml:
prev. | current | |
<% if availables.blank? %> | ||
2 | | |
2 | <p> <%= _("You have no plugins installed")%>... </p> | |
<% else %> | ||
<%= render :partial => 'available', :collection => availables %> | ||
<% end %> | ||
rool/rails/typo/trunk/app/views/admin/sidebar/_publish.rhtml:
prev. | current | |
1 | ||
1 | <p><%= _("Changes published")%></p> | |
<script type="text/javascript">new Effect.Highlight("messages");</script> |
rool/rails/typo/trunk/app/views/admin/sidebar/_target.rhtml:
prev. | current | |
1 | ||
1 | <div id="sidebar_instructions" class="target"><%= _("Drag some plugins here to fill your sidebar")%>!</div> |
rool/rails/typo/trunk/app/views/admin/sidebar/index.rhtml:
prev. | current | |
<% @page_heading = 'Sidebar' %> | ||
2 | | |
2 | <% content_for('tasks') do %> | |
3 | <%= tab _("Choose a theme"), :controller=>"themes", :action=>"index" %> | |
4 | <%= tab _("Manage Text Filters"), :controller=>"textfilters", :action=>"list" %> | |
5 | <% end %> | |
6 | <p><%= _("Drag and drop to change the sidebar items displayed on this blog. To remove items from the sidebar just click remove Changes are saved immediately, but not activated until you click the 'Publish' button")%>.</p> | |
<%= form_remote_tag(:url=>{:action=>'publish'}, | ||
:loading => "new Element.show('update_spinner')") %> | ||
6 | | |
10 | <input value="<%= _('Publish changes')%>" class="space" type="submit"/> | |
<div id="messages"> </div> | ||
<div id="sidebar-config"> | ||
<div id="available" class="dropbox"> | ||
12 | | |
16 | <h3><%= _("Available Items")%></h3> | |
<div id="available_box"> | ||
<%= render :partial => 'availables', :object => @available %> | ||
</div> | ||
... | ... | |
<div id="cnt-active"> | ||
<h3 id="hdr-active"> | ||
20 | | |
24 | <%= _("Active Sidebar items")%> | |
<%= image_tag "spinner-blue.gif", :id => 'update_spinner', | ||
:style => 'display:none;' -%> | ||
</h3> | ||
... | ... | |
</div> | ||
<br clear="all" /> | ||
30 | | |
34 | <input value="<%= _('Publish changes')%>" class="space" type="submit"/> | |
</div> | ||
<%= end_form_tag %> |
rool/rails/typo/trunk/app/views/admin/textfilters/_form.rhtml:
prev. | current | |
<%= error_messages_for 'textfilter' %> | ||
<!--[form:textfilter]--> | ||
<p> | ||
4 | | |
4 | <label for="textfilter_name"><%= _("Name") %>:</label><br /> | |
<%= text_field 'textfilter', 'name', :size => 40 %> | ||
</p> | ||
<p> | ||
8 | | |
8 | <label for="textfilter_description"><%= _("Description") %>:</label><br /> | |
<%= text_field 'textfilter', 'description', :size => 40 %> | ||
</p> | ||
12 | ||
12 | <label for="markup"><%= _("Markup type")%>:</label><br/> | |
<select name="textfilter[markup]"> | ||
<% @markup_options.each do |filter| -%> | ||
... | ... | |
<br/> | ||
22 | ||
22 | <h4><%= _("Post-processing filters")%></h4> | |
<table> | ||
<% @postprocess_options.sort_by {|f| f[1]}.each do |filter| %> | ||
... | ... | |
</tr> | ||
<% end -%> | ||
</table> | ||
33 | ||
33 | <h4><%= _("Parameters")%></h4> | |
<table> | ||
<% @filterparams.keys.sort.each do |key| -%> | ||
<tr> | ||
<td><label for="params[<%= key %>]" title="<%=h @filterhelp[key] %>"><%= @filterdescriptions[key] %></label></td> | ||
39 | <% if @filteroptions[key].nil? -%> | |
<td><input name="params[<%= key %>]" value="<%=h @filterparams[key] %>"/></td> | ||
41 | <% else -%> | |
42 | <td><select name="params[<%= key %>]"> | |
43 | <% for opt in @filteroptions[key] -%> | |
44 | <option value="<%= opt.downcase.gsub(' ','_') %>"<%= %{ selected="selected"} if opt.downcase.gsub(' ','_') == @filterparams[key] %>><%= opt %></option> | |
45 | <% end -%> | |
46 | </select></td> | |
47 | <% end -%> | |
</tr> | ||
<% end -%> | ||
</table> |
rool/rails/typo/trunk/app/views/admin/textfilters/_macros.rhtml:
prev. | current | |
<table cellspacing="1" cellpadding="0"> | ||
<tr> | ||
3 | | |
4 | | |
5 | | |
6 | | |
3 | <th><%= _("Name")%></th> | |
4 | <th><%= _("Description")%></th> | |
5 | <th><%= _("Tag")%></th> | |
6 | <th><%= _("Show Help")%></th> | |
</tr> | ||
<% for macro in @macros.sort_by { |f| f.short_name } %> | ||
<tr <%= alternate_class %>> |
rool/rails/typo/trunk/app/views/admin/textfilters/_textfilters.rhtml:
prev. | current | |
<table cellspacing="1" cellpadding="0"> | ||
<tr> | ||
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
3 | <th><%= _("Name")%></th> | |
4 | <th><% _("Description")%></th> | |
5 | <th><%= _("Markup")%></th> | |
6 | <th><%= _("Filters")%></th> | |
7 | <th><%= _("Edit")%></th> | |
8 | <th><%= _("Delete")%></th> | |
</tr> | ||
<% for textfilter in @textfilters.sort_by { |f| f.name } %> | ||
<tr <%= alternate_class %>> |
rool/rails/typo/trunk/app/views/admin/textfilters/destroy.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Text Filters') %> | |
3 | | |
4 | | |
5 | ||
6 | | |
7 | | |
3 | <p><%= _("Are you sure you want to delete this filter")%> '<%= @textfilter.name %>'?</p> | |
4 | <% form_tag :controller => '/admin/textfilters', :action => 'destroy' do %> | |
<%= hidden_field "textfilter", "id" %> | ||
9 | | |
10 | | |
6 | <%= confirm_delete(_("Delete this filter")) %> | |
7 | <% end %> |
rool/rails/typo/trunk/app/views/admin/textfilters/edit.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Text Filters') %> | |
3 | | |
4 | | |
5 | ||
<%= start_form_tag({ :action => "edit", :id => @textfilter }, :id => "textfilter_form") %> | ||
7 | | |
4 | <h3><%= _("Editing textfilter")%></h3> | |
<div class="form"> | ||
<%= render :partial => "form" %> |
rool/rails/typo/trunk/app/views/admin/textfilters/list.rhtml:
prev. | current | |
<% @page_heading = 'Text Filters' %> | ||
<% content_for('tasks') do %> | ||
4 | | |
4 | <%= task_new _('Create new text filter') %> | |
5 | <%= tab _("Choose a theme"), :controller=>"themes", :action=>"index" %> | |
6 | <%= tab _("Customize Sidebar"), :controller=>"sidebar", :action=>"index" %> | |
<% end %> | ||
<div class="list" id="textfilters"> | ||
<%= render :partial => 'textfilters' %> | ||
</div> | ||
11 | | |
13 | <h2><%= _("Macros")%></h2> | |
<div class="list" id="macros"> | ||
<% reset_alternation -%> | ||
<%= render :partial => "macros" %> |
rool/rails/typo/trunk/app/views/admin/textfilters/macro_help.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _("Macro Filter Help") + ": #{@macro.display_name}" %> | |
<%= @help_text %> |
rool/rails/typo/trunk/app/views/admin/textfilters/new.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Text Filters') %> | |
2 | <% content_for('tasks') do %> | |
3 | <%= task_overview %> | |
4 | <% end %> | |
5 | <h3><%= _("Creating text filter")%></h3> | |
3 | | |
7 | <% form_tag({ :action => "new" }, :id => "textfilter_form") do %> | |
5 | | |
6 | | |
7 | | |
9 | <div class="form"> | |
<%= render_partial "form" %> | ||
</div> | ||
<div id="operations"> | ||
12 | | |
14 | <%= save %> or <%= cancel %> | |
</div> | ||
15 | | |
17 | <% end %> |
rool/rails/typo/trunk/app/views/admin/textfilters/show.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _("Text Filter Details") + ": #{@textfilter.description}" %> | |
<% content_for('tasks') do %> | ||
4 | | |
4 | <%= task_edit _('Edit this filter'), @textfilter.id %> | |
<%= task_help 'See help text for this filter', @textfilter.id %> | ||
<% end %> | ||
<h3><%=h @textfilter.description %></h3> | ||
<div class="form"> | ||
11 | | |
11 | <h4><%= _("Markup type")%>:</h4> | |
<%=h @textfilters[@textfilter.markup].display_name %> | ||
<% if @textfilter.filters.size > 0 -%> | ||
15 | | |
15 | <h4><%= _("Post-processing filters")%></h4> | |
<ul> | ||
<% @textfilter.filters.each do |key| -%> | ||
<li><%=h @textfilters[key.to_s].display_name %></li> | ||
... | ... | |
<% end -%> | ||
<% if @textfilter.params.size > 0 -%> | ||
24 | | |
24 | <h4><%= _("Parameters")%></h4> | |
<table> | ||
<% @textfilter.params.keys.sort.each do |key| -%> | ||
<tr> |
rool/rails/typo/trunk/app/views/admin/textfilters/show_help.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _("Text Filter Help") + ": #{@textfilter.description}" %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
4 | <%= task_edit _('Edit this text filter'), @textfilter.id %> | |
5 | <%= task_show _('Show this filter'), @textfilter.id %> | |
<% end %> | ||
<%= @help_text %> |
rool/rails/typo/trunk/app/views/admin/themes/index.rhtml:
prev. | current | |
1 | <% @page_heading = _('Choose a theme') %> | |
2 | <% content_for('tasks') do %> | |
3 | <%= tab _("Customize Sidebar"), :controller=>"sidebar", :action=>"index" %> | |
4 | <%= tab _("Manage Text Filters"), :controller=>"textfilters", :action=>"list" %> | |
5 | <% end %> | |
6 | ||
<% for theme in @themes %> | ||
<div class="set theme" style="margin-top:10px;"> | ||
<div class="preview"><img src="<%= url_for :action => 'preview', :theme => theme.name %>" alt="<%= theme.name %>" /></div> | ||
... | ... | |
<%= theme.description_html %> | ||
<% if theme.path == @active.path -%> | ||
5 | | |
11 | <em>(<%= _("Active theme")%>)</em> | |
<% else -%> | ||
7 | | |
13 | <%= link_to _("Activate"), :action => 'switchto', :theme => theme.name %> | |
<% end -%> | ||
<br clear="all" /> |
rool/rails/typo/trunk/app/views/admin/trackbacks/_form.rhtml:
prev. | current | |
<%= error_messages_for 'trackback' %> | ||
<!--[form:trackback]--> | ||
<p> | ||
4 | | |
4 | <label for="trackback_blog_name"><%=_("Blog name")%>:</label><br /> | |
<%= text_field 'trackback', 'blog_name' %> | ||
</p> | ||
<p> | ||
8 | | |
8 | <label for="trackback_title"><%= _("Title")%>:</label><br /> | |
<%= text_field 'trackback', 'title' %> | ||
</p> | ||
<p> | ||
12 | | |
12 | <label for="trackback_url"><%= _("Url")%>:</label><br /> | |
<%= text_field 'trackback', 'url' %> | ||
</p> | ||
<p> | ||
16 | | |
16 | <label for="trackback_excerpt"><%= _("Body")%>:</label><br /> | |
<%= text_area 'trackback', 'excerpt' %> | ||
</p> | ||
<!--[eoform:trackback]--> |
rool/rails/typo/trunk/app/views/admin/trackbacks/destroy.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Trackbacks') %> | |
3 | | |
4 | | |
3 | <p><%= _("Are you sure you want to delete this item?")%></p> | |
4 | <% form_tag :action => "destroy", :id => @trackback.id do %> | |
<%= confirm_delete %> | ||
6 | | |
7 | <% end %> |
rool/rails/typo/trunk/app/views/admin/trackbacks/edit.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _("Trackbacks for") + " #{ link_to h(@article.title), :controller => '/admin/content', :action => 'show', :id => @article }" %> | |
3 | | |
3 | <% form_tag :action=>"edit", :id => @trackback.id do %> | |
5 | | |
6 | | |
5 | <div class="form"> | |
6 | <h3><%= _("Editing trackback")%></h3> | |
<%= render_partial "form" %> | ||
</div> | ||
<div id="operations"> | ||
11 | | |
11 | <%= save %> or <%= cancel %> | |
</div> | ||
14 | | |
14 | <% end %> |
rool/rails/typo/trunk/app/views/admin/trackbacks/list.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _("Trackbacks for") + " #{ link_to h(@article.title), :controller => '/admin/content', :action => 'show', :id => @article }" %> | |
<% content_for('tasks') do %> | ||
<%= task_new 'Create new trackback' %> | ||
5 | | |
5 | <li><%= link_to 'Manage Articles', :controller => '/admin/content', :action => 'list' %></li> | |
<% end %> | ||
<div class="list"> | ||
<table> | ||
<tr> | ||
11 | | |
12 | | |
13 | | |
14 | | |
15 | | |
16 | | |
17 | | |
11 | <th><%= _("Blog Name")%></th> | |
12 | <th><%= _("Title")%></th> | |
13 | <th><%= _("Body")%></th> | |
14 | <th><%= _("IP")%></th> | |
15 | <th><%= _("Created at")%></th> | |
16 | <th><%= _("Edit")%></th> | |
17 | <th><%= _("Delete")%></th> | |
</tr> | ||
<% for trackback in @trackbacks -%> | ||
<tr> | ||
<td class="field"><%= image_tag 'checked.gif' %> <%= link_to trackback.blog_name, trackback.url %></td> | ||
22 | | |
22 | <td class="field"><%= link_to truncate(trackback.title), :action => "show", :id => trackback.id %> <%= link_to_permalink trackback.article,image_tag('go.png') %></td> | |
<td class="field"><%=h truncate(trackback.excerpt) %></td> | ||
<td class="field"><%=h trackback.ip %></td> | ||
<td class="field"><%=h trackback.created_at %></td> |
rool/rails/typo/trunk/app/views/admin/trackbacks/new.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _("Trackbacks for") + " #{ link_to h(@article.title), :controller => '/admin/content', :action => 'show', :id => @article }" %> | |
3 | | |
3 | <h3><%= _("Creating trackback")%></h3> | |
5 | | |
5 | <% form_tag :action=>"new" do %> | |
7 | | |
7 | <div class="form"> | |
<%= render_partial "form" %> | ||
</div> | ||
<div id="operations"> | ||
12 | | |
12 | <%= save %> or <%= cancel %> | |
</div> | ||
15 | | |
15 | <% end %> |
rool/rails/typo/trunk/app/views/admin/trackbacks/show.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _("Trackbacks for") + " #{ link_to h(@article.title), :controller => '/admin/content', :action => 'show', :id => @article }" %> | |
<% content_for('tasks') do %> | ||
4 | | |
4 | <%= task_edit _('Edit this trackback'), @trackback.id %> | |
<% end %> | ||
<div class="form"> | ||
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
8 | <label><%= _("Blog name")%>:</label> <span class="static"><%=h @trackback.blog_name %></span><br/> | |
9 | <label><%= _("Title")%>:</label> <span class="static"><%=h @trackback.title %></span><br/> | |
10 | <label><%= _("Url")%>:</label> <span class="static"><%=h @trackback.url %></span><br/> | |
11 | <label><%= _("IP")%>:</label> <span class="static"><%=h @trackback.ip %></span><br/> | |
12 | <label><%= _("Created at")%>:</label> <span class="static"><%=h @trackback.created_at %></span><br/> | |
13 | <label><%= _("Body")%>:</label> <span class="static"><%=h @trackback.excerpt %></span><br/> | |
</div> |
rool/rails/typo/trunk/app/views/admin/users/_form.rhtml:
prev. | current | |
<%= error_messages_for 'user' %> | ||
<!--[form:user]--> | ||
<p> | ||
4 | | |
4 | <label for="user_login"><%= _("Login")%>:</label><br /> | |
<%= text_field 'user', 'login' %> | ||
</p> | ||
<p> | ||
8 | | |
8 | <label for="user_login"><%= _("Display Name")%>:</label><br/> | |
<%= text_field 'user', 'name' %> | ||
</p> | ||
<p> | ||
12 | ||
12 | <label for="user_email"><%= _("Email")%>:</label> <small>(this will be shown publically if supplied)</small><br/> | |
<%= text_field 'user', 'email' %> | ||
</p> | ||
<p> | ||
16 | ||
16 | <label for="user_jabber"><%= _("Jabber")%>:</label> <small>(this can be blank)</small><br/> | |
<%= text_field 'user', 'jabber' %> | ||
</p> | ||
<p> | ||
20 | | |
20 | <label for="user_password"><%= _("Password")%>:</label><br /> | |
<%= password_field_tag 'user[password]', '', :id => 'user_password', :size => 30 %> | ||
</p> | ||
<p> | ||
24 | | |
24 | <label for="user_password"><%= _("Password confirmation")%>:</label><br /> | |
<%= password_field 'user', 'password_confirmation' %> | ||
</p> | ||
<p> | ||
29 | | |
29 | <label for="user_notify_via_email"><%= _("Send notification messages via email")%>?</label><br /> | |
<%= check_box 'user', 'notify_via_email' %> | ||
</p> | ||
<p> | ||
34 | | |
34 | <label for="user_notify_via_jabber"><%= _("Send notification messages via jabber")%>?</label><br /> | |
<%= check_box 'user', 'notify_via_jabber' %> | ||
</p> | ||
<p> | ||
39 | | |
39 | <label for="user_notify_on_new_articles"><%= _("Send notification messages when new articles are posted")%>?</label><br /> | |
<%= check_box 'user', 'notify_on_new_articles' %> | ||
</p> | ||
<p> | ||
44 | | |
44 | <label for="user_notify_on_comments"><%= _("Send notification messages when comments are posted")%>?</label><br /> | |
<%= check_box 'user', 'notify_on_comments' %> | ||
</p> | ||
rool/rails/typo/trunk/app/views/admin/users/_user.rhtml:
prev. | current | |
<div class="user"> | ||
<h4><%= link_to h(user.login), {:action => "show", :id => user.id} %></h4> | ||
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
3 | <p><%= _("Number of Articles")%>: <%= Article.count :conditions => "user_id = #{user.id}" %></p> | |
4 | <p><%= _("Number of Comments")%>: <%= Comment.count :conditions => "user_id = #{user.id}" %></p> | |
5 | <p><%= _("Notified") %> <% if user.notify_via_email? %> <%= _("via email") %> <% end %>: | |
6 | <%= "new articles" if user.notify_on_new_articles? %> | |
7 | <%= "comments" if user.notify_on_comments? %></p> | |
8 | <p><%= link_to _('Edit'), :action => 'edit', :id => user %><strong> |</strong> <%= link_to _('Delete'), :action => 'destroy', :id => user %></p> | |
</div> |
rool/rails/typo/trunk/app/views/admin/users/destroy.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Users') %> | |
<% content_for('tasks') do %> | ||
4 | | |
5 | | |
4 | <%= task_show _('Show this user'), @user.id %> | |
5 | <% end %> | |
7 | | |
7 | <h3><%= _("Really delete user")%> "<%= @user.name || @user.login %>" ?</h3> | |
<br/> | ||
11 | | |
11 | <% form_tag do %> | |
<%= hidden_field "user", "id" %> | ||
13 | | |
14 | | |
13 | <%= confirm_delete(_("Yes") + "...") %> | |
14 | <% end %> |
rool/rails/typo/trunk/app/views/admin/users/edit.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Edit User') %> | |
2 | <% content_for('tasks') do %> | |
3 | <%= tab _("New User"), :controller=>"users", :action=>"new"%> | |
4 | <%= task_overview %> | |
5 | <% end%> | |
3 | | |
7 | <% form_tag :action=>"edit", :id => @user.id do %> | |
5 | | |
6 | | |
9 | <h3><%= _("Editing user")%></h3> | |
10 | <div class="form"> | |
<%= render_partial "form" %> | ||
</div> | ||
... | ... | |
<%= save %> or <%= cancel %> | ||
</div> | ||
14 | | |
18 | <% end %> |
rool/rails/typo/trunk/app/views/admin/users/list.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('Manage Users') %> | |
<% content_for('tasks') do %> | ||
4 | | |
4 | <%= task_new _('Add new user') %> | |
<% end %> | ||
<div id="users"> | ||
<%= render :partial => 'user', :collection => @users %> |
rool/rails/typo/trunk/app/views/admin/users/new.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _('New User') %> | |
2 | <% content_for('tasks') do %> | |
3 | <%= task_overview %> | |
4 | <% end%> | |
5 | <h3><%= _("Creating user")%></h3> | |
3 | | |
7 | <% form_tag :action=>"new" do %> | |
5 | | |
6 | ||
7 | | |
9 | <div class="form"> | |
<%= render_partial "form" %> | ||
</div> | ||
<div id="operations"> | ||
12 | | |
14 | <%= save %> or <%= cancel %> | |
</div> | ||
15 | | |
18 | <% end %> |
rool/rails/typo/trunk/app/views/admin/users/show.rhtml:
prev. | current | |
1 | | |
1 | <% @page_heading = _("User") + ": #{@user.name}" %> | |
<% content_for('tasks') do %> | ||
<%= task_new 'Create new user' %> | ||
... | ... | |
<% end %> | ||
<div class="form"> | ||
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
14 | | |
15 | | |
16 | | |
9 | <label><%= _("Name")%>:</label> <span class="static"><%=h @user.name %></span><br/> | |
10 | <label><%= _("Login")%>:</label> <span class="static"><%=h @user.login %></span><br/> | |
11 | <label><%= _("Email")%>:</label> <span class="static"><%=h @user.email %></span><br/> | |
12 | <label><%= _("Jabber")%>:</label> <span class="static"><%=h @user.jabber %></span><br/> | |
13 | <label><%= _("Notify via email")%>:</label> <span class="static"><%= @user.notify_via_email? ? _("yes") : _("no") %></span><br/> | |
14 | <label><%= _("Notify via jabber")%>:</label> <span class="static"><%= @user.notify_via_jabber? ? _("yes") : _("no") %></span><br/> | |
15 | <label><%= _("Notify on new articles")%>:</label> <span class="static"><%= @user.notify_on_new_articles? ? _("yes") : _("no") %></span><br/> | |
16 | <label><%= _("Notify on new comments")%>:</label> <span class="static"><%= @user.notify_on_comments? ? _("yes") : _("no") %></span><br/> | |
</div> | ||
19 | ||
20 | ||
21 | <div class="list"> | |
22 | <h2><%= _("User's articles")%></h2> | |
23 | <%= render :partial => 'admin/content/articles' %> | |
24 | </div> |
rool/rails/typo/trunk/app/views/articles/_article.rhtml:
prev. | current | |
1 | ||
2 | ||
1 | <h2><%= link_to_permalink article,article.title %></h2> | |
2 | <p class="auth"><%= _("Posted by")%> <%= author_link(article) %> | |
<%= js_distance_of_time_in_words_to_now article.published_at %></p> | ||
4 | ||
4 | <%= html article, :body %> |
rool/rails/typo/trunk/app/views/articles/_comment.rhtml:
prev. | current | |
<%= link_to_unless(comment.url.blank?, h(comment.author), comment.url) %> | ||
</strong> | ||
</cite> | ||
11 | | |
12 | | |
11 | <%= _("said")%> <%= distance_of_time_in_words comment.article.published_at, comment.created_at %> later:<br /> | |
</div> | ||
14 | | |
13 | <%= comment.generate_html(:body) %> | |
<% unless comment.published -%> | ||
16 | | |
17 | | |
18 | | |
19 | | |
15 | <div class="spamwarning"><%= _("This comment has been flagged for moderator approval. It won't appear on this blog until the author approves it")%>.</div> | |
<% end -%> | ||
</li> | ||
rool/rails/typo/trunk/app/views/articles/_comment_box.rhtml:
prev. | current | |
1 | ||
2 | | |
1 | <%= form_remote_tag :url => {:action => "comment", :id => @article}, | |
2 | :position=> :bottom, | |
:update => {:success => 'commentList'}, | ||
4 | | |
4 | :loading => "loading()", | |
:complete => "complete(request)", | ||
:failure => "failure(request)", | ||
:html => {:id=>"commentform",:class=>"commentform"} %> | ||
... | ... | |
<a name="respond"></a> | ||
<table cellpadding="4" cellspacing="0" class="frm-tbl"> | ||
<tr> | ||
17 | | |
17 | <td><p><label for="comment_author"><%= _("Your name")%></label></p></td> | |
<td> | ||
19 | ||
20 | | |
21 | ||
22 | | |
23 | | |
24 | ||
19 | <% if hubssolib_privileged? -%> | |
20 | <input id="comment_author" name="comment[author]" size="20" type="text" value="<%= hubssolib_unique_name %>" /> | |
21 | <% else -%> | |
22 | <input id="comment_author" name="comment[author]" size="20" type="hidden" value="<%= hubssolib_unique_name %>" /> | |
23 | <b><%= hubssolib_unique_name %></b> | |
24 | <% end -%> | |
<small><%= link_to_function("(leave url/email »)", "Element.toggle('guest_url'); Element.toggle('guest_email')") %></small> | ||
</td> | ||
</tr> | ||
<tr id="guest_url" style="display:none;"> | ||
29 | | |
29 | <td><p><label for="comment_url"><%= _("Your blog")%></label></p></td> | |
<td> <%= text_field "comment", "url" %></td> | ||
</tr> | ||
<tr id="guest_email" style="display:none;"> | ||
33 | | |
33 | <td><p><label for="comment_email"><%= _("Your email")%></label></p></td> | |
<td> <%= text_field "comment", "email" %></td> | ||
</tr> | ||
<tr> | ||
37 | | |
37 | <td><p><label for="comment_body"><%= _("Your message")%></label></p></td> | |
<td valign="top" colspan="2"> | ||
<%= text_area "comment", "body" %> | ||
</td> | ||
... | ... | |
<tr> | ||
<td colspan="2" id="frm-btns"> | ||
<span id="comment_loading" style="display:none;"><%= image_tag "spinner.gif" %></span> | ||
45 | | |
46 | | |
45 | <%= markup_help_popup TextFilter.find_by_name(this_blog.comment_text_filter), _("Comment Markup Help") %> | |
46 | <a href="#" onclick="new Ajax.Updater('preview', '<%= url_for :action => 'comment_preview' %>', {asynchronous:true, evalScripts:true, parameters:Form.serialize('commentform'), onComplete:function(request){Element.show('preview')}}); return false;"><%= _("Preview comment")%></a> | |
<input type="submit" name="submit" id="form-submit-button" value="submit" class="button" /> | ||
</td> | ||
</tr> |
rool/rails/typo/trunk/app/views/articles/_trackback.rhtml:
prev. | current | |
<li id="trackback-<%= trackback.id %>"<%= onhover_show_admin_tools(:trackback, trackback.id) %>> | ||
<%= admin_tools_for trackback %> | ||
<a name="trackback-<%= trackback.id %>"></a> | ||
4 | | |
4 | <%= _("From")%> <strong><%= trackback.blog_name %></strong><br /> | |
<a href="<%= trackback.url %>" rel="nofollow"><%=h trackback.title %></a><br/> | ||
<%= trackback.excerpt %> | ||
</li> |
rool/rails/typo/trunk/app/views/articles/archives.rhtml:
prev. | current | |
<% if @articles.to_a.empty? -%> | ||
<div class="post"> | ||
3 | ||
3 | <p><%= _("No articles found")%>...</p> | |
</div> | ||
<% else | ||
currentmonth = 0 | ||
... | ... | |
<% end -%> | ||
<div class="archivepost"> | ||
<%= article.published_at.mday %> - | ||
16 | | |
16 | <%= link_to_permalink(article,h(article.title)) %> | |
<% if !article.categories.empty? %> posted in | ||
18 | | |
18 | <%= article.categories.collect {|c| link_to_permalink c,c.name }.join(", ") -%> | |
<% end -%> | ||
</div> | ||
<% end |
rool/rails/typo/trunk/app/views/articles/comment_preview.rhtml:
prev. | current | |
<%= gravatar_tag(@comment.email) if this_blog.use_gravatar and @comment.email and !@comment.email.empty? %> | ||
2 | ||
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | ||
11 | ||
2 | <div class="citation"><cite><strong><%=h @comment[:author] %></strong></cite> <%= _("is about to say")%>:</div> | |
3 | <%= @comment.html %> |
rool/rails/typo/trunk/app/views/articles/groupings.rhtml:
prev. | current | |
<% end -%> | ||
</ul> | ||
<% else -%> | ||
12 | ||
12 | <p><%= _("There are")%> <%= @grouping_class.to_s.underscore.pluralize %>.</p> | |
<% end -%> | ||
</div> |
rool/rails/typo/trunk/app/views/articles/index.rhtml:
prev. | current | |
<% for article in @articles -%> | ||
<div class="post"> | ||
<%= render_partial "article", article %> | ||
4 | | |
4 | <%= link_to_permalink article, _("Read more") + "..." if article.extended? %> | |
<p class="meta"><%= article_links article %></p> | ||
</div> | ||
<% end -%> | ||
<% unless @pages.item_count <= this_blog.limit_article_display %> | ||
10 | | |
10 | <p id="pagination"><%= _("Older posts")%>: <%= pagination_links @pages, :params => { :action => @controller.action_name } %></p> | |
<% end -%> |
rool/rails/typo/trunk/app/views/articles/read.rhtml:
prev. | current | |
<rdf:Description | ||
rdf:about="" | ||
<% if @article.allow_pings? -%> | ||
8 | | |
8 | trackback:ping="<%= @article.trackback_url %>" | |
<% end -%> | ||
dc:title="<%=h @article.title.gsub(/-+/, '-') %>" | ||
11 | | |
12 | | |
11 | dc:identifier="<%= @article.permalink_url %>" | |
12 | dc:description="<%=h (html(@article).strip_html[0..255]).gsub(/-+/, '-') %>" | |
dc:creator="<%= h @article.author %>" | ||
dc:date="<%= @article.updated_at.xmlschema %>" /> | ||
</rdf:RDF> | ||
... | ... | |
<%= link_to("edit", { :controller => "admin/content", :action => "edit", :id => @article }, | ||
:class => "admintools", :style => "display: none", :id => "admin_article") %> | ||
<h2><%=h @article.title %></h2> | ||
22 | | |
22 | <p class="auth"><%= _("Posted by")%> <%= author_link(@article) %> | |
<%= js_distance_of_time_in_words_to_now @article.published_at.utc %></p> | ||
24 | | |
24 | <%= html(@article) %> | |
</div> | ||
<p class="meta"> | ||
<%= article_links @article %> | ||
</p> | ||
30 | ||
30 | <% if @article.allow_comments? or @article.published_comments.size > 0 -%> | |
<a name="comments"></a><h4 class="blueblk">Comments</h4> | ||
32 | | |
32 | <% unless @article.comments_closed? -%> | |
<p class="postmetadata alt"> | ||
34 | ||
35 | | |
34 | <a href="<%= url_for(:controller => 'articles', :action => 'read_and_comment', :id => @article.id, :anchor => 'comments') %>">Comment on this article</a> | |
35 | </p> | |
<% else -%> | ||
37 | | |
37 | <p><%= _("Comments are disabled")%></p> | |
<% end -%> | ||
39 | | |
40 | | |
39 | ||
<ol class="comment-list" id="commentList"> | ||
42 | | |
41 | <% if @article.published_comments.blank? %> | |
<li id="dummy_comment" style="display: none"></li> | ||
<% else %> | ||
45 | | |
44 | <%= render(:partial => "comment", :collection => @article.published_comments) %> | |
<% end %> | ||
</ol> | ||
<% end -%> | ||
<% if @article.allow_pings? -%> | ||
51 | | |
50 | <a name="trackbacks"></a><h4 class="blueblk"><%= _("Trackbacks")%></h4> | |
<p> | ||
53 | | |
54 | | |
52 | <%= _("Use the following link to trackback from your own site")%>:<br/> | |
53 | <span class="light-bg"><%= @article.trackback_url %></span> | |
</p> | ||
<%= content_tag(:ol, | ||
57 | | |
58 | | |
56 | render(:partial => "trackback", :collection => @article.published_trackbacks), | |
57 | :id => 'trackbackList', :class => 'trackback-list') unless @article.published_trackbacks.blank? %> | |
<% end -%> | ||
<p class="postmetadata alt"> | ||
<small> | ||
63 | | |
62 | <a href="<%= url_for :controller => 'xml', :action=>'feed', :type=>'article', :format => 'rss20', :id => @article %>" title="RSS Feed"><%= _("RSS feed for this post")%></a> | |
<% if @article.allow_pings? -%> | ||
65 | | |
64 | <a href="<%= @article.trackback_url %>" ><%= _("trackback uri")%></a> | |
<% end -%> | ||
</small> | ||
</p> | ||
69 | ||
70 | ||
71 | | |
72 | ||
73 | | |
74 |
rool/rails/typo/trunk/app/views/articles/view_page.rhtml:
prev. | current | |
<div id="viewpage" > | ||
2 | | |
2 | <%= html @page %> | |
</div> |
rool/rails/typo/trunk/app/views/layouts/administration.rhtml:
prev. | current | |
<div id="header"> | ||
<div id="info"> | ||
19 | | |
<%= current_user_notice rescue nil %> | | ||
21 | | |
20 | <%= link_to _('your blog') + '»', :controller => "/articles" %> | |
</div> | ||
24 | | |
23 | <h1><%= link_to _("Typo admin") + " - #{this_blog.blog_name rescue nil}", :controller => "/admin/general" %></h1> | |
</div> | ||
<!-- /HEADER --> | ||
<div id="tabs-container"> | ||
<ul id="tabs"> | ||
31 | | |
32 | | |
33 | | |
34 | | |
35 | | |
36 | | |
37 | | |
38 | | |
39 | | |
40 | | |
30 | <%= tab _("Publish"), :controller=>"/admin/content", :action => 'new' %> | |
31 | <%= tab _("Manage"), :controller=>"/admin/content/list", :action => 'index' %> | |
32 | <%= tab _("Discuss"), :controller=>"/admin/feedback", :action => 'index' %> | |
33 | <%= tab _("Design"), :controller=>"/admin/themes", :action => 'index' %> | |
34 | <%= tab _("Users"), :controller=>"/admin/users", :action => 'index' %> | |
35 | <%= tab _("Settings"), :controller=>"/admin/", :action => 'index' %> | |
</ul> | ||
</div> | ||
... | ... | |
<div id="main"> | ||
<h2><%= @page_heading %></h2> | ||
56 | | |
51 | <% if not first_render =~ /general|login|signup|logout/ %> | |
<div class="tasks"> | ||
58 | | |
53 | <h3><%= _("Things you can do") %></h3> | |
<ul> | ||
<%= @content_for_tasks %> | ||
61 | | |
</ul> | ||
<div style="clear:both;"></div> | ||
</div> | ||
... | ... | |
</div> | ||
</div> | ||
<div id="footer"> | ||
71 | | |
65 | Typo <%=h TYPO_VERSION %> <%= _("with %s Famfamfam iconset %s", '<a href="http://famfamfam.com/">', '</a>') %> | |
</div> | ||
</div> | ||
</body> |
rool/rails/typo/trunk/app/views/live/search.rhtml:
prev. | current | |
<h3>Searched for <em>"<%=h @search %>"</em></h3> | ||
<ul> | ||
<% for article in @articles.to_a -%> | ||
5 | | |
5 | <li><%= link_to_permalink article,h(article.title) %></li> | |
<% end -%> | ||
</ul> | ||
<% else %> |
rool/rails/typo/trunk/app/views/notification_mailer/_mail_footer.rhtml:
prev. | current | |
</div> | ||
3 | ||
4 | ||
5 | ||
6 | ||
7 | ||
8 | ||
3 | <p><em>This is being sent to <%=h @user.name %> because you asked to be notified via e-mail whenever new content is posted to, or existing content is edited in <a href="<%= @blog.base_url + @blog.url_for(:controller => '/articles', :action => 'index') %>"><%= @blog.blog_name %></a>. To unsubscribe, go to <a href="<%= @link_url = @blog.base_url + @blog.url_for(:controller => '/admin/users', :action => 'edit', :id => @user.id) %>"><%=h @link_url%></a> and change your user settings.</p> | |
rool/rails/typo/trunk/app/views/notification_mailer/article.rhtml:
prev. | current | |
1 | ||
1 | <p>A new article has been posted on | |
2 | <a href="<%= @blog.base_url + @blog.url_for(:controller => '/articles', :action => 'index') %>"><%= @blog.blog_name %></a>:</p> | |
<%= render :partial => './mail_header' %> | ||
<h2><%=h @article.title %></h2> | ||
5 | ||
6 | <%= html @article, :body %> | |
<%= render :partial => './mail_footer' %> |
rool/rails/typo/trunk/app/views/notification_mailer/comment.rhtml:
prev. | current | |
<p>A new comment has been posted on | ||
2 | | |
3 | | |
2 | <a href="<%= @blog.base_url + @blog.url_for(:controller => '/articles', :action => 'index') %>"><%= @blog.blog_name %></a>, responding to | |
3 | <a href="<%= @blog.base_url + @comment.article.permalink_url %>"><%=h(@comment.article.title) %></a>.</p> | |
<%= render :partial => './mail_header' %> | ||
<h2><%=h @comment.title %></h2> | ||
<cite><strong><%= (@comment.url.blank?) ? h(@comment.author) : link_to(h(@comment.author), @comment.url) %></strong> </cite> | ||
8 | | |
8 | <%= link_to('said', @comment.permalink_url) %> | |
<%= distance_of_time_in_words @article.published_at, @comment.created_at %> later:<br /> | ||
10 | ||
10 | <%= html @comment %> | |
<%= render :partial => './mail_footer' %> |
rool/rails/typo/trunk/app/views/settings/done.rhtml:
prev. | current | |
1 | ||
1 | <div class="notice"><%= flash[:notice] %></div> | |
Installation Complete! |
rool/rails/typo/trunk/app/views/settings/install.rhtml:
prev. | current | |
1 | ||
2 | ||
1 | <div class="notice"><%= flash[:notice] %></div> | |
2 | <% form_tag do %> | |
<% for field in @fields -%> | ||
... | ... | |
<%= submit_tag %> | ||
12 | ||
13 | <% end %> |
rool/rails/typo/trunk/app/views/shared/_search.rhtml:
prev. | current | |
1 | ||
1 | <% form_tag({:controller => 'articles', :action => 'search'}, {:method => 'get', :id => 'sform'}) do %> | |
<label for="q">Live Search:</label><input type="text" id="q" name="q" value="" size="15" /> | ||
<%= image_tag "spinner-blue.gif", :id => 'search_spinner', :style => 'display:none;' %> | ||
4 | ||
5 | ||
6 | | |
4 | <% end %> | |
5 | <%= observe_field "q", :frequency => 1, | |
6 | :url => { :controller => "live", :action => "search" }, | |
:loading => "Element.show('search_spinner')", | ||
:complete => "Element.hide('search_spinner')", | ||
:update => "search-results", |
rool/rails/typo/trunk/app/views/sidebar/_sidebar.rhtml:
prev. | current | |
<% benchmark "BENCHMARK: display_plugins: #{sidebar.controller}" do %> | ||
2 | ||
<div class="sidebar-node"> | ||
<%= render_sidebar(sidebar) %> | ||
</div> |
rool/rails/typo/trunk/app/views/xml/_atom10_item_article.rxml:
prev. | current | |
xm.updated item.updated_at.xmlschema | ||
xm.title post_title(item), "type"=>"html" | ||
14 | | |
14 | xm.link "rel" => "alternate", "type" => "text/html", "href" => item.permalink_url | |
item.categories.each do |category| | ||
17 | | |
17 | xm.category "term" => category.permalink, "label" => category.name, "scheme" => category.permalink_url | |
end | ||
item.tags.each do |tag| | ||
20 | | |
20 | xm.category "term" => tag.display_name, "scheme" => tag.permalink_url | |
end | ||
item.resources.each do |resource| | ||
... | ... | |
xm.link "rel" => "enclosure", | ||
:type => resource.mime, | ||
:title => item.title, | ||
28 | | |
28 | :href => this_blog.file_url(resource.filename), | |
:length => resource.size | ||
else | ||
xm.link "rel" => "enclosure", | ||
:type => resource.mime, | ||
:title => item.title, | ||
34 | | |
34 | :href => this_blog.file_url(resource.filename) | |
end | ||
end | ||
37 | | |
38 | | |
37 | xm.summary html(item, :body), "type"=>"html" | |
38 | if this_blog.show_extended_on_rss | |
39 | xm.content html(item, :all), "type"=>"html" if this_blog.show_extended_on_rss | |
40 | end | |
end |
rool/rails/typo/trunk/app/views/xml/_atom10_item_comment.rxml:
prev. | current | |
xm.updated item.updated_at.xmlschema | ||
xm.title "Comment on #{item.article.title} by #{item.author}", "type"=>"html" | ||
9 | | |
9 | xm.link "rel" => "alternate", "type" => "text/html", "href" => item.permalink_url | |
11 | | |
12 | | |
11 | xm.content html(item), "type"=>"html" | |
end |
rool/rails/typo/trunk/app/views/xml/_atom10_item_trackback.rxml:
prev. | current | |
xm.updated item.updated_at.xmlschema | ||
xm.title "Trackback from #{item.blog_name}: #{item.title} on #{item.article.title}", "type"=>"html" | ||
12 | | |
12 | xm.link "rel" => "alternate", "type" => "text/html", "href" => item.permalink_url | |
content = item.excerpt | ||
xm.summary content, "type"=>"html" |
rool/rails/typo/trunk/app/views/xml/_googlesitemap_item_article.rxml:
prev. | current | |
1 | ||
2 | | |
1 | xm.url do | |
2 | xm.loc item.permalink_url | |
xm.lastmod item.updated_at.xmlschema | ||
xm.priority 0.8 | ||
end |
rool/rails/typo/trunk/app/views/xml/_googlesitemap_item_category.rxml:
prev. | current | |
xm.item do | ||
2 | | |
2 | xm.loc item.permalink_url | |
xm.lastmod collection_lastmod(item) | ||
end |
rool/rails/typo/trunk/app/views/xml/_googlesitemap_item_page.rxml:
prev. | current | |
1 | ||
2 | | |
1 | xm.url do | |
2 | xm.loc item.permalink_url | |
xm.lastmod item.updated_at.xmlschema | ||
end |
rool/rails/typo/trunk/app/views/xml/_googlesitemap_item_tag.rxml:
prev. | current | |
1 | ||
2 | | |
1 | xm.url do | |
2 | xm.loc item.permalink_url | |
xm.lastmod collection_lastmod(item) | ||
end |
rool/rails/typo/trunk/app/views/xml/_itunes_item_resource.rxml:
prev. | current | |
xm.item do | ||
xm.title(item.itunes_subtitle) | ||
xm.enclosure( | ||
4 | | |
5 | | |
4 | :url => @blog.file_url(item.filename), | |
:length => item.size, | ||
:type => item.mime) | ||
xm.pubDate pub_date(item.created_at) | ||
9 | | |
10 | | |
8 | xm.guid this_blog.file_url(item.filename), "isPermaLink" => "false" | |
xm.itunes :author,(item.itunes_author) | ||
xm.itunes :subtitle,(item.itunes_subtitle) | ||
xm.itunes :summary,(item.itunes_summary) |
rool/rails/typo/trunk/app/views/xml/_rss20_item_article.rxml:
prev. | current | |
xm.item do | ||
xm.title post_title(item) | ||
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
3 | xm.description html(item, this_blog.show_extended_on_rss ? :all : :body) | |
xm.pubDate pub_date(item.published_at) | ||
xm.guid "urn:uuid:#{item.guid}", "isPermaLink" => "false" | ||
author = item.user.name rescue item.author | ||
email = item.user.email rescue nil | ||
author = "#{email} (#{author})" if this_blog.link_to_author unless email.blank? | ||
xm.author author | ||
15 | | |
10 | xm.link item.permalink_url | |
for category in item.categories | ||
xm.category category.name | ||
end | ||
... | ... | |
if not item.resources.empty? | ||
resource = item.resources.first | ||
xm.enclosure( | ||
27 | | |
28 | | |
22 | :url => item.blog.file_url(resource.filename), | |
:length => resource.size, | ||
:type => resource.mime) | ||
end | ||
if item.allow_pings? | ||
33 | | |
27 | xm.trackback :ping, item.trackback_url | |
end | ||
end |
rool/rails/typo/trunk/app/views/xml/_rss20_item_comment.rxml:
prev. | current | |
xm.item do | ||
xm.title "\"#{item.article.title}\" by #{item.author}" | ||
3 | | |
3 | xm.description html(item) | |
xm.pubDate pub_date(item.created_at) | ||
xm.guid "urn:uuid:#{item.guid}", "isPermaLink" => "false" | ||
6 | | |
6 | xm.link item.permalink_url | |
end |
rool/rails/typo/trunk/app/views/xml/atom10_feed.rxml:
prev. | current | |
xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8" | ||
xml.feed "xml:lang" => "en-US", "xmlns" => 'http://www.w3.org/2005/Atom' do | ||
3 | | |
3 | xml.title "ROOL News: #{@feed_title}" | |
if(not this_blog.blog_subtitle.blank?) | ||
xml.subtitle this_blog.blog_subtitle, "type"=>"html" | ||
end |
rool/rails/typo/trunk/app/views/xml/itunes_feed.rxml:
prev. | current | |
"xmlns:itunes" => "http://www.itunes.com/dtds/podcast-1.0.dtd" do | ||
xml.channel do | ||
9 | | |
9 | xml.title "ROOL News: #{@feed_title}" | |
xml.link @link | ||
xml.language "en-us" | ||
xml.ttl "40" |
rool/rails/typo/trunk/app/views/xml/rsd.rxml:
prev. | current | |
xml.service do | ||
xml.engineName "Typo" | ||
xml.engineLink "http://www.typosphere.org" | ||
6 | | |
6 | xml.homePageLink url_for(:controller => "articles") | |
xml.apis do | ||
xml.api "name" => "Movable Type", "preferred"=>"true", | ||
9 | | |
9 | "apiLink" => url_for(:controller => "backend", :action => "xmlrpc", :only_path => false), | |
"blogID" => "1" | ||
xml.api "name" => "MetaWeblog", "preferred"=>"false", | ||
12 | | |
12 | "apiLink" => url_for(:controller => "backend", :action => "xmlrpc", :only_path => false), | |
"blogID" => "1" | ||
xml.api "name" => "Blogger", "preferred"=>"false", | ||
15 | | |
15 | "apiLink" => url_for(:controller => "backend", :action => "xmlrpc", :only_path => false), | |
"blogID" => "1" | ||
end | ||
end |
rool/rails/typo/trunk/app/views/xml/rss20_feed.rxml:
prev. | current | |
xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/", | ||
"xmlns:trackback" => "http://madskills.com/public/xml/rss/module/trackback/" do | ||
xml.channel do | ||
7 | | |
7 | xml.title "ROOL News: #{@feed_title}" | |
xml.link @link | ||
xml.language "en-us" | ||
xml.ttl "40" |
rool/rails/typo/trunk/bin/typo:
prev. | current | |
#!/usr/bin/env ruby | ||
3 | ||
3 | require 'rubygems' | |
4 | require 'rails-installer' | |
class TypoInstaller < RailsInstaller | ||
application_name 'typo' | ||
support_location 'the Typo mailing list' | ||
8 | | |
def install_post_hook | ||
sweep_cache | ||
end | ||
13 | | |
13 | ||
# Sweep the cache | ||
def sweep_cache | ||
16 | | |
17 | | |
18 | | |
16 | in_directory install_directory do | |
17 | message "Cleaning out #{@@app_name.capitalize}'s cache" | |
18 | status = system_silently("rake -s sweep_cache") | |
19 | end | |
end | ||
end | ||
rool/rails/typo/trunk/config/boot.rb:
prev. | current | |
rails_gem_version = $1 | ||
if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version | ||
25 | | |
25 | # Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems | |
26 | rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last | |
if rails_gem | ||
28 | | |
29 | gem "rails", "=#{rails_gem.version.version}" | |
require rails_gem.full_gem_path + '/lib/initializer' | ||
else | ||
31 | | |
32 | STDERR.puts %(Cannot find gem for Rails ~>#{version}.0: | |
Install the missing gem with 'gem install -v=#{version} rails', or | ||
change environment.rb to define RAILS_GEM_VERSION with your desired version. | ||
) | ||
exit 1 | ||
end | ||
else | ||
38 | | |
39 | gem "rails" | |
require 'initializer' | ||
end | ||
end |
rool/rails/typo/trunk/config/environment.rb:
prev. | current | |
# Add additional load paths for your own custom dirs | ||
# config.load_paths += %W( #{RAILS_ROOT}/app/services ) | ||
27 | ||
28 | # I need the localization plugin to load first | |
29 | # Otherwise, I can't localize plugins <= localization | |
30 | config.plugins = [ 'localization' ] | |
31 | Dir.entries("#{RAILS_ROOT}/vendor/plugins/").each { |dir| | |
32 | config.plugins.push("#{dir}") if File.directory?("#{RAILS_ROOT}/vendor/plugins/#{dir}/lib") | |
33 | } | |
34 | ||
config.load_paths += %W( | ||
vendor/rubypants | ||
vendor/akismet | ||
... | ... | |
vendor/sparklines/lib | ||
vendor/uuidtools/lib | ||
vendor/jabber4r/lib | ||
37 | | |
38 | | |
39 | | |
40 | | |
41 | | |
42 | | |
43 | | |
45 | vendor/mocha/lib | |
46 | vendor/memcache-client/lib | |
47 | vendor/cached_model/lib | |
).map {|dir| "#{RAILS_ROOT}/#{dir}"}.select { |dir| File.directory?(dir) } | ||
# Force all environments to use the same logger level | ||
... | ... | |
# Activate observers that should always be running | ||
# config.active_record.observers = :cacher, :garbage_collector | ||
60 | | |
64 | config.active_record.observers = :email_notifier, :web_notifier | |
66 | config.active_record.allow_concurrency = false | |
67 | ||
# Make Active Record use UTC-base instead of local time | ||
# config.active_record.default_timezone = :utc | ||
... | ... | |
# inflect.uncountable %w( fish sheep ) | ||
# end | ||
87 | Inflector.inflections {|i| i.uncountable %w(feedback)} | |
88 | ||
# Include your application configuration below | ||
# Allow multiple Rails applications by giving the session cookie a | ||
... | ... | |
require 'flickr' | ||
require 'uuidtools' | ||
95 | ||
96 | ||
97 | ||
98 | ||
99 | ||
100 | ||
101 | ||
102 | ||
103 | require 'migrator' | |
104 | require 'rails_patch/active_record' | |
105 | require 'login_system' | |
106 | require 'typo_version' | |
107 | require 'metafragment' | |
108 | require 'actionparamcache' | |
$KCODE = 'u' | ||
104 | ||
105 | ||
106 | ||
107 | ||
108 | ||
109 | ||
110 | ||
111 | ||
112 | ||
113 | ||
114 | ||
110 | require 'jcode' | |
111 | require 'xmlrpc_fix' | |
112 | require 'transforms' | |
113 | require 'builder' | |
115 | require 'typo_deprecated' | |
116 | ||
117 | #MemoryProfiler.start(:delay => 10, :string_debug => false) | |
118 | ||
unless Builder::XmlMarkup.methods.include? '_attr_value' | ||
# Builder 2.0 has many important fixes, but for now we will only backport | ||
# this one... | ||
... | ... | |
end | ||
FLICKR_KEY='84f652422f05b96b29b9a960e0081c50' | ||
165 | ||
166 | #require 'memcache_util' | |
167 | require 'cached_model' | |
168 | CachedModel.use_local_cache = true | |
169 | CachedModel.use_memcache = false | |
170 | ||
171 | # Uncomment this to choose your blog's language | |
172 | #Localization.lang = 'fr_FR' |
rool/rails/typo/trunk/config/environments/production.rb:
prev. | current | |
# config.logger = SyslogLogger.new | ||
9 | ||
9 | # Full error reports are disabled and caching is turned on | |
config.action_controller.consider_all_requests_local = false | ||
config.action_controller.perform_caching = true | ||
rool/rails/typo/trunk/config/environments/test.rb:
prev. | current | |
# test suite. You never need to work with it otherwise. Remember that | ||
# your test database is "scratch space" for the test suite and is wiped | ||
# and recreated between test runs. Don't rely on the data there! | ||
5 | ||
5 | config.cache_classes = false | |
# Log error messages when you accidentally call methods on nil. | ||
config.whiny_nils = true |
rool/rails/typo/trunk/config/routes.rb:
prev. | current | |
ActionController::Routing::Routes.draw do |map| | ||
# default | ||
4 | | |
4 | map.index PATH_PREFIX + '/', :controller => 'articles', :action => 'index' | |
map.admin PATH_PREFIX + '/admin', :controller => 'admin/general', :action => 'index' | ||
# admin/comments controller needs parent article id | ||
... | ... | |
map.xml PATH_PREFIX + '/xml/articlerss/:id/feed.xml', :controller => 'xml', :action => 'articlerss' | ||
map.xml PATH_PREFIX + '/xml/commentrss/feed.xml', :controller => 'xml', :action => 'commentrss' | ||
map.xml PATH_PREFIX + '/xml/trackbackrss/feed.xml', :controller => 'xml', :action => 'trackbackrss' | ||
21 | ||
21 | ||
map.xml PATH_PREFIX + '/xml/:format/feed.xml', :controller => 'xml', :action => 'feed', :type => 'feed' | ||
map.xml PATH_PREFIX + '/xml/:format/:type/feed.xml', :controller => 'xml', :action => 'feed' | ||
map.xml PATH_PREFIX + '/xml/:format/:type/:id/feed.xml', :controller => 'xml', :action => 'feed' | ||
... | ... | |
:controller => 'articles', :action => 'permalink', | ||
:year => /\d{4}/, :day => /\d{1,2}/, :month => /\d{1,2}/ | ||
59 | map.connect PATH_PREFIX + '/articles/add_comment/:id', | |
60 | :controller => 'articles', :action => 'read_and_comment' | |
61 | ||
map.connect PATH_PREFIX + '/articles/category/:id', | ||
:controller => 'articles', :action => 'category' | ||
map.connect PATH_PREFIX + '/articles/category/:id/page/:page', | ||
... | ... | |
map.connect PATH_PREFIX + '/pages/*name',:controller => 'articles', :action => 'view_page' | ||
map.connect PATH_PREFIX + '/stylesheets/theme/:filename', | ||
74 | | |
75 | | |
76 | | |
77 | :controller => 'theme', :action => 'stylesheets', :filename => /.*/ | |
78 | map.connect PATH_PREFIX + '/javascripts/theme/:filename', | |
79 | :controller => 'theme', :action => 'javascript', :filename => /.*/ | |
map.connect PATH_PREFIX + '/images/theme/:filename', | ||
78 | | |
81 | :controller => 'theme', :action => 'images', :filename => /.*/ | |
83 | # For the tests | |
84 | map.connect PATH_PREFIX + '/theme/static_view_test', :controller => 'theme', :action => 'static_view_test' | |
85 | ||
map.connect PATH_PREFIX + '/plugins/filters/:filter/:public_action', | ||
:controller => 'textfilter', :action => 'public_action' | ||
83 | | |
84 | | |
85 | | |
86 | | |
87 | | |
89 | # Work around the Bad URI bug | |
90 | %w{ accounts articles backend files live sidebar textfilter xml }.each do |i| | |
91 | map.connect PATH_PREFIX + "/#{i}", :controller => "#{i}", :action => 'index' | |
92 | map.connect PATH_PREFIX + "/#{i}/:action", :controller => "#{i}" | |
93 | map.connect PATH_PREFIX + "/#{i}/:action/:id", :controller => i, :id => nil | |
94 | end | |
89 | | |
96 | %w{blacklist cache categories comments content feedback general pages | |
97 | resources sidebar textfilters themes trackbacks users}.each do |i| | |
98 | map.connect PATH_PREFIX + "/admin/#{i}", :controller => "admin/#{i}", :action => 'index' | |
99 | map.connect PATH_PREFIX + "/admin/#{i}/:action/:id", :controller => "admin/#{i}", :action => nil, :id => nil | |
100 | end | |
101 | ||
map.connect PATH_PREFIX + '/:controller/:action/:id' | ||
91 | ||
map.connect PATH_PREFIX + '/*from', :controller => 'redirect', :action => 'redirect' | ||
end |
rool/rails/typo/trunk/db/migrate/046_fixup_forthcoming_publications.rb:
prev. | current | |
require 'bare_migration' | ||
class FixupForthcomingPublications < ActiveRecord::Migration | ||
class Trigger < ActiveRecord::Base | ||
4 | | |
4 | belongs_to :pending_item, :polymorphic => true | |
end | ||
class Content < ActiveRecord::Base |
rool/rails/typo/trunk/db/schema.mysql.sql:
prev. | current | |
-- tables | ||
10 | ||
11 | | |
12 | | |
13 | | |
14 | ||
15 | ||
CREATE TABLE articles_tags ( | ||
17 | | |
18 | | |
11 | `article_id` int(11) DEFAULT NULL, | |
12 | `tag_id` int(11) DEFAULT NULL | |
) ENGINE=InnoDB; | ||
CREATE TABLE blacklist_patterns ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
23 | | |
24 | | |
17 | `type` varchar(255) DEFAULT NULL, | |
18 | `pattern` varchar(255) DEFAULT NULL | |
) ENGINE=InnoDB; | ||
CREATE TABLE blogs ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
29 | | |
23 | `settings` text DEFAULT NULL, | |
24 | `base_url` varchar(255) DEFAULT NULL | |
) ENGINE=InnoDB; | ||
CREATE TABLE categories ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
34 | | |
35 | | |
36 | | |
29 | `name` varchar(255) DEFAULT NULL, | |
30 | `position` int(11) DEFAULT NULL, | |
31 | `permalink` varchar(255) DEFAULT NULL | |
) ENGINE=InnoDB; | ||
34 | CREATE TABLE categorizations ( | |
35 | `id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | |
36 | `article_id` int(11) DEFAULT NULL, | |
37 | `category_id` int(11) DEFAULT NULL, | |
38 | `is_primary` tinyint(1) DEFAULT NULL | |
39 | ) ENGINE=InnoDB; | |
40 | ||
CREATE TABLE contents ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
41 | | |
42 | | |
43 | | |
44 | | |
45 | | |
46 | | |
47 | | |
48 | | |
49 | | |
50 | | |
51 | | |
52 | | |
53 | | |
54 | | |
55 | | |
56 | | |
57 | | |
58 | | |
59 | | |
60 | | |
61 | | |
62 | | |
63 | | |
64 | | |
43 | `type` varchar(255) DEFAULT NULL, | |
44 | `title` varchar(255) DEFAULT NULL, | |
45 | `author` varchar(255) DEFAULT NULL, | |
46 | `body` text DEFAULT NULL, | |
47 | `extended` text DEFAULT NULL, | |
48 | `excerpt` text DEFAULT NULL, | |
49 | `keywords` varchar(255) DEFAULT NULL, | |
50 | `created_at` datetime DEFAULT NULL, | |
51 | `updated_at` datetime DEFAULT NULL, | |
52 | `user_id` int(11) DEFAULT NULL, | |
53 | `permalink` varchar(255) DEFAULT NULL, | |
54 | `guid` varchar(255) DEFAULT NULL, | |
55 | `text_filter_id` int(11) DEFAULT NULL, | |
56 | `whiteboard` text DEFAULT NULL, | |
57 | `name` varchar(255) DEFAULT NULL, | |
`published` tinyint(1) DEFAULT 0, | ||
66 | | |
67 | | |
59 | `allow_pings` tinyint(1) DEFAULT NULL, | |
60 | `allow_comments` tinyint(1) DEFAULT NULL, | |
`blog_id` int(11) NOT NULL, | ||
69 | | |
62 | `published_at` datetime DEFAULT NULL, | |
63 | `state` text DEFAULT NULL | |
) ENGINE=InnoDB; | ||
66 | CREATE TABLE feedback ( | |
67 | `id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | |
68 | `type` varchar(255) DEFAULT NULL, | |
69 | `title` varchar(255) DEFAULT NULL, | |
70 | `author` varchar(255) DEFAULT NULL, | |
71 | `body` text DEFAULT NULL, | |
72 | `extended` text DEFAULT NULL, | |
73 | `excerpt` text DEFAULT NULL, | |
74 | `keywords` varchar(255) DEFAULT NULL, | |
75 | `created_at` datetime DEFAULT NULL, | |
76 | `updated_at` datetime DEFAULT NULL, | |
77 | `user_id` int(11) DEFAULT NULL, | |
78 | `permalink` varchar(255) DEFAULT NULL, | |
79 | `guid` varchar(255) DEFAULT NULL, | |
80 | `text_filter_id` int(11) DEFAULT NULL, | |
81 | `whiteboard` text DEFAULT NULL, | |
82 | `article_id` int(11) DEFAULT NULL, | |
83 | `email` varchar(255) DEFAULT NULL, | |
84 | `url` varchar(255) DEFAULT NULL, | |
85 | `ip` varchar(40) DEFAULT NULL, | |
86 | `blog_name` varchar(255) DEFAULT NULL, | |
87 | `name` varchar(255) DEFAULT NULL, | |
88 | `published` tinyint(1) DEFAULT 0, | |
89 | `allow_pings` tinyint(1) DEFAULT NULL, | |
90 | `allow_comments` tinyint(1) DEFAULT NULL, | |
91 | `blog_id` int(11) NOT NULL, | |
92 | `published_at` datetime DEFAULT NULL, | |
93 | `state` text DEFAULT NULL, | |
94 | `status_confirmed` tinyint(1) DEFAULT NULL | |
95 | ) ENGINE=InnoDB; | |
96 | ||
CREATE TABLE notifications ( | ||
73 | | |
74 | | |
75 | | |
76 | | |
98 | `id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | |
99 | `content_id` int(11) DEFAULT NULL, | |
100 | `user_id` int(11) DEFAULT NULL, | |
101 | `created_at` datetime DEFAULT NULL, | |
102 | `updated_at` datetime DEFAULT NULL | |
) ENGINE=InnoDB; | ||
CREATE TABLE page_caches ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
81 | | |
107 | `name` varchar(255) DEFAULT NULL | |
) ENGINE=InnoDB; | ||
CREATE TABLE pings ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
86 | | |
87 | | |
88 | | |
112 | `article_id` int(11) DEFAULT NULL, | |
113 | `url` varchar(255) DEFAULT NULL, | |
114 | `created_at` datetime DEFAULT NULL | |
) ENGINE=InnoDB; | ||
CREATE TABLE redirects ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
93 | | |
94 | | |
119 | `from_path` varchar(255) DEFAULT NULL, | |
120 | `to_path` varchar(255) DEFAULT NULL | |
) ENGINE=InnoDB; | ||
CREATE TABLE resources ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
99 | | |
100 | | |
101 | | |
102 | | |
103 | | |
104 | | |
105 | | |
106 | | |
107 | | |
108 | | |
109 | | |
110 | | |
111 | | |
112 | | |
125 | `size` int(11) DEFAULT NULL, | |
126 | `filename` varchar(255) DEFAULT NULL, | |
127 | `mime` varchar(255) DEFAULT NULL, | |
128 | `created_at` datetime DEFAULT NULL, | |
129 | `updated_at` datetime DEFAULT NULL, | |
130 | `article_id` int(11) DEFAULT NULL, | |
131 | `itunes_metadata` tinyint(1) DEFAULT NULL, | |
132 | `itunes_author` varchar(255) DEFAULT NULL, | |
133 | `itunes_subtitle` varchar(255) DEFAULT NULL, | |
134 | `itunes_duration` int(11) DEFAULT NULL, | |
135 | `itunes_summary` text DEFAULT NULL, | |
136 | `itunes_keywords` varchar(255) DEFAULT NULL, | |
137 | `itunes_category` varchar(255) DEFAULT NULL, | |
138 | `itunes_explicit` tinyint(1) DEFAULT NULL | |
) ENGINE=InnoDB; | ||
CREATE TABLE sessions ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
117 | | |
118 | | |
119 | | |
120 | | |
143 | `sessid` varchar(255) DEFAULT NULL, | |
144 | `data` text DEFAULT NULL, | |
145 | `created_at` datetime DEFAULT NULL, | |
146 | `updated_at` datetime DEFAULT NULL | |
) ENGINE=InnoDB; | ||
CREATE TABLE sidebars ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
125 | | |
126 | | |
127 | | |
128 | | |
151 | `active_position` int(11) DEFAULT NULL, | |
152 | `config` text DEFAULT NULL, | |
153 | `staged_position` int(11) DEFAULT NULL, | |
154 | `type` varchar(255) DEFAULT NULL, | |
155 | `blog_id` int(11) DEFAULT NULL | |
) ENGINE=InnoDB; | ||
CREATE TABLE tags ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
133 | | |
134 | | |
135 | | |
136 | | |
160 | `name` varchar(255) DEFAULT NULL, | |
161 | `created_at` datetime DEFAULT NULL, | |
162 | `updated_at` datetime DEFAULT NULL, | |
163 | `display_name` varchar(255) DEFAULT NULL | |
) ENGINE=InnoDB; | ||
CREATE TABLE text_filters ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
141 | | |
142 | | |
143 | | |
144 | | |
145 | | |
168 | `name` varchar(255) DEFAULT NULL, | |
169 | `description` varchar(255) DEFAULT NULL, | |
170 | `markup` varchar(255) DEFAULT NULL, | |
171 | `filters` text DEFAULT NULL, | |
172 | `params` text DEFAULT NULL | |
) ENGINE=InnoDB; | ||
CREATE TABLE triggers ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
150 | | |
151 | | |
152 | | |
153 | | |
177 | `pending_item_id` int(11) DEFAULT NULL, | |
178 | `pending_item_type` varchar(255) DEFAULT NULL, | |
179 | `due_at` datetime DEFAULT NULL, | |
180 | `trigger_method` varchar(255) DEFAULT NULL | |
) ENGINE=InnoDB; | ||
CREATE TABLE users ( | ||
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, | ||
158 | | |
159 | | |
160 | | |
161 | | |
162 | | |
163 | | |
164 | | |
165 | | |
166 | | |
167 | | |
185 | `login` varchar(255) DEFAULT NULL, | |
186 | `password` varchar(255) DEFAULT NULL, | |
187 | `email` text DEFAULT NULL, | |
188 | `name` text DEFAULT NULL, | |
189 | `notify_via_email` tinyint(1) DEFAULT NULL, | |
190 | `notify_on_new_articles` tinyint(1) DEFAULT NULL, | |
191 | `notify_on_comments` tinyint(1) DEFAULT NULL, | |
192 | `notify_watch_my_articles` tinyint(1) DEFAULT NULL, | |
193 | `notify_via_jabber` tinyint(1) DEFAULT NULL, | |
194 | `jabber` varchar(255) DEFAULT NULL | |
) ENGINE=InnoDB; | ||
-- indexes | ||
173 | ||
174 | ||
175 | ||
176 | ||
177 | ||
178 | ||
179 | ||
200 | CREATE INDEX `index_blacklist_patterns_on_pattern` ON blacklist_patterns (`pattern`); | |
201 | CREATE INDEX `index_categories_on_permalink` ON categories (`permalink`); | |
202 | CREATE INDEX `index_contents_on_blog_id` ON contents (`blog_id`); | |
203 | CREATE INDEX `index_contents_on_text_filter_id` ON contents (`text_filter_id`); | |
204 | CREATE INDEX `index_contents_on_published` ON contents (`published`); | |
205 | CREATE INDEX `index_feedback_on_text_filter_id` ON feedback (`text_filter_id`); | |
206 | CREATE INDEX `index_feedback_on_article_id` ON feedback (`article_id`); | |
207 | CREATE INDEX `index_page_caches_on_name` ON page_caches (`name`); | |
208 | CREATE INDEX `index_pings_on_article_id` ON pings (`article_id`); | |
209 | CREATE INDEX `index_sessions_on_sessid` ON sessions (`sessid`); | |
-- data | ||
183 | ||
184 | ||
185 | ||
INSERT INTO text_filters (`name`, `filters`, `description`, `params`, `markup`) VALUES('none', '--- [] | ||
', 'None', '--- {} | ||
... | ... | |
', 'textile'); | ||
239 | INSERT INTO `sidebars` (`id`, `active_position`, `config`, `staged_position`, `type`, `blog_id`) VALUES (1, 0, '--- !map:HashWithIndifferentAccess \nempty: false\ncount: true\n', 0, 'CategorySidebar', 1); | |
240 | INSERT INTO `sidebars` (`id`, `active_position`, `config`, `staged_position`, `type`, `blog_id`) VALUES (3, 2, '--- !map:HashWithIndifferentAccess \nformat: rss20\ntrackbacks: false\ncomments: true\narticles: true\n', 2, 'XmlSidebar', 1); | |
241 | INSERT INTO `sidebars` (`id`, `active_position`, `config`, `staged_position`, `type`, `blog_id`) VALUES (4, 1, '--- !map:HashWithIndifferentAccess \nbody: "<ul>\\n <li><a href=\\"http://www.typosphere.org\\" title=\\"Typo\\">Typo</a></li>\\n <li><a href=\\"http://blog.leetsoft.com\\" title=\\"too-biased\\">too-biased</a></li>\\n <li><a href=\\"http://blog.remor.com/\\" title=\\"seth hall\\">Seth Hall</a></li>\\n <li><a href=\\"http://scottstuff.net\\" title=\\"Scottstuff\\">scottstuff.net</a></li>\\n <li><a href=\\"http://www.bofh.org.uk\\" title=\\"Just a Summary\\">Just A Summary</a></li>\\n <li><a href=\\"http://nubyonrails.com\\" title=\\"Topfunky\\">Topfunky</a></li>\\n <li><a href=\\"http://planettypo.com\\" title=\\"PlanetTypo\\">PlanetTypo</a></li>\\n <li><a href=\\"http://typoforums.org\\" title=\\"Typo Forums\\">Typo Forums</a></li>\\n <li><a href=\\"http://fredericdevillamil.com\\" title=\\"Fr\\xC3\\xA9d\\xC3\\xA9ric de Villamil\\">Fr\\xC3\\xA9d\\xC3\\xA9ric de Villamil</a></li>\\n\\\n </ul>\\n"\ntitle: Links\n', NULL, 'StaticSidebar', 1); | |
242 | ||
-- schema version meta-info | ||
CREATE TABLE schema_info ( | ||
215 | | |
246 | `version` int(11) DEFAULT NULL | |
) ENGINE=InnoDB; | ||
218 | ||
249 | insert into schema_info (version) values (61); |
rool/rails/typo/trunk/db/schema.postgresql.sql:
prev. | current | |
-- tables | ||
10 | ||
11 | | |
12 | | |
13 | | |
14 | ||
15 | ||
CREATE TABLE articles_tags ( | ||
17 | | |
18 | | |
11 | "article_id" integer DEFAULT NULL, | |
12 | "tag_id" integer DEFAULT NULL | |
); | ||
CREATE TABLE blacklist_patterns ( | ||
"id" serial primary key, | ||
23 | | |
24 | | |
17 | "type" character varying(255) DEFAULT NULL, | |
18 | "pattern" character varying(255) DEFAULT NULL | |
); | ||
CREATE TABLE blogs ( | ||
"id" serial primary key, | ||
29 | | |
23 | "settings" text DEFAULT NULL, | |
24 | "base_url" character varying(255) DEFAULT NULL | |
); | ||
CREATE TABLE categories ( | ||
"id" serial primary key, | ||
34 | | |
35 | | |
36 | | |
29 | "name" character varying(255) DEFAULT NULL, | |
30 | "position" integer DEFAULT NULL, | |
31 | "permalink" character varying(255) DEFAULT NULL | |
); | ||
34 | CREATE TABLE categorizations ( | |
35 | "id" serial primary key, | |
36 | "article_id" integer DEFAULT NULL, | |
37 | "category_id" integer DEFAULT NULL, | |
38 | "is_primary" boolean DEFAULT NULL | |
39 | ); | |
40 | ||
CREATE TABLE contents ( | ||
"id" serial primary key, | ||
41 | | |
42 | | |
43 | | |
44 | | |
45 | | |
46 | | |
47 | | |
48 | | |
49 | | |
50 | | |
51 | | |
52 | | |
53 | | |
54 | | |
55 | | |
56 | | |
57 | | |
58 | | |
59 | | |
60 | | |
61 | | |
62 | | |
63 | | |
64 | | |
43 | "type" character varying(255) DEFAULT NULL, | |
44 | "title" character varying(255) DEFAULT NULL, | |
45 | "author" character varying(255) DEFAULT NULL, | |
46 | "body" text DEFAULT NULL, | |
47 | "extended" text DEFAULT NULL, | |
48 | "excerpt" text DEFAULT NULL, | |
49 | "keywords" character varying(255) DEFAULT NULL, | |
50 | "created_at" timestamp DEFAULT NULL, | |
51 | "updated_at" timestamp DEFAULT NULL, | |
52 | "user_id" integer DEFAULT NULL, | |
53 | "permalink" character varying(255) DEFAULT NULL, | |
54 | "guid" character varying(255) DEFAULT NULL, | |
55 | "text_filter_id" integer DEFAULT NULL, | |
56 | "whiteboard" text DEFAULT NULL, | |
57 | "name" character varying(255) DEFAULT NULL, | |
"published" boolean DEFAULT 'f', | ||
66 | | |
67 | | |
59 | "allow_pings" boolean DEFAULT NULL, | |
60 | "allow_comments" boolean DEFAULT NULL, | |
"blog_id" integer NOT NULL, | ||
69 | | |
62 | "published_at" timestamp DEFAULT NULL, | |
63 | "state" text DEFAULT NULL | |
); | ||
66 | CREATE TABLE feedback ( | |
67 | "id" serial primary key, | |
68 | "type" character varying(255) DEFAULT NULL, | |
69 | "title" character varying(255) DEFAULT NULL, | |
70 | "author" character varying(255) DEFAULT NULL, | |
71 | "body" text DEFAULT NULL, | |
72 | "extended" text DEFAULT NULL, | |
73 | "excerpt" text DEFAULT NULL, | |
74 | "keywords" character varying(255) DEFAULT NULL, | |
75 | "created_at" timestamp DEFAULT NULL, | |
76 | "updated_at" timestamp DEFAULT NULL, | |
77 | "user_id" integer DEFAULT NULL, | |
78 | "permalink" character varying(255) DEFAULT NULL, | |
79 | "guid" character varying(255) DEFAULT NULL, | |
80 | "text_filter_id" integer DEFAULT NULL, | |
81 | "whiteboard" text DEFAULT NULL, | |
82 | "article_id" integer DEFAULT NULL, | |
83 | "email" character varying(255) DEFAULT NULL, | |
84 | "url" character varying(255) DEFAULT NULL, | |
85 | "ip" character varying(40) DEFAULT NULL, | |
86 | "blog_name" character varying(255) DEFAULT NULL, | |
87 | "name" character varying(255) DEFAULT NULL, | |
88 | "published" boolean DEFAULT 'f', | |
89 | "allow_pings" boolean DEFAULT NULL, | |
90 | "allow_comments" boolean DEFAULT NULL, | |
91 | "blog_id" integer NOT NULL, | |
92 | "published_at" timestamp DEFAULT NULL, | |
93 | "state" text DEFAULT NULL, | |
94 | "status_confirmed" boolean DEFAULT NULL | |
95 | ); | |
96 | ||
CREATE TABLE notifications ( | ||
73 | | |
74 | | |
75 | | |
76 | | |
98 | "id" serial primary key, | |
99 | "content_id" integer DEFAULT NULL, | |
100 | "user_id" integer DEFAULT NULL, | |
101 | "created_at" timestamp DEFAULT NULL, | |
102 | "updated_at" timestamp DEFAULT NULL | |
); | ||
CREATE TABLE page_caches ( | ||
"id" serial primary key, | ||
81 | | |
107 | "name" character varying(255) DEFAULT NULL | |
); | ||
CREATE TABLE pings ( | ||
"id" serial primary key, | ||
86 | | |
87 | | |
88 | | |
112 | "article_id" integer DEFAULT NULL, | |
113 | "url" character varying(255) DEFAULT NULL, | |
114 | "created_at" timestamp DEFAULT NULL | |
); | ||
CREATE TABLE redirects ( | ||
"id" serial primary key, | ||
93 | | |
94 | | |
119 | "from_path" character varying(255) DEFAULT NULL, | |
120 | "to_path" character varying(255) DEFAULT NULL | |
); | ||
CREATE TABLE resources ( | ||
"id" serial primary key, | ||
99 | | |
100 | | |
101 | | |
102 | | |
103 | | |
104 | | |
105 | | |
106 | | |
107 | | |
108 | | |
109 | | |
110 | | |
111 | | |
112 | | |
125 | "size" integer DEFAULT NULL, | |
126 | "filename" character varying(255) DEFAULT NULL, | |
127 | "mime" character varying(255) DEFAULT NULL, | |
128 | "created_at" timestamp DEFAULT NULL, | |
129 | "updated_at" timestamp DEFAULT NULL, | |
130 | "article_id" integer DEFAULT NULL, | |
131 | "itunes_metadata" boolean DEFAULT NULL, | |
132 | "itunes_author" character varying(255) DEFAULT NULL, | |
133 | "itunes_subtitle" character varying(255) DEFAULT NULL, | |
134 | "itunes_duration" integer DEFAULT NULL, | |
135 | "itunes_summary" text DEFAULT NULL, | |
136 | "itunes_keywords" character varying(255) DEFAULT NULL, | |
137 | "itunes_category" character varying(255) DEFAULT NULL, | |
138 | "itunes_explicit" boolean DEFAULT NULL | |
); | ||
CREATE TABLE sessions ( | ||
"id" serial primary key, | ||
117 | | |
118 | | |
119 | | |
120 | | |
143 | "sessid" character varying(255) DEFAULT NULL, | |
144 | "data" text DEFAULT NULL, | |
145 | "created_at" timestamp DEFAULT NULL, | |
146 | "updated_at" timestamp DEFAULT NULL | |
); | ||
CREATE TABLE sidebars ( | ||
"id" serial primary key, | ||
125 | | |
126 | | |
127 | | |
128 | | |
151 | "active_position" integer DEFAULT NULL, | |
152 | "config" text DEFAULT NULL, | |
153 | "staged_position" integer DEFAULT NULL, | |
154 | "type" character varying(255) DEFAULT NULL, | |
155 | "blog_id" integer DEFAULT NULL | |
); | ||
CREATE TABLE tags ( | ||
"id" serial primary key, | ||
133 | | |
134 | | |
135 | | |
136 | | |
160 | "name" character varying(255) DEFAULT NULL, | |
161 | "created_at" timestamp DEFAULT NULL, | |
162 | "updated_at" timestamp DEFAULT NULL, | |
163 | "display_name" character varying(255) DEFAULT NULL | |
); | ||
CREATE TABLE text_filters ( | ||
"id" serial primary key, | ||
141 | | |
142 | | |
143 | | |
144 | | |
145 | | |
168 | "name" character varying(255) DEFAULT NULL, | |
169 | "description" character varying(255) DEFAULT NULL, | |
170 | "markup" character varying(255) DEFAULT NULL, | |
171 | "filters" text DEFAULT NULL, | |
172 | "params" text DEFAULT NULL | |
); | ||
CREATE TABLE triggers ( | ||
"id" serial primary key, | ||
150 | | |
151 | | |
152 | | |
153 | | |
177 | "pending_item_id" integer DEFAULT NULL, | |
178 | "pending_item_type" character varying(255) DEFAULT NULL, | |
179 | "due_at" timestamp DEFAULT NULL, | |
180 | "trigger_method" character varying(255) DEFAULT NULL | |
); | ||
CREATE TABLE users ( | ||
"id" serial primary key, | ||
158 | | |
159 | | |
160 | | |
161 | | |
162 | | |
163 | | |
164 | | |
165 | | |
166 | | |
167 | | |
185 | "login" character varying(255) DEFAULT NULL, | |
186 | "password" character varying(255) DEFAULT NULL, | |
187 | "email" text DEFAULT NULL, | |
188 | "name" text DEFAULT NULL, | |
189 | "notify_via_email" boolean DEFAULT NULL, | |
190 | "notify_on_new_articles" boolean DEFAULT NULL, | |
191 | "notify_on_comments" boolean DEFAULT NULL, | |
192 | "notify_watch_my_articles" boolean DEFAULT NULL, | |
193 | "notify_via_jabber" boolean DEFAULT NULL, | |
194 | "jabber" character varying(255) DEFAULT NULL | |
); | ||
-- indexes | ||
173 | ||
174 | ||
175 | ||
176 | ||
177 | ||
178 | ||
179 | ||
200 | CREATE INDEX "index_blacklist_patterns_on_pattern" ON blacklist_patterns ("pattern"); | |
201 | CREATE INDEX "index_categories_on_permalink" ON categories ("permalink"); | |
202 | CREATE INDEX "index_contents_on_blog_id" ON contents ("blog_id"); | |
203 | CREATE INDEX "index_contents_on_text_filter_id" ON contents ("text_filter_id"); | |
204 | CREATE INDEX "index_contents_on_published" ON contents ("published"); | |
205 | CREATE INDEX "index_feedback_on_text_filter_id" ON feedback ("text_filter_id"); | |
206 | CREATE INDEX "index_feedback_on_article_id" ON feedback ("article_id"); | |
207 | CREATE INDEX "index_page_caches_on_name" ON page_caches ("name"); | |
208 | CREATE INDEX "index_pings_on_article_id" ON pings ("article_id"); | |
209 | CREATE INDEX "index_sessions_on_sessid" ON sessions ("sessid"); | |
-- data | ||
183 | ||
184 | ||
185 | ||
INSERT INTO text_filters ("name", "filters", "description", "params", "markup") VALUES('none', '--- [] | ||
', 'None', '--- {} | ||
... | ... | |
', 'textile'); | ||
239 | INSERT INTO sidebars ("id", "active_position", "config", "staged_position", "type", "blog_id") VALUES (1, 0, '--- !map:HashWithIndifferentAccess \nempty: false\ncount: true\n', 0, 'CategorySidebar', 1); | |
240 | INSERT INTO sidebars ("id", "active_position", "config", "staged_position", "type", "blog_id") VALUES (2, 2, '--- !map:HashWithIndifferentAccess \nformat: rss20\ntrackbacks: false\ncomments: true\narticles: true\n', 2, 'XmlSidebar', 1); | |
241 | INSERT INTO sidebars ("id", "active_position", "config", "staged_position", "type", "blog_id") VALUES (3, 1, '--- !map:HashWithIndifferentAccess \nbody: "<ul>\\n <li><a href=\\"http://www.typosphere.org\\" title=\\"Typo\\">Typo</a></li>\\n <li><a href=\\"http://blog.leetsoft.com\\" title=\\"too-biased\\">too-biased</a></li>\\n <li><a href=\\"http://blog.remor.com/\\" title=\\"seth hall\\">Seth Hall</a></li>\\n <li><a href=\\"http://scottstuff.net\\" title=\\"Scottstuff\\">scottstuff.net</a></li>\\n <li><a href=\\"http://www.bofh.org.uk\\" title=\\"Just a Summary\\">Just A Summary</a></li>\\n <li><a href=\\"http://nubyonrails.com\\" title=\\"Topfunky\\">Topfunky</a></li>\\n <li><a href=\\"http://planettypo.com\\" title=\\"PlanetTypo\\">PlanetTypo</a></li>\\n <li><a href=\\"http://typoforums.org\\" title=\\"Typo Forums\\">Typo Forums</a></li>\\n <li><a href=\\"http://fredericdevillamil.com\\" title=\\"Fr\\xC3\\xA9d\\xC3\\xA9ric de Villamil\\">Fr\\xC3\\xA9d\\xC3\\xA9ric de Villamil</a></li>\\n\\\n </ul>\\n"\ntitle: Links\n', NULL, 'StaticSidebar', 1); | |
242 | ||
243 | ||
-- schema version meta-info | ||
CREATE TABLE schema_info ( | ||
215 | | |
247 | "version" integer DEFAULT NULL | |
); | ||
218 | ||
250 | insert into schema_info (version) values (61); |
rool/rails/typo/trunk/db/schema.rb:
prev. | current | |
# migrations feature of ActiveRecord to incrementally modify your database, and | ||
# then regenerate this schema definition. | ||
5 | ||
5 | ActiveRecord::Schema.define(:version => 61) do | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
12 | ||
create_table "articles_tags", :id => false, :force => true do |t| | ||
t.column "article_id", :integer | ||
15 | | |
9 | t.column "tag_id", :integer | |
end | ||
create_table "blacklist_patterns", :force => true do |t| | ||
19 | | |
13 | t.column "type", :string | |
t.column "pattern", :string | ||
end | ||
23 | | |
17 | add_index "blacklist_patterns", ["pattern"], :name => "blacklist_patterns_pattern_index" | |
create_table "blogs", :force => true do |t| | ||
t.column "settings", :text | ||
21 | t.column "base_url", :string | |
end | ||
create_table "categories", :force => true do |t| | ||
30 | | |
31 | | |
32 | | |
25 | t.column "name", :string | |
26 | t.column "position", :integer | |
t.column "permalink", :string | ||
end | ||
add_index "categories", ["permalink"], :name => "categories_permalink_index" | ||
32 | create_table "categorizations", :force => true do |t| | |
33 | t.column "article_id", :integer | |
34 | t.column "category_id", :integer | |
35 | t.column "is_primary", :boolean | |
36 | end | |
37 | ||
create_table "contents", :force => true do |t| | ||
39 | | |
40 | | |
41 | | |
42 | | |
43 | | |
44 | | |
45 | | |
46 | | |
47 | | |
48 | | |
49 | | |
50 | | |
51 | | |
52 | | |
39 | t.column "type", :string | |
40 | t.column "title", :string | |
41 | t.column "author", :string | |
42 | t.column "body", :text | |
43 | t.column "extended", :text | |
44 | t.column "excerpt", :text | |
45 | t.column "keywords", :string | |
46 | t.column "created_at", :datetime | |
47 | t.column "updated_at", :datetime | |
48 | t.column "user_id", :integer | |
49 | t.column "permalink", :string | |
50 | t.column "guid", :string | |
t.column "text_filter_id", :integer | ||
54 | | |
55 | | |
56 | | |
57 | | |
58 | | |
59 | | |
60 | | |
61 | | |
62 | | |
63 | | |
64 | | |
52 | t.column "whiteboard", :text | |
53 | t.column "name", :string | |
54 | t.column "published", :boolean, :default => false | |
55 | t.column "allow_pings", :boolean | |
t.column "allow_comments", :boolean | ||
66 | | |
67 | | |
68 | | |
57 | t.column "blog_id", :integer, :null => false | |
58 | t.column "published_at", :datetime | |
59 | t.column "state", :text | |
end | ||
71 | | |
add_index "contents", ["blog_id"], :name => "contents_blog_id_index" | ||
63 | add_index "contents", ["published"], :name => "index_contents_on_published" | |
64 | add_index "contents", ["text_filter_id"], :name => "index_contents_on_text_filter_id" | |
74 | | |
75 | | |
76 | | |
66 | create_table "feedback", :force => true do |t| | |
67 | t.column "type", :string | |
68 | t.column "title", :string | |
69 | t.column "author", :string | |
70 | t.column "body", :text | |
71 | t.column "excerpt", :text | |
72 | t.column "created_at", :datetime | |
73 | t.column "updated_at", :datetime | |
74 | t.column "user_id", :integer | |
75 | t.column "guid", :string | |
76 | t.column "text_filter_id", :integer | |
77 | t.column "whiteboard", :text | |
78 | t.column "article_id", :integer | |
79 | t.column "email", :string | |
80 | t.column "url", :string | |
81 | t.column "ip", :string, :limit => 40 | |
82 | t.column "blog_name", :string | |
83 | t.column "published", :boolean, :default => false | |
84 | t.column "blog_id", :integer, :null => false | |
85 | t.column "published_at", :datetime | |
86 | t.column "state", :text | |
87 | t.column "status_confirmed", :boolean | |
88 | end | |
89 | ||
90 | add_index "feedback", ["article_id"], :name => "index_feedback_on_article_id" | |
91 | add_index "feedback", ["text_filter_id"], :name => "index_feedback_on_text_filter_id" | |
92 | ||
93 | create_table "notifications", :force => true do |t| | |
94 | t.column "content_id", :integer | |
95 | t.column "user_id", :integer | |
t.column "created_at", :datetime | ||
t.column "updated_at", :datetime | ||
end | ||
... | ... | |
add_index "page_caches", ["name"], :name => "page_caches_name_index" | ||
create_table "pings", :force => true do |t| | ||
88 | | |
89 | | |
107 | t.column "article_id", :integer | |
108 | t.column "url", :string | |
t.column "created_at", :datetime | ||
end | ||
93 | | |
112 | add_index "pings", ["article_id"], :name => "pings_article_id_index" | |
create_table "redirects", :force => true do |t| | ||
t.column "from_path", :string | ||
97 | | |
116 | t.column "to_path", :string | |
end | ||
create_table "resources", :force => true do |t| | ||
101 | | |
102 | | |
103 | | |
104 | | |
105 | | |
106 | | |
120 | t.column "size", :integer | |
121 | t.column "filename", :string | |
122 | t.column "mime", :string | |
123 | t.column "created_at", :datetime | |
124 | t.column "updated_at", :datetime | |
125 | t.column "article_id", :integer | |
t.column "itunes_metadata", :boolean | ||
108 | | |
127 | t.column "itunes_author", :string | |
t.column "itunes_subtitle", :string | ||
t.column "itunes_duration", :integer | ||
111 | | |
130 | t.column "itunes_summary", :text | |
t.column "itunes_keywords", :string | ||
t.column "itunes_category", :string | ||
t.column "itunes_explicit", :boolean | ||
end | ||
create_table "sessions", :force => true do |t| | ||
118 | | |
119 | | |
137 | t.column "sessid", :string | |
138 | t.column "data", :text | |
t.column "created_at", :datetime | ||
t.column "updated_at", :datetime | ||
end | ||
... | ... | |
create_table "sidebars", :force => true do |t| | ||
t.column "active_position", :integer | ||
128 | | |
147 | t.column "config", :text | |
t.column "staged_position", :integer | ||
130 | | |
149 | t.column "type", :string | |
150 | t.column "blog_id", :integer | |
end | ||
create_table "tags", :force => true do |t| | ||
134 | | |
135 | | |
136 | | |
154 | t.column "name", :string | |
155 | t.column "created_at", :datetime | |
156 | t.column "updated_at", :datetime | |
t.column "display_name", :string | ||
end | ||
create_table "text_filters", :force => true do |t| | ||
141 | | |
161 | t.column "name", :string | |
t.column "description", :string | ||
143 | | |
144 | | |
145 | | |
163 | t.column "markup", :string | |
164 | t.column "filters", :text | |
165 | t.column "params", :text | |
end | ||
create_table "triggers", :force => true do |t| | ||
149 | | |
169 | t.column "pending_item_id", :integer | |
t.column "pending_item_type", :string | ||
151 | | |
152 | | |
171 | t.column "due_at", :datetime | |
172 | t.column "trigger_method", :string | |
end | ||
create_table "users", :force => true do |t| | ||
156 | | |
157 | | |
158 | | |
159 | | |
160 | | |
161 | | |
162 | | |
176 | t.column "login", :string | |
177 | t.column "password", :string | |
178 | t.column "email", :text | |
179 | t.column "name", :text | |
180 | t.column "notify_via_email", :boolean | |
181 | t.column "notify_on_new_articles", :boolean | |
182 | t.column "notify_on_comments", :boolean | |
t.column "notify_watch_my_articles", :boolean | ||
164 | | |
165 | | |
184 | t.column "notify_via_jabber", :boolean | |
185 | t.column "jabber", :string | |
end | ||
168 | | |
169 | ||
end |
rool/rails/typo/trunk/db/schema.sqlite.sql:
prev. | current | |
-- tables | ||
10 | ||
11 | | |
12 | | |
13 | | |
14 | ||
15 | ||
CREATE TABLE articles_tags ( | ||
17 | | |
18 | | |
11 | "article_id" integer DEFAULT NULL, | |
12 | "tag_id" integer DEFAULT NULL | |
); | ||
CREATE TABLE blacklist_patterns ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
23 | | |
24 | | |
17 | "type" varchar(255) DEFAULT NULL, | |
18 | "pattern" varchar(255) DEFAULT NULL | |
); | ||
CREATE TABLE blogs ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
29 | | |
23 | "settings" text DEFAULT NULL, | |
24 | "base_url" varchar(255) DEFAULT NULL | |
); | ||
CREATE TABLE categories ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
34 | | |
35 | | |
36 | | |
29 | "name" varchar(255) DEFAULT NULL, | |
30 | "position" integer DEFAULT NULL, | |
31 | "permalink" varchar(255) DEFAULT NULL | |
); | ||
34 | CREATE TABLE categorizations ( | |
35 | "id" INTEGER PRIMARY KEY NOT NULL, | |
36 | "article_id" integer DEFAULT NULL, | |
37 | "category_id" integer DEFAULT NULL, | |
38 | "is_primary" boolean DEFAULT NULL | |
39 | ); | |
40 | ||
CREATE TABLE contents ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
41 | | |
42 | | |
43 | | |
44 | | |
45 | | |
46 | | |
47 | | |
48 | | |
49 | | |
50 | | |
51 | | |
52 | | |
53 | | |
54 | | |
55 | | |
56 | | |
57 | | |
58 | | |
59 | | |
60 | | |
61 | | |
62 | | |
63 | | |
64 | | |
43 | "type" varchar(255) DEFAULT NULL, | |
44 | "title" varchar(255) DEFAULT NULL, | |
45 | "author" varchar(255) DEFAULT NULL, | |
46 | "body" text DEFAULT NULL, | |
47 | "extended" text DEFAULT NULL, | |
48 | "excerpt" text DEFAULT NULL, | |
49 | "keywords" varchar(255) DEFAULT NULL, | |
50 | "created_at" datetime DEFAULT NULL, | |
51 | "updated_at" datetime DEFAULT NULL, | |
52 | "user_id" integer DEFAULT NULL, | |
53 | "permalink" varchar(255) DEFAULT NULL, | |
54 | "guid" varchar(255) DEFAULT NULL, | |
55 | "text_filter_id" integer DEFAULT NULL, | |
56 | "whiteboard" text DEFAULT NULL, | |
57 | "name" varchar(255) DEFAULT NULL, | |
"published" boolean DEFAULT 'f', | ||
66 | | |
67 | | |
59 | "allow_pings" boolean DEFAULT NULL, | |
60 | "allow_comments" boolean DEFAULT NULL, | |
"blog_id" integer NOT NULL, | ||
69 | | |
62 | "published_at" datetime DEFAULT NULL, | |
63 | "state" text DEFAULT NULL | |
); | ||
66 | CREATE TABLE feedback ( | |
67 | "id" INTEGER PRIMARY KEY NOT NULL, | |
68 | "type" varchar(255) DEFAULT NULL, | |
69 | "title" varchar(255) DEFAULT NULL, | |
70 | "author" varchar(255) DEFAULT NULL, | |
71 | "body" text DEFAULT NULL, | |
72 | "extended" text DEFAULT NULL, | |
73 | "excerpt" text DEFAULT NULL, | |
74 | "keywords" varchar(255) DEFAULT NULL, | |
75 | "created_at" datetime DEFAULT NULL, | |
76 | "updated_at" datetime DEFAULT NULL, | |
77 | "user_id" integer DEFAULT NULL, | |
78 | "permalink" varchar(255) DEFAULT NULL, | |
79 | "guid" varchar(255) DEFAULT NULL, | |
80 | "text_filter_id" integer DEFAULT NULL, | |
81 | "whiteboard" text DEFAULT NULL, | |
82 | "article_id" integer DEFAULT NULL, | |
83 | "email" varchar(255) DEFAULT NULL, | |
84 | "url" varchar(255) DEFAULT NULL, | |
85 | "ip" varchar(40) DEFAULT NULL, | |
86 | "blog_name" varchar(255) DEFAULT NULL, | |
87 | "name" varchar(255) DEFAULT NULL, | |
88 | "published" boolean DEFAULT 'f', | |
89 | "allow_pings" boolean DEFAULT NULL, | |
90 | "allow_comments" boolean DEFAULT NULL, | |
91 | "blog_id" integer NOT NULL, | |
92 | "published_at" datetime DEFAULT NULL, | |
93 | "state" text DEFAULT NULL, | |
94 | "status_confirmed" boolean DEFAULT NULL | |
95 | ); | |
96 | ||
CREATE TABLE notifications ( | ||
73 | | |
74 | | |
75 | | |
76 | | |
98 | "id" INTEGER PRIMARY KEY NOT NULL, | |
99 | "content_id" integer DEFAULT NULL, | |
100 | "user_id" integer DEFAULT NULL, | |
101 | "created_at" datetime DEFAULT NULL, | |
102 | "updated_at" datetime DEFAULT NULL | |
); | ||
CREATE TABLE page_caches ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
81 | | |
107 | "name" varchar(255) DEFAULT NULL | |
); | ||
CREATE TABLE pings ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
86 | | |
87 | | |
88 | | |
112 | "article_id" integer DEFAULT NULL, | |
113 | "url" varchar(255) DEFAULT NULL, | |
114 | "created_at" datetime DEFAULT NULL | |
); | ||
CREATE TABLE redirects ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
93 | | |
94 | | |
119 | "from_path" varchar(255) DEFAULT NULL, | |
120 | "to_path" varchar(255) DEFAULT NULL | |
); | ||
CREATE TABLE resources ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
99 | | |
100 | | |
101 | | |
102 | | |
103 | | |
104 | | |
105 | | |
106 | | |
107 | | |
108 | | |
109 | | |
110 | | |
111 | | |
112 | | |
125 | "size" integer DEFAULT NULL, | |
126 | "filename" varchar(255) DEFAULT NULL, | |
127 | "mime" varchar(255) DEFAULT NULL, | |
128 | "created_at" datetime DEFAULT NULL, | |
129 | "updated_at" datetime DEFAULT NULL, | |
130 | "article_id" integer DEFAULT NULL, | |
131 | "itunes_metadata" boolean DEFAULT NULL, | |
132 | "itunes_author" varchar(255) DEFAULT NULL, | |
133 | "itunes_subtitle" varchar(255) DEFAULT NULL, | |
134 | "itunes_duration" integer DEFAULT NULL, | |
135 | "itunes_summary" text DEFAULT NULL, | |
136 | "itunes_keywords" varchar(255) DEFAULT NULL, | |
137 | "itunes_category" varchar(255) DEFAULT NULL, | |
138 | "itunes_explicit" boolean DEFAULT NULL | |
); | ||
CREATE TABLE sessions ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
117 | | |
118 | | |
119 | | |
120 | | |
143 | "sessid" varchar(255) DEFAULT NULL, | |
144 | "data" text DEFAULT NULL, | |
145 | "created_at" datetime DEFAULT NULL, | |
146 | "updated_at" datetime DEFAULT NULL | |
); | ||
CREATE TABLE sidebars ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
125 | | |
126 | | |
127 | | |
128 | | |
151 | "active_position" integer DEFAULT NULL, | |
152 | "config" text DEFAULT NULL, | |
153 | "staged_position" integer DEFAULT NULL, | |
154 | "type" varchar(255) DEFAULT NULL, | |
155 | "blog_id" integer DEFAULT NULL | |
); | ||
CREATE TABLE tags ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
133 | | |
134 | | |
135 | | |
136 | | |
160 | "name" varchar(255) DEFAULT NULL, | |
161 | "created_at" datetime DEFAULT NULL, | |
162 | "updated_at" datetime DEFAULT NULL, | |
163 | "display_name" varchar(255) DEFAULT NULL | |
); | ||
CREATE TABLE text_filters ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
141 | | |
142 | | |
143 | | |
144 | | |
145 | | |
168 | "name" varchar(255) DEFAULT NULL, | |
169 | "description" varchar(255) DEFAULT NULL, | |
170 | "markup" varchar(255) DEFAULT NULL, | |
171 | "filters" text DEFAULT NULL, | |
172 | "params" text DEFAULT NULL | |
); | ||
CREATE TABLE triggers ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
150 | | |
151 | | |
152 | | |
153 | | |
177 | "pending_item_id" integer DEFAULT NULL, | |
178 | "pending_item_type" varchar(255) DEFAULT NULL, | |
179 | "due_at" datetime DEFAULT NULL, | |
180 | "trigger_method" varchar(255) DEFAULT NULL | |
); | ||
CREATE TABLE users ( | ||
"id" INTEGER PRIMARY KEY NOT NULL, | ||
158 | | |
159 | | |
160 | | |
161 | | |
162 | | |
163 | | |
164 | | |
165 | | |
166 | | |
167 | | |
185 | "login" varchar(255) DEFAULT NULL, | |
186 | "password" varchar(255) DEFAULT NULL, | |
187 | "email" text DEFAULT NULL, | |
188 | "name" text DEFAULT NULL, | |
189 | "notify_via_email" boolean DEFAULT NULL, | |
190 | "notify_on_new_articles" boolean DEFAULT NULL, | |
191 | "notify_on_comments" boolean DEFAULT NULL, | |
192 | "notify_watch_my_articles" boolean DEFAULT NULL, | |
193 | "notify_via_jabber" boolean DEFAULT NULL, | |
194 | "jabber" varchar(255) DEFAULT NULL | |
); | ||
-- indexes | ||
173 | ||
174 | ||
175 | ||
176 | ||
177 | ||
178 | ||
179 | ||
200 | CREATE INDEX "index_blacklist_patterns_on_pattern" ON blacklist_patterns ("pattern"); | |
201 | CREATE INDEX "index_categories_on_permalink" ON categories ("permalink"); | |
202 | CREATE INDEX "index_contents_on_blog_id" ON contents ("blog_id"); | |
203 | CREATE INDEX "index_contents_on_text_filter_id" ON contents ("text_filter_id"); | |
204 | CREATE INDEX "index_contents_on_published" ON contents ("published"); | |
205 | CREATE INDEX "index_feedback_on_text_filter_id" ON feedback ("text_filter_id"); | |
206 | CREATE INDEX "index_feedback_on_article_id" ON feedback ("article_id"); | |
207 | CREATE INDEX "index_page_caches_on_name" ON page_caches ("name"); | |
208 | CREATE INDEX "index_pings_on_article_id" ON pings ("article_id"); | |
209 | CREATE INDEX "index_sessions_on_sessid" ON sessions ("sessid"); | |
-- data | ||
183 | ||
184 | ||
185 | ||
INSERT INTO text_filters ("name", "filters", "description", "params", "markup") VALUES('none', '--- [] | ||
', 'None', '--- {} | ||
... | ... | |
', 'textile'); | ||
239 | INSERT INTO sidebars ("id", "active_position", "config", "staged_position", "type", "blog_id") VALUES (1, 0, '--- !map:HashWithIndifferentAccess \nempty: false\ncount: true\n', 0, 'CategorySidebar', 1); | |
240 | INSERT INTO sidebars ("id", "active_position", "config", "staged_position", "type", "blog_id") VALUES (2, 2, '--- !map:HashWithIndifferentAccess \nformat: rss20\ntrackbacks: false\ncomments: true\narticles: true\n', 2, 'XmlSidebar', 1); | |
241 | INSERT INTO sidebars ("id", "active_position", "config", "staged_position", "type", "blog_id") VALUES (3, 1, '--- !map:HashWithIndifferentAccess \nbody: "<ul>\\n <li><a href=\\"http://www.typosphere.org\\" title=\\"Typo\\">Typo</a></li>\\n <li><a href=\\"http://blog.leetsoft.com\\" title=\\"too-biased\\">too-biased</a></li>\\n <li><a href=\\"http://blog.remor.com/\\" title=\\"seth hall\\">Seth Hall</a></li>\\n <li><a href=\\"http://scottstuff.net\\" title=\\"Scottstuff\\">scottstuff.net</a></li>\\n <li><a href=\\"http://www.bofh.org.uk\\" title=\\"Just a Summary\\">Just A Summary</a></li>\\n <li><a href=\\"http://nubyonrails.com\\" title=\\"Topfunky\\">Topfunky</a></li>\\n <li><a href=\\"http://planettypo.com\\" title=\\"PlanetTypo\\">PlanetTypo</a></li>\\n <li><a href=\\"http://typoforums.org\\" title=\\"Typo Forums\\">Typo Forums</a></li>\\n <li><a href=\\"http://fredericdevillamil.com\\" title=\\"Fr\\xC3\\xA9d\\xC3\\xA9ric de Villamil\\">Fr\\xC3\\xA9d\\xC3\\xA9ric de Villamil</a></li>\\n\\\n </ul>\\n"\ntitle: Links\n', NULL, 'StaticSidebar', 1); | |
242 | ||
243 | ||
-- schema version meta-info | ||
CREATE TABLE schema_info ( | ||
215 | | |
247 | "version" integer DEFAULT NULL | |
); | ||
218 | ||
250 | insert into schema_info (version) values (61); |
rool/rails/typo/trunk/db/schema.sqlserver.sql:
prev. | current | |
-- tables | ||
10 | ||
11 | | |
12 | | |
13 | | |
14 | ||
15 | ||
CREATE TABLE articles_tags ( | ||
17 | | |
18 | | |
11 | [article_id] integer DEFAULT NULL, | |
12 | [tag_id] integer DEFAULT NULL | |
); | ||
CREATE TABLE blacklist_patterns ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
24 | | |
25 | | |
18 | [type] varchar(255) DEFAULT NULL, | |
19 | [pattern] varchar(255) DEFAULT NULL | |
); | ||
CREATE TABLE blogs ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
31 | | |
25 | [settings] text DEFAULT NULL, | |
26 | [base_url] varchar(255) DEFAULT NULL | |
); | ||
CREATE TABLE categories ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
37 | | |
38 | | |
39 | | |
32 | [name] varchar(255) DEFAULT NULL, | |
33 | [position] integer DEFAULT NULL, | |
34 | [permalink] varchar(255) DEFAULT NULL | |
); | ||
37 | CREATE TABLE categorizations ( | |
38 | [id] int NOT NULL IDENTITY(1, | |
39 | 1) PRIMARY KEY, | |
40 | [article_id] integer DEFAULT NULL, | |
41 | [category_id] integer DEFAULT NULL, | |
42 | [is_primary] bit DEFAULT NULL | |
43 | ); | |
44 | ||
CREATE TABLE contents ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
45 | | |
46 | | |
47 | | |
48 | | |
49 | | |
50 | | |
51 | | |
52 | | |
53 | | |
54 | | |
55 | | |
56 | | |
57 | | |
58 | | |
59 | | |
60 | | |
61 | | |
62 | | |
63 | | |
64 | | |
65 | | |
66 | | |
67 | | |
68 | | |
48 | [type] varchar(255) DEFAULT NULL, | |
49 | [title] varchar(255) DEFAULT NULL, | |
50 | [author] varchar(255) DEFAULT NULL, | |
51 | [body] text DEFAULT NULL, | |
52 | [extended] text DEFAULT NULL, | |
53 | [excerpt] text DEFAULT NULL, | |
54 | [keywords] varchar(255) DEFAULT NULL, | |
55 | [created_at] datetime DEFAULT NULL, | |
56 | [updated_at] datetime DEFAULT NULL, | |
57 | [user_id] integer DEFAULT NULL, | |
58 | [permalink] varchar(255) DEFAULT NULL, | |
59 | [guid] varchar(255) DEFAULT NULL, | |
60 | [text_filter_id] integer DEFAULT NULL, | |
61 | [whiteboard] text DEFAULT NULL, | |
62 | [name] varchar(255) DEFAULT NULL, | |
[published] bit DEFAULT 0, | ||
70 | | |
71 | | |
72 | | |
73 | | |
64 | [allow_pings] bit DEFAULT NULL, | |
65 | [allow_comments] bit DEFAULT NULL, | |
66 | [blog_id] integer NOT NULL, | |
67 | [published_at] datetime DEFAULT NULL, | |
68 | [state] text DEFAULT NULL | |
); | ||
71 | CREATE TABLE feedback ( | |
72 | [id] int NOT NULL IDENTITY(1, | |
73 | 1) PRIMARY KEY, | |
74 | [type] varchar(255) DEFAULT NULL, | |
75 | [title] varchar(255) DEFAULT NULL, | |
76 | [author] varchar(255) DEFAULT NULL, | |
77 | [body] text DEFAULT NULL, | |
78 | [extended] text DEFAULT NULL, | |
79 | [excerpt] text DEFAULT NULL, | |
80 | [keywords] varchar(255) DEFAULT NULL, | |
81 | [created_at] datetime DEFAULT NULL, | |
82 | [updated_at] datetime DEFAULT NULL, | |
83 | [user_id] integer DEFAULT NULL, | |
84 | [permalink] varchar(255) DEFAULT NULL, | |
85 | [guid] varchar(255) DEFAULT NULL, | |
86 | [text_filter_id] integer DEFAULT NULL, | |
87 | [whiteboard] text DEFAULT NULL, | |
88 | [article_id] integer DEFAULT NULL, | |
89 | [email] varchar(255) DEFAULT NULL, | |
90 | [url] varchar(255) DEFAULT NULL, | |
91 | [ip] varchar(40) DEFAULT NULL, | |
92 | [blog_name] varchar(255) DEFAULT NULL, | |
93 | [name] varchar(255) DEFAULT NULL, | |
94 | [published] bit DEFAULT 0, | |
95 | [allow_pings] bit DEFAULT NULL, | |
96 | [allow_comments] bit DEFAULT NULL, | |
97 | [blog_id] integer NOT NULL, | |
98 | [published_at] datetime DEFAULT NULL, | |
99 | [state] text DEFAULT NULL, | |
100 | [status_confirmed] bit DEFAULT NULL | |
101 | ); | |
102 | ||
CREATE TABLE notifications ( | ||
77 | | |
78 | | |
79 | | |
80 | | |
104 | [id] int NOT NULL IDENTITY(1, | |
105 | 1) PRIMARY KEY, | |
106 | [content_id] integer DEFAULT NULL, | |
107 | [user_id] integer DEFAULT NULL, | |
108 | [created_at] datetime DEFAULT NULL, | |
109 | [updated_at] datetime DEFAULT NULL | |
); | ||
CREATE TABLE page_caches ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
86 | | |
115 | [name] varchar(255) DEFAULT NULL | |
); | ||
CREATE TABLE pings ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
92 | | |
93 | | |
94 | | |
121 | [article_id] integer DEFAULT NULL, | |
122 | [url] varchar(255) DEFAULT NULL, | |
123 | [created_at] datetime DEFAULT NULL | |
); | ||
CREATE TABLE redirects ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
100 | | |
101 | | |
129 | [from_path] varchar(255) DEFAULT NULL, | |
130 | [to_path] varchar(255) DEFAULT NULL | |
); | ||
CREATE TABLE resources ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
107 | | |
108 | | |
109 | | |
110 | | |
111 | | |
112 | | |
113 | | |
114 | | |
115 | | |
116 | | |
117 | | |
118 | | |
119 | | |
120 | | |
136 | [size] integer DEFAULT NULL, | |
137 | [filename] varchar(255) DEFAULT NULL, | |
138 | [mime] varchar(255) DEFAULT NULL, | |
139 | [created_at] datetime DEFAULT NULL, | |
140 | [updated_at] datetime DEFAULT NULL, | |
141 | [article_id] integer DEFAULT NULL, | |
142 | [itunes_metadata] bit DEFAULT NULL, | |
143 | [itunes_author] varchar(255) DEFAULT NULL, | |
144 | [itunes_subtitle] varchar(255) DEFAULT NULL, | |
145 | [itunes_duration] integer DEFAULT NULL, | |
146 | [itunes_summary] text DEFAULT NULL, | |
147 | [itunes_keywords] varchar(255) DEFAULT NULL, | |
148 | [itunes_category] varchar(255) DEFAULT NULL, | |
149 | [itunes_explicit] bit DEFAULT NULL | |
); | ||
CREATE TABLE sessions ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
126 | | |
127 | | |
128 | | |
129 | | |
155 | [sessid] varchar(255) DEFAULT NULL, | |
156 | [data] text DEFAULT NULL, | |
157 | [created_at] datetime DEFAULT NULL, | |
158 | [updated_at] datetime DEFAULT NULL | |
); | ||
CREATE TABLE sidebars ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
135 | | |
136 | | |
137 | | |
138 | | |
164 | [active_position] integer DEFAULT NULL, | |
165 | [config] text DEFAULT NULL, | |
166 | [staged_position] integer DEFAULT NULL, | |
167 | [type] varchar(255) DEFAULT NULL, | |
168 | [blog_id] integer DEFAULT NULL | |
); | ||
CREATE TABLE tags ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
144 | | |
145 | | |
146 | | |
147 | | |
174 | [name] varchar(255) DEFAULT NULL, | |
175 | [created_at] datetime DEFAULT NULL, | |
176 | [updated_at] datetime DEFAULT NULL, | |
177 | [display_name] varchar(255) DEFAULT NULL | |
); | ||
CREATE TABLE text_filters ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
153 | | |
154 | | |
155 | | |
156 | | |
157 | | |
183 | [name] varchar(255) DEFAULT NULL, | |
184 | [description] varchar(255) DEFAULT NULL, | |
185 | [markup] varchar(255) DEFAULT NULL, | |
186 | [filters] text DEFAULT NULL, | |
187 | [params] text DEFAULT NULL | |
); | ||
CREATE TABLE triggers ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
163 | | |
164 | | |
165 | | |
166 | | |
193 | [pending_item_id] integer DEFAULT NULL, | |
194 | [pending_item_type] varchar(255) DEFAULT NULL, | |
195 | [due_at] datetime DEFAULT NULL, | |
196 | [trigger_method] varchar(255) DEFAULT NULL | |
); | ||
CREATE TABLE users ( | ||
[id] int NOT NULL IDENTITY(1, | ||
1) PRIMARY KEY, | ||
172 | | |
173 | | |
174 | | |
175 | | |
176 | | |
177 | | |
178 | | |
179 | | |
180 | | |
181 | | |
202 | [login] varchar(255) DEFAULT NULL, | |
203 | [password] varchar(255) DEFAULT NULL, | |
204 | [email] text DEFAULT NULL, | |
205 | [name] text DEFAULT NULL, | |
206 | [notify_via_email] bit DEFAULT NULL, | |
207 | [notify_on_new_articles] bit DEFAULT NULL, | |
208 | [notify_on_comments] bit DEFAULT NULL, | |
209 | [notify_watch_my_articles] bit DEFAULT NULL, | |
210 | [notify_via_jabber] bit DEFAULT NULL, | |
211 | [jabber] varchar(255) DEFAULT NULL | |
); | ||
-- indexes | ||
187 | ||
188 | ||
189 | ||
190 | ||
191 | ||
192 | ||
193 | ||
217 | CREATE INDEX [index_blacklist_patterns_on_pattern] ON blacklist_patterns ([pattern]); | |
218 | CREATE INDEX [index_categories_on_permalink] ON categories ([permalink]); | |
219 | CREATE INDEX [index_contents_on_blog_id] ON contents ([blog_id]); | |
220 | CREATE INDEX [index_contents_on_text_filter_id] ON contents ([text_filter_id]); | |
221 | CREATE INDEX [index_contents_on_published] ON contents ([published]); | |
222 | CREATE INDEX [index_feedback_on_text_filter_id] ON feedback ([text_filter_id]); | |
223 | CREATE INDEX [index_feedback_on_article_id] ON feedback ([article_id]); | |
224 | CREATE INDEX [index_page_caches_on_name] ON page_caches ([name]); | |
225 | CREATE INDEX [index_pings_on_article_id] ON pings ([article_id]); | |
226 | CREATE INDEX [index_sessions_on_sessid] ON sessions ([sessid]); | |
-- data | ||
197 | ||
198 | ||
199 | ||
INSERT INTO text_filters ([name], [filters], [description], [params], [markup]) VALUES('none', '--- [] | ||
', 'None', '--- {} | ||
... | ... | |
', 'textile'); | ||
256 | INSERT INTO sidebars ([id], [active_position], [config], [staged_position], [type], [blog_id]) VALUES (1, 0, '--- !map:HashWithIndifferentAccess \nempty: false\ncount: true\n', 0, 'CategorySidebar', 1); | |
257 | INSERT INTO sidebars ([id], [active_position], [config], [staged_position], [type], [blog_id]) VALUES (2, 2, '--- !map:HashWithIndifferentAccess \nformat: rss20\ntrackbacks: false\ncomments: true\narticles: true\n', 2, 'XmlSidebar', 1); | |
258 | INSERT INTO sidebars ([id], [active_position], [config], [staged_position], [type], [blog_id]) VALUES (3, 1, '--- !map:HashWithIndifferentAccess \nbody: "<ul>\\n <li><a href=\\"http://www.typosphere.org\\" title=\\"Typo\\">Typo</a></li>\\n <li><a href=\\"http://blog.leetsoft.com\\" title=\\"too-biased\\">too-biased</a></li>\\n <li><a href=\\"http://blog.remor.com/\\" title=\\"seth hall\\">Seth Hall</a></li>\\n <li><a href=\\"http://scottstuff.net\\" title=\\"Scottstuff\\">scottstuff.net</a></li>\\n <li><a href=\\"http://www.bofh.org.uk\\" title=\\"Just a Summary\\">Just A Summary</a></li>\\n <li><a href=\\"http://nubyonrails.com\\" title=\\"Topfunky\\">Topfunky</a></li>\\n <li><a href=\\"http://planettypo.com\\" title=\\"PlanetTypo\\">PlanetTypo</a></li>\\n <li><a href=\\"http://typoforums.org\\" title=\\"Typo Forums\\">Typo Forums</a></li>\\n <li><a href=\\"http://fredericdevillamil.com\\" title=\\"Fr\\xC3\\xA9d\\xC3\\xA9ric de Villamil\\">Fr\\xC3\\xA9d\\xC3\\xA9ric de Villamil</a></li>\\n\\\n </ul>\\n"\ntitle: Links\n', NULL, 'StaticSidebar', 1); | |
259 | ||
260 | ||
-- schema version meta-info | ||
CREATE TABLE schema_info ( | ||
229 | | |
264 | [version] integer DEFAULT NULL | |
); | ||
232 | ||
267 | insert into schema_info (version) values (61); |
rool/rails/typo/trunk/db/schema_version:
prev. | current | |
1 | ||
2 | 61 |
rool/rails/typo/trunk/doc/Installer.txt:
prev. | current | |
You didn't install Swig before installing `sqlite3-ruby`. Uninstall the SQLite | ||
driver, install Swig, and then re-install `sqlite3-ruby`. | ||
140 | ### SQLite dies with "unsupported file format" | |
141 | ||
142 | You have multiple versions of SQLite3 installed, and you're using the command-line tool from one with the library from the other. Most likely this is on OS X with Darwinports. Make sure that `/opt/local/bin` is ahead of `/usr/bin` in your path. | |
143 | ||
### MySQL fails with timeout errors | ||
Install the MySQL GEM. It's faster then Rails' default MySQL driver, and it |
rool/rails/typo/trunk/lib/email_notify.rb:
prev. | current | |
@@logger ||= RAILS_DEFAULT_LOGGER || Logger.new(STDOUT) | ||
end | ||
6 | | |
6 | def self.send_comment(comment, user) | |
return if user.email.blank? | ||
begin | ||
10 | | |
10 | email = NotificationMailer.create_comment(comment, user) | |
EmailNotify.send_message(user,email) | ||
rescue => err | ||
logger.error "Unable to send comment email: #{err.inspect}" | ||
end | ||
end | ||
17 | | |
17 | def self.send_article(article, user) | |
return if user.email.blank? | ||
begin | ||
21 | | |
21 | email = NotificationMailer.create_article(article, user) | |
EmailNotify.send_message(user,email) | ||
rescue => err | ||
logger.error "Unable to send article email: #{err.inspect}" |
rool/rails/typo/trunk/lib/generators/sidebar/sidebar_generator.rb:
prev. | current | |
class SidebarGenerator < Rails::Generator::NamedBase | ||
2 | attr_reader :plugin_path | |
3 | ||
4 | def initialize(runtime_args, runtime_options = { }) | |
5 | super | |
6 | @plugin_path = "vendor/plugins/#{file_name}" | |
7 | end | |
8 | ||
def manifest | ||
record do |m| | ||
4 | | |
11 | m.directory "#{plugin_path}/lib" | |
12 | m.directory "#{plugin_path}/test" | |
13 | m.directory "#{plugin_path}/views" | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
15 | m.template 'init.rb', "#{plugin_path}/init.rb" | |
16 | m.template 'sidebar.rb', "#{plugin_path}/lib/#{file_name}.rb" | |
17 | m.template 'unit_test.rb', "#{plugin_path}/test/#{file_name}_test.rb" | |
18 | m.template 'Rakefile', "#{plugin_path}/Rakefile" | |
19 | m.template 'content.rhtml', "#{plugin_path}/views/content.rhtml" | |
end | ||
end | ||
end |
rool/rails/typo/trunk/lib/jabber_notify.rb:
prev. | current | |
1 | ||
1 | require 'xmpp4r/client' | |
class JabberNotify | ||
@@jabber = nil | ||
6 | def self.logger | |
7 | @@logger ||= RAILS_DEFAULT_LOGGER || Logger.new(STDOUT) | |
8 | end | |
9 | ||
def self.send_message(user, subject, body, html) | ||
return if user.jabber.blank? | ||
begin | ||
STDERR.puts "** Sending #{body} to #{user.jabber} via jabber." | ||
11 | | |
15 | message = Jabber::Message::new(user.jabber, body) | |
message.subject = subject | ||
13 | | |
14 | | |
15 | | |
17 | session.send(message) | |
rescue => err | ||
17 | | |
19 | logger.error "Attempt to use jabber failed: #{err.inspect}" if defined? logger | |
end | ||
end | ||
... | ... | |
def self.session | ||
return @@jabber if @@jabber | ||
25 | | |
27 | address = Blog.default.jabber_address | |
unless address =~ /\// | ||
address = address + '/typo' | ||
end | ||
30 | | |
32 | @@jabber = Jabber::Client.new(Jabber::JID.new(address), true) | |
33 | @@jabber.connect | |
34 | @@jabber.auth(Blog.default.jabber_password) | |
35 | return @@jabber | |
end | ||
end |
rool/rails/typo/trunk/lib/rails_patch/active_record.rb:
prev. | current | |
:conditions => ["#{field} = ?", value], *options) | ||
end | ||
end | ||
8 | ||
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
14 | | |
15 | | |
16 | | |
17 | | |
18 | | |
19 | | |
20 | | |
21 | | |
22 | ||
23 | | |
24 | | |
25 | | |
26 | | |
27 | | |
28 | | |
29 | | |
30 | | |
31 | | |
32 | | |
33 | | |
34 | | |
end | ||
rool/rails/typo/trunk/lib/sidebars/component_plugin.rb:
prev. | current | |
module Sidebars | ||
class Sidebars::ComponentPlugin < Sidebars::Plugin | ||
self.template_root = File.join RAILS_ROOT, "components" | ||
4 | class << self | |
5 | @abstract = true | |
6 | end | |
end | ||
end |
rool/rails/typo/trunk/lib/sidebars/plugin.rb:
prev. | current | |
class CheckBoxField < self | ||
def input_html(sidebar) | ||
66 | | |
66 | check_box_tag(input_name(sidebar), 1, sidebar.config[key], options)+ | |
67 | hidden_field_tag(input_name(sidebar),0) | |
end | ||
def line_html(sidebar) | ||
... | ... | |
end | ||
def available_sidebars | ||
121 | | |
122 | | |
122 | Sidebars::Plugin.subclasses.select do |sidebar| | |
123 | sidebar.concrete? | |
end | ||
end | ||
126 | | |
127 | | |
128 | | |
129 | | |
130 | | |
131 | | |
132 | | |
133 | | |
127 | ||
128 | def concrete? | |
129 | self.to_s !~ /^Sidebars::(Co(mponent|nsolidated))?Plugin/ | |
end | ||
# The name that's stored in the DB. This is the final chunk of the | ||
# controller name, like 'xml' or 'flickr'. | ||
def short_name | ||
139 | | |
135 | self.to_s.underscore.split(%r{/}).last | |
end | ||
@@display_name_of = { } | ||
... | ... | |
def default_helper_module! | ||
end | ||
end | ||
195 | | |
191 | ||
def index | ||
@sidebar=params['sidebar'] | ||
set_config | ||
... | ... | |
@sidebar.config = self.class.default_config.dup.merge(@sidebar.config) | ||
@sidebar.config ||= (self.class.default_config) | ||
end | ||
226 | | |
222 | ||
def sb_config(key) | ||
config = @sidebar.class.default_config | ||
config.merge!(@sidebar.config || {}) |
rool/rails/typo/trunk/lib/spam_protection.rb:
prev. | current | |
def article_closed?(record) | ||
return false if this_blog.sp_article_auto_close.zero? or not record.new_record? | ||
16 | | |
16 | if record.article.published_at.to_i < this_blog.sp_article_auto_close.days.ago.to_i | |
logger.info("[SP] Blocked interaction with #{record.article.title}") | ||
return true | ||
end | ||
... | ... | |
reason = catch(:hit) do | ||
case string | ||
when Format::IP_ADDRESS: self.scan_ip(string) | ||
29 | | |
29 | when Format::HTTP_URI: self.scan_uris(string) rescue URI::InvalidURIError | |
else self.scan_text(string) | ||
end | ||
end | ||
... | ... | |
end | ||
def scan_text(string) | ||
48 | | |
uri_list = string.scan(/(http:\/\/[^\s"]+)/m).flatten | ||
51 | | |
52 | | |
53 | | |
54 | | |
50 | check_uri_count(uri_list) | |
51 | check_against_blacklist(string) | |
52 | scan_uris(uri_list) | |
56 | | |
57 | | |
58 | | |
54 | return false | |
55 | end | |
57 | def check_against_blacklist(text) | |
# Pattern scanning | ||
61 | | |
59 | BlacklistPattern.find(:all).each do |pattern| | |
logger.info("[SP] Scanning for #{pattern.class} #{pattern.pattern}") | ||
64 | | |
62 | throw :hit, "#{pattern} matched" if pattern.matches?(text) | |
end | ||
64 | end | |
67 | | |
66 | def check_uri_count(uris) | |
67 | limit = this_blog.sp_url_limit | |
68 | return if limit.to_i.zero? | |
69 | if uris.size > limit | |
70 | throw :hit, "Hard URL Limit hit: #{uris.size} > #{limit}" | |
71 | end | |
end | ||
70 | | |
71 | | |
74 | def scan_uris(uris = []) | |
75 | uris.each do |uri| | |
76 | host = URI.parse(uri).host rescue next | |
77 | return scan_ip(host) if host =~ Format::IP_ADDRESS | |
73 | | |
74 | | |
79 | host_parts = host.split('.').reverse | |
80 | domain = Array.new | |
76 | | |
77 | | |
78 | | |
82 | # Check for two level TLD | |
83 | (SECOND_LEVEL.include?(host_parts[1]) ? 3:2).times do | |
84 | domain.unshift(host_parts.shift) | |
85 | end | |
86 | ||
87 | logger.info("[SP] Scanning domain #{domain.join('.')}") | |
88 | query_rbls(HOST_RBLS, host, domain.join('.')) | |
89 | logger.info("[SP] Finished domain scan #{domain.join('.')}") | |
90 | return false | |
end | ||
80 | ||
81 | | |
82 | | |
end | ||
def query_rbls(rbls, *subdomains) | ||
... | ... | |
subdomains.uniq.each do |d| | ||
begin | ||
response = IPSocket.getaddress([d, rbl].join('.')) | ||
90 | | |
99 | if response =~ /^127\.0\.0\./ | |
100 | throw :hit, | |
101 | "#{rbl} positively resolved subdomain #{d} => #{response}" | |
102 | end | |
rescue SocketError | ||
# NXDOMAIN response => negative: d is not in RBL | ||
end |
rool/rails/typo/trunk/lib/tasks/release.rake:
prev. | current | |
require 'rake/gempackagetask' | ||
require 'rake/contrib/rubyforgepublisher' | ||
4 | ||
4 | PKG_VERSION = "4.1" | |
PKG_NAME = "typo" | ||
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}" | ||
RUBY_FORGE_PROJECT = 'typo' | ||
8 | ||
8 | RUBY_FORGE_USER = 'fdevillamil' | |
RELEASE_NAME = "#{PKG_NAME}-#{PKG_VERSION}" | ||
spec = Gem::Specification.new do |s| | ||
... | ... | |
s.has_rdoc = false | ||
s.files = Dir.glob('**/*', File::FNM_DOTMATCH).reject do |f| | ||
18 | | |
18 | [ /\.$/, /config\/database.yml$/, /config\/database.yml-/, | |
19 | /database\.sqlite/, | |
/\.log$/, /^pkg/, /\.svn/, /^vendor\/rails/, | ||
/^public\/(files|xml|articles|pages|index.html)/, | ||
/^public\/(stylesheets|javascripts|images)\/theme/, /\~$/, | ||
... | ... | |
s.platform = Gem::Platform::RUBY | ||
s.executables = ['typo'] | ||
32 | | |
33 | s.add_dependency("rails", "= 1.2") | |
s.add_dependency("mongrel", ">= 0.3.13.3") | ||
s.add_dependency("mongrel_cluster", ">= 0.2.0") | ||
s.add_dependency("sqlite3-ruby", ">= 1.1.0") | ||
37 | s.add_dependency("rails-app-installer", ">= 0.2.0") | |
end | ||
Rake::GemPackageTask.new(spec) do |p| | ||
... | ... | |
p.need_zip = true | ||
end | ||
44 | ||
desc "Publish the zip/tgz" | ||
task :leetsoft_upload => [:package] do | ||
47 | | |
48 | | |
48 | # Rake::SshFilePublisher.new("leetsoft.com", "dist/pkg", "pkg", "#{PKG_FILE_NAME}.zip").upload | |
49 | # Rake::SshFilePublisher.new("leetsoft.com", "dist/pkg", "pkg", "#{PKG_FILE_NAME}.tgz").upload | |
end | ||
desc "Publish the release files to RubyForge." | ||
task :tag_svn do | ||
53 | | |
54 | system("svn cp http://svn.typosphere.org/typo/trunk http://svn.typosphere.org/typo/tags/release_#{PKG_VERSION.gsub(/\./,'_')} -m 'tag release #{PKG_VERSION}'") | |
end | ||
desc "Publish the release files to RubyForge." | ||
... | ... | |
end | ||
desc "Upload the package to leetsoft, rubyforge and tag the release in svn" | ||
172 | ||
173 | task :release => [:sweep_cache, :package, :rubyforge_upload, :tag_svn ] | |
rool/rails/typo/trunk/lib/text_filter_plugin.rb:
prev. | current | |
1 | ||
2 | | |
3 | | |
4 | ||
1 | class TextFilterPlugin | |
class << self | ||
include TypoPlugins | ||
end | ||
5 | ||
6 | @@filter_map = {} | |
7 | def self.inherited(sub) | |
8 | if sub.to_s =~ /^Plugin/ or sub.to_s =~ /^Typo::Textfilter/ | |
9 | name = sub.short_name | |
10 | @@filter_map[name] = sub | |
11 | end | |
12 | end | |
13 | ||
14 | def self.filter_map | |
15 | @@filter_map | |
16 | end | |
plugin_display_name "Unknown Text Filter" | ||
plugin_description "Unknown Text Filter Description" | ||
... | ... | |
false | ||
end | ||
16 | | |
17 | | |
18 | | |
19 | | |
20 | ||
# The name that needs to be used when refering to the plugin's | ||
# controller in render statements | ||
def self.component_name | ||
24 | | |
28 | if (self.to_s =~ /::([a-zA-Z]+)$/) | |
"plugins/textfilters/#{$1}".downcase | ||
else | ||
raise "I don't know who I am: #{self.to_s}" | ||
... | ... | |
def self.config_value(params,name) | ||
params[:filterparams][name] || default_config[name][:default] | ||
end | ||
58 | ||
59 | def self.logger | |
60 | @logger ||= RAILS_DEFAULT_LOGGER || Logger.new(STDOUT) | |
61 | end | |
end | ||
class TextFilterPlugin::PostProcess < TextFilterPlugin | ||
... | ... | |
attributes | ||
end | ||
73 | | |
81 | def self.filtertext(blog, content, text, params) | |
filterparams = params[:filterparams] | ||
75 | | |
76 | | |
83 | regex1 = /<typo:#{short_name}(?:[ \t][^>]*)?\/>/ | |
84 | regex2 = /<typo:#{short_name}([ \t][^>]*)?>(.*?)<\/typo:#{short_name}>/m | |
new_text = text.gsub(regex1) do |match| | ||
79 | | |
87 | macrofilter(blog,content,attributes_parse(match),params) | |
end | ||
new_text = new_text.gsub(regex2) do |match| | ||
83 | | |
91 | macrofilter(blog,content,attributes_parse($1.to_s),params,$2.to_s) | |
end | ||
new_text | ||
... | ... | |
class TextFilterPlugin::Markup < TextFilterPlugin | ||
end | ||
106 | ||
107 | class Typo | |
108 | class Textfilter | |
109 | class MacroPost < TextFilterPlugin | |
110 | plugin_display_name "MacroPost" | |
111 | plugin_description "Macro expansion meta-filter (post-markup)" | |
112 | ||
113 | def self.filtertext(blog,content,text,params) | |
114 | filterparams = params[:filterparams] | |
115 | ||
116 | macros = TextFilter.available_filter_types['macropost'] | |
117 | macros.inject(text) do |text,macro| | |
118 | macro.filtertext(blog,content,text,params) | |
119 | end | |
120 | end | |
121 | end | |
122 | ||
123 | class MacroPre < TextFilterPlugin | |
124 | plugin_display_name "MacroPre" | |
125 | plugin_description "Macro expansion meta-filter (pre-markup)" | |
126 | ||
127 | def self.filtertext(blog,content,text,params) | |
128 | filterparams = params[:filterparams] | |
129 | ||
130 | macros = TextFilter.available_filter_types['macropre'] | |
131 | macros.inject(text) do |text,macro| | |
132 | macro.filtertext(blog,content,text,params) | |
133 | end | |
134 | end | |
135 | end | |
136 | end | |
137 | end |
rool/rails/typo/trunk/lib/typo_version.rb:
prev. | current | |
1 | ||
1 | TYPO_VERSION = '4.1' |
rool/rails/typo/trunk/public/500.html:
prev. | current | |
"http://www.w3.org/TR/html4/loose.dtd"> | ||
<html> | ||
<body> | ||
5 | | |
5 | <h1>Application error (Rails)</h1> | |
<p>Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html</p> | ||
</body> | ||
8 | ||
9 | </html> |
rool/rails/typo/trunk/public/dispatch.rb:
prev. | current | |
1 | ||
1 | #!/bin/env ruby | |
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) | ||
rool/rails/typo/trunk/public/javascripts/controls.js:
prev. | current | |
1 | ||
2 | ||
3 | ||
1 | // Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) | |
2 | // (c) 2005, 2006 Ivan Krstic (http://blogs.law.harvard.edu/ivan) | |
3 | // (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com) | |
// Contributors: | ||
// Richard Livsey | ||
// Rahul Bhargava | ||
// Rob Wills | ||
// | ||
9 | ||
9 | // script.aculo.us is freely distributable under the terms of an MIT-style license. | |
10 | // For details, see the script.aculo.us web site: http://script.aculo.us/ | |
// Autocompleter.Base handles all the autocompletion functionality | ||
// that's independent of the data source for autocompletion. This | ||
... | ... | |
// useful when one of the tokens is \n (a newline), as it | ||
// allows smart autocompletion after linebreaks. | ||
37 | if(typeof Effect == 'undefined') | |
38 | throw("controls.js requires including script.aculo.us' effects.js library"); | |
39 | ||
var Autocompleter = {} | ||
Autocompleter.Base = function() {}; | ||
Autocompleter.Base.prototype = { | ||
... | ... | |
this.index = 0; | ||
this.entryCount = 0; | ||
48 | | |
52 | if(this.setOptions) | |
this.setOptions(options); | ||
else | ||
this.options = options || {}; | ||
... | ... | |
this.options.frequency = this.options.frequency || 0.4; | ||
this.options.minChars = this.options.minChars || 1; | ||
this.options.onShow = this.options.onShow || | ||
58 | | |
59 | | |
60 | | |
61 | | |
62 | | |
63 | | |
64 | | |
62 | function(element, update){ | |
63 | if(!update.style.position || update.style.position=='absolute') { | |
64 | update.style.position = 'absolute'; | |
65 | Position.clone(element, update, { | |
66 | setHeight: false, | |
67 | offsetTop: element.offsetHeight | |
68 | }); | |
69 | } | |
70 | Effect.Appear(update,{duration:0.15}); | |
71 | }; | |
this.options.onHide = this.options.onHide || | ||
66 | | |
73 | function(element, update){ new Effect.Fade(update,{duration:0.15}) }; | |
68 | | |
75 | if(typeof(this.options.tokens) == 'string') | |
this.options.tokens = new Array(this.options.tokens); | ||
this.observer = null; | ||
... | ... | |
}, | ||
fixIEOverlapping: function() { | ||
97 | | |
104 | Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); | |
this.iefix.style.zIndex = 1; | ||
this.update.style.zIndex = 2; | ||
Element.show(this.iefix); | ||
... | ... | |
markPrevious: function() { | ||
if(this.index > 0) this.index-- | ||
else this.index = this.entryCount-1; | ||
212 | this.getEntry(this.index).scrollIntoView(true); | |
}, | ||
markNext: function() { | ||
if(this.index < this.entryCount-1) this.index++ | ||
else this.index = 0; | ||
218 | this.getEntry(this.index).scrollIntoView(false); | |
}, | ||
getEntry: function(index) { | ||
... | ... | |
if(!this.changed && this.hasFocus) { | ||
this.update.innerHTML = choices; | ||
Element.cleanWhitespace(this.update); | ||
257 | | |
266 | Element.cleanWhitespace(this.update.down()); | |
259 | | |
268 | if(this.update.firstChild && this.update.down().childNodes) { | |
this.entryCount = | ||
261 | | |
270 | this.update.down().childNodes.length; | |
for (var i = 0; i < this.entryCount; i++) { | ||
var entry = this.getEntry(i); | ||
entry.autocompleteIndex = i; | ||
... | ... | |
} | ||
this.stopIndicator(); | ||
272 | ||
this.index = 0; | ||
274 | | |
282 | ||
283 | if(this.entryCount==1 && this.options.autoSelect) { | |
284 | this.selectEntry(); | |
285 | this.hide(); | |
286 | } else { | |
287 | this.render(); | |
288 | } | |
} | ||
}, | ||
... | ... | |
this.element = $(element); | ||
this.options = Object.extend({ | ||
476 | paramName: "value", | |
okButton: true, | ||
okText: "ok", | ||
cancelLink: true, | ||
... | ... | |
Element.hide(this.element); | ||
this.createForm(); | ||
this.element.parentNode.insertBefore(this.form, this.element); | ||
534 | | |
549 | if (!this.options.loadTextURL) Field.scrollFreeActivate(this.editField); | |
// stop the event to avoid a page refresh in Safari | ||
if (evt) { | ||
Event.stop(evt); | ||
... | ... | |
var textField = document.createElement("input"); | ||
textField.obj = this; | ||
textField.type = "text"; | ||
593 | | |
608 | textField.name = this.options.paramName; | |
textField.value = text; | ||
textField.style.backgroundColor = this.options.highlightcolor; | ||
textField.className = 'editor_field'; | ||
... | ... | |
this.options.textarea = true; | ||
var textArea = document.createElement("textarea"); | ||
textArea.obj = this; | ||
606 | | |
621 | textArea.name = this.options.paramName; | |
textArea.value = this.convertHTMLLineBreaks(text); | ||
textArea.rows = this.options.rows; | ||
textArea.cols = this.options.cols || 40; | ||
... | ... | |
Element.removeClassName(this.form, this.options.loadingClassName); | ||
this.editField.disabled = false; | ||
this.editField.value = transport.responseText.stripTags(); | ||
654 | Field.scrollFreeActivate(this.editField); | |
}, | ||
onclickCancel: function() { | ||
this.onComplete(); | ||
... | ... | |
collection.each(function(e,i) { | ||
optionTag = document.createElement("option"); | ||
optionTag.value = (e instanceof Array) ? e[0] : e; | ||
791 | if((typeof this.options.value == 'undefined') && | |
792 | ((e instanceof Array) ? this.element.innerHTML == e[1] : e == optionTag.value)) optionTag.selected = true; | |
if(this.options.value==optionTag.value) optionTag.selected = true; | ||
optionTag.appendChild(document.createTextNode((e instanceof Array) ? e[1] : e)); | ||
selectTag.appendChild(optionTag); |
rool/rails/typo/trunk/public/javascripts/dragdrop.js:
prev. | current | |
1 | ||
2 | ||
1 | // Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) | |
2 | // (c) 2005, 2006 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) | |
// | ||
4 | ||
4 | // script.aculo.us is freely distributable under the terms of an MIT-style license. | |
5 | // For details, see the script.aculo.us web site: http://script.aculo.us/ | |
6 | ||
7 | if(typeof Effect == 'undefined') | |
8 | throw("dragdrop.js requires including script.aculo.us' effects.js library"); | |
var Droppables = { | ||
drops: [], | ||
... | ... | |
}, | ||
activate: function(draggable) { | ||
148 | | |
149 | | |
150 | if(draggable.options.delay) { | |
151 | this._timeout = setTimeout(function() { | |
152 | Draggables._timeout = null; | |
153 | window.focus(); | |
154 | Draggables.activeDraggable = draggable; | |
155 | }.bind(this), draggable.options.delay); | |
156 | } else { | |
157 | window.focus(); // allows keypress events if window isn't currently focused, fails for Safari | |
158 | this.activeDraggable = draggable; | |
159 | } | |
}, | ||
deactivate: function() { | ||
... | ... | |
// the same coordinates, prevent needless redrawing (moz bug?) | ||
if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; | ||
this._lastPointer = pointer; | ||
173 | ||
this.activeDraggable.updateDrag(event, pointer); | ||
}, | ||
endDrag: function(event) { | ||
178 | if(this._timeout) { | |
179 | clearTimeout(this._timeout); | |
180 | this._timeout = null; | |
181 | } | |
if(!this.activeDraggable) return; | ||
this._lastPointer = null; | ||
this.activeDraggable.endDrag(event); | ||
... | ... | |
this.observers.each( function(o) { | ||
if(o[eventName]) o[eventName](eventName, draggable, event); | ||
}); | ||
208 | if(draggable.options[eventName]) draggable.options[eventName](draggable, event); | |
}, | ||
_cacheObserverCallbacks: function() { | ||
... | ... | |
/*--------------------------------------------------------------------------*/ | ||
var Draggable = Class.create(); | ||
223 | Draggable._dragging = {}; | |
224 | ||
Draggable.prototype = { | ||
initialize: function(element) { | ||
209 | | |
227 | var defaults = { | |
handle: false, | ||
211 | | |
212 | | |
213 | | |
reverteffect: function(element, top_offset, left_offset) { | ||
var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02; | ||
216 | | |
231 | new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur, | |
232 | queue: {scope:'_draggable', position:'end'} | |
233 | }); | |
}, | ||
218 | | |
219 | | |
235 | endeffect: function(element) { | |
236 | var toOpacity = typeof element._opacity == 'number' ? element._opacity : 1.0; | |
237 | new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, | |
238 | queue: {scope:'_draggable', position:'end'}, | |
239 | afterFinish: function(){ | |
240 | Draggable._dragging[element] = false | |
241 | } | |
242 | }); | |
}, | ||
zindex: 1000, | ||
revert: false, | ||
scroll: false, | ||
scrollSensitivity: 20, | ||
scrollSpeed: 15, | ||
226 | | |
227 | | |
249 | snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] } | |
250 | delay: 0 | |
251 | }; | |
252 | ||
253 | if(!arguments[1] || typeof arguments[1].endeffect == 'undefined') | |
254 | Object.extend(defaults, { | |
255 | starteffect: function(element) { | |
256 | element._opacity = Element.getOpacity(element); | |
257 | Draggable._dragging[element] = true; | |
258 | new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); | |
259 | } | |
260 | }); | |
261 | ||
262 | var options = Object.extend(defaults, arguments[1] || {}); | |
this.element = $(element); | ||
231 | | |
232 | | |
233 | | |
234 | | |
266 | if(options.handle && (typeof options.handle == 'string')) | |
267 | this.handle = this.element.down('.'+options.handle, 0); | |
268 | ||
if(!this.handle) this.handle = $(options.handle); | ||
if(!this.handle) this.handle = this.element; | ||
238 | | |
272 | if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) { | |
options.scroll = $(options.scroll); | ||
274 | this._isScrollChild = Element.childOf(this.element, options.scroll); | |
275 | } | |
Element.makePositioned(this.element); // fix IE | ||
... | ... | |
}, | ||
initDrag: function(event) { | ||
301 | if(typeof Draggable._dragging[this.element] != 'undefined' && | |
302 | Draggable._dragging[this.element]) return; | |
if(Event.isLeftClick(event)) { | ||
// abort on form elements, fixes a Firefox issue | ||
var src = Event.element(event); | ||
... | ... | |
src.tagName=='BUTTON' || | ||
src.tagName=='TEXTAREA')) return; | ||
275 | | |
276 | | |
277 | | |
278 | | |
279 | | |
var pointer = [Event.pointerX(event), Event.pointerY(event)]; | ||
var pos = Position.cumulativeOffset(this.element); | ||
this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); | ||
... | ... | |
} | ||
Draggables.notify('onStart', this, event); | ||
348 | ||
if(this.options.starteffect) this.options.starteffect(this.element); | ||
}, | ||
... | ... | |
Position.prepare(); | ||
Droppables.show(pointer, this.element); | ||
Draggables.notify('onDrag', this, event); | ||
357 | ||
this.draw(pointer); | ||
if(this.options.change) this.options.change(this); | ||
... | ... | |
with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } | ||
} else { | ||
p = Position.page(this.options.scroll); | ||
334 | | |
335 | | |
369 | p[0] += this.options.scroll.scrollLeft + Position.deltaX; | |
370 | p[1] += this.options.scroll.scrollTop + Position.deltaY; | |
p.push(p[0]+this.options.scroll.offsetWidth); | ||
p.push(p[1]+this.options.scroll.offsetHeight); | ||
} | ||
... | ... | |
if(this.options.endeffect) | ||
this.options.endeffect(this.element); | ||
381 | ||
416 | ||
Draggables.deactivate(this); | ||
Droppables.reset(); | ||
}, | ||
... | ... | |
draw: function(point) { | ||
var pos = Position.cumulativeOffset(this.element); | ||
436 | if(this.options.ghosting) { | |
437 | var r = Position.realOffset(this.element); | |
438 | pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY; | |
439 | } | |
440 | ||
var d = this.currentDelta(); | ||
pos[0] -= d[0]; pos[1] -= d[1]; | ||
404 | | |
444 | if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) { | |
pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft; | ||
pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop; | ||
} | ||
... | ... | |
if(this.options.snap) { | ||
if(typeof this.options.snap == 'function') { | ||
415 | | |
455 | p = this.options.snap(p[0],p[1],this); | |
} else { | ||
if(this.options.snap instanceof Array) { | ||
p = p.map( function(v, i) { | ||
... | ... | |
style.left = p[0] + "px"; | ||
if((!this.options.constraint) || (this.options.constraint=='vertical')) | ||
style.top = p[1] + "px"; | ||
471 | ||
if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering | ||
}, | ||
... | ... | |
}, | ||
startScrolling: function(speed) { | ||
484 | if(!(speed[0] || speed[1])) return; | |
this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed]; | ||
this.lastScrolled = new Date(); | ||
this.scrollInterval = setInterval(this.scroll.bind(this), 10); | ||
... | ... | |
Position.prepare(); | ||
Droppables.show(Draggables._lastPointer, this.element); | ||
Draggables.notify('onDrag', this); | ||
467 | | |
468 | | |
469 | | |
470 | | |
471 | | |
472 | | |
473 | | |
474 | | |
509 | if (this._isScrollChild) { | |
510 | Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); | |
511 | Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; | |
512 | Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; | |
513 | if (Draggables._lastScrollPointer[0] < 0) | |
514 | Draggables._lastScrollPointer[0] = 0; | |
515 | if (Draggables._lastScrollPointer[1] < 0) | |
516 | Draggables._lastScrollPointer[1] = 0; | |
517 | this.draw(Draggables._lastScrollPointer); | |
518 | } | |
if(this.options.change) this.options.change(this); | ||
}, | ||
... | ... | |
} | ||
var Sortable = { | ||
570 | SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, | |
571 | ||
sortables: {}, | ||
_findRootElement: function(element) { | ||
... | ... | |
containment: element, // also takes array of elements (or id's); or false | ||
handle: false, // or a CSS class | ||
only: false, | ||
612 | delay: 0, | |
hoverclass: null, | ||
ghosting: false, | ||
scroll: false, | ||
scrollSensitivity: 20, | ||
scrollSpeed: 15, | ||
571 | | |
618 | format: this.SERIALIZE_RULE, | |
onChange: Prototype.emptyFunction, | ||
onUpdate: Prototype.emptyFunction | ||
}, arguments[1] || {}); | ||
... | ... | |
scroll: options.scroll, | ||
scrollSpeed: options.scrollSpeed, | ||
scrollSensitivity: options.scrollSensitivity, | ||
632 | delay: options.delay, | |
ghosting: options.ghosting, | ||
constraint: options.constraint, | ||
handle: options.handle }; | ||
... | ... | |
tree: options.tree, | ||
hoverclass: options.hoverclass, | ||
onHover: Sortable.onHover | ||
613 | | |
} | ||
var options_for_tree = { | ||
... | ... | |
(this.findElements(element, options) || []).each( function(e) { | ||
// handles are per-draggable | ||
var handle = options.handle ? | ||
638 | | |
685 | $(e).down('.'+options.handle,0) : e; | |
options.draggables.push( | ||
new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); | ||
Droppables.add(e, options_for_droppable); | ||
... | ... | |
if(!Element.isParent(dropon, element)) { | ||
var index; | ||
709 | | |
756 | var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only}); | |
var child = null; | ||
if(children) { | ||
... | ... | |
}, | ||
unmark: function() { | ||
736 | | |
783 | if(Sortable._marker) Sortable._marker.hide(); | |
}, | ||
mark: function(dropon, position) { | ||
... | ... | |
if(sortable && !sortable.ghosting) return; | ||
if(!Sortable._marker) { | ||
745 | | |
746 | | |
747 | | |
748 | | |
792 | Sortable._marker = | |
793 | ($('dropmarker') || Element.extend(document.createElement('DIV'))). | |
794 | hide().addClassName('dropmarker').setStyle({position:'absolute'}); | |
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); | ||
} | ||
var offsets = Position.cumulativeOffset(dropon); | ||
752 | | |
753 | | |
798 | Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'}); | |
if(position=='after') | ||
if(sortable.overlap == 'horizontal') | ||
757 | | |
802 | Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'}); | |
else | ||
759 | | |
804 | Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'}); | |
761 | | |
806 | Sortable._marker.show(); | |
}, | ||
_tree: function(element, options, parent) { | ||
... | ... | |
id: encodeURIComponent(match ? match[1] : null), | ||
element: element, | ||
parent: parent, | ||
776 | | |
821 | children: [], | |
position: parent.children.length, | ||
778 | | |
823 | container: $(children[i]).down(options.treeTag) | |
} | ||
/* Get the element containing the children and recurse over it */ | ||
... | ... | |
return parent; | ||
}, | ||
791 | | |
792 | | |
793 | | |
794 | | |
795 | | |
796 | | |
797 | | |
798 | | |
799 | | |
800 | | |
801 | ||
tree: function(element) { | ||
element = $(element); | ||
var sortableOptions = this.options(element); | ||
... | ... | |
var root = { | ||
id: null, | ||
parent: null, | ||
816 | | |
850 | children: [], | |
container: element, | ||
position: 0 | ||
} | ||
821 | | |
855 | return Sortable._tree(element, options, root); | |
}, | ||
/* Construct a [i] index for a particular node */ | ||
... | ... | |
if (options.tree) { | ||
return Sortable.tree(element, arguments[1]).children.map( function (item) { | ||
870 | | |
904 | return [name + Sortable._constructIndex(item) + "[id]=" + | |
encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); | ||
}).flatten().join('&'); | ||
} else { | ||
... | ... | |
} | ||
} | ||
881 | ||
915 | // Returns true if child is contained within element | |
Element.isParent = function(child, element) { | ||
if (!child.parentNode || child == element) return false; | ||
884 | ||
if (child.parentNode == element) return true; | ||
886 | ||
return Element.isParent(child.parentNode, element); | ||
} | ||
... | ... | |
} | ||
Element.offsetSize = function (element, type) { | ||
909 | | |
910 | | |
911 | | |
912 | | |
913 | ||
942 | return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')]; | |
943 | } |
rool/rails/typo/trunk/public/javascripts/effects.js:
prev. | current | |
1 | ||
1 | // Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) | |
// Contributors: | ||
// Justin Palmer (http://encytemedia.com/) | ||
// Mark Pilgrim (http://diveintomark.org/) | ||
// Martin Bialasinki | ||
// | ||
7 | ||
7 | // script.aculo.us is freely distributable under the terms of an MIT-style license. | |
8 | // For details, see the script.aculo.us web site: http://script.aculo.us/ | |
// converts rgb() and #xxx to #xxxxxx format, | ||
// returns self (or first argument) if not convertable | ||
String.prototype.parseColor = function() { | ||
12 | | |
13 | var color = '#'; | |
if(this.slice(0,4) == 'rgb(') { | ||
var cols = this.slice(4,this.length-1).split(','); | ||
var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); | ||
... | ... | |
Element.setContentZoom = function(element, percent) { | ||
element = $(element); | ||
44 | | |
45 | element.setStyle({fontSize: (percent/100) + 'em'}); | |
if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); | ||
47 | return element; | |
} | ||
48 | ||
50 | Element.getOpacity = function(element){ | |
51 | element = $(element); | |
var opacity; | ||
50 | | |
53 | if (opacity = element.getStyle('opacity')) | |
return parseFloat(opacity); | ||
52 | | |
55 | if (opacity = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) | |
if(opacity[1]) return parseFloat(opacity[1]) / 100; | ||
return 1.0; | ||
} | ||
... | ... | |
Element.setOpacity = function(element, value){ | ||
element= $(element); | ||
if (value == 1){ | ||
60 | | |
63 | element.setStyle({ opacity: | |
(/Gecko/.test(navigator.userAgent) && !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? | ||
62 | | |
63 | | |
64 | | |
65 | 0.999999 : 1.0 }); | |
66 | if(/MSIE/.test(navigator.userAgent) && !window.opera) | |
67 | element.setStyle({filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'')}); | |
} else { | ||
if(value < 0.00001) value = 0; | ||
67 | | |
68 | | |
69 | | |
70 | | |
71 | | |
70 | element.setStyle({opacity: value}); | |
71 | if(/MSIE/.test(navigator.userAgent) && !window.opera) | |
72 | element.setStyle( | |
73 | { filter: element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'') + | |
74 | 'alpha(opacity='+value*100+')' }); | |
} | ||
76 | return element; | |
} | ||
Element.getInlineOpacity = function(element){ | ||
return $(element).style.opacity || ''; | ||
} | ||
79 | ||
80 | | |
81 | | |
82 | | |
83 | | |
84 | | |
85 | | |
86 | ||
87 | ||
Element.forceRerendering = function(element) { | ||
try { | ||
element = $(element); | ||
... | ... | |
/*--------------------------------------------------------------------------*/ | ||
var Effect = { | ||
102 | _elementDoesNotExistError: { | |
103 | name: 'ElementDoesNotExistError', | |
104 | message: 'The specified DOM element does not exist, but is required for this effect to operate' | |
105 | }, | |
tagifyText: function(element) { | ||
107 | if(typeof Builder == 'undefined') | |
108 | throw("Effect.tagifyText requires including script.aculo.us' builder.js library"); | |
109 | ||
var tagifyStyle = 'position:relative'; | ||
109 | | |
111 | if(/MSIE/.test(navigator.userAgent) && !window.opera) tagifyStyle += ';zoom:1'; | |
112 | ||
element = $(element); | ||
$A(element.childNodes).each( function(child) { | ||
if(child.nodeType==3) { | ||
... | ... | |
/* ------------- transitions ------------- */ | ||
162 | ||
165 | Effect.Transitions = { | |
166 | linear: Prototype.K, | |
167 | sinoidal: function(pos) { | |
168 | return (-Math.cos(pos*Math.PI)/2) + 0.5; | |
169 | }, | |
170 | reverse: function(pos) { | |
171 | return 1-pos; | |
172 | }, | |
173 | flicker: function(pos) { | |
174 | return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4; | |
175 | }, | |
176 | wobble: function(pos) { | |
177 | return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5; | |
178 | }, | |
179 | pulse: function(pos, pulses) { | |
180 | pulses = pulses || 5; | |
181 | return ( | |
182 | Math.round((pos % (1/pulses)) * pulses) == 0 ? | |
183 | ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) : | |
184 | 1 - ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) | |
185 | ); | |
186 | }, | |
187 | none: function(pos) { | |
188 | return 0; | |
189 | }, | |
190 | full: function(pos) { | |
191 | return 1; | |
192 | } | |
193 | }; | |
164 | ||
165 | | |
166 | ||
167 | ||
168 | | |
169 | ||
170 | ||
171 | | |
172 | ||
173 | ||
174 | | |
175 | ||
176 | ||
177 | | |
178 | ||
179 | ||
180 | | |
181 | | |
182 | ||
183 | ||
184 | | |
185 | ||
186 | ||
187 | | |
188 | ||
189 | ||
/* ------------- core effects ------------- */ | ||
Effect.ScopedQueue = Class.create(); | ||
... | ... | |
e.finishOn += effect.finishOn; | ||
}); | ||
break; | ||
220 | case 'with-last': | |
221 | timestamp = this.effects.pluck('startOn').max() || timestamp; | |
222 | break; | |
case 'end': | ||
// start effect after last queued effect has finished | ||
timestamp = this.effects.pluck('finishOn').max() || timestamp; | ||
... | ... | |
} | ||
}); | ||
359 | Effect.Event = Class.create(); | |
360 | Object.extend(Object.extend(Effect.Event.prototype, Effect.Base.prototype), { | |
361 | initialize: function() { | |
362 | var options = Object.extend({ | |
363 | duration: 0 | |
364 | }, arguments[0] || {}); | |
365 | this.start(options); | |
366 | }, | |
367 | update: Prototype.emptyFunction | |
368 | }); | |
369 | ||
Effect.Opacity = Class.create(); | ||
Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), { | ||
initialize: function(element) { | ||
this.element = $(element); | ||
374 | if(!this.element) throw(Effect._elementDoesNotExistError); | |
// make this work on IE on elements without 'layout' | ||
356 | | |
376 | if(/MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout)) | |
this.element.setStyle({zoom: 1}); | ||
var options = Object.extend({ | ||
from: this.element.getOpacity() || 0.0, | ||
... | ... | |
Object.extend(Object.extend(Effect.Move.prototype, Effect.Base.prototype), { | ||
initialize: function(element) { | ||
this.element = $(element); | ||
393 | if(!this.element) throw(Effect._elementDoesNotExistError); | |
var options = Object.extend({ | ||
x: 0, | ||
y: 0, | ||
... | ... | |
}, | ||
update: function(position) { | ||
this.element.setStyle({ | ||
396 | | |
397 | | |
417 | left: Math.round(this.options.x * position + this.originalLeft) + 'px', | |
418 | top: Math.round(this.options.y * position + this.originalTop) + 'px' | |
}); | ||
} | ||
}); | ||
... | ... | |
Effect.Scale = Class.create(); | ||
Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), { | ||
initialize: function(element, percent) { | ||
411 | | |
432 | this.element = $(element); | |
433 | if(!this.element) throw(Effect._elementDoesNotExistError); | |
var options = Object.extend({ | ||
scaleX: true, | ||
scaleY: true, | ||
... | ... | |
this.originalLeft = this.element.offsetLeft; | ||
var fontSize = this.element.getStyle('font-size') || '100%'; | ||
436 | | |
458 | ['em','px','%','pt'].each( function(fontSizeType) { | |
if(fontSize.indexOf(fontSizeType)>0) { | ||
this.fontSize = parseFloat(fontSize); | ||
this.fontSizeType = fontSizeType; | ||
... | ... | |
this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); | ||
}, | ||
finish: function(position) { | ||
461 | | |
483 | if(this.restoreAfterFinish) this.element.setStyle(this.originalStyle); | |
}, | ||
setDimensions: function(height, width) { | ||
var d = {}; | ||
465 | | |
466 | | |
487 | if(this.options.scaleX) d.width = Math.round(width) + 'px'; | |
488 | if(this.options.scaleY) d.height = Math.round(height) + 'px'; | |
if(this.options.scaleFromCenter) { | ||
var topd = (height - this.dims[0])/2; | ||
var leftd = (width - this.dims[1])/2; | ||
... | ... | |
Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), { | ||
initialize: function(element) { | ||
this.element = $(element); | ||
508 | if(!this.element) throw(Effect._elementDoesNotExistError); | |
var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {}); | ||
this.start(options); | ||
}, | ||
... | ... | |
to: 0.0, | ||
afterFinishInternal: function(effect) { | ||
if(effect.options.to!=0) return; | ||
550 | | |
551 | | |
573 | effect.element.hide().setStyle({opacity: oldOpacity}); | |
}}, arguments[1] || {}); | ||
return new Effect.Opacity(element,options); | ||
} | ||
... | ... | |
effect.element.forceRerendering(); | ||
}, | ||
beforeSetup: function(effect) { | ||
566 | | |
567 | | |
588 | effect.element.setOpacity(effect.options.from).show(); | |
}}, arguments[1] || {}); | ||
return new Effect.Opacity(element,options); | ||
} | ||
Effect.Puff = function(element) { | ||
element = $(element); | ||
574 | | |
595 | var oldStyle = { | |
596 | opacity: element.getInlineOpacity(), | |
597 | position: element.getStyle('position'), | |
598 | top: element.style.top, | |
599 | left: element.style.left, | |
600 | width: element.style.width, | |
601 | height: element.style.height | |
602 | }; | |
return new Effect.Parallel( | ||
[ new Effect.Scale(element, 200, | ||
{ sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), | ||
new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], | ||
Object.extend({ duration: 1.0, | ||
beforeSetupInternal: function(effect) { | ||
581 | | |
609 | Position.absolutize(effect.effects[0].element) | |
610 | }, | |
afterFinishInternal: function(effect) { | ||
583 | | |
584 | | |
612 | effect.effects[0].element.hide().setStyle(oldStyle); } | |
}, arguments[1] || {}) | ||
); | ||
} | ||
... | ... | |
Effect.BlindUp = function(element) { | ||
element = $(element); | ||
element.makeClipping(); | ||
592 | | |
620 | return new Effect.Scale(element, 0, | |
Object.extend({ scaleContent: false, | ||
scaleX: false, | ||
restoreAfterFinish: true, | ||
afterFinishInternal: function(effect) { | ||
597 | | |
598 | | |
625 | effect.element.hide().undoClipping(); | |
} | ||
}, arguments[1] || {}) | ||
); | ||
... | ... | |
Effect.BlindDown = function(element) { | ||
element = $(element); | ||
var elementDimensions = element.getDimensions(); | ||
607 | | |
608 | | |
609 | | |
610 | | |
611 | | |
612 | | |
613 | | |
614 | | |
615 | | |
616 | | |
617 | | |
618 | | |
619 | | |
620 | | |
621 | | |
622 | | |
634 | return new Effect.Scale(element, 100, Object.extend({ | |
635 | scaleContent: false, | |
636 | scaleX: false, | |
637 | scaleFrom: 0, | |
638 | scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, | |
639 | restoreAfterFinish: true, | |
640 | afterSetup: function(effect) { | |
641 | effect.element.makeClipping().setStyle({height: '0px'}).show(); | |
642 | }, | |
643 | afterFinishInternal: function(effect) { | |
644 | effect.element.undoClipping(); | |
645 | } | |
646 | }, arguments[1] || {})); | |
} | ||
Effect.SwitchOff = function(element) { | ||
element = $(element); | ||
var oldOpacity = element.getInlineOpacity(); | ||
628 | | |
652 | return new Effect.Appear(element, Object.extend({ | |
duration: 0.4, | ||
from: 0, | ||
transition: Effect.Transitions.flicker, | ||
... | ... | |
duration: 0.3, scaleFromCenter: true, | ||
scaleX: false, scaleContent: false, restoreAfterFinish: true, | ||
beforeSetup: function(effect) { | ||
637 | | |
638 | | |
661 | effect.element.makePositioned().makeClipping(); | |
}, | ||
afterFinishInternal: function(effect) { | ||
641 | | |
642 | | |
643 | | |
644 | | |
664 | effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); | |
} | ||
}) | ||
} | ||
648 | | |
668 | }, arguments[1] || {})); | |
} | ||
Effect.DropOut = function(element) { | ||
... | ... | |
effect.effects[0].element.makePositioned(); | ||
}, | ||
afterFinishInternal: function(effect) { | ||
666 | | |
667 | | |
668 | | |
686 | effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); | |
} | ||
}, arguments[1] || {})); | ||
} | ||
... | ... | |
{ x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { | ||
new Effect.Move(effect.element, | ||
{ x: -20, y: 0, duration: 0.05, afterFinishInternal: function(effect) { | ||
690 | | |
691 | | |
708 | effect.element.undoPositioned().setStyle(oldStyle); | |
}}) }}) }}) }}) }}) }}); | ||
} | ||
Effect.SlideDown = function(element) { | ||
696 | | |
697 | | |
713 | element = $(element).cleanWhitespace(); | |
// SlideDown need to have the content of the element wrapped in a container element with fixed height! | ||
699 | | |
715 | var oldInnerBottom = element.down().getStyle('bottom'); | |
var elementDimensions = element.getDimensions(); | ||
return new Effect.Scale(element, 100, Object.extend({ | ||
scaleContent: false, | ||
scaleX: false, | ||
704 | | |
720 | scaleFrom: window.opera ? 0 : 1, | |
scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, | ||
restoreAfterFinish: true, | ||
afterSetup: function(effect) { | ||
effect.element.makePositioned(); | ||
709 | | |
725 | effect.element.down().makePositioned(); | |
if(window.opera) effect.element.setStyle({top: ''}); | ||
711 | | |
712 | | |
713 | | |
727 | effect.element.makeClipping().setStyle({height: '0px'}).show(); | |
728 | }, | |
afterUpdateInternal: function(effect) { | ||
715 | | |
730 | effect.element.down().setStyle({bottom: | |
(effect.dims[0] - effect.element.clientHeight) + 'px' }); | ||
}, | ||
afterFinishInternal: function(effect) { | ||
719 | | |
720 | | |
721 | | |
722 | | |
723 | | |
724 | | |
725 | | |
726 | | |
727 | | |
728 | | |
734 | effect.element.undoClipping().undoPositioned(); | |
735 | effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } | |
}, arguments[1] || {}) | ||
); | ||
} | ||
732 | | |
739 | ||
Effect.SlideUp = function(element) { | ||
734 | | |
735 | | |
736 | | |
737 | | |
741 | element = $(element).cleanWhitespace(); | |
742 | var oldInnerBottom = element.down().getStyle('bottom'); | |
743 | return new Effect.Scale(element, window.opera ? 0 : 1, | |
Object.extend({ scaleContent: false, | ||
scaleX: false, | ||
scaleMode: 'box', | ||
... | ... | |
restoreAfterFinish: true, | ||
beforeStartInternal: function(effect) { | ||
effect.element.makePositioned(); | ||
745 | | |
751 | effect.element.down().makePositioned(); | |
if(window.opera) effect.element.setStyle({top: ''}); | ||
747 | | |
748 | | |
753 | effect.element.makeClipping().show(); | |
754 | }, | |
afterUpdateInternal: function(effect) { | ||
750 | | |
751 | | |
756 | effect.element.down().setStyle({bottom: | |
757 | (effect.dims[0] - effect.element.clientHeight) + 'px' }); | |
758 | }, | |
afterFinishInternal: function(effect) { | ||
753 | | |
754 | | |
755 | | |
756 | | |
757 | | |
760 | effect.element.hide().undoClipping().undoPositioned().setStyle({bottom: oldInnerBottom}); | |
761 | effect.element.down().undoPositioned(); | |
762 | } | |
}, arguments[1] || {}) | ||
); | ||
} | ||
// Bug in opera makes the TD containing this element expand for a instance after finish | ||
Effect.Squish = function(element) { | ||
764 | | |
765 | | |
766 | | |
767 | | |
768 | | |
769 | | |
770 | | |
769 | return new Effect.Scale(element, window.opera ? 1 : 0, { | |
770 | restoreAfterFinish: true, | |
771 | beforeSetup: function(effect) { | |
772 | effect.element.makeClipping(); | |
773 | }, | |
774 | afterFinishInternal: function(effect) { | |
775 | effect.element.hide().undoClipping(); | |
776 | } | |
}); | ||
} | ||
... | ... | |
y: initialMoveY, | ||
duration: 0.01, | ||
beforeSetup: function(effect) { | ||
826 | | |
827 | | |
828 | | |
832 | effect.element.hide().makeClipping().makePositioned(); | |
}, | ||
afterFinishInternal: function(effect) { | ||
new Effect.Parallel( | ||
... | ... | |
sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) | ||
], Object.extend({ | ||
beforeSetup: function(effect) { | ||
839 | | |
840 | | |
843 | effect.effects[0].element.setStyle({height: '0px'}).show(); | |
}, | ||
afterFinishInternal: function(effect) { | ||
843 | | |
844 | | |
845 | | |
846 | effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); | |
} | ||
}, options) | ||
) | ||
... | ... | |
new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) | ||
], Object.extend({ | ||
beforeStartInternal: function(effect) { | ||
899 | | |
900 | | |
900 | effect.effects[0].element.makePositioned().makeClipping(); | |
901 | }, | |
afterFinishInternal: function(effect) { | ||
902 | | |
903 | | |
904 | | |
905 | | |
903 | effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } | |
}, options) | ||
); | ||
} | ||
... | ... | |
var options = arguments[1] || {}; | ||
var oldOpacity = element.getInlineOpacity(); | ||
var transition = options.transition || Effect.Transitions.sinoidal; | ||
915 | | |
913 | var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) }; | |
reverser.bind(transition); | ||
return new Effect.Opacity(element, | ||
918 | | |
916 | Object.extend(Object.extend({ duration: 2.0, from: 0, | |
afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } | ||
}, options), {transition: reverser})); | ||
} | ||
... | ... | |
left: element.style.left, | ||
width: element.style.width, | ||
height: element.style.height }; | ||
930 | | |
928 | element.makeClipping(); | |
return new Effect.Scale(element, 5, Object.extend({ | ||
scaleContent: false, | ||
scaleX: false, | ||
... | ... | |
scaleContent: false, | ||
scaleY: false, | ||
afterFinishInternal: function(effect) { | ||
939 | | |
940 | | |
941 | | |
937 | effect.element.hide().undoClipping().setStyle(oldStyle); | |
} }); | ||
}}, arguments[1] || {})); | ||
}; | ||
942 | Effect.Morph = Class.create(); | |
943 | Object.extend(Object.extend(Effect.Morph.prototype, Effect.Base.prototype), { | |
944 | initialize: function(element) { | |
945 | this.element = $(element); | |
946 | if(!this.element) throw(Effect._elementDoesNotExistError); | |
947 | var options = Object.extend({ | |
948 | style: '' | |
949 | }, arguments[1] || {}); | |
950 | this.start(options); | |
951 | }, | |
952 | setup: function(){ | |
953 | function parseColor(color){ | |
954 | if(!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; | |
955 | color = color.parseColor(); | |
956 | return $R(0,2).map(function(i){ | |
957 | return parseInt( color.slice(i*2+1,i*2+3), 16 ) | |
958 | }); | |
959 | } | |
960 | this.transforms = this.options.style.parseStyle().map(function(property){ | |
961 | var originalValue = this.element.getStyle(property[0]); | |
962 | return $H({ | |
963 | style: property[0], | |
964 | originalValue: property[1].unit=='color' ? | |
965 | parseColor(originalValue) : parseFloat(originalValue || 0), | |
966 | targetValue: property[1].unit=='color' ? | |
967 | parseColor(property[1].value) : property[1].value, | |
968 | unit: property[1].unit | |
969 | }); | |
970 | }.bind(this)).reject(function(transform){ | |
971 | return ( | |
972 | (transform.originalValue == transform.targetValue) || | |
973 | ( | |
974 | transform.unit != 'color' && | |
975 | (isNaN(transform.originalValue) || isNaN(transform.targetValue)) | |
976 | ) | |
977 | ) | |
978 | }); | |
979 | }, | |
980 | update: function(position) { | |
981 | var style = $H(), value = null; | |
982 | this.transforms.each(function(transform){ | |
983 | value = transform.unit=='color' ? | |
984 | $R(0,2).inject('#',function(m,v,i){ | |
985 | return m+(Math.round(transform.originalValue[i]+ | |
986 | (transform.targetValue[i] - transform.originalValue[i])*position)).toColorPart() }) : | |
987 | transform.originalValue + Math.round( | |
988 | ((transform.targetValue - transform.originalValue) * position) * 1000)/1000 + transform.unit; | |
989 | style[transform.style] = value; | |
990 | }); | |
991 | this.element.setStyle(style); | |
992 | } | |
993 | }); | |
994 | ||
995 | Effect.Transform = Class.create(); | |
996 | Object.extend(Effect.Transform.prototype, { | |
997 | initialize: function(tracks){ | |
998 | this.tracks = []; | |
999 | this.options = arguments[1] || {}; | |
1000 | this.addTracks(tracks); | |
1001 | }, | |
1002 | addTracks: function(tracks){ | |
1003 | tracks.each(function(track){ | |
1004 | var data = $H(track).values().first(); | |
1005 | this.tracks.push($H({ | |
1006 | ids: $H(track).keys().first(), | |
1007 | effect: Effect.Morph, | |
1008 | options: { style: data } | |
1009 | })); | |
1010 | }.bind(this)); | |
1011 | return this; | |
1012 | }, | |
1013 | play: function(){ | |
1014 | return new Effect.Parallel( | |
1015 | this.tracks.map(function(track){ | |
1016 | var elements = [$(track.ids) || $$(track.ids)].flatten(); | |
1017 | return elements.map(function(e){ return new track.effect(e, Object.extend({ sync:true }, track.options)) }); | |
1018 | }).flatten(), | |
1019 | this.options | |
1020 | ); | |
1021 | } | |
1022 | }); | |
1023 | ||
1024 | Element.CSS_PROPERTIES = ['azimuth', 'backgroundAttachment', 'backgroundColor', 'backgroundImage', | |
1025 | 'backgroundPosition', 'backgroundRepeat', 'borderBottomColor', 'borderBottomStyle', | |
1026 | 'borderBottomWidth', 'borderCollapse', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', | |
1027 | 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderSpacing', 'borderTopColor', | |
1028 | 'borderTopStyle', 'borderTopWidth', 'bottom', 'captionSide', 'clear', 'clip', 'color', 'content', | |
1029 | 'counterIncrement', 'counterReset', 'cssFloat', 'cueAfter', 'cueBefore', 'cursor', 'direction', | |
1030 | 'display', 'elevation', 'emptyCells', 'fontFamily', 'fontSize', 'fontSizeAdjust', 'fontStretch', | |
1031 | 'fontStyle', 'fontVariant', 'fontWeight', 'height', 'left', 'letterSpacing', 'lineHeight', | |
1032 | 'listStyleImage', 'listStylePosition', 'listStyleType', 'marginBottom', 'marginLeft', 'marginRight', | |
1033 | 'marginTop', 'markerOffset', 'marks', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'opacity', | |
1034 | 'orphans', 'outlineColor', 'outlineOffset', 'outlineStyle', 'outlineWidth', 'overflowX', 'overflowY', | |
1035 | 'paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop', 'page', 'pageBreakAfter', 'pageBreakBefore', | |
1036 | 'pageBreakInside', 'pauseAfter', 'pauseBefore', 'pitch', 'pitchRange', 'position', 'quotes', | |
1037 | 'richness', 'right', 'size', 'speakHeader', 'speakNumeral', 'speakPunctuation', 'speechRate', 'stress', | |
1038 | 'tableLayout', 'textAlign', 'textDecoration', 'textIndent', 'textShadow', 'textTransform', 'top', | |
1039 | 'unicodeBidi', 'verticalAlign', 'visibility', 'voiceFamily', 'volume', 'whiteSpace', 'widows', | |
1040 | 'width', 'wordSpacing', 'zIndex']; | |
1041 | ||
1042 | Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; | |
1043 | ||
1044 | String.prototype.parseStyle = function(){ | |
1045 | var element = Element.extend(document.createElement('div')); | |
1046 | element.innerHTML = '<div style="' + this + '"></div>'; | |
1047 | var style = element.down().style, styleRules = $H(); | |
1048 | ||
1049 | Element.CSS_PROPERTIES.each(function(property){ | |
1050 | if(style[property]) styleRules[property] = style[property]; | |
1051 | }); | |
1052 | ||
1053 | var result = $H(); | |
1054 | ||
1055 | styleRules.each(function(pair){ | |
1056 | var property = pair[0], value = pair[1], unit = null; | |
1057 | ||
1058 | if(value.parseColor('#zzzzzz') != '#zzzzzz') { | |
1059 | value = value.parseColor(); | |
1060 | unit = 'color'; | |
1061 | } else if(Element.CSS_LENGTH.test(value)) | |
1062 | var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/), | |
1063 | value = parseFloat(components[1]), unit = (components.length == 3) ? components[2] : null; | |
1064 | ||
1065 | result[property.underscore().dasherize()] = $H({ value:value, unit:unit }); | |
1066 | }.bind(this)); | |
1067 | ||
1068 | return result; | |
1069 | }; | |
1070 | ||
1071 | Element.morph = function(element, style) { | |
1072 | new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || {})); | |
1073 | return element; | |
1074 | }; | |
1075 | ||
['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setContentZoom', | ||
947 | | |
1077 | 'collectTextNodes','collectTextNodesIgnoreClass','morph'].each( | |
function(f) { Element.Methods[f] = Element[f]; } | ||
); | ||
rool/rails/typo/trunk/public/javascripts/prototype.js:
prev. | current | |
1 | ||
2 | | |
1 | /* Prototype JavaScript framework, version 1.5.0 | |
2 | * (c) 2005-2007 Sam Stephenson | |
* | ||
* Prototype is freely distributable under the terms of an MIT-style license. | ||
* For details, see the Prototype web site: http://prototype.conio.net/ | ||
... | ... | |
/*--------------------------------------------------------------------------*/ | ||
var Prototype = { | ||
10 | | |
10 | Version: '1.5.0', | |
11 | BrowserFeatures: { | |
12 | XPath: !!document.evaluate | |
13 | }, | |
14 | ||
ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)', | ||
12 | ||
emptyFunction: function() {}, | ||
14 | | |
17 | K: function(x) { return x } | |
} | ||
var Class = { | ||
... | ... | |
return destination; | ||
} | ||
34 | ||
35 | | |
36 | | |
37 | | |
38 | | |
39 | | |
40 | | |
41 | | |
37 | Object.extend(Object, { | |
38 | inspect: function(object) { | |
39 | try { | |
40 | if (object === undefined) return 'undefined'; | |
41 | if (object === null) return 'null'; | |
42 | return object.inspect ? object.inspect() : object.toString(); | |
43 | } catch (e) { | |
44 | if (e instanceof RangeError) return '...'; | |
45 | throw e; | |
46 | } | |
47 | }, | |
48 | ||
49 | keys: function(object) { | |
50 | var keys = []; | |
51 | for (var property in object) | |
52 | keys.push(property); | |
53 | return keys; | |
54 | }, | |
55 | ||
56 | values: function(object) { | |
57 | var values = []; | |
58 | for (var property in object) | |
59 | values.push(object[property]); | |
60 | return values; | |
61 | }, | |
62 | ||
63 | clone: function(object) { | |
64 | return Object.extend({}, object); | |
} | ||
43 | ||
66 | }); | |
Function.prototype.bind = function() { | ||
var __method = this, args = $A(arguments), object = args.shift(); | ||
... | ... | |
} | ||
Function.prototype.bindAsEventListener = function(object) { | ||
53 | | |
76 | var __method = this, args = $A(arguments), object = args.shift(); | |
return function(event) { | ||
55 | | |
78 | return __method.apply(object, [( event || window.event)].concat(args).concat($A(arguments))); | |
} | ||
} | ||
... | ... | |
these: function() { | ||
var returnValue; | ||
80 | | |
103 | for (var i = 0, length = arguments.length; i < length; i++) { | |
var lambda = arguments[i]; | ||
try { | ||
returnValue = lambda(); | ||
... | ... | |
}, | ||
registerCallback: function() { | ||
105 | | |
128 | this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); | |
}, | ||
131 | stop: function() { | |
132 | if (!this.timer) return; | |
133 | clearInterval(this.timer); | |
134 | this.timer = null; | |
135 | }, | |
136 | ||
onTimerEvent: function() { | ||
if (!this.currentlyExecuting) { | ||
try { | ||
this.currentlyExecuting = true; | ||
112 | | |
141 | this.callback(this); | |
} finally { | ||
this.currentlyExecuting = false; | ||
} | ||
} | ||
} | ||
} | ||
148 | String.interpret = function(value){ | |
149 | return value == null ? '' : String(value); | |
150 | } | |
151 | ||
Object.extend(String.prototype, { | ||
gsub: function(pattern, replacement) { | ||
var result = '', source = this, match; | ||
... | ... | |
while (source.length > 0) { | ||
if (match = source.match(pattern)) { | ||
result += source.slice(0, match.index); | ||
127 | | |
160 | result += String.interpret(replacement(match)); | |
source = source.slice(match.index + match[0].length); | ||
} else { | ||
result += source, source = ''; | ||
... | ... | |
unescapeHTML: function() { | ||
var div = document.createElement('div'); | ||
div.innerHTML = this.stripTags(); | ||
192 | | |
225 | return div.childNodes[0] ? (div.childNodes.length > 1 ? | |
226 | $A(div.childNodes).inject('',function(memo,node){ return memo+node.nodeValue }) : | |
227 | div.childNodes[0].nodeValue) : ''; | |
}, | ||
195 | | |
196 | | |
197 | | |
198 | | |
199 | | |
200 | | |
230 | toQueryParams: function(separator) { | |
231 | var match = this.strip().match(/([^?#]*)(#.*)?$/); | |
232 | if (!match) return {}; | |
233 | ||
234 | return match[1].split(separator || '&').inject({}, function(hash, pair) { | |
235 | if ((pair = pair.split('='))[0]) { | |
236 | var name = decodeURIComponent(pair[0]); | |
237 | var value = pair[1] ? decodeURIComponent(pair[1]) : undefined; | |
238 | ||
239 | if (hash[name] !== undefined) { | |
240 | if (hash[name].constructor != Array) | |
241 | hash[name] = [hash[name]]; | |
242 | if (value) hash[name].push(value); | |
243 | } | |
244 | else hash[name] = value; | |
245 | } | |
246 | return hash; | |
}); | ||
}, | ||
... | ... | |
return this.split(''); | ||
}, | ||
254 | succ: function() { | |
255 | return this.slice(0, this.length - 1) + | |
256 | String.fromCharCode(this.charCodeAt(this.length - 1) + 1); | |
257 | }, | |
258 | ||
camelize: function() { | ||
209 | | |
210 | | |
260 | var parts = this.split('-'), len = parts.length; | |
261 | if (len == 1) return parts[0]; | |
212 | | |
213 | | |
214 | | |
263 | var camelized = this.charAt(0) == '-' | |
264 | ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) | |
265 | : parts[0]; | |
216 | | |
217 | | |
218 | | |
219 | | |
267 | for (var i = 1; i < len; i++) | |
268 | camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); | |
221 | | |
270 | return camelized; | |
}, | ||
224 | | |
225 | | |
273 | capitalize: function(){ | |
274 | return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); | |
275 | }, | |
276 | ||
277 | underscore: function() { | |
278 | return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); | |
279 | }, | |
280 | ||
281 | dasherize: function() { | |
282 | return this.gsub(/_/,'-'); | |
283 | }, | |
284 | ||
285 | inspect: function(useDoubleQuotes) { | |
286 | var escapedString = this.replace(/\\/g, '\\\\'); | |
287 | if (useDoubleQuotes) | |
288 | return '"' + escapedString.replace(/"/g, '\\"') + '"'; | |
289 | else | |
290 | return "'" + escapedString.replace(/'/g, '\\\'') + "'"; | |
} | ||
}); | ||
... | ... | |
return this.template.gsub(this.pattern, function(match) { | ||
var before = match[1]; | ||
if (before == '\\') return match[2]; | ||
249 | | |
314 | return before + String.interpret(object[match[3]]); | |
}); | ||
} | ||
} | ||
... | ... | |
} catch (e) { | ||
if (e != $break) throw e; | ||
} | ||
336 | return this; | |
}, | ||
339 | eachSlice: function(number, iterator) { | |
340 | var index = -number, slices = [], array = this.toArray(); | |
341 | while ((index += number) < array.length) | |
342 | slices.push(array.slice(index, index+number)); | |
343 | return slices.map(iterator); | |
344 | }, | |
345 | ||
all: function(iterator) { | ||
var result = true; | ||
this.each(function(value, index) { | ||
... | ... | |
}, | ||
any: function(iterator) { | ||
283 | | |
356 | var result = false; | |
this.each(function(value, index) { | ||
if (result = !!(iterator || Prototype.K)(value, index)) | ||
throw $break; | ||
... | ... | |
collect: function(iterator) { | ||
var results = []; | ||
this.each(function(value, index) { | ||
294 | | |
367 | results.push((iterator || Prototype.K)(value, index)); | |
}); | ||
return results; | ||
}, | ||
299 | | |
372 | detect: function(iterator) { | |
var result; | ||
this.each(function(value, index) { | ||
if (iterator(value, index)) { | ||
... | ... | |
return found; | ||
}, | ||
413 | inGroupsOf: function(number, fillWith) { | |
414 | fillWith = fillWith === undefined ? null : fillWith; | |
415 | return this.eachSlice(number, function(slice) { | |
416 | while(slice.length < number) slice.push(fillWith); | |
417 | return slice; | |
418 | }); | |
419 | }, | |
420 | ||
inject: function(memo, iterator) { | ||
this.each(function(value, index) { | ||
memo = iterator(memo, value, index); | ||
... | ... | |
invoke: function(method) { | ||
var args = $A(arguments).slice(1); | ||
349 | | |
430 | return this.map(function(value) { | |
return value[method].apply(value, args); | ||
}); | ||
}, | ||
... | ... | |
}, | ||
sortBy: function(iterator) { | ||
401 | | |
482 | return this.map(function(value, index) { | |
return {value: value, criteria: iterator(value, index)}; | ||
}).sort(function(left, right) { | ||
var a = left.criteria, b = right.criteria; | ||
... | ... | |
}, | ||
toArray: function() { | ||
410 | | |
491 | return this.map(); | |
}, | ||
zip: function() { | ||
... | ... | |
}); | ||
}, | ||
505 | size: function() { | |
506 | return this.toArray().length; | |
507 | }, | |
508 | ||
inspect: function() { | ||
return '#<Enumerable:' + this.toArray().inspect() + '>'; | ||
} | ||
... | ... | |
return iterable.toArray(); | ||
} else { | ||
var results = []; | ||
442 | | |
527 | for (var i = 0, length = iterable.length; i < length; i++) | |
results.push(iterable[i]); | ||
return results; | ||
} | ||
... | ... | |
Object.extend(Array.prototype, { | ||
_each: function(iterator) { | ||
455 | | |
540 | for (var i = 0, length = this.length; i < length; i++) | |
iterator(this[i]); | ||
}, | ||
... | ... | |
compact: function() { | ||
return this.select(function(value) { | ||
474 | | |
559 | return value != null; | |
}); | ||
}, | ||
... | ... | |
}, | ||
indexOf: function(object) { | ||
493 | | |
578 | for (var i = 0, length = this.length; i < length; i++) | |
if (this[i] == object) return i; | ||
return -1; | ||
}, | ||
... | ... | |
return (inline !== false ? this : this.toArray())._reverse(); | ||
}, | ||
587 | reduce: function() { | |
588 | return this.length > 1 ? this : this[0]; | |
589 | }, | |
590 | ||
591 | uniq: function() { | |
592 | return this.inject([], function(array, value) { | |
593 | return array.include(value) ? array : array.concat([value]); | |
594 | }); | |
595 | }, | |
596 | ||
597 | clone: function() { | |
598 | return [].concat(this); | |
599 | }, | |
600 | ||
601 | size: function() { | |
602 | return this.length; | |
603 | }, | |
604 | ||
inspect: function() { | ||
return '[' + this.map(Object.inspect).join(', ') + ']'; | ||
} | ||
}); | ||
506 | ||
609 | ||
610 | Array.prototype.toArray = Array.prototype.clone; | |
611 | ||
612 | function $w(string){ | |
613 | string = string.strip(); | |
614 | return string ? string.split(/\s+/) : []; | |
615 | } | |
616 | ||
617 | if(window.opera){ | |
618 | Array.prototype.concat = function(){ | |
619 | var array = []; | |
620 | for(var i = 0, length = this.length; i < length; i++) array.push(this[i]); | |
621 | for(var i = 0, length = arguments.length; i < length; i++) { | |
622 | if(arguments[i].constructor == Array) { | |
623 | for(var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) | |
624 | array.push(arguments[i][j]); | |
625 | } else { | |
626 | array.push(arguments[i]); | |
627 | } | |
628 | } | |
629 | return array; | |
630 | } | |
631 | } | |
632 | var Hash = function(obj) { | |
633 | Object.extend(this, obj || {}); | |
634 | }; | |
635 | ||
636 | Object.extend(Hash, { | |
637 | toQueryString: function(obj) { | |
638 | var parts = []; | |
639 | ||
640 | this.prototype._each.call(obj, function(pair) { | |
641 | if (!pair.key) return; | |
642 | ||
643 | if (pair.value && pair.value.constructor == Array) { | |
644 | var values = pair.value.compact(); | |
645 | if (values.length < 2) pair.value = values.reduce(); | |
646 | else { | |
647 | key = encodeURIComponent(pair.key); | |
648 | values.each(function(value) { | |
649 | value = value != undefined ? encodeURIComponent(value) : ''; | |
650 | parts.push(key + '=' + encodeURIComponent(value)); | |
651 | }); | |
652 | return; | |
653 | } | |
654 | } | |
655 | if (pair.value == undefined) pair[1] = ''; | |
656 | parts.push(pair.map(encodeURIComponent).join('=')); | |
657 | }); | |
658 | ||
659 | return parts.join('&'); | |
660 | } | |
661 | }); | |
662 | ||
663 | Object.extend(Hash.prototype, Enumerable); | |
664 | Object.extend(Hash.prototype, { | |
_each: function(iterator) { | ||
for (var key in this) { | ||
var value = this[key]; | ||
510 | | |
668 | if (value && value == Hash.prototype[key]) continue; | |
var pair = [key, value]; | ||
pair.key = key; | ||
... | ... | |
}, | ||
merge: function(hash) { | ||
528 | | |
686 | return $H(hash).inject(this, function(mergedHash, pair) { | |
mergedHash[pair.key] = pair.value; | ||
return mergedHash; | ||
}); | ||
}, | ||
692 | remove: function() { | |
693 | var result; | |
694 | for(var i = 0, length = arguments.length; i < length; i++) { | |
695 | var value = this[arguments[i]]; | |
696 | if (value !== undefined){ | |
697 | if (result === undefined) result = value; | |
698 | else { | |
699 | if (result.constructor != Array) result = [result]; | |
700 | result.push(value) | |
701 | } | |
702 | } | |
703 | delete this[arguments[i]]; | |
704 | } | |
705 | return result; | |
706 | }, | |
707 | ||
toQueryString: function() { | ||
535 | | |
536 | | |
537 | | |
709 | return Hash.toQueryString(this); | |
}, | ||
inspect: function() { | ||
... | ... | |
return pair.map(Object.inspect).join(': '); | ||
}).join(', ') + '}>'; | ||
} | ||
545 | ||
717 | }); | |
function $H(object) { | ||
548 | | |
549 | | |
550 | | |
551 | | |
552 | ||
720 | if (object && object.constructor == Hash) return object; | |
721 | return new Hash(object); | |
722 | }; | |
ObjectRange = Class.create(); | ||
Object.extend(ObjectRange.prototype, Enumerable); | ||
Object.extend(ObjectRange.prototype, { | ||
... | ... | |
_each: function(iterator) { | ||
var value = this.start; | ||
564 | | |
734 | while (this.include(value)) { | |
iterator(value); | ||
value = value.succ(); | ||
567 | | |
737 | } | |
}, | ||
include: function(value) { | ||
... | ... | |
this.responders._each(iterator); | ||
}, | ||
602 | | |
603 | | |
604 | | |
772 | register: function(responder) { | |
773 | if (!this.include(responder)) | |
774 | this.responders.push(responder); | |
}, | ||
607 | | |
608 | | |
777 | unregister: function(responder) { | |
778 | this.responders = this.responders.without(responder); | |
}, | ||
dispatch: function(callback, request, transport, json) { | ||
this.each(function(responder) { | ||
613 | | |
783 | if (typeof responder[callback] == 'function') { | |
try { | ||
responder[callback].apply(responder, [request, transport, json]); | ||
} catch (e) {} | ||
... | ... | |
onCreate: function() { | ||
Ajax.activeRequestCount++; | ||
}, | ||
628 | ||
onComplete: function() { | ||
Ajax.activeRequestCount--; | ||
} | ||
... | ... | |
method: 'post', | ||
asynchronous: true, | ||
contentType: 'application/x-www-form-urlencoded', | ||
810 | encoding: 'UTF-8', | |
parameters: '' | ||
} | ||
Object.extend(this.options, options || {}); | ||
644 | | |
646 | | |
647 | | |
648 | | |
649 | | |
650 | | |
651 | ||
652 | | |
653 | | |
815 | this.options.method = this.options.method.toLowerCase(); | |
816 | if (typeof this.options.parameters == 'string') | |
817 | this.options.parameters = this.options.parameters.toQueryParams(); | |
} | ||
} | ||
... | ... | |
['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; | ||
Ajax.Request.prototype = Object.extend(new Ajax.Base(), { | ||
826 | _complete: false, | |
827 | ||
initialize: function(url, options) { | ||
this.transport = Ajax.getTransport(); | ||
this.setOptions(options); | ||
... | ... | |
}, | ||
request: function(url) { | ||
669 | | |
670 | | |
835 | this.url = url; | |
836 | this.method = this.options.method; | |
837 | var params = this.options.parameters; | |
839 | if (!['get', 'post'].include(this.method)) { | |
840 | // simulate other verbs over post | |
841 | params['_method'] = this.method; | |
842 | this.method = 'post'; | |
843 | } | |
844 | ||
845 | params = Hash.toQueryString(params); | |
846 | if (params && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&_=' | |
847 | ||
848 | // when GET, append parameters to URL | |
849 | if (this.method == 'get' && params) | |
850 | this.url += (this.url.indexOf('?') > -1 ? '&' : '?') + params; | |
851 | ||
try { | ||
673 | | |
674 | | |
675 | | |
676 | ||
Ajax.Responders.dispatch('onCreate', this, this.transport); | ||
679 | | |
855 | this.transport.open(this.method.toUpperCase(), this.url, | |
this.options.asynchronous); | ||
682 | | |
683 | | |
684 | | |
685 | | |
858 | if (this.options.asynchronous) | |
859 | setTimeout(function() { this.respondToReadyState(1) }.bind(this), 10); | |
861 | this.transport.onreadystatechange = this.onStateChange.bind(this); | |
this.setRequestHeaders(); | ||
689 | | |
690 | | |
864 | var body = this.method == 'post' ? (this.options.postBody || params) : null; | |
692 | | |
866 | this.transport.send(body); | |
867 | ||
868 | /* Force Firefox to handle ready state 4 for synchronous requests */ | |
869 | if (!this.options.asynchronous && this.transport.overrideMimeType) | |
870 | this.onStateChange(); | |
871 | ||
872 | } | |
873 | catch (e) { | |
this.dispatchException(e); | ||
} | ||
}, | ||
878 | onStateChange: function() { | |
879 | var readyState = this.transport.readyState; | |
880 | if (readyState > 1 && !((readyState == 4) && this._complete)) | |
881 | this.respondToReadyState(this.transport.readyState); | |
882 | }, | |
883 | ||
setRequestHeaders: function() { | ||
698 | | |
699 | | |
700 | | |
701 | | |
885 | var headers = { | |
886 | 'X-Requested-With': 'XMLHttpRequest', | |
887 | 'X-Prototype-Version': Prototype.Version, | |
888 | 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' | |
889 | }; | |
703 | | |
704 | | |
891 | if (this.method == 'post') { | |
892 | headers['Content-type'] = this.options.contentType + | |
893 | (this.options.encoding ? '; charset=' + this.options.encoding : ''); | |
706 | | |
707 | | |
708 | | |
895 | /* Force "Connection: close" for older Mozilla browsers to work | |
896 | * around a bug where XMLHttpRequest sends an incorrect | |
897 | * Content-length header. See Mozilla Bugzilla #246651. | |
*/ | ||
710 | | |
711 | | |
899 | if (this.transport.overrideMimeType && | |
900 | (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) | |
901 | headers['Connection'] = 'close'; | |
} | ||
714 | | |
715 | | |
904 | // user-defined headers | |
905 | if (typeof this.options.requestHeaders == 'object') { | |
906 | var extras = this.options.requestHeaders; | |
717 | | |
718 | | |
719 | | |
908 | if (typeof extras.push == 'function') | |
909 | for (var i = 0, length = extras.length; i < length; i += 2) | |
910 | headers[extras[i]] = extras[i+1]; | |
911 | else | |
912 | $H(extras).each(function(pair) { headers[pair.key] = pair.value }); | |
913 | } | |
721 | | |
722 | | |
723 | | |
724 | | |
915 | for (var name in headers) | |
916 | this.transport.setRequestHeader(name, headers[name]); | |
}, | ||
727 | | |
728 | | |
729 | | |
730 | | |
919 | success: function() { | |
920 | return !this.transport.status | |
921 | || (this.transport.status >= 200 && this.transport.status < 300); | |
}, | ||
733 | | |
734 | | |
735 | | |
736 | | |
737 | | |
738 | ||
739 | | |
740 | | |
741 | | |
742 | | |
743 | | |
744 | | |
745 | | |
746 | ||
respondToReadyState: function(readyState) { | ||
748 | | |
925 | var state = Ajax.Request.Events[readyState]; | |
var transport = this.transport, json = this.evalJSON(); | ||
751 | | |
928 | if (state == 'Complete') { | |
try { | ||
930 | this._complete = true; | |
(this.options['on' + this.transport.status] | ||
754 | | |
932 | || this.options['on' + (this.success() ? 'Success' : 'Failure')] | |
|| Prototype.emptyFunction)(transport, json); | ||
} catch (e) { | ||
this.dispatchException(e); | ||
} | ||
760 | | |
761 | | |
938 | if ((this.getHeader('Content-type') || 'text/javascript').strip(). | |
939 | match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)) | |
940 | this.evalResponse(); | |
} | ||
try { | ||
765 | | |
766 | | |
944 | (this.options['on' + state] || Prototype.emptyFunction)(transport, json); | |
945 | Ajax.Responders.dispatch('on' + state, this, transport, json); | |
} catch (e) { | ||
this.dispatchException(e); | ||
} | ||
771 | | |
772 | | |
950 | if (state == 'Complete') { | |
951 | // avoid memory leak in MSIE: clean up | |
this.transport.onreadystatechange = Prototype.emptyFunction; | ||
953 | } | |
}, | ||
956 | getHeader: function(name) { | |
957 | try { | |
958 | return this.transport.getResponseHeader(name); | |
959 | } catch (e) { return null } | |
960 | }, | |
961 | ||
962 | evalJSON: function() { | |
963 | try { | |
964 | var json = this.getHeader('X-JSON'); | |
965 | return json ? eval('(' + json + ')') : null; | |
966 | } catch (e) { return null } | |
967 | }, | |
968 | ||
969 | evalResponse: function() { | |
970 | try { | |
971 | return eval(this.transport.responseText); | |
972 | } catch (e) { | |
973 | this.dispatchException(e); | |
974 | } | |
975 | }, | |
976 | ||
dispatchException: function(exception) { | ||
(this.options.onException || Prototype.emptyFunction)(this, exception); | ||
Ajax.Responders.dispatch('onException', this, exception); | ||
... | ... | |
Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), { | ||
initialize: function(container, url, options) { | ||
786 | | |
787 | | |
788 | | |
789 | | |
987 | this.container = { | |
988 | success: (container.success || container), | |
989 | failure: (container.failure || (container.success ? null : container)) | |
} | ||
this.transport = Ajax.getTransport(); | ||
this.setOptions(options); | ||
var onComplete = this.options.onComplete || Prototype.emptyFunction; | ||
796 | | |
996 | this.options.onComplete = (function(transport, param) { | |
this.updateContent(); | ||
798 | | |
998 | onComplete(transport, param); | |
}).bind(this); | ||
this.request(url); | ||
}, | ||
updateContent: function() { | ||
805 | | |
806 | | |
1005 | var receiver = this.container[this.success() ? 'success' : 'failure']; | |
var response = this.transport.responseText; | ||
809 | | |
810 | | |
1008 | if (!this.options.evalScripts) response = response.stripScripts(); | |
812 | | |
813 | | |
1010 | if (receiver = $(receiver)) { | |
1011 | if (this.options.insertion) | |
new this.options.insertion(receiver, response); | ||
815 | | |
816 | | |
817 | | |
1013 | else | |
1014 | receiver.update(response); | |
} | ||
820 | | |
1017 | if (this.success()) { | |
if (this.onComplete) | ||
setTimeout(this.onComplete.bind(this), 10); | ||
} | ||
... | ... | |
}, | ||
stop: function() { | ||
849 | | |
1046 | this.updater.options.onComplete = undefined; | |
clearTimeout(this.timer); | ||
(this.onComplete || Prototype.emptyFunction).apply(this, arguments); | ||
}, | ||
... | ... | |
this.updater = new Ajax.Updater(this.container, this.url, this.options); | ||
} | ||
}); | ||
869 | ||
870 | | |
871 | | |
872 | | |
873 | | |
874 | | |
875 | | |
1066 | function $(element) { | |
1067 | if (arguments.length > 1) { | |
1068 | for (var i = 0, elements = [], length = arguments.length; i < length; i++) | |
1069 | elements.push($(arguments[i])); | |
1070 | return elements; | |
} | ||
877 | | |
1072 | if (typeof element == 'string') | |
1073 | element = document.getElementById(element); | |
1074 | return Element.extend(element); | |
} | ||
1077 | if (Prototype.BrowserFeatures.XPath) { | |
1078 | document._getElementsByXPath = function(expression, parentElement) { | |
1079 | var results = []; | |
1080 | var query = document.evaluate(expression, $(parentElement) || document, | |
1081 | null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
1082 | for (var i = 0, length = query.snapshotLength; i < length; i++) | |
1083 | results.push(query.snapshotItem(i)); | |
1084 | return results; | |
1085 | }; | |
1086 | } | |
1087 | ||
document.getElementsByClassName = function(className, parentElement) { | ||
881 | | |
882 | | |
883 | | |
884 | | |
1089 | if (Prototype.BrowserFeatures.XPath) { | |
1090 | var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]"; | |
1091 | return document._getElementsByXPath(q, parentElement); | |
1092 | } else { | |
1093 | var children = ($(parentElement) || document.body).getElementsByTagName('*'); | |
1094 | var elements = [], child; | |
1095 | for (var i = 0, length = children.length; i < length; i++) { | |
1096 | child = children[i]; | |
1097 | if (Element.hasClassName(child, className)) | |
1098 | elements.push(Element.extend(child)); | |
1099 | } | |
return elements; | ||
886 | | |
887 | ||
1101 | } | |
1102 | }; | |
/*--------------------------------------------------------------------------*/ | ||
... | ... | |
var Element = new Object(); | ||
Element.extend = function(element) { | ||
895 | | |
896 | | |
1110 | if (!element || _nativeExtensions || element.nodeType == 3) return element; | |
if (!element._extended && element.tagName && element != window) { | ||
899 | | |
900 | | |
1113 | var methods = Object.clone(Element.Methods), cache = Element.extend.cache; | |
1114 | ||
1115 | if (element.tagName == 'FORM') | |
1116 | Object.extend(methods, Form.Methods); | |
1117 | if (['INPUT', 'TEXTAREA', 'SELECT'].include(element.tagName)) | |
1118 | Object.extend(methods, Form.Element.Methods); | |
1119 | ||
1120 | Object.extend(methods, Element.Methods.Simulated); | |
1121 | ||
1122 | for (var property in methods) { | |
var value = methods[property]; | ||
902 | | |
1124 | if (typeof value == 'function' && !(property in element)) | |
element[property] = cache.findOrStore(value); | ||
} | ||
} | ||
element._extended = true; | ||
return element; | ||
909 | ||
1131 | }; | |
Element.extend.cache = { | ||
findOrStore: function(value) { | ||
... | ... | |
return value.apply(null, [this].concat($A(arguments))); | ||
} | ||
} | ||
917 | ||
1139 | }; | |
Element.Methods = { | ||
visible: function(element) { | ||
return $(element).style.display != 'none'; | ||
}, | ||
924 | | |
925 | | |
926 | | |
927 | | |
928 | | |
1146 | toggle: function(element) { | |
1147 | element = $(element); | |
1148 | Element[Element.visible(element) ? 'hide' : 'show'](element); | |
1149 | return element; | |
}, | ||
931 | | |
932 | | |
933 | | |
934 | | |
935 | | |
1152 | hide: function(element) { | |
1153 | $(element).style.display = 'none'; | |
1154 | return element; | |
}, | ||
938 | | |
939 | | |
940 | | |
941 | | |
942 | | |
1157 | show: function(element) { | |
1158 | $(element).style.display = ''; | |
1159 | return element; | |
}, | ||
remove: function(element) { | ||
element = $(element); | ||
element.parentNode.removeChild(element); | ||
1165 | return element; | |
}, | ||
update: function(element, html) { | ||
1169 | html = typeof html == 'undefined' ? '' : html.toString(); | |
$(element).innerHTML = html.stripScripts(); | ||
setTimeout(function() {html.evalScripts()}, 10); | ||
1172 | return element; | |
}, | ||
replace: function(element, html) { | ||
element = $(element); | ||
1177 | html = typeof html == 'undefined' ? '' : html.toString(); | |
if (element.outerHTML) { | ||
element.outerHTML = html.stripScripts(); | ||
} else { | ||
... | ... | |
range.createContextualFragment(html.stripScripts()), element); | ||
} | ||
setTimeout(function() {html.evalScripts()}, 10); | ||
1187 | return element; | |
}, | ||
968 | | |
1190 | inspect: function(element) { | |
element = $(element); | ||
970 | | |
1192 | var result = '<' + element.tagName.toLowerCase(); | |
1193 | $H({'id': 'id', 'className': 'class'}).each(function(pair) { | |
1194 | var property = pair.first(), attribute = pair.last(); | |
1195 | var value = (element[property] || '').toString(); | |
1196 | if (value) result += ' ' + attribute + '=' + value.inspect(true); | |
1197 | }); | |
1198 | return result + '>'; | |
}, | ||
1201 | recursivelyCollect: function(element, property) { | |
1202 | element = $(element); | |
1203 | var elements = []; | |
1204 | while (element = element[property]) | |
1205 | if (element.nodeType == 1) | |
1206 | elements.push(Element.extend(element)); | |
1207 | return elements; | |
1208 | }, | |
1209 | ||
1210 | ancestors: function(element) { | |
1211 | return $(element).recursivelyCollect('parentNode'); | |
1212 | }, | |
1213 | ||
1214 | descendants: function(element) { | |
1215 | return $A($(element).getElementsByTagName('*')); | |
1216 | }, | |
1217 | ||
1218 | immediateDescendants: function(element) { | |
1219 | if (!(element = $(element).firstChild)) return []; | |
1220 | while (element && element.nodeType != 1) element = element.nextSibling; | |
1221 | if (element) return [element].concat($(element).nextSiblings()); | |
1222 | return []; | |
1223 | }, | |
1224 | ||
1225 | previousSiblings: function(element) { | |
1226 | return $(element).recursivelyCollect('previousSibling'); | |
1227 | }, | |
1228 | ||
1229 | nextSiblings: function(element) { | |
1230 | return $(element).recursivelyCollect('nextSibling'); | |
1231 | }, | |
1232 | ||
1233 | siblings: function(element) { | |
1234 | element = $(element); | |
1235 | return element.previousSiblings().reverse().concat(element.nextSiblings()); | |
1236 | }, | |
1237 | ||
1238 | match: function(element, selector) { | |
1239 | if (typeof selector == 'string') | |
1240 | selector = new Selector(selector); | |
1241 | return selector.match($(element)); | |
1242 | }, | |
1243 | ||
1244 | up: function(element, expression, index) { | |
1245 | return Selector.findElement($(element).ancestors(), expression, index); | |
1246 | }, | |
1247 | ||
1248 | down: function(element, expression, index) { | |
1249 | return Selector.findElement($(element).descendants(), expression, index); | |
1250 | }, | |
1251 | ||
1252 | previous: function(element, expression, index) { | |
1253 | return Selector.findElement($(element).previousSiblings(), expression, index); | |
1254 | }, | |
1255 | ||
1256 | next: function(element, expression, index) { | |
1257 | return Selector.findElement($(element).nextSiblings(), expression, index); | |
1258 | }, | |
1259 | ||
1260 | getElementsBySelector: function() { | |
1261 | var args = $A(arguments), element = $(args.shift()); | |
1262 | return Selector.findChildElements(element, args); | |
1263 | }, | |
1264 | ||
1265 | getElementsByClassName: function(element, className) { | |
1266 | return document.getElementsByClassName(className, element); | |
1267 | }, | |
1268 | ||
1269 | readAttribute: function(element, name) { | |
1270 | element = $(element); | |
1271 | if (document.all && !window.opera) { | |
1272 | var t = Element._attributeTranslations; | |
1273 | if (t.values[name]) return t.values[name](element, name); | |
1274 | if (t.names[name]) name = t.names[name]; | |
1275 | var attribute = element.attributes[name]; | |
1276 | if(attribute) return attribute.nodeValue; | |
1277 | } | |
1278 | return element.getAttribute(name); | |
1279 | }, | |
1280 | ||
1281 | getHeight: function(element) { | |
1282 | return $(element).getDimensions().height; | |
1283 | }, | |
1284 | ||
1285 | getWidth: function(element) { | |
1286 | return $(element).getDimensions().width; | |
1287 | }, | |
1288 | ||
classNames: function(element) { | ||
return new Element.ClassNames(element); | ||
}, | ||
hasClassName: function(element, className) { | ||
if (!(element = $(element))) return; | ||
979 | | |
1295 | var elementClassName = element.className; | |
1296 | if (elementClassName.length == 0) return false; | |
1297 | if (elementClassName == className || | |
1298 | elementClassName.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))) | |
1299 | return true; | |
1300 | return false; | |
}, | ||
addClassName: function(element, className) { | ||
if (!(element = $(element))) return; | ||
984 | | |
1305 | Element.classNames(element).add(className); | |
1306 | return element; | |
}, | ||
removeClassName: function(element, className) { | ||
if (!(element = $(element))) return; | ||
989 | | |
1311 | Element.classNames(element).remove(className); | |
1312 | return element; | |
}, | ||
1315 | toggleClassName: function(element, className) { | |
1316 | if (!(element = $(element))) return; | |
1317 | Element.classNames(element)[element.hasClassName(className) ? 'remove' : 'add'](className); | |
1318 | return element; | |
1319 | }, | |
1320 | ||
1321 | observe: function() { | |
1322 | Event.observe.apply(Event, arguments); | |
1323 | return $A(arguments).first(); | |
1324 | }, | |
1325 | ||
1326 | stopObserving: function() { | |
1327 | Event.stopObserving.apply(Event, arguments); | |
1328 | return $A(arguments).first(); | |
1329 | }, | |
1330 | ||
// removes whitespace-only text node children | ||
cleanWhitespace: function(element) { | ||
element = $(element); | ||
995 | | |
996 | | |
1334 | var node = element.firstChild; | |
1335 | while (node) { | |
1336 | var nextNode = node.nextSibling; | |
if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) | ||
998 | | |
1338 | element.removeChild(node); | |
1339 | node = nextNode; | |
} | ||
1341 | return element; | |
}, | ||
empty: function(element) { | ||
return $(element).innerHTML.match(/^\s*$/); | ||
}, | ||
1006 | | |
1348 | descendantOf: function(element, ancestor) { | |
element = $(element), ancestor = $(ancestor); | ||
while (element = element.parentNode) | ||
if (element == ancestor) return true; | ||
... | ... | |
scrollTo: function(element) { | ||
element = $(element); | ||
1015 | | |
1016 | | |
1017 | | |
1357 | var pos = Position.cumulativeOffset(element); | |
1358 | window.scrollTo(pos[0], pos[1]); | |
1359 | return element; | |
}, | ||
getStyle: function(element, style) { | ||
element = $(element); | ||
1022 | | |
1364 | if (['float','cssFloat'].include(style)) | |
1365 | style = (typeof element.style.styleFloat != 'undefined' ? 'styleFloat' : 'cssFloat'); | |
1366 | style = style.camelize(); | |
1367 | var value = element.style[style]; | |
if (!value) { | ||
if (document.defaultView && document.defaultView.getComputedStyle) { | ||
var css = document.defaultView.getComputedStyle(element, null); | ||
1026 | | |
1371 | value = css ? css[style] : null; | |
} else if (element.currentStyle) { | ||
1028 | | |
1373 | value = element.currentStyle[style]; | |
} | ||
} | ||
1377 | if((value == 'auto') && ['width','height'].include(style) && (element.getStyle('display') != 'none')) | |
1378 | value = element['offset'+style.capitalize()] + 'px'; | |
1379 | ||
if (window.opera && ['left', 'top', 'right', 'bottom'].include(style)) | ||
if (Element.getStyle(element, 'position') == 'static') value = 'auto'; | ||
1034 | ||
1382 | if(style == 'opacity') { | |
1383 | if(value) return parseFloat(value); | |
1384 | if(value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) | |
1385 | if(value[1]) return parseFloat(value[1]) / 100; | |
1386 | return 1.0; | |
1387 | } | |
return value == 'auto' ? null : value; | ||
}, | ||
setStyle: function(element, style) { | ||
element = $(element); | ||
1040 | | |
1041 | | |
1393 | for (var name in style) { | |
1394 | var value = style[name]; | |
1395 | if(name == 'opacity') { | |
1396 | if (value == 1) { | |
1397 | value = (/Gecko/.test(navigator.userAgent) && | |
1398 | !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? 0.999999 : 1.0; | |
1399 | if(/MSIE/.test(navigator.userAgent) && !window.opera) | |
1400 | element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,''); | |
1401 | } else if(value == '') { | |
1402 | if(/MSIE/.test(navigator.userAgent) && !window.opera) | |
1403 | element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,''); | |
1404 | } else { | |
1405 | if(value < 0.00001) value = 0; | |
1406 | if(/MSIE/.test(navigator.userAgent) && !window.opera) | |
1407 | element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'') + | |
1408 | 'alpha(opacity='+value*100+')'; | |
1409 | } | |
1410 | } else if(['float','cssFloat'].include(name)) name = (typeof element.style.styleFloat != 'undefined') ? 'styleFloat' : 'cssFloat'; | |
1411 | element.style[name.camelize()] = value; | |
1412 | } | |
1413 | return element; | |
}, | ||
getDimensions: function(element) { | ||
element = $(element); | ||
1046 | | |
1418 | var display = $(element).getStyle('display'); | |
1419 | if (display != 'none' && display != null) // Safari bug | |
return {width: element.offsetWidth, height: element.offsetHeight}; | ||
// All *Width and *Height properties give 0 on elements with display none, | ||
... | ... | |
var els = element.style; | ||
var originalVisibility = els.visibility; | ||
var originalPosition = els.position; | ||
1427 | var originalDisplay = els.display; | |
els.visibility = 'hidden'; | ||
els.position = 'absolute'; | ||
1056 | | |
1430 | els.display = 'block'; | |
var originalWidth = element.clientWidth; | ||
var originalHeight = element.clientHeight; | ||
1059 | | |
1433 | els.display = originalDisplay; | |
els.position = originalPosition; | ||
els.visibility = originalVisibility; | ||
return {width: originalWidth, height: originalHeight}; | ||
... | ... | |
element.style.left = 0; | ||
} | ||
} | ||
1452 | return element; | |
}, | ||
undoPositioned: function(element) { | ||
... | ... | |
element.style.bottom = | ||
element.style.right = ''; | ||
} | ||
1465 | return element; | |
}, | ||
makeClipping: function(element) { | ||
element = $(element); | ||
1094 | | |
1095 | | |
1470 | if (element._overflow) return element; | |
1471 | element._overflow = element.style.overflow || 'auto'; | |
if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden') | ||
element.style.overflow = 'hidden'; | ||
1474 | return element; | |
}, | ||
undoClipping: function(element) { | ||
element = $(element); | ||
1102 | | |
1103 | | |
1104 | | |
1479 | if (!element._overflow) return element; | |
1480 | element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; | |
1481 | element._overflow = null; | |
1482 | return element; | |
} | ||
1106 | ||
1484 | }; | |
1486 | Object.extend(Element.Methods, {childOf: Element.Methods.descendantOf}); | |
1487 | ||
1488 | Element._attributeTranslations = {}; | |
1489 | ||
1490 | Element._attributeTranslations.names = { | |
1491 | colspan: "colSpan", | |
1492 | rowspan: "rowSpan", | |
1493 | valign: "vAlign", | |
1494 | datetime: "dateTime", | |
1495 | accesskey: "accessKey", | |
1496 | tabindex: "tabIndex", | |
1497 | enctype: "encType", | |
1498 | maxlength: "maxLength", | |
1499 | readonly: "readOnly", | |
1500 | longdesc: "longDesc" | |
1501 | }; | |
1502 | ||
1503 | Element._attributeTranslations.values = { | |
1504 | _getAttr: function(element, attribute) { | |
1505 | return element.getAttribute(attribute, 2); | |
1506 | }, | |
1507 | ||
1508 | _flag: function(element, attribute) { | |
1509 | return $(element).hasAttribute(attribute) ? attribute : null; | |
1510 | }, | |
1511 | ||
1512 | style: function(element) { | |
1513 | return element.style.cssText.toLowerCase(); | |
1514 | }, | |
1515 | ||
1516 | title: function(element) { | |
1517 | var node = element.getAttributeNode('title'); | |
1518 | return node.specified ? node.nodeValue : null; | |
1519 | } | |
1520 | }; | |
1521 | ||
1522 | Object.extend(Element._attributeTranslations.values, { | |
1523 | href: Element._attributeTranslations.values._getAttr, | |
1524 | src: Element._attributeTranslations.values._getAttr, | |
1525 | disabled: Element._attributeTranslations.values._flag, | |
1526 | checked: Element._attributeTranslations.values._flag, | |
1527 | readonly: Element._attributeTranslations.values._flag, | |
1528 | multiple: Element._attributeTranslations.values._flag | |
1529 | }); | |
1530 | ||
1531 | Element.Methods.Simulated = { | |
1532 | hasAttribute: function(element, attribute) { | |
1533 | var t = Element._attributeTranslations; | |
1534 | attribute = t.names[attribute] || attribute; | |
1535 | return $(element).getAttributeNode(attribute).specified; | |
1536 | } | |
1537 | }; | |
1538 | ||
1539 | // IE is missing .innerHTML support for TABLE-related elements | |
1540 | if (document.all && !window.opera){ | |
1541 | Element.Methods.update = function(element, html) { | |
1542 | element = $(element); | |
1543 | html = typeof html == 'undefined' ? '' : html.toString(); | |
1544 | var tagName = element.tagName.toUpperCase(); | |
1545 | if (['THEAD','TBODY','TR','TD'].include(tagName)) { | |
1546 | var div = document.createElement('div'); | |
1547 | switch (tagName) { | |
1548 | case 'THEAD': | |
1549 | case 'TBODY': | |
1550 | div.innerHTML = '<table><tbody>' + html.stripScripts() + '</tbody></table>'; | |
1551 | depth = 2; | |
1552 | break; | |
1553 | case 'TR': | |
1554 | div.innerHTML = '<table><tbody><tr>' + html.stripScripts() + '</tr></tbody></table>'; | |
1555 | depth = 3; | |
1556 | break; | |
1557 | case 'TD': | |
1558 | div.innerHTML = '<table><tbody><tr><td>' + html.stripScripts() + '</td></tr></tbody></table>'; | |
1559 | depth = 4; | |
1560 | } | |
1561 | $A(element.childNodes).each(function(node){ | |
1562 | element.removeChild(node) | |
1563 | }); | |
1564 | depth.times(function(){ div = div.firstChild }); | |
1565 | ||
1566 | $A(div.childNodes).each( | |
1567 | function(node){ element.appendChild(node) }); | |
1568 | } else { | |
1569 | element.innerHTML = html.stripScripts(); | |
1570 | } | |
1571 | setTimeout(function() {html.evalScripts()}, 10); | |
1572 | return element; | |
1573 | } | |
1574 | }; | |
1575 | ||
Object.extend(Element, Element.Methods); | ||
var _nativeExtensions = false; | ||
1112 | ||
1113 | | |
1114 | | |
1115 | ||
1580 | if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)) | |
1581 | ['', 'Form', 'Input', 'TextArea', 'Select'].each(function(tag) { | |
1582 | var className = 'HTML' + tag + 'Element'; | |
1583 | if(window[className]) return; | |
1584 | var klass = window[className] = {}; | |
1585 | klass.prototype = document.createElement(tag ? tag.toLowerCase() : 'div').__proto__; | |
1586 | }); | |
Element.addMethods = function(methods) { | ||
Object.extend(Element.Methods, methods || {}); | ||
1120 | | |
1121 | | |
1122 | | |
1591 | function copy(methods, destination, onlyIfAbsent) { | |
1592 | onlyIfAbsent = onlyIfAbsent || false; | |
1593 | var cache = Element.extend.cache; | |
1594 | for (var property in methods) { | |
var value = methods[property]; | ||
1124 | | |
1125 | | |
1596 | if (!onlyIfAbsent || !(property in destination)) | |
1597 | destination[property] = cache.findOrStore(value); | |
} | ||
1599 | } | |
1600 | ||
1601 | if (typeof HTMLElement != 'undefined') { | |
1602 | copy(Element.Methods, HTMLElement.prototype); | |
1603 | copy(Element.Methods.Simulated, HTMLElement.prototype, true); | |
1604 | copy(Form.Methods, HTMLFormElement.prototype); | |
1605 | [HTMLInputElement, HTMLTextAreaElement, HTMLSelectElement].each(function(klass) { | |
1606 | copy(Form.Element.Methods, klass.prototype); | |
1607 | }); | |
_nativeExtensions = true; | ||
} | ||
} | ||
1131 | ||
1132 | ||
var Toggle = new Object(); | ||
Toggle.display = Element.toggle; | ||
... | ... | |
try { | ||
this.element.insertAdjacentHTML(this.adjacency, this.content); | ||
} catch (e) { | ||
1151 | | |
1152 | | |
1630 | var tagName = this.element.tagName.toUpperCase(); | |
1631 | if (['TBODY', 'TR'].include(tagName)) { | |
this.insertContent(this.contentFromAnonymousTable()); | ||
} else { | ||
throw e; | ||
... | ... | |
add: function(classNameToAdd) { | ||
if (this.include(classNameToAdd)) return; | ||
1251 | | |
1730 | this.set($A(this).concat(classNameToAdd).join(' ')); | |
}, | ||
remove: function(classNameToRemove) { | ||
if (!this.include(classNameToRemove)) return; | ||
1256 | | |
1257 | | |
1258 | | |
1735 | this.set($A(this).without(classNameToRemove).join(' ')); | |
}, | ||
toString: function() { | ||
1262 | | |
1739 | return $A(this).join(' '); | |
} | ||
1264 | ||
1741 | }; | |
Object.extend(Element.ClassNames.prototype, Enumerable); | ||
var Selector = Class.create(); | ||
... | ... | |
if (params.wildcard) | ||
conditions.push('true'); | ||
if (clause = params.id) | ||
1311 | | |
1788 | conditions.push('element.readAttribute("id") == ' + clause.inspect()); | |
if (clause = params.tagName) | ||
conditions.push('element.tagName.toUpperCase() == ' + clause.inspect()); | ||
if ((clause = params.classNames).length > 0) | ||
1315 | | |
1316 | | |
1792 | for (var i = 0, length = clause.length; i < length; i++) | |
1793 | conditions.push('element.hasClassName(' + clause[i].inspect() + ')'); | |
if (clause = params.attributes) { | ||
clause.each(function(attribute) { | ||
1319 | | |
1796 | var value = 'element.readAttribute(' + attribute.name.inspect() + ')'; | |
var splitValueBy = function(delimiter) { | ||
return value + ' && ' + value + '.split(' + delimiter.inspect() + ')'; | ||
} | ||
... | ... | |
); break; | ||
case '!=': conditions.push(value + ' != ' + attribute.value.inspect()); break; | ||
case '': | ||
1332 | | |
1809 | case undefined: conditions.push('element.hasAttribute(' + attribute.name.inspect() + ')'); break; | |
default: throw 'Unknown operator ' + attribute.operator + ' in selector'; | ||
} | ||
}); | ||
... | ... | |
compileMatcher: function() { | ||
this.match = new Function('element', 'if (!element.tagName) return false; \ | ||
1820 | element = $(element); \ | |
return ' + this.buildMatchExpression()); | ||
}, | ||
... | ... | |
scope = (scope || document).getElementsByTagName(this.params.tagName || '*'); | ||
var results = []; | ||
1357 | | |
1835 | for (var i = 0, length = scope.length; i < length; i++) | |
if (this.match(element = scope[i])) | ||
results.push(Element.extend(element)); | ||
... | ... | |
} | ||
} | ||
1369 | ||
1370 | | |
1371 | | |
1372 | | |
1373 | | |
1374 | | |
1375 | | |
1376 | ||
1377 | ||
1378 | | |
1379 | | |
1380 | | |
1847 | Object.extend(Selector, { | |
1848 | matchElements: function(elements, expression) { | |
1849 | var selector = new Selector(expression); | |
1850 | return elements.select(selector.match.bind(selector)).map(Element.extend); | |
}, | ||
1383 | | |
1384 | | |
1853 | findElement: function(elements, expression, index) { | |
1854 | if (typeof expression == 'number') index = expression, expression = false; | |
1855 | return Selector.matchElements(elements, expression || '*')[index || 0]; | |
}, | ||
1387 | | |
1388 | | |
1389 | | |
1390 | | |
1391 | | |
1858 | findChildElements: function(element, expressions) { | |
1859 | return expressions.map(function(expression) { | |
1860 | return expression.match(/[^\s"]+(?:"[^"]*"[^\s"]+)*/g).inject([null], function(results, expr) { | |
1861 | var selector = new Selector(expr); | |
1862 | return results.inject([], function(elements, result) { | |
1863 | return elements.concat(selector.findElements(result || element)); | |
1864 | }); | |
1865 | }); | |
1866 | }).flatten(); | |
1867 | } | |
1868 | }); | |
1393 | | |
1394 | | |
1870 | function $$() { | |
1871 | return Selector.findChildElements(document, $A(arguments)); | |
1872 | } | |
1873 | var Form = { | |
1874 | reset: function(form) { | |
1875 | $(form).reset(); | |
1876 | return form; | |
}, | ||
1397 | | |
1398 | | |
1399 | | |
1400 | | |
1401 | | |
1879 | serializeElements: function(elements, getHash) { | |
1880 | var data = elements.inject({}, function(result, element) { | |
1881 | if (!element.disabled && element.name) { | |
1882 | var key = element.name, value = $(element).getValue(); | |
1883 | if (value != undefined) { | |
1884 | if (result[key]) { | |
1885 | if (result[key].constructor != Array) result[key] = [result[key]]; | |
1886 | result[key].push(value); | |
1887 | } | |
1888 | else result[key] = value; | |
1889 | } | |
1890 | } | |
1891 | return result; | |
1892 | }); | |
1893 | ||
1894 | return getHash ? data : Hash.toQueryString(data); | |
} | ||
1403 | ||
1896 | }; | |
1405 | ||
1406 | ||
1407 | ||
1408 | | |
1409 | | |
1410 | | |
1411 | ||
1412 | | |
1413 | | |
1414 | | |
1415 | | |
1416 | | |
1417 | ||
1418 | | |
1898 | Form.Methods = { | |
1899 | serialize: function(form, getHash) { | |
1900 | return Form.serializeElements(Form.getElements(form), getHash); | |
}, | ||
getElements: function(form) { | ||
1422 | | |
1423 | | |
1424 | ||
1425 | | |
1426 | | |
1427 | | |
1428 | | |
1429 | | |
1430 | | |
1904 | return $A($(form).getElementsByTagName('*')).inject([], | |
1905 | function(elements, child) { | |
1906 | if (Form.Element.Serializers[child.tagName.toLowerCase()]) | |
1907 | elements.push(Element.extend(child)); | |
1908 | return elements; | |
1909 | } | |
1910 | ); | |
}, | ||
getInputs: function(form, typeName, name) { | ||
form = $(form); | ||
var inputs = form.getElementsByTagName('input'); | ||
1437 | | |
1438 | | |
1917 | if (!typeName && !name) return $A(inputs).map(Element.extend); | |
1440 | | |
1441 | | |
1919 | for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { | |
var input = inputs[i]; | ||
1443 | | |
1444 | | |
1921 | if ((typeName && input.type != typeName) || (name && input.name != name)) | |
continue; | ||
1446 | | |
1923 | matchingInputs.push(Element.extend(input)); | |
} | ||
return matchingInputs; | ||
}, | ||
disable: function(form) { | ||
1453 | | |
1454 | | |
1455 | | |
1930 | form = $(form); | |
1931 | form.getElements().each(function(element) { | |
element.blur(); | ||
element.disabled = 'true'; | ||
1458 | | |
1934 | }); | |
1935 | return form; | |
}, | ||
enable: function(form) { | ||
1462 | | |
1463 | | |
1464 | | |
1939 | form = $(form); | |
1940 | form.getElements().each(function(element) { | |
element.disabled = ''; | ||
1466 | | |
1942 | }); | |
1943 | return form; | |
}, | ||
findFirstElement: function(form) { | ||
1470 | | |
1947 | return $(form).getElements().find(function(element) { | |
return element.type != 'hidden' && !element.disabled && | ||
['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); | ||
}); | ||
}, | ||
focusFirstElement: function(form) { | ||
1477 | | |
1954 | form = $(form); | |
1955 | form.findFirstElement().activate(); | |
1956 | return form; | |
1957 | } | |
1958 | } | |
1959 | ||
1960 | Object.extend(Form, Form.Methods); | |
1961 | ||
1962 | /*--------------------------------------------------------------------------*/ | |
1963 | ||
1964 | Form.Element = { | |
1965 | focus: function(element) { | |
1966 | $(element).focus(); | |
1967 | return element; | |
}, | ||
1480 | | |
1481 | | |
1970 | select: function(element) { | |
1971 | $(element).select(); | |
1972 | return element; | |
} | ||
} | ||
1485 | ||
1976 | Form.Element.Methods = { | |
serialize: function(element) { | ||
element = $(element); | ||
1979 | if (!element.disabled && element.name) { | |
1980 | var value = element.getValue(); | |
1981 | if (value != undefined) { | |
1982 | var pair = {}; | |
1983 | pair[element.name] = value; | |
1984 | return Hash.toQueryString(pair); | |
1985 | } | |
1986 | } | |
1987 | return ''; | |
1988 | }, | |
1989 | ||
1990 | getValue: function(element) { | |
1991 | element = $(element); | |
var method = element.tagName.toLowerCase(); | ||
1489 | | |
1993 | return Form.Element.Serializers[method](element); | |
1994 | }, | |
1491 | | |
1492 | | |
1493 | | |
1996 | clear: function(element) { | |
1997 | $(element).value = ''; | |
1998 | return element; | |
1999 | }, | |
1495 | | |
1496 | | |
2001 | present: function(element) { | |
2002 | return $(element).value != ''; | |
2003 | }, | |
1498 | | |
1499 | | |
1500 | | |
1501 | | |
2005 | activate: function(element) { | |
2006 | element = $(element); | |
2007 | element.focus(); | |
2008 | if (element.select && ( element.tagName.toLowerCase() != 'input' || | |
2009 | !['button', 'reset', 'submit'].include(element.type) ) ) | |
2010 | element.select(); | |
2011 | return element; | |
}, | ||
1504 | | |
2014 | disable: function(element) { | |
element = $(element); | ||
1506 | | |
1507 | | |
2016 | element.disabled = true; | |
2017 | return element; | |
2018 | }, | |
1509 | | |
1510 | | |
2020 | enable: function(element) { | |
2021 | element = $(element); | |
2022 | element.blur(); | |
2023 | element.disabled = false; | |
2024 | return element; | |
} | ||
} | ||
2028 | Object.extend(Form.Element, Form.Element.Methods); | |
2029 | var Field = Form.Element; | |
2030 | var $F = Form.Element.getValue; | |
2031 | ||
2032 | /*--------------------------------------------------------------------------*/ | |
2033 | ||
Form.Element.Serializers = { | ||
input: function(element) { | ||
switch (element.type.toLowerCase()) { | ||
1517 | | |
1518 | | |
1519 | | |
1520 | | |
1521 | | |
case 'checkbox': | ||
case 'radio': | ||
return Form.Element.Serializers.inputSelector(element); | ||
2040 | default: | |
2041 | return Form.Element.Serializers.textarea(element); | |
} | ||
1526 | | |
}, | ||
inputSelector: function(element) { | ||
1530 | | |
1531 | | |
2046 | return element.checked ? element.value : null; | |
}, | ||
textarea: function(element) { | ||
1535 | | |
2050 | return element.value; | |
}, | ||
select: function(element) { | ||
1539 | | |
2054 | return this[element.type == 'select-one' ? | |
'selectOne' : 'selectMany'](element); | ||
}, | ||
selectOne: function(element) { | ||
1544 | | |
1545 | | |
1546 | | |
1547 | | |
1548 | | |
1549 | | |
2059 | var index = element.selectedIndex; | |
2060 | return index >= 0 ? this.optionValue(element.options[index]) : null; | |
}, | ||
selectMany: function(element) { | ||
1553 | | |
1554 | | |
2064 | var values, length = element.length; | |
2065 | if (!length) return null; | |
2066 | ||
2067 | for (var i = 0, values = []; i < length; i++) { | |
var opt = element.options[i]; | ||
1556 | | |
1557 | | |
2069 | if (opt.selected) values.push(this.optionValue(opt)); | |
} | ||
1559 | | |
2071 | return values; | |
2072 | }, | |
2073 | ||
2074 | optionValue: function(opt) { | |
2075 | // extend element because hasAttribute may not be native | |
2076 | return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; | |
} | ||
} | ||
/*--------------------------------------------------------------------------*/ | ||
1565 | ||
1566 | ||
1567 | ||
1568 | ||
Abstract.TimedObserver = function() {} | ||
Abstract.TimedObserver.prototype = { | ||
initialize: function(element, frequency, callback) { | ||
... | ... | |
onTimerEvent: function() { | ||
var value = this.getValue(); | ||
1586 | | |
2099 | var changed = ('string' == typeof this.lastValue && 'string' == typeof value | |
2100 | ? this.lastValue != value : String(this.lastValue) != String(value)); | |
2101 | if (changed) { | |
this.callback(this.element, value); | ||
this.lastValue = value; | ||
} | ||
... | ... | |
}, | ||
registerFormCallbacks: function() { | ||
1631 | | |
1632 | | |
1633 | | |
2146 | Form.getElements(this.element).each(this.registerCallback.bind(this)); | |
}, | ||
registerCallback: function(element) { | ||
... | ... | |
case 'radio': | ||
Event.observe(element, 'click', this.onElementEvent.bind(this)); | ||
break; | ||
1643 | | |
1644 | | |
1645 | | |
1646 | | |
1647 | | |
2156 | default: | |
Event.observe(element, 'change', this.onElementEvent.bind(this)); | ||
break; | ||
} | ||
... | ... | |
KEY_RIGHT: 39, | ||
KEY_DOWN: 40, | ||
KEY_DELETE: 46, | ||
2191 | KEY_HOME: 36, | |
2192 | KEY_END: 35, | |
2193 | KEY_PAGEUP: 33, | |
2194 | KEY_PAGEDOWN: 34, | |
element: function(event) { | ||
return event.target || event.srcElement; | ||
... | ... | |
unloadCache: function() { | ||
if (!Event.observers) return; | ||
1737 | | |
2250 | for (var i = 0, length = Event.observers.length; i < length; i++) { | |
Event.stopObserving.apply(this, Event.observers[i]); | ||
Event.observers[i][0] = null; | ||
} | ||
... | ... | |
}, | ||
observe: function(element, name, observer, useCapture) { | ||
1745 | | |
2258 | element = $(element); | |
useCapture = useCapture || false; | ||
if (name == 'keypress' && | ||
... | ... | |
|| element.attachEvent)) | ||
name = 'keydown'; | ||
1753 | | |
2266 | Event._observeAndCache(element, name, observer, useCapture); | |
}, | ||
stopObserving: function(element, name, observer, useCapture) { | ||
1757 | | |
2270 | element = $(element); | |
useCapture = useCapture || false; | ||
if (name == 'keypress' && | ||
... | ... | |
if (element.removeEventListener) { | ||
element.removeEventListener(name, observer, useCapture); | ||
} else if (element.detachEvent) { | ||
1768 | | |
2281 | try { | |
2282 | element.detachEvent('on' + name, observer); | |
2283 | } catch (e) {} | |
} | ||
} | ||
}); | ||
... | ... | |
valueL += element.offsetLeft || 0; | ||
element = element.offsetParent; | ||
if (element) { | ||
1822 | | |
2337 | if(element.tagName=='BODY') break; | |
2338 | var p = Element.getStyle(element, 'position'); | |
if (p == 'relative' || p == 'absolute') break; | ||
} | ||
} while (element); | ||
... | ... | |
element.offsetWidth; | ||
}, | ||
1878 | | |
1879 | | |
1880 | | |
1881 | | |
1882 | | |
1883 | | |
1884 | | |
1885 | | |
1886 | | |
1887 | | |
1888 | ||
page: function(forElement) { | ||
var valueT = 0, valueL = 0; | ||
... | ... | |
element = forElement; | ||
do { | ||
1905 | | |
1906 | | |
2410 | if (!window.opera || element.tagName=='BODY') { | |
2411 | valueT -= element.scrollTop || 0; | |
2412 | valueL -= element.scrollLeft || 0; | |
2413 | } | |
} while (element = element.parentNode); | ||
return [valueL, valueT]; | ||
... | ... | |
element._originalHeight = element.style.height; | ||
element.style.position = 'absolute'; | ||
1967 | | |
1968 | | |
1969 | | |
1970 | | |
2474 | element.style.top = top + 'px'; | |
2475 | element.style.left = left + 'px'; | |
2476 | element.style.width = width + 'px'; | |
2477 | element.style.height = height + 'px'; | |
}, | ||
relativize: function(element) { | ||
... | ... | |
return [valueL, valueT]; | ||
} | ||
2006 | ||
2514 | } | |
2515 | ||
2516 | Element.addMethods(); | |
rool/rails/typo/trunk/public/javascripts/typo.js:
prev. | current | |
Element.cleanWhitespace('commentList'); | ||
new Effect.BlindDown($('commentList').lastChild); | ||
if ($('dummy_comment')) { Element.remove('dummy_comment'); } | ||
48 | | |
49 | | |
48 | $('commentform').elements["comment_body"].value = ''; | |
49 | $('commentform').elements["comment_body"].focus(); | |
} | ||
function failure(request) { | ||
... | ... | |
{ | ||
if (! window.focus) return true; | ||
var href; | ||
75 | | |
75 | window.open(mylink, windowname, 'width=400,height=500,scrollbars=yes'); | |
return false; | ||
} | ||
... | ... | |
register_onload(function() { | ||
if ($('commentform')) { | ||
91 | var _author = getCookie('typoapp_author'); | |
var _url = getCookie('typoapp_url'); | ||
92 | | |
94 | if(_author != null) { $('commentform').elements['comment[author]'].value = _author } | |
if(_url != null) { $('commentform').elements['comment[url]'].value = _url } | ||
95 | | |
if ($('commentform').elements['comment[url]'].value != '' | ||
|| $('commentform').elements['comment[email]'].value != '') { |
rool/rails/typo/trunk/public/stylesheets/administration.css:
prev. | current | |
1 | ||
2 | | |
3 | | |
1 | /* @group General/Master Containers */ | |
5 | | |
3 | body { | |
margin: 0; | ||
font: 1em/1.6em Verdana, Helvetica, Arial, sans-serif; | ||
text-align: center; | ||
color: #000; | ||
10 | | |
8 | } | |
12 | ||
13 | | |
10 | #container { | |
text-align: left; | ||
font-size: 70%; | ||
margin: 0 auto; | ||
17 | | |
14 | } | |
19 | | |
16 | #header { | |
height: 92px; | ||
color: #fff; | ||
22 | | |
19 | } | |
24 | | |
21 | #overall { | |
background: #fff; | ||
width: 85%; | ||
margin: 0 auto; | ||
28 | | |
25 | } | |
30 | | |
27 | #content { | |
background: #fff; | ||
margin: 5px 0 0 0; | ||
padding: 10px; | ||
34 | | |
31 | } | |
36 | | |
33 | #main { | |
padding-left: 10px; | ||
38 | | |
35 | } | |
#info { | ||
float: right; | ||
margin-right: 20px; | ||
margin-top: 5px; | ||
font-size: 80%; | ||
45 | | |
42 | } | |
47 | | |
44 | #footer { | |
margin-top: 7px; | ||
height: 35px; | ||
text-align: center; | ||
51 | | |
48 | } | |
53 | ||
54 | | |
55 | | |
50 | /* @end */ | |
57 | | |
52 | /* @group Utility */ | |
53 | ||
54 | form { | |
margin: 0; | ||
padding: 0; | ||
60 | | |
57 | } | |
62 | | |
59 | img { | |
60 | border: none; | |
61 | } | |
64 | | |
65 | | |
66 | | |
67 | | |
63 | a { | |
64 | color: #8D805D; | |
65 | text-decoration: none; | |
66 | } | |
69 | | |
70 | | |
71 | | |
68 | a:hover { | |
69 | color: #333; | |
70 | } | |
73 | | |
74 | | |
75 | | |
76 | | |
77 | ||
78 | | |
79 | | |
72 | hr { | |
73 | border: none; | |
74 | border-bottom: 1px solid #7D8692; | |
75 | } | |
77 | /* @end */ | |
82 | | |
83 | | |
84 | | |
85 | | |
86 | | |
87 | | |
88 | | |
89 | | |
90 | | |
79 | /* @group Primary Navigation */ | |
92 | | |
93 | | |
94 | | |
95 | | |
96 | | |
97 | | |
98 | | |
81 | #tabs-container { | |
82 | height: 20px; | |
83 | width: auto; | |
84 | padding: 14px 0 0 100px; | |
85 | margin-top: -40px; | |
86 | border-bottom: 1px solid #637987; | |
87 | background: #F8F7EF; | |
88 | } | |
100 | | |
101 | | |
102 | | |
103 | | |
104 | | |
105 | | |
90 | #tabs { | |
91 | padding: 0; | |
92 | margin: 0 0 0 40px; | |
93 | font: normal 100% Georgia, Garamond, Times; | |
94 | line-height: normal; | |
95 | text-transform: uppercase; | |
96 | } | |
107 | | |
108 | | |
109 | | |
110 | | |
111 | | |
112 | | |
113 | | |
114 | | |
98 | #tabs li { | |
99 | list-style: none; | |
100 | margin: 0; | |
101 | padding: 0; | |
102 | display: inline; | |
103 | } | |
116 | | |
117 | | |
118 | | |
119 | | |
105 | #tabs li a { | |
106 | padding: 3px 8px 3px 8px; | |
107 | margin-left: 3px; | |
108 | background: #F8F7EF; | |
109 | text-decoration: none; | |
110 | color: #003; | |
111 | line-height: normal; | |
112 | } | |
121 | | |
122 | | |
123 | | |
124 | | |
125 | | |
114 | #tabs li a:hover { | |
115 | color: #993300; | |
116 | border-top: 12px solid #E8E4D3; | |
117 | } | |
127 | | |
128 | | |
129 | | |
130 | | |
131 | | |
119 | #tabs li a.active { | |
120 | color: #993300; | |
121 | border-top: 12px solid #E8E4D3; | |
122 | background: #F8F7EF; | |
123 | } | |
125 | #tabs li a.active:hover { | |
126 | color: #777; | |
127 | background: #fff; | |
128 | border-color: #637987; | |
129 | } | |
134 | ||
135 | | |
136 | | |
131 | /* @end */ | |
133 | /* @group Tasks Links */ | |
134 | ||
.tasks { | ||
background: #F8F7EF; | ||
border-top: 1px dotted #C2C0BB; | ||
border-bottom: 1px dotted #C2C0BB; | ||
padding: 5px; | ||
margin-bottom: 15px; | ||
144 | | |
141 | } | |
.tasks ul { | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
150 | | |
147 | } | |
.tasks ul li { | ||
display: inline; | ||
line-height: normal; | ||
155 | | |
152 | } | |
.tasks li a { | ||
display: block; | ||
... | ... | |
padding: 2px 5px; | ||
margin-right: 5px; | ||
text-decoration: none; | ||
163 | | |
160 | } | |
.tasks li a:hover { | ||
background: #637987; | ||
color: #fff; | ||
168 | | |
165 | } | |
167 | /* @end */ | |
171 | ||
172 | | |
173 | | |
169 | /* @group Headings */ | |
175 | | |
176 | | |
177 | | |
178 | | |
179 | | |
171 | h2 { | |
172 | font: normal 170% Georgia, Times, Helvetica; | |
173 | color: #930; | |
174 | padding: 5px 0 0 5px; | |
175 | } | |
181 | | |
182 | | |
183 | | |
184 | | |
185 | | |
177 | h3 { | |
178 | font-size: 130%; | |
179 | padding: 5px; | |
180 | margin-bottom: 0; | |
181 | } | |
187 | | |
188 | | |
189 | | |
190 | | |
191 | | |
192 | | |
193 | | |
194 | | |
195 | | |
196 | | |
183 | #header h1 { | |
184 | background: #EDEBD5; | |
185 | margin: 0; | |
186 | padding: 14px 0 12px 100px; | |
187 | border-bottom: 1px dashed #A9A585; | |
188 | border-top: 4px solid #4A4902; | |
189 | font: normal 200% Georgia, Garamond, Times; | |
190 | text-transform: uppercase; | |
191 | letter-spacing: 0.08em; | |
192 | } | |
198 | | |
199 | | |
200 | | |
201 | | |
202 | | |
203 | | |
194 | #header h1 a { | |
195 | color: #000; | |
196 | margin: 10px 0 10px 0; | |
197 | text-decoration: none; | |
198 | border: none; | |
199 | } | |
205 | | |
206 | | |
207 | | |
208 | | |
209 | | |
201 | .form h3, h3 { | |
202 | background: #333; | |
203 | color: #fff; | |
204 | font-weight: normal; | |
205 | } | |
211 | | |
212 | | |
213 | | |
214 | | |
215 | | |
207 | .form h4 { | |
208 | padding: 2px; | |
209 | margin: 0; | |
210 | font-size: 120%; | |
211 | } | |
217 | | |
218 | | |
219 | | |
220 | | |
221 | | |
222 | | |
223 | | |
213 | .tasks h3 { | |
214 | font: normal 120%/normal "Trebuchet MS", Arial, Verdana; | |
215 | background: transparent; | |
216 | margin: 0 0 5px 0; | |
217 | padding: 0; | |
218 | color: #4A611C; | |
219 | } | |
225 | | |
226 | | |
227 | | |
228 | | |
229 | | |
230 | ||
231 | | |
232 | | |
221 | .set h3 { | |
222 | background: none; | |
223 | margin: 0 0 5px 0; | |
224 | color: #1F273F; | |
225 | } | |
234 | | |
227 | /* @end */ | |
236 | | |
237 | | |
238 | | |
229 | /* @group Table Listings */ | |
240 | | |
241 | | |
242 | | |
243 | | |
244 | | |
231 | .operation { | |
232 | width: 25px; | |
233 | text-align: center; | |
234 | } | |
246 | | |
247 | | |
248 | | |
236 | .list { | |
237 | clear: left; | |
238 | } | |
250 | | |
251 | | |
252 | | |
240 | .list table { | |
241 | width: 98%; | |
242 | } | |
254 | ||
255 | | |
256 | | |
244 | .list table th { | |
245 | text-align: left; | |
246 | font-weight: bold; | |
247 | border-bottom: 4px solid #ccc; | |
248 | } | |
249 | ||
250 | .list table tr td { | |
251 | padding: 0 2px; | |
252 | } | |
253 | ||
254 | tr.shade { | |
255 | background: #E4E4D7; | |
256 | } | |
257 | ||
258 | /* @end */ | |
259 | ||
260 | /* @group Form Elements */ | |
261 | ||
label { | ||
font-weight: bold; | ||
259 | | |
264 | } | |
.form { | ||
border: 1px solid #C2C0BB; | ||
background: #F8F7EF; | ||
margin-bottom: 10px; | ||
padding: 0 0 0 10px; | ||
266 | | |
271 | } | |
.form div { | ||
padding: 5px; | ||
270 | | |
275 | } | |
.form input { | ||
273 | | |
274 | | |
275 | | |
278 | font-family: Georgia; | |
279 | font-size: 1em; | |
280 | letter-spacing: 0.02em; | |
} | ||
.form textarea { | ||
279 | | |
280 | | |
281 | | |
282 | | |
283 | | |
284 | | |
284 | width: 350px; | |
285 | font-family: Georgia; | |
286 | line-height: 1.1em; | |
287 | font-size: 1em; | |
288 | letter-spacing: 0.02em; | |
289 | word-spacing: 0.05em; | |
} | ||
#blog_name { | ||
font-size: 130%; | ||
} | ||
291 | ||
292 | | |
293 | | |
296 | /* @end */ | |
295 | | |
298 | /* @group Popups/Tooltips */ | |
299 | ||
300 | .tip-catlist { | |
width: 200px; | ||
background: #EEF1FE; | ||
border: 2px solid #C2D2E7; | ||
padding: 5px; | ||
300 | | |
305 | } | |
307 | /* @end */ | |
303 | ||
304 | | |
305 | | |
309 | /* @group Live Preview */ | |
#preview, #preview_extended { | ||
background: #fff; | ||
border: 1px dashed #ccc; | ||
310 | | |
311 | | |
314 | padding: 0 0 0 5px; | |
width: 50%; | ||
316 | height: 500px; | |
float: right; | ||
314 | | |
margin-bottom: 10px; | ||
line-height: 1.5em; | ||
letter-spacing: 0.02em; | ||
318 | | |
319 | | |
320 | | |
321 | word-spacing: 0.05em; | |
322 | font-size: 0.95em; | |
323 | } | |
322 | ||
323 | | |
324 | | |
325 | /* @end */ | |
327 | /* @group General Settings Screen */ | |
328 | ||
.set { | ||
background: #F8F7EF; | ||
328 | | |
padding: 0 10px 5px 10px; | ||
margin-bottom: 10px; | ||
position: relative; | ||
} | ||
#gensettings { | ||
337 | /* Nothing here */ | |
338 | } | |
340 | legend { | |
341 | font-size: 130%; | |
342 | text-transform: capitalize; | |
} | ||
338 | ||
339 | | |
340 | | |
345 | .admin ul { | |
346 | margin: 0; | |
347 | padding: 0; | |
348 | } | |
350 | .admin li { | |
351 | list-style: none; | |
352 | padding: 5px; | |
353 | margin: 0; | |
354 | clear: both; | |
355 | } | |
343 | | |
357 | .admin li p { | |
358 | line-height: 1.6em; | |
359 | } | |
360 | ||
361 | .admin li.checkbox { | |
362 | line-height: 1.4em; | |
363 | } | |
364 | ||
365 | .admin label.float { | |
366 | display: block; | |
367 | float: left; | |
368 | width: 200px; | |
369 | margin-left: 0; | |
370 | margin-right: 12px; | |
371 | padding: 0; | |
372 | text-align: right; | |
373 | } | |
374 | ||
375 | .admin label.block { | |
376 | display: block; | |
377 | } | |
378 | ||
379 | .admin input.float { | |
380 | width: auto; | |
381 | } | |
382 | ||
383 | .admin span.float { | |
384 | margin-left: 212px; | |
385 | padding: 0; | |
386 | display: block; | |
387 | clear: both; | |
388 | } | |
389 | ||
390 | .mandatory { | |
391 | color: #f00; | |
392 | } | |
393 | ||
394 | /* @end */ | |
395 | ||
396 | /* @group Sidebar */ | |
397 | ||
398 | #sidebar-config { | |
/* Safari Fix */ | ||
345 | | |
346 | | |
400 | border-top: 5px solid #fff; | |
401 | } | |
348 | | |
349 | | |
350 | | |
351 | | |
403 | #sidebar-config p { | |
404 | margin: 0; | |
405 | padding-left: 5px; | |
406 | } | |
353 | | |
354 | | |
355 | | |
356 | | |
408 | #available { | |
409 | float: left; | |
410 | width: 300px; | |
411 | } | |
358 | | |
359 | | |
360 | | |
361 | | |
413 | #active, #cnt-active { | |
414 | width: 300px; | |
415 | min-height: 200px; | |
416 | } | |
363 | | |
364 | | |
365 | | |
366 | | |
418 | #cnt-active { | |
419 | margin-left: 320px; | |
420 | background: #F8F7EF; | |
421 | } | |
368 | | |
369 | | |
370 | | |
371 | | |
423 | #available { | |
424 | background: #F8F7EF; | |
425 | padding-bottom: 10px; | |
426 | } | |
373 | | |
374 | | |
375 | | |
376 | | |
428 | #active { | |
429 | background: #F8F7EF; | |
430 | padding-bottom: 10px; | |
431 | } | |
378 | | |
379 | | |
380 | | |
381 | | |
382 | | |
383 | | |
433 | #available h3, #active h3, #cnt-active h3 { | |
434 | background: #E4E4D7; | |
435 | color: #333; | |
436 | margin: 0 0 10px 0; | |
437 | padding: 2px 5px; | |
438 | } | |
385 | | |
386 | | |
387 | | |
440 | .dropbox { | |
441 | width: 270px; | |
442 | } | |
389 | | |
390 | | |
391 | | |
392 | | |
393 | | |
394 | | |
395 | | |
444 | .handle { | |
445 | cursor: move; | |
446 | font-size: 130%; | |
447 | font-weight: normal; | |
448 | padding-left: 5px; | |
449 | margin: 0; | |
450 | } | |
397 | | |
398 | | |
399 | | |
452 | .dragitem, .dropitem { | |
453 | margin: 0 0 5px 12px; | |
454 | } | |
401 | | |
402 | | |
403 | | |
404 | | |
405 | | |
406 | | |
407 | | |
456 | .dragitem { | |
457 | border: 1px solid #9cabba; | |
458 | border-top: 1px solid #bacddf; | |
459 | border-left: 1px solid #bacddf; | |
460 | background: #fff; | |
461 | width: 270px; | |
462 | } | |
.handle { | ||
background: #f7f7f7; | ||
... | ... | |
} | ||
/* | ||
420 | | |
421 | | |
475 | ||
476 | @end */ | |
477 | ||
478 | /* @group Miscellaneous */ | |
479 | ||
.form p { | ||
margin: 0; | ||
padding: 0 0 5px; | ||
425 | | |
483 | } | |
#info { | ||
428 | | |
486 | color: #4A4902; | |
} | ||
#info a { | ||
color: #4A4902; | ||
433 | | |
491 | } | |
#info a:hover { | ||
border-bottom: 1px dotted #222; | ||
437 | | |
495 | } | |
.form p>small { | ||
color: gray; | ||
} | ||
443 | | |
501 | .form .note { | |
font-style: italic; | ||
font-size: 90%; | ||
446 | | |
504 | } | |
448 | ||
449 | ||
450 | ||
506 | .r { | |
507 | text-align: right; | |
508 | } | |
510 | .c { | |
511 | text-align: center; | |
512 | } | |
513 | ||
514 | .space { | |
515 | margin: 10px; | |
516 | } | |
517 | ||
.errorExplanation { | ||
background: #FFE6E6; | ||
color: #000; | ||
... | ... | |
.theme h3 { | ||
margin: 0; | ||
} | ||
488 | ||
489 | | |
490 | | |
555 | /* @end */ | |
556 | ||
557 | /* @group Users */ | |
558 | ||
div#users { | ||
background: #F8F7EF; | ||
margin-top: 10px; | ||
... | ... | |
margin: 0; | ||
padding: 5px; | ||
} | ||
527 | ||
528 | | |
529 | | |
595 | /* @end */ | |
596 | ||
597 | /* @group Misc Containers */ | |
598 | ||
#quick-post { | ||
background: #EDEBD5; | ||
padding: 10px; | ||
... | ... | |
} | ||
#quick-post input { | ||
540 | | |
541 | | |
542 | | |
608 | font-family: Georgia; | |
609 | font-size: 13px; | |
610 | letter-spacing: 0.02em; | |
} | ||
#quick-post textarea { | ||
546 | | |
547 | | |
548 | | |
549 | | |
550 | | |
551 | | |
614 | width: 350px; | |
615 | font-family: Georgia; | |
616 | line-height: 14px; | |
617 | font-size: 12px; | |
618 | letter-spacing: 0.02em; | |
619 | word-spacing: 0.05em; | |
} | ||
#quick-navigate { | ||
... | ... | |
border-top: none; | ||
} | ||
562 | ||
630 | #advanced { | |
631 | line-height: 1.3em; | |
632 | } | |
#advanced label { | ||
clear: left; | ||
... | ... | |
#loginform { | ||
width: 300px; | ||
572 | | |
573 | | |
642 | margin-left: auto; | |
643 | margin-right: auto; | |
padding: 100px; | ||
} | ||
#loginform input { | ||
578 | | |
648 | margin-bottom: 10px; | |
} | ||
#loginform div.form { | ||
582 | | |
652 | padding: 10px; | |
} | ||
#loginform .fieldWithErrors { | ||
... | ... | |
} | ||
#flash .notice { | ||
598 | | |
599 | | |
600 | | |
601 | | |
602 | | |
668 | font-size: 11px; | |
669 | color: #fff; | |
670 | background: #637987; | |
671 | border-top: 1px solid #336699; | |
672 | border-bottom: 1px solid #336699; | |
} | ||
#flash .error { | ||
606 | | |
607 | | |
608 | | |
676 | background: #e99; | |
677 | border-top: 1px solid #822; | |
678 | border-bottom: 1px solid #822; | |
} | ||
#category_list { | ||
... | ... | |
border-bottom: 1px dotted #ccc; | ||
} | ||
624 | ||
625 | | |
626 | | |
694 | /* @end */ | |
696 | /* @group Feedback */ | |
697 | ||
.feedbackbody td { | ||
border-bottom: 1px dotted #ccc; | ||
} | ||
701 | ||
702 | .presumed_ham td { | |
703 | border-bottom: 1px dotted #ccc; | |
704 | } | |
705 | ||
706 | .presumed_spam td { | |
707 | border-bottom: 1px dotted #ccc; | |
708 | } | |
709 | ||
710 | .ham td { | |
711 | border-bottom: 1px dotted #ccc; | |
712 | } | |
713 | ||
714 | .spam td { | |
715 | border-bottom: 1px dotted #ccc; | |
716 | } | |
717 | ||
718 | .spam .state { | |
719 | font-weight: bold | |
720 | } | |
721 | ||
722 | /* @end */ | |
rool/rails/typo/trunk/test/fixtures/blogs.yml:
prev. | current | |
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | ||
default: | ||
id: 1 | ||
4 | base_url: http://myblog.net | |
settings: | ||
jabber_password: "" | ||
show_extended_on_rss: true | ||
itunes_owner: "" | ||
blog_name: test blog | ||
10 | title_prefix: 1 | |
limit_article_display: 10 | ||
sp_url_limit: 3 | ||
use_gravatar: false | ||
... | ... | |
sp_article_auto_close: 300 | ||
link_to_author: false | ||
itunes_summary: "" | ||
35 | | |
37 | comment_text_filter: markdown | |
sp_allow_non_ajax_comments: true | ||
37 | | |
second: | ||
id: 2 | ||
42 | base_url: http://otherblog.net | |
settings: | ||
jabber_password: "" | ||
show_extended_on_rss: true | ||
itunes_owner: "" | ||
blog_name: second test blog | ||
48 | title_prefix: 0 | |
limit_article_display: 10 | ||
sp_url_limit: 0 | ||
use_gravatar: false |
rool/rails/typo/trunk/test/fixtures/contents.yml:
prev. | current | |
article1: | ||
blog_id: 1 | ||
5 | | |
5 | id: 1 | |
title: Article 1! | ||
body: body | ||
8 | | |
extended: extended content | ||
10 | | |
created_at: <%= (Time.now - 2.days).strftime("%Y-%m-%d") %> | ||
updated_at: <%= (Time.now - 2.days).strftime("%Y-%m-%d") %> | ||
published_at: <%= (Time.now - 2.days).strftime("%Y-%m-%d") %> | ||
... | ... | |
type: Article | ||
published: true | ||
state: ContentState::Published | ||
23 | | |
21 | ||
article2: | ||
type: Article | ||
blog_id: 1 | ||
id: 2 | ||
title: Article 2! | ||
body: body | ||
30 | | |
extended: extended content | ||
32 | | |
created_at: <%= (Time.now - 1.days).strftime("%Y-%m-%d") %> | ||
updated_at: <%= (Time.now - 1.days).strftime("%Y-%m-%d") %> | ||
published_at: <%= (Time.now - 1.days).strftime("%Y-%m-%d") %> | ||
... | ... | |
id: 3 | ||
title: Article 3! | ||
body: body | ||
52 | | |
extended: extended content | ||
54 | | |
created_at: 2004-06-01 20:00:02 | ||
updated_at: 2004-06-01 20:00:02 | ||
published_at: 2004-06-01 20:00:02 | ||
... | ... | |
id: 4 | ||
title: Article 4! | ||
body: I'm not "public":http://www.example.com/public! | ||
73 | | |
published: false | ||
state: ContentState::Draft | ||
created_at: 2004-06-01 20:00:01 | ||
... | ... | |
author: Tobi | ||
guid: ddddd | ||
86 | ||
87 | | |
88 | | |
89 | | |
90 | | |
91 | | |
92 | | |
93 | | |
94 | | |
95 | | |
96 | | |
97 | | |
98 | | |
99 | | |
100 | ||
101 | ||
102 | | |
103 | | |
104 | | |
105 | | |
106 | | |
107 | | |
108 | | |
109 | | |
110 | | |
111 | | |
112 | | |
113 | | |
114 | | |
115 | | |
116 | | |
117 | ||
118 | ||
119 | | |
120 | | |
121 | | |
122 | | |
123 | | |
124 | | |
125 | | |
126 | | |
127 | | |
128 | | |
129 | | |
130 | | |
131 | ||
132 | ||
133 | | |
134 | | |
135 | | |
136 | | |
137 | | |
138 | | |
139 | | |
140 | | |
141 | | |
142 | | |
143 | | |
144 | | |
145 | | |
146 | | |
147 | ||
148 | ||
149 | | |
150 | | |
151 | | |
152 | | |
153 | | |
154 | | |
155 | | |
156 | | |
157 | | |
158 | | |
159 | | |
160 | | |
161 | | |
162 | | |
163 | ||
164 | ||
165 | | |
166 | | |
167 | | |
168 | | |
169 | | |
170 | | |
171 | | |
172 | | |
173 | | |
174 | | |
175 | | |
176 | | |
177 | | |
178 | | |
179 | ||
first_page: | ||
type: Page | ||
blog_id: 1 | ||
... | ... | |
id: 14 | ||
title: Inactive Article | ||
body: body | ||
229 | | |
extended: extended content | ||
231 | | |
created_at: 2004-05-01 20:00:02 | ||
updated_at: 2004-05-01 20:00:02 | ||
published_at: 2004-05-01 20:00:02 | ||
... | ... | |
published: true | ||
state: ContentState::Published | ||
244 | ||
245 | | |
246 | | |
247 | | |
248 | | |
249 | | |
250 | | |
251 | | |
252 | | |
253 | | |
254 | | |
255 | | |
256 | | |
257 | | |
258 | | |
259 | ||
second_blog_article: | ||
type: Article | ||
blog_id: 2 | ||
id: 16 | ||
title: Second Blog Article | ||
body: body | ||
266 | | |
extended: extended content | ||
268 | | |
allow_comments: true | ||
allow_pings: true | ||
permalink: second-blog-article | ||
... | ... | |
id: 17 | ||
title: Find me! | ||
body: search target | ||
287 | | |
extended: extended content | ||
289 | | |
allow_comments: true | ||
allow_pings: true | ||
permalink: second-blog-article | ||
... | ... | |
title: Associations aren't :dependent => true anymore | ||
body: originally seen on <a href="http://blog.rubyonrails.org/">blog.rubyonrails.org</a> | ||
extended: extended content | ||
309 | | |
allow_comments: true | ||
allow_pings: true | ||
permalink: associations-arent-dependent-true-anymore | ||
... | ... | |
guid: urn:uuid:0d676c66-4135-4a8b-9d65-b6a3248d3032 | ||
published: true | ||
state: ContentState::Published | ||
197 | ||
198 | spammed_article: | |
199 | type: Article | |
200 | blog_id: 1 | |
201 | id: 19 | |
202 | title: C'mon Spam Me! | |
203 | body: A bunch of innocuous content | |
204 | allow_comments: true | |
205 | allow_pings: true | |
206 | permalink: cmon-spam-me | |
207 | created_at: 2001-01-01 | |
208 | updated_at: 2001-01-01 | |
209 | published_at: 2001-01-01 | |
210 | user_id: 1 | |
211 | author: Tobi | |
212 | guid: urn:uuid:0d676c66-4135-4a8b-9d65-b6a3248d3023 | |
213 | published: true | |
214 | state: ContentState::Published | |
215 |
rool/rails/typo/trunk/test/fixtures/sidebars.yml:
prev. | current | |
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | ||
2 | ||
3 | | |
4 | ||
5 | | |
2 | static_sidebar: | |
3 | id: 3 | |
4 | active_position: 1 | |
5 | staged_position: 1 | |
6 | blog_id: 1 | |
7 | config: |+ | |
8 | --- !map:HashWithIndifferentAccess | |
9 | title: Static Sidebar | |
10 | body: The body of a static sidebar | |
11 | ||
12 | type: StaticSidebar |
rool/rails/typo/trunk/test/functional/accounts_controller_test.rb:
prev. | current | |
assert_session_has :user | ||
assert_equal users(:bob), @response.session[:user] | ||
27 | ||
28 | | |
27 | assert @response.redirect_url_match?("http://localhost/bogus/location") | |
end | ||
def test_signup | ||
... | ... | |
post :signup, :user => { :login => "newbob", :password => "newpassword", :password_confirmation => "newpassword" } | ||
assert_session_has :user | ||
36 | | |
37 | | |
35 | assert_response :redirect, :controller => "admin/general", :action => "index" | |
end | ||
def test_disable_signup_after_user_exists | ||
get :signup | ||
42 | | |
43 | | |
40 | assert_response :redirect, :action => "login" | |
end | ||
def test_bad_signup | ||
... | ... | |
post :signup, :user => { :login => "newbob", :password => "newpassword", :password_confirmation => "wrong" } | ||
assert_invalid_column_on_record "user", :password | ||
53 | | |
50 | assert_response :success | |
post :signup, :user => { :login => "yo", :password => "newpassword", :password_confirmation => "newpassword" } | ||
assert_invalid_column_on_record "user", :login | ||
57 | | |
54 | assert_response :success | |
post :signup, :user => { :login => "yo", :password => "newpassword", :password_confirmation => "wrong" } | ||
assert_invalid_column_on_record "user", [:login, :password] | ||
61 | | |
58 | assert_response :success | |
end | ||
def test_invalid_login | ||
... | ... | |
assert_session_has_no :user | ||
end | ||
81 | ||
end |
rool/rails/typo/trunk/test/functional/admin/article_preview_test.rb:
prev. | current | |
require File.dirname(__FILE__) + '/../../test_helper' | ||
require 'admin/content_controller' | ||
require 'http_mock' | ||
4 | require 'base64' | |
class Admin::ContentController; def rescue_action(e) raise e end; end | ||
... | ... | |
assert_equal @art_count, Article.find(:all).size | ||
end | ||
24 | DATA_URI_HEADER = "data:text/html;charset=utf-8;base64," | |
25 | def extract_data_uri | |
26 | assert_equal DATA_URI_HEADER, @response.body[0,DATA_URI_HEADER.size] | |
27 | data = @response.body[DATA_URI_HEADER.size..-1] | |
28 | data = Base64.decode64(data) | |
29 | @response.body = data | |
30 | end | |
31 | ||
def test_only_title | ||
post :preview, 'article' => { :title => 'A title' } | ||
assert_response :success | ||
26 | | |
27 | | |
28 | | |
35 | assert_template 'preview' | |
36 | extract_data_uri | |
37 | assert_tag :tag => 'h2', :content => 'A title' | |
assert_no_new_articles | ||
end | ||
def test_only_body | ||
post :preview, :article => { :body => 'A body' } | ||
44 | extract_data_uri | |
45 | ||
assert_tag :tag => 'p', | ||
:child => 'A body', | ||
37 | | |
48 | :after => { :tag => 'h2', :content => "" } | |
assert_no_new_articles | ||
end | ||
... | ... | |
def test_only_extended | ||
post :preview, :article => { :body => 'An extension' } | ||
56 | extract_data_uri | |
57 | ||
assert_tag :tag => 'p', | ||
:child => 'An extension', | ||
47 | | |
60 | :after => { :tag => 'h2', :content => "" } | |
assert_no_new_articles | ||
end | ||
... | ... | |
:title => 'A title', :body => 'A body', | ||
:extended => 'An extension' } | ||
70 | extract_data_uri | |
71 | ||
assert_tag \ | ||
:tag => 'p', | ||
:child => 'An extension', | ||
:after => {:tag => 'p', :child => 'A body', | ||
61 | | |
76 | :after => { :tag => 'h2', :content => "A title" }} | |
assert_no_new_articles | ||
end |
rool/rails/typo/trunk/test/functional/admin/blacklist_controller_test.rb:
prev. | current | |
def test_index | ||
get :index | ||
20 | | |
20 | assert_template 'list' | |
end | ||
def test_list | ||
get :list | ||
25 | | |
25 | assert_template 'list' | |
assert_template_has 'blacklist_patterns' | ||
end | ||
def test_create | ||
30 | | |
30 | num_blacklist_patterns = BlacklistPattern.count | |
post :new, 'blacklist_pattern' => { } | ||
33 | | |
33 | assert_response :redirect, :action => 'list' | |
35 | | |
35 | assert_equal num_blacklist_patterns + 1, BlacklistPattern.count | |
end | ||
def test_edit | ||
get :edit, 'id' => 1 | ||
40 | | |
41 | | |
42 | | |
40 | assert_template 'edit' | |
41 | assert_template_has('blacklist_pattern') | |
42 | assert_valid assigns(:blacklist_pattern) | |
end | ||
def test_update | ||
post :edit, 'id' => 1 | ||
47 | | |
47 | assert_response :redirect, :action => 'list' | |
end | ||
def test_destroy | ||
assert_not_nil BlacklistPattern.find(1) | ||
get :destroy, 'id' => 1 | ||
54 | | |
54 | assert_response :success | |
post :destroy, 'id' => 1 | ||
57 | | |
57 | assert_response :redirect, :action => 'list' | |
assert_raise(ActiveRecord::RecordNotFound) { | ||
blacklist_pattern = BlacklistPattern.find(1) |
rool/rails/typo/trunk/test/functional/admin/categories_controller_test.rb:
prev. | current | |
def test_index | ||
get :index | ||
20 | | |
20 | assert_template 'list' | |
assert_template_has 'categories' | ||
end | ||
def test_list | ||
get :list | ||
26 | | |
26 | assert_template 'list' | |
assert_template_has 'categories' | ||
assert_tag :tag => "div", | ||
:attributes => { :id => "category_container" } | ||
... | ... | |
def test_show | ||
get :show, 'id' => 1 | ||
34 | | |
34 | assert_template 'show' | |
assert_template_has 'category' | ||
36 | | |
36 | assert_valid assigns(:category) | |
end | ||
def test_create | ||
40 | | |
40 | num_categories = Category.count | |
post :new, 'category' => { :name => "test category" } | ||
43 | | |
43 | assert_response :redirect, :action => 'list' | |
45 | | |
45 | assert_equal num_categories + 1, Category.count | |
end | ||
def test_edit | ||
get :edit, :id => 1 | ||
50 | | |
50 | assert_template 'edit' | |
assert_template_has 'category' | ||
52 | | |
52 | assert_valid assigns(:category) | |
end | ||
def test_update | ||
post :edit, :id => 1 | ||
57 | | |
57 | assert_response :redirect, :action => 'list' | |
end | ||
def test_destroy | ||
assert_not_nil Category.find(1) | ||
get :destroy, :id => 1 | ||
64 | | |
65 | | |
64 | assert_response :success | |
65 | assert_template 'destroy' | |
post :destroy, :id => 1 | ||
68 | | |
68 | assert_response :redirect, :action => 'list' | |
assert_raise(ActiveRecord::RecordNotFound) { Category.find(1) } | ||
end |
rool/rails/typo/trunk/test/functional/admin/comments_controller_test.rb:
prev. | current | |
class Admin::CommentsController; def rescue_action(e) raise e end; end | ||
class Admin::CommentsControllerTest < Test::Unit::TestCase | ||
9 | | |
9 | fixtures :contents, :feedback, :users, :notifications | |
def setup | ||
@controller = Admin::CommentsController.new | ||
... | ... | |
def test_index | ||
get :index, :article_id => 2 | ||
21 | | |
21 | assert_template 'list' | |
end | ||
def test_list | ||
get :list, :article_id => 2 | ||
26 | | |
26 | assert_template 'list' | |
assert_template_has 'comments' | ||
end | ||
def test_show | ||
31 | | |
32 | | |
31 | get :show, :id => feedback(:spam_comment).id, :article_id => 2 | |
32 | assert_template 'show' | |
assert_template_has 'comment' | ||
34 | | |
34 | assert_valid @response.template_objects['comment'] | |
end | ||
def test_new | ||
get :new, :article_id => 2 | ||
39 | | |
39 | assert_template 'new' | |
assert_template_has 'comment' | ||
end | ||
def test_create | ||
44 | | |
44 | num_comments = Comment.count | |
post(:new, :comment => { 'author' => 'author', 'body' => 'body' }, | ||
:article_id => 2) | ||
48 | | |
48 | assert_response :redirect, :action => 'show' | |
50 | | |
50 | assert_equal num_comments + 1, Comment.count | |
end | ||
def test_edit | ||
54 | | |
55 | | |
54 | get :edit, :id => feedback(:spam_comment).id, :article_id => 2 | |
55 | assert_template 'edit' | |
assert_template_has 'comment' | ||
57 | | |
57 | assert_valid assigns(:comment) | |
end | ||
def test_update | ||
61 | | |
62 | | |
61 | post :edit, :id => feedback(:spam_comment).id, :article_id => 2 | |
62 | assert_response :redirect, :action => 'show', :id => feedback(:spam_comment).id | |
end | ||
def test_destroy | ||
66 | | |
66 | assert_not_nil Comment.find(feedback(:spam_comment).id) | |
68 | | |
69 | | |
68 | get :destroy, :id => feedback(:spam_comment).id, :article_id => 2 | |
69 | assert_response :success | |
71 | | |
72 | | |
71 | post :destroy, :id => feedback(:spam_comment).id, :article_id => 2 | |
72 | assert_response :redirect, :action => 'list' | |
assert_raise(ActiveRecord::RecordNotFound) { | ||
75 | | |
75 | comment = Comment.find(feedback(:spam_comment).id) | |
} | ||
end | ||
end |
rool/rails/typo/trunk/test/functional/admin/content_controller_test.rb:
prev. | current | |
class Admin::ContentController; def rescue_action(e) raise e end; end | ||
class Admin::ContentControllerTest < Test::Unit::TestCase | ||
10 | | |
11 | | |
10 | fixtures :contents, :feedback, :users, :categories, :resources, :text_filters, | |
11 | :blogs, :categorizations | |
def setup | ||
@controller = Admin::ContentController.new | ||
... | ... | |
def test_index | ||
get :index | ||
22 | | |
22 | assert_template 'list' | |
end | ||
def test_list | ||
get :list | ||
27 | | |
27 | assert_template 'list' | |
assert_template_has 'articles' | ||
end | ||
def test_show | ||
get :show, 'id' => 1 | ||
33 | | |
33 | assert_template 'show' | |
assert_template_has 'article' | ||
35 | | |
35 | assert_valid assigns(:article) | |
assert_not_nil assigns(:article) | ||
assert_not_nil assigns(:categories) | ||
assert_not_nil assigns(:resources) | ||
... | ... | |
def test_new | ||
get :new | ||
43 | | |
43 | assert_template 'new' | |
assert_template_has 'article' | ||
end | ||
... | ... | |
emails.clear | ||
tags = ['foo', 'bar', 'baz bliz', 'gorp gack gar'] | ||
post :new, 'article' => { :title => "posted via tests!", :body => "Foo", :keywords => "foo bar 'baz bliz' \"gorp gack gar\""}, 'categories' => [1] | ||
73 | | |
73 | assert_response :redirect, :action => 'show' | |
assert_equal num_articles + 1, this_blog.published_articles.size | ||
... | ... | |
:article => { :title => "News from the future!", | ||
:body => "The future's cool!", | ||
:published_at => Time.now + 1.hour }) | ||
93 | | |
93 | assert_response :redirect, :action => 'show' | |
assert ! assigns(:article).published? | ||
assert_equal num_articles, this_blog.published_articles.size | ||
assert_equal 1, Trigger.count | ||
... | ... | |
body = "body via *textile*" | ||
extended="*foo*" | ||
post :new, 'article' => { :title => "another test", :body => body, :extended => extended} | ||
114 | | |
114 | assert_response :redirect, :action => 'show' | |
new_article = Article.find(:first, :order => "created_at DESC") | ||
assert_equal body, new_article.body | ||
assert_equal extended, new_article.extended | ||
assert_equal "textile", new_article.text_filter.name | ||
120 | | |
121 | | |
120 | assert_equal "<p>body via <strong>textile</strong></p>", new_article.html(:body) | |
121 | assert_equal "<p><strong>foo</strong></p>", new_article.html(:extended) | |
end | ||
def test_edit | ||
get :edit, 'id' => 1 | ||
assert_equal assigns(:selected), Article.find(1).categories.collect {|c| c.id} | ||
127 | | |
127 | assert_template 'edit' | |
assert_template_has 'article' | ||
129 | | |
129 | assert_valid assigns(:article) | |
end | ||
def test_update | ||
... | ... | |
body = "another *textile* test" | ||
post :edit, 'id' => 1, 'article' => {:body => body, :text_filter => 'textile'} | ||
138 | | |
138 | assert_response :redirect, :action => 'show', :id => 1 | |
article = Article.find(1) | ||
assert_equal "textile", article.text_filter.name | ||
assert_equal body, article.body | ||
143 | | |
144 | | |
145 | | |
assert_equal 0, emails.size | ||
end | ||
... | ... | |
assert_not_nil Article.find(1) | ||
get :destroy, 'id' => 1 | ||
154 | | |
151 | assert_response :success | |
post :destroy, 'id' => 1 | ||
157 | | |
154 | assert_response :redirect, :action => 'list' | |
assert_raise(ActiveRecord::RecordNotFound) { | ||
article = Article.find(1) | ||
... | ... | |
def test_category_add | ||
get :category_add, :id => 1, :category_id => 1 | ||
167 | | |
168 | | |
169 | | |
164 | assert_template '_show_categories' | |
165 | assert_valid assigns(:article) | |
166 | assert_valid assigns(:category) | |
assert Article.find(1).categories.include?(Category.find(1)) | ||
assert_not_nil assigns(:article) | ||
assert_not_nil assigns(:category) | ||
... | ... | |
def test_category_remove | ||
get :category_remove, :id => 1, :category_id => 1 | ||
179 | | |
180 | | |
181 | | |
176 | assert_template '_show_categories' | |
177 | assert_valid assigns(:article) | |
178 | assert_valid assigns(:category) | |
assert !Article.find(1).categories.include?(Category.find(1)) | ||
assert_not_nil assigns(:article) | ||
assert_not_nil assigns(:category) | ||
... | ... | |
def test_resource_add | ||
get :resource_add, :id => 1, :resource_id => 1 | ||
191 | | |
192 | | |
193 | | |
188 | assert_template '_show_resources' | |
189 | assert_valid assigns(:article) | |
190 | assert_valid assigns(:resource) | |
assert Article.find(1).resources.include?(Resource.find(1)) | ||
assert_not_nil assigns(:article) | ||
assert_not_nil assigns(:resource) | ||
... | ... | |
def test_resource_remove | ||
get :resource_remove, :id => 1, :resource_id => 1 | ||
203 | | |
204 | | |
205 | | |
200 | assert_template '_show_resources' | |
201 | assert_valid assigns(:article) | |
202 | assert_valid assigns(:resource) | |
assert !Article.find(1).resources.include?(Resource.find(1)) | ||
assert_not_nil assigns(:article) | ||
assert_not_nil assigns(:resource) | ||
... | ... | |
def test_attachment_box_add | ||
get :attachment_box_add, :id => 2 | ||
214 | | |
211 | assert_template '_attachment' | |
#assert_tag :tag => 'script' | ||
end | ||
218 | | |
219 | | |
220 | | |
221 | | |
222 | ||
def test_resource_container | ||
get :show, :id => contents(:article1).id # article without attachments | ||
Resource.find(:all).each do |resource| |
rool/rails/typo/trunk/test/functional/admin/feedback_controller_test.rb:
prev. | current | |
require File.dirname(__FILE__) + '/../../test_helper' | ||
require 'admin/feedback_controller' | ||
3 | require 'comment' | |
4 | require 'trackback' | |
# Re-raise errors caught by the controller. | ||
class Admin::FeedbackController; def rescue_action(e) raise e end; end | ||
class Admin::FeedbackControllerTest < Test::Unit::TestCase | ||
fixtures :contents, :users, :resources, :text_filters, | ||
9 | | |
11 | :blogs, :categorizations, :feedback | |
def setup | ||
@controller = Admin::FeedbackController.new | ||
... | ... | |
def test_index | ||
get :index | ||
20 | | |
21 | | |
22 | | |
22 | ||
23 | assert_response :success | |
24 | assert_template 'list' | |
25 | assert_equal Feedback.count, assigns(:feedback).size | |
end | ||
27 | ||
28 | def test_list_unconfirmed | |
29 | get :index, :confirmed => 'f' | |
30 | ||
31 | assert_response :success | |
32 | assert_template 'list' | |
33 | ||
34 | assert_equal(Feedback.count(:conditions => ['blog_id = 1 AND status_confirmed = ?', false]), | |
35 | assigns(:feedback).size) | |
36 | ||
37 | end | |
38 | ||
39 | def test_list_spam | |
40 | get :index, :published => 'f' | |
41 | ||
42 | assert_response :success | |
43 | assert_template 'list' | |
44 | ||
45 | assert_equal(Feedback.count(:conditions => ['blog_id = 1 AND published = ?', false]), | |
46 | assigns(:feedback).size) | |
47 | end | |
48 | ||
49 | def test_list_unconfirmed_spam | |
50 | get :index, :published => 'f', :confirmed => 'f' | |
51 | ||
52 | assert_response :success | |
53 | assert_template 'list' | |
54 | ||
55 | assert_equal(Feedback.count(:conditions => ['blog_id = 1 AND published = ? AND status_confirmed = ?', false, false]), | |
56 | assigns(:feedback).size) | |
57 | end | |
58 | ||
end |
rool/rails/typo/trunk/test/functional/admin/general_controller_test.rb:
prev. | current | |
def test_index | ||
get :index | ||
19 | | |
19 | assert_template 'index' | |
end | ||
def test_redirect | ||
get :redirect | ||
24 | | |
24 | assert_response :redirect, :controller => 'admin/general', :action => 'index' | |
end | ||
end |
rool/rails/typo/trunk/test/functional/admin/pages_controller_test.rb:
prev. | current | |
assert_equal "new_page", new_page.name | ||
60 | | |
60 | assert_response :redirect, :action => "show", :id => new_page.id | |
# XXX: The flash is currently being made available improperly to tests (scoop) | ||
#assert_equal "Page was successfully created.", flash[:notice] | ||
... | ... | |
post :edit, :id => contents(:markdown_page).id, :page => { :name => "markdown-page", :title => "Markdown Page", | ||
:body => "Adding a [link](http://www.typosphere.org/) here" } | ||
77 | assert_response :redirect, :action => "show", :id => contents(:markdown_page).id | |
78 | | |
79 | ||
80 | | |
81 | ||
# XXX: The flash is currently being made available improperly to tests (scoop) | ||
#assert_equal "Page was successfully updated.", flash[:notice] | ||
end | ||
def test_destroy | ||
post :destroy, :id => contents(:another_page).id | ||
88 | | |
85 | assert_response :redirect, :action => "list" | |
assert_raise(ActiveRecord::RecordNotFound) { Page.find(contents(:another_page).id) } | ||
end | ||
91 | ||
92 | | |
93 | | |
94 | | |
95 | | |
96 | | |
97 | | |
98 | | |
99 | ||
100 | | |
101 | | |
102 | | |
end |
rool/rails/typo/trunk/test/functional/admin/resources_controller_test.rb:
prev. | current | |
def test_list | ||
get :list | ||
19 | | |
20 | | |
19 | assert_response :success | |
20 | assert_template 'list' | |
assert_template_has 'resources' | ||
assert_not_nil assigns(:resources) | ||
assert_not_nil assigns(:resources_pages) | ||
... | ... | |
assert_not_nil Resource.find(1) | ||
get :destroy, :id => 1 | ||
30 | | |
31 | | |
30 | assert_response :success | |
31 | assert_template 'destroy' | |
assert_not_nil assigns(:file) | ||
post :destroy, :id => 1 | ||
assert_response 302 | ||
follow_redirect | ||
37 | | |
37 | assert_template 'list' | |
end | ||
def test_new | ||
get :new | ||
42 | | |
43 | | |
42 | assert_response :success | |
43 | assert_template 'new' | |
end | ||
def test_upload |
rool/rails/typo/trunk/test/functional/admin/textfilters_controller_test.rb:
prev. | current | |
def test_new_without_filters | ||
post :new, :textfilter => { :name => 'filterx', | ||
:description => 'Filter X', :markup => 'markdown' } | ||
21 | | |
21 | assert_response :redirect, :action => 'show' | |
end | ||
def test_edit_without_filters | ||
post :edit, :id => 1, :textfilter => { :name => 'filterx', | ||
:description => 'Filter X', :markup => 'markdown' } | ||
27 | | |
27 | assert_response :redirect, :action => 'show' | |
end | ||
end |
rool/rails/typo/trunk/test/functional/admin/themes_controller_test.rb:
prev. | current | |
def test_switchto | ||
get :switchto, :theme => 'azure' | ||
27 | | |
27 | assert_response :redirect, :action => 'index' | |
end | ||
def test_preview |
rool/rails/typo/trunk/test/functional/admin/trackbacks_controller_test.rb:
prev. | current | |
class Admin::TrackbacksController; def rescue_action(e) raise e end; end | ||
class Admin::TrackbacksControllerTest < Test::Unit::TestCase | ||
8 | | |
8 | fixtures :contents, :feedback, :users | |
def setup | ||
@controller = Admin::TrackbacksController.new | ||
... | ... | |
def test_index | ||
get :index, :article_id => 2 | ||
20 | | |
20 | assert_template 'list' | |
end | ||
def test_list | ||
get :list, :article_id => 2 | ||
25 | | |
25 | assert_template 'list' | |
assert_template_has 'trackbacks' | ||
end | ||
def test_show | ||
30 | | |
31 | | |
30 | get :show, :id => feedback(:trackback1).id, :article_id => 2 | |
31 | assert_template 'show' | |
assert_template_has 'trackback' | ||
33 | | |
33 | assert_valid assigns(:trackback) | |
end | ||
def test_new | ||
get :new, :article_id => 2 | ||
38 | | |
38 | assert_template 'new' | |
assert_template_has 'trackback' | ||
end | ||
def test_create | ||
43 | | |
43 | num_trackbacks = Trackback.count | |
post :new, :trackback => { 'title' => 'title', 'excerpt' => 'excerpt', 'blog_name' => 'blog_name', 'url' => 'url' }, :article_id => 2 | ||
46 | | |
46 | assert_response :redirect, :action => 'show' | |
48 | | |
48 | assert_equal num_trackbacks + 1, Trackback.count | |
end | ||
def test_edit | ||
52 | | |
53 | | |
52 | get :edit, :id => feedback(:trackback1).id, :article_id => 2 | |
53 | assert_template 'edit' | |
assert_template_has 'trackback' | ||
55 | | |
55 | assert_valid assigns(:trackback) | |
end | ||
def test_update | ||
59 | | |
60 | | |
59 | post :edit, :id => feedback(:trackback1).id, :article_id => 2 | |
60 | assert_response :redirect, :action => 'show', :id => feedback(:trackback1).id | |
end | ||
def test_destroy | ||
64 | | |
64 | assert_not_nil Trackback.find(feedback(:trackback1).id) | |
66 | | |
67 | | |
66 | get :destroy, :id => feedback(:trackback1).id, :article_id => 2 | |
67 | assert_response :success | |
69 | | |
70 | | |
69 | post :destroy, :id => feedback(:trackback1).id, :article_id => 2 | |
70 | assert_response :redirect, :action => 'list' | |
assert_raise(ActiveRecord::RecordNotFound) { | ||
73 | | |
73 | trackback = Trackback.find(feedback(:trackback1).id) | |
} | ||
end | ||
end |
rool/rails/typo/trunk/test/functional/admin/users_controller_test.rb:
prev. | current | |
def test_index | ||
get :index | ||
20 | | |
20 | assert_template 'list' | |
assert_template_has 'users' | ||
end | ||
def test_list | ||
get :list | ||
26 | | |
26 | assert_template 'list' | |
assert_template_has 'users' | ||
end | ||
def test_new | ||
get :new | ||
32 | | |
32 | assert_template 'new' | |
post :new, :user => { :login => 'errand', :email => 'corey@test.com', | ||
:password => 'testpass', :password_confirmation => 'testpass' } | ||
36 | | |
36 | assert_response :redirect, :action => 'list' | |
follow_redirect | ||
38 | | |
38 | assert_template 'list' | |
end | ||
def test_show | ||
get :show, :id => 1 | ||
43 | | |
44 | | |
43 | assert_template 'show' | |
44 | assert_valid assigns(:user) | |
45 | ||
46 | assert_template_has 'user' | |
47 | assert_template_has 'articles' | |
end | ||
def test_edit | ||
get :edit, :id => 1 | ||
49 | | |
50 | | |
52 | assert_template 'edit' | |
53 | assert_valid assigns(:user) | |
post :edit, :id => 1, :user => { :login => 'errand', | ||
:email => 'corey@test.com', :password => 'testpass', | ||
:password_confirmation => 'testpass' } | ||
55 | | |
58 | assert_response :redirect, :action => 'show' | |
follow_redirect | ||
57 | | |
58 | | |
60 | assert_template 'show' | |
61 | assert_valid assigns(:user) | |
end | ||
def test_destroy | ||
62 | | |
63 | | |
64 | | |
65 | user_count = User.count | |
66 | get :destroy, :id => users(:bob).id | |
67 | assert_template 'destroy' | |
68 | assert_valid assigns(:user) | |
66 | | |
67 | | |
70 | assert_equal user_count, User.count | |
71 | post :destroy, :id => users(:bob).id | |
72 | assert_response :redirect, :action => 'list' | |
follow_redirect | ||
69 | | |
74 | assert_template 'list' | |
75 | assert_equal user_count - 1, User.count | |
end | ||
end |
rool/rails/typo/trunk/test/functional/articles_controller_test.rb:
prev. | current | |
end | ||
class ArticlesControllerTest < Test::Unit::TestCase | ||
20 | | |
20 | fixtures :contents, :feedback, :categories, :blogs, :users, :categorizations, :text_filters, :articles_tags, :tags | |
include ArticlesHelper | ||
def setup | ||
... | ... | |
:body => "The future is cool!", | ||
:keywords => "future", | ||
:created_at => Time.now + 12.minutes) | ||
31 | ||
31 | Sidebar.delete_all | |
end | ||
# Category subpages | ||
... | ... | |
get :category, :id => "software" | ||
assert_response :success | ||
39 | | |
40 | | |
39 | assert_template "index" | |
40 | assert_tag :tag => 'title', :content => 'test blog : category software' | |
# Check it works when permalink != name. Ticket #736 | ||
get :category, :id => "weird-permalink" | ||
assert_response :success | ||
46 | | |
46 | assert_template "index" | |
end | ||
def test_empty_category | ||
get :category, :id => "life-on-mars" | ||
assert_response :success | ||
52 | | |
52 | assert_template "error" | |
end | ||
def test_nonexistent_category | ||
get :category, :id => 'nonexistent-category' | ||
assert_response :success | ||
58 | | |
58 | assert_template "error" | |
end | ||
def test_tag | ||
get :tag, :id => "foo" | ||
assert_response :success | ||
65 | | |
65 | assert_template "index" | |
67 | | |
67 | assert_tag :tag => 'title', :content => 'test blog : tag foo' | |
assert_tag :tag => 'h2', :content => 'Article 2!' | ||
assert_tag :tag => 'h2', :content => 'Article 1!' | ||
end | ||
... | ... | |
def test_nonexistent_tag | ||
get :tag, :id => "nonexistent" | ||
assert_response :success | ||
75 | | |
75 | assert_template "error" | |
end | ||
def test_tag_routes | ||
... | ... | |
get :tag, :id => "foo" | ||
assert_equal 1, assigns(:articles).size | ||
assert_tag(:tag => 'p', | ||
88 | | |
89 | | |
90 | | |
88 | :attributes =>{ :id => 'pagination' }, | |
89 | :content => %r{Older posts: 1}, | |
:descendant => {:tag => 'a', | ||
:attributes =>{ | ||
:href => "/articles/tag/foo/page/2"}, | ||
... | ... | |
def test_index | ||
get :index | ||
assert_response :success | ||
101 | | |
100 | assert_template "index" | |
end | ||
# Archives page | ||
def test_archives | ||
get :archives | ||
assert_response :success | ||
108 | | |
107 | assert_template "archives" | |
end | ||
110 | def test_blog_title | |
111 | blogs(:default).title_prefix = 1 | |
112 | get :permalink, :year => 2004, :month => 06, :day => 01, :title => "article-3" | |
113 | assert_response :success | |
114 | assert_tag :tag => 'title', :content => /^test blog : Article 3!$/ | |
115 | ||
116 | blogs(:default).title_prefix = 0 | |
117 | @controller = ArticlesController.new | |
118 | assert_equal 0, blogs(:default).title_prefix | |
119 | get :permalink, :year => 2004, :month => 06, :day => 01, :title => "article-3" | |
120 | assert_response :success | |
121 | assert_tag :tag => 'title', :content => /^Article 3!$/ | |
122 | end | |
123 | ||
# Permalinks | ||
def test_permalink | ||
get :permalink, :year => 2004, :month => 06, :day => 01, :title => "article-3" | ||
... | ... | |
def test_find_by_date | ||
get :find_by_date, :year => 2004, :month => 06, :day => 01 | ||
assert_response :success | ||
124 | | |
137 | assert_template "index" | |
end | ||
def test_comment_posting | ||
... | ... | |
Article.find(1).notify_users << users(:tobi) | ||
135 | | |
148 | post :comment, { :id => 1, :comment => {'body' => 'This is *markdown*', 'author' => 'bob' }} | |
assert_response :success | ||
138 | | |
151 | assert_tag :tag => 'em', :content => 'markdown' | |
comment = Article.find(1).comments.last | ||
assert comment | ||
143 | | |
156 | assert_not_nil cookies["typoapp_author"] | |
145 | | |
158 | assert_equal "<p>This is <em>markdown</em></p>", comment.html.to_s | |
160 | assert_equal 2, emails.size | |
assert_equal User.find(:all, | ||
:conditions => ['(notify_via_email = ?) and (notify_on_comments = ?)', true, true], | ||
:order => 'email').collect { |each| each.email }, | ||
... | ... | |
comment = Article.find(art_id).comments.last | ||
assert comment | ||
171 | | |
185 | assert_match expected_html, comment.html.to_s | |
$do_breakpoints | ||
end | ||
... | ... | |
end | ||
def test_comment_spam2 | ||
180 | | |
194 | comment_template_test %r{<p>Link to <a href=["']http://spammer.example.com['"] rel=["']nofollow['"]>spammy goodness</a></p>}, 'Link to [spammy goodness](http://spammer.example.com)' | |
end | ||
197 | def test_comment_spam3 | |
198 | post :comment, :id => 1, :comment => {:body => '<a href="http://spam.org">spam</a>', :author => '<a href="spamme.com">spamme</a>', :email => '<a href="http://morespam.net">foo</a>'} | |
199 | ||
200 | assert_response :success | |
201 | comment = Article.find(1).comments.last | |
202 | assert comment | |
203 | ||
204 | get :read, :id => 1 | |
205 | assert_response 200 | |
206 | ||
207 | assert ! (@response.body =~ %r{<a href="http://spamme.com">}), "Author leaks" | |
208 | assert ! (@response.body =~ %r{<a href="http://spam.org">}), "Body leaks <a>" | |
209 | assert ! (@response.body =~ %r{<a href="http://morespam.net">}), "Email leaks" | |
210 | end | |
211 | ||
def test_comment_xss1 | ||
this_blog.comment_text_filter = "none" | ||
comment_template_test %{Have you ever alert("foo"); been hacked?}, | ||
... | ... | |
end | ||
def test_comment_autolink | ||
195 | | |
196 | | |
224 | comment_template_test "<p>What's up with <a href=\"http://slashdot.org\" rel=\"nofollow\">http://slashdot.org</a> these days?</p>", "What's up with http://slashdot.org these days\?" | |
225 | end | |
### TODO -- there's a bug in Rails with auto_links | ||
# def test_comment_autolink2 | ||
... | ... | |
def test_comment_nuking | ||
num_comments = Comment.count | ||
205 | | |
234 | post :nuke_comment, { :id => feedback(:spam_comment).id }, {} | |
assert_response 403 | ||
208 | | |
237 | get :nuke_comment, { :id => feedback(:spam_comment).id }, { :user => users(:bob)} | |
assert_response 403 | ||
211 | | |
240 | post :nuke_comment, { :id => feedback(:spam_comment).id }, { :user => users(:bob)} | |
assert_response :success | ||
assert_equal num_comments -1, Comment.count | ||
end | ||
... | ... | |
num_trackbacks = Article.find(2).trackbacks.count | ||
post :trackback, { :id => 2, :url => "http://www.google.com", :title => "My Trackback", :excerpt => "This is a test" } | ||
assert_response :success | ||
251 | | |
280 | assert_no_tag :tag => "response", | |
281 | :child => {:tag => "error", :content => "1"} | |
assert_equal num_trackbacks+1, Article.find(2).trackbacks.count | ||
end | ||
... | ... | |
get :index | ||
275 | | |
276 | | |
277 | ||
305 | assert_response :redirect, | |
306 | :controller => "admin/general", :action => "redirect" | |
end | ||
def test_no_users_exist | ||
... | ... | |
assert User.count.zero? | ||
get :index | ||
287 | | |
288 | | |
316 | assert_response :redirect, :controller => "accounts", :action => "signup" | |
end | ||
def test_pages_static | ||
get :view_page, :name => 'page_one' | ||
assert_response :success | ||
295 | | |
323 | assert_template "view_page" | |
get :view_page, :name => 'page one' | ||
assert_response 404 | ||
... | ... | |
# Switch gravatar integration to on | ||
this_blog.use_gravatar = true | ||
352 | @controller = ArticlesController.new | |
assert this_blog.use_gravatar | ||
get :read, :id => 1 | ||
assert_response :success | ||
... | ... | |
assert_response :success | ||
assert_template "read" | ||
387 | assert_equal contents(:article1).comments.to_a.select{|c| c.published?}, contents(:article1).published_comments | |
388 | ||
assert_tag :tag => "ol", | ||
:attributes => { :id => "commentList"}, | ||
:children => { :count => contents(:article1).comments.to_a.select{|c| c.published?}.size, | ||
... | ... | |
def test_author | ||
get :author, :id => 'tobi' | ||
497 | | |
498 | | |
528 | assert_response :success | |
529 | assert_template 'index' | |
assert assigns(:articles) | ||
assert_equal users(:tobi).articles.published, assigns(:articles) | ||
# This is until we write a proper author feed | ||
... | ... | |
def test_nonexistent_author | ||
get :author, :id => 'nonexistent-chap' | ||
509 | | |
510 | | |
540 | assert_response :success | |
541 | assert_template 'error' | |
assert assigns(:message) | ||
assert_equal "Can't find posts with author 'nonexistent-chap'", assigns(:message) | ||
end | ||
... | ... | |
def test_author_list | ||
get :author | ||
518 | | |
519 | | |
549 | assert_response :success | |
550 | assert_template 'groupings' | |
assert_tag(:tag => 'ul', | ||
:descendant => {\ |
rool/rails/typo/trunk/test/functional/backend_controller_test.rb:
prev. | current | |
class BackendController; def rescue_action(e) raise e end; end | ||
class BackendControllerTest < Test::Unit::TestCase | ||
11 | | |
11 | fixtures :contents, :categories, :blogs, :users, :categorizations, :text_filters | |
def setup | ||
@controller = BackendController.new | ||
... | ... | |
new_post = Article.find(result) | ||
assert_equal "new post title", new_post.title | ||
assert_equal "new post *body*", new_post.body | ||
49 | | |
49 | assert_equal "<p>new post <strong>body</strong></p>", new_post.html(:body) | |
assert_equal "textile", new_post.text_filter.name | ||
assert_equal users(:tobi), new_post.user | ||
assert_equal this_blog.id, new_post.blog_id | ||
... | ... | |
new_post = Article.find(result) | ||
assert_equal "new post body for post without", new_post.title | ||
assert_equal "new post body for post without title but with a lenghty body", new_post.body | ||
65 | | |
65 | assert_equal "<p>new post body for post without title but with a lenghty body</p>", new_post.html(:body) | |
end | ||
def test_blogger_new_post_with_categories | ||
... | ... | |
assert_equal article.title, new_article.title | ||
assert_equal article.body, new_article.body | ||
143 | | |
143 | assert_equal "<p>this is a <strong>test</strong></p>", new_article.html(:body) | |
assert_equal Time.now.midnight.to_s, new_article.published_at.to_s | ||
assert_equal this_blog.id, new_article.blog_id | ||
end | ||
... | ... | |
assert_equal "Posted via Test", new_post.title | ||
assert_equal "textile", new_post.text_filter.name | ||
assert_equal article.body, new_post.body | ||
165 | | |
165 | assert_equal "<p>body</p>", new_post.html(:body) | |
assert_equal article.extended, new_post.extended | ||
167 | | |
167 | assert_equal "<p>extend me</p>", new_post.html(:extended) | |
assert_equal Time.now.midnight.to_s, new_post.published_at.to_s | ||
assert_equal this_blog.id, new_post.blog_id | ||
end |
rool/rails/typo/trunk/test/functional/redirect_controller_test.rb:
prev. | current | |
def test_redirect | ||
get :redirect, :from => "foo/bar" | ||
assert_response 301 | ||
22 | | |
22 | assert_response :redirect, "/someplace/else" | |
end | ||
def test_url_root_redirect | ||
@request.relative_url_root = "/blog" | ||
get :redirect, :from => "foo/bar" | ||
assert_response 301 | ||
29 | | |
29 | assert_response :redirect, "/blog/someplace/else" | |
get :redirect, :from => "bar/foo" | ||
assert_response 301 | ||
33 | | |
33 | assert_response :redirect, "/blog/someplace/else" | |
end | ||
def test_no_redirect |
rool/rails/typo/trunk/test/functional/textfilter_controller_test.rb:
prev. | current | |
class ActionController::Base; def rescue_action(e) raise e end; end | ||
class TextfilterControllerTest < Test::Unit::TestCase | ||
11 | | |
11 | fixtures :text_filters, :blogs | |
def setup | ||
@controller = TextfilterController.new | ||
... | ... | |
# @controller.initialize_current_url #rescue nil | ||
end | ||
26 | ||
27 | def blog | |
28 | blogs(:default) | |
29 | end | |
27 | | |
28 | | |
31 | def filter_text(text, filters, filterparams={}) | |
32 | TextFilter.filter_text(blog, text, self, filters, filterparams) | |
end | ||
def whiteboard | ||
... | ... | |
assert_equal '<p><em>“foo”</em></p>', | ||
filter_text('*"foo"*',[:doesntexist1,:markdown,"doesn't exist 2",:smartypants,:nopenotmeeither]) | ||
71 | ||
72 | | |
73 | | |
74 | ||
75 | | |
76 | | |
end | ||
def test_amazon | ||
... | ... | |
def test_named_filter | ||
assert_equal '<p><em>“foo”</em></p>', | ||
203 | | |
201 | TextFilter.filter_text_by_name(blog, '*"foo"*', 'markdown smartypants') | |
end | ||
def test_code_plus_markup_chain | ||
... | ... | |
\t<p><em>footer text here</em></p> | ||
EOF | ||
247 | | |
248 | | |
245 | assert_equal expects_markdown.strip, TextFilter.filter_text_by_name(blog, text, 'markdown') | |
246 | assert_equal expects_textile.strip, TextFilter.filter_text_by_name(blog, text, 'textile') | |
end | ||
def test_lightbox |
rool/rails/typo/trunk/test/functional/theme_controller_test.rb:
prev. | current | |
def test_stylesheets | ||
get :stylesheets, :filename => "azure.css" | ||
assert_response :success | ||
16 | | |
16 | assert_equal "text/css; charset=utf-8", @response.headers['Content-Type'] | |
assert_equal "inline; filename=\"azure.css\"", @response.headers['Content-Disposition'] | ||
end | ||
rool/rails/typo/trunk/test/functional/xml_controller_test.rb:
prev. | current | |
class XmlController; def rescue_action(e) raise e end; end | ||
class XmlControllerTest < Test::Unit::TestCase | ||
33 | | |
33 | fixtures :contents, :categories, :categorizations, :tags, | |
:articles_tags, :users, :blogs, :resources | ||
def setup | ||
... | ... | |
assert_xml @response.body | ||
assert_feedvalidator @response.body, :todo | ||
90 | | |
90 | assert_rss20(7) | |
end | ||
def test_feed_rss20_comments | ||
... | ... | |
assert_xml @response.body | ||
assert_feedvalidator @response.body | ||
108 | | |
108 | assert_rss20(3) | |
end | ||
def test_feed_rss20_article | ||
... | ... | |
assert_equal(assigns(:items).sort { |a, b| b.created_at <=> a.created_at }, | ||
assigns(:items)) | ||
148 | | |
148 | assert_atom10(7) | |
end | ||
def test_feed_atom10_comments | ||
... | ... | |
assert_equal(assigns(:items).sort { |a, b| b.created_at <=> a.created_at }, | ||
assigns(:items)) | ||
174 | | |
174 | assert_atom10(3) | |
assert_xpath('//title[@type="html"]') | ||
assert_xpath('//summary', "Trackback entry has no summaries") | ||
... | ... | |
def test_pubdate_conformance | ||
get :feed, :format => 'rss20', :type => 'feed' | ||
assert_response :success | ||
244 | | |
245 | | |
244 | ||
245 | assert_equal contents(:article2).created_at.rfc822, get_xpath('/rss/channel/item[title="Article 2!"]/pubDate').first.text | |
end | ||
def test_rsd | ||
... | ... | |
assert_response :success | ||
assert_match /extended content/, @response.body | ||
262 | @controller = XmlController.new | |
set_extended_on_rss false | ||
get :feed, :format => 'rss20', :type => 'feed' | ||
assert_response :success | ||
... | ... | |
assert_not_equal 0, get_xpath(%{//summary]}).size, "Extended feed has no summaries" | ||
assert_not_equal 0, get_xpath(%{//content]}).size, "Extended feed has no content" | ||
283 | @controller = XmlController.new | |
set_extended_on_rss false | ||
get :feed, :format => 'atom10', :type => 'feed' | ||
assert_response :success | ||
... | ... | |
assert_xml @response.body | ||
assert_feedvalidator @response.body, :todo | ||
end | ||
341 | | |
343 | ||
# TODO(laird): make this more robust | ||
def test_sitemap | ||
get :feed, :format => 'googlesitemap', :type => 'sitemap' | ||
345 | | |
347 | ||
assert_response :success | ||
assert_xml @response.body | ||
end |
rool/rails/typo/trunk/test/mocks/test/xmlrpc_mock.rb:
prev. | current | |
class XMLRPC::Client | ||
attr_reader :method_name, :args | ||
attr_accessor :uri | ||
5 | $xmlrpc_pings = [] | |
def initialize | ||
end | ||
def self.new2(uri) | ||
10 | | |
11 | $xmlrpc_pings ||= [] | |
client = new | ||
client.uri = uri | ||
client | ||
end | ||
def self.pings | ||
17 | | |
18 | $xmlrpc_pings | |
end | ||
def call(name, *args) | ||
@method_name = name | ||
@args = *args | ||
23 | | |
24 | | |
24 | $xmlrpc_pings ||= [] | |
25 | $xmlrpc_pings << self | |
end | ||
end | ||
end |
rool/rails/typo/trunk/test/mocks/themes/azure/layouts/default.rhtml:
prev. | current | |
<div id="container" class="clearfix"> | ||
<div id="header"> | ||
<div id="logo"> | ||
15 | | |
15 | <h1 id="sitename"><%= link_to this_blog.blog_name, this_blog.base_url %></h1> | |
<h2 id="subtitle"><%= this_blog.blog_subtitle %></h2> | ||
</div> | ||
</div> | ||
19 | | |
19 | ||
<div id="search"> <%= render :partial => "shared/search" %></div> | ||
<% benchmark "BENCHMARK: layout/content" do %> | ||
... | ... | |
</div> | ||
<% end %> | ||
<div id="sidebar"> | ||
30 | | |
30 | ||
<div id="search-results"></div> | ||
<% benchmark "BENCHMARK: layout/sidebars" do %> | ||
<%= render_sidebars %> | ||
<% end %> | ||
35 | | |
35 | ||
<%= link_to image_tag("powered.gif"), "http://www.typosphere.org/", {:class => "powered" } %> | ||
</div> | ||
... | ... | |
<div id="footer"> | ||
<ul> | ||
<li><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0</a></li> | ||
44 | | |
44 | <li><a href="http://jigsaw.w3.org/css-validator/validator?uri=<%= this_blog.base_url %>">Valid CSS</a></li> | |
</ul> | ||
</div> | ||
</div> |
rool/rails/typo/trunk/test/test_helper.rb:
prev. | current | |
# Instantiated fixtures are slow, but give you @david where you otherwise would need people(:david) | ||
self.use_instantiated_fixtures = false | ||
16 | def run(result) | |
17 | yield(STARTED, name) | |
18 | @_result = result | |
19 | begin | |
20 | CachedModel.cache_reset | |
21 | setup | |
22 | __send__(@method_name) | |
23 | rescue Test::Unit::AssertionFailedError => e | |
24 | add_failure(e.message, e.backtrace) | |
25 | rescue StandardError, ScriptError | |
26 | add_error($!) | |
27 | ensure | |
28 | begin | |
29 | teardown | |
30 | rescue Test::Unit::AssertionFailedError => e | |
31 | add_failure(e.message, e.backtrace) | |
32 | rescue StandardError, ScriptError | |
33 | add_error($!) | |
34 | end | |
35 | end | |
36 | result.add_run | |
37 | yield(FINISHED, name) | |
38 | end | |
39 | ||
40 | ||
# Add more helper methods to be used by all tests here... | ||
def assert_xml(xml) | ||
assert_nothing_raised do | ||
... | ... | |
def this_blog | ||
Blog.default || Blog.create! | ||
end | ||
81 | ||
82 | def assert_template_has(key=nil, message=nil) | |
83 | msg = build_message(message, "<?> is not a template object", key) | |
84 | assert_block(msg) { @response.has_template_object?(key) } | |
85 | end | |
86 | ||
87 | def assert_template_has_no(key=nil, message=nil) | |
88 | msg = build_message(message, "<?> is a template object <?>", | |
89 | key, @response.template_objects[key]) | |
90 | assert_block(msg) { !@response.has_template_object?(key) } | |
91 | end | |
92 | ||
93 | def assert_session_has(key=nil, message=nil) | |
94 | msg = build_message(message, "<?> is not in the session <?>", | |
95 | key, @response.session) | |
96 | assert_block(msg) { @response.has_session_object?(key) } | |
97 | end | |
98 | ||
99 | def assert_session_has_no(key=nil, message=nil) | |
100 | msg = build_message(message, "<?> is in the session <?>", | |
101 | key, @response.session) | |
102 | assert_block(msg) { !@response.has_session_object?(key) } | |
103 | end | |
104 | ||
105 | def assert_invalid_column_on_record(key = nil, columns = "", message = nil) #:nodoc: | |
106 | record = find_record_in_template(key) | |
107 | record.send(:validate) | |
108 | ||
109 | cols = glue_columns(columns) | |
110 | cols.delete_if { |col| record.errors.invalid?(col) } | |
111 | msg = build_message(message, "Active Record has valid columns <?>)", cols.join(",") ) | |
112 | assert_block(msg) { cols.empty? } | |
113 | end | |
114 | ||
115 | def glue_columns(columns) | |
116 | cols = [] | |
117 | cols << columns if columns.class == String | |
118 | cols += columns if columns.class == Array | |
119 | cols | |
120 | end | |
121 | ||
122 | def find_record_in_template(key = nil) | |
123 | assert_not_nil assigns(key) | |
124 | record = @response.template_objects[key] | |
125 | ||
126 | assert_not_nil(record) | |
127 | assert_kind_of ActiveRecord::Base, record | |
128 | ||
129 | return record | |
130 | end | |
end | ||
# Extend HTML::Tag to understand URI matching |
rool/rails/typo/trunk/test/unit/article_test.rb:
prev. | current | |
require 'http_mock' | ||
class ArticleTest < Test::Unit::TestCase | ||
6 | | |
6 | fixtures :blogs, :contents, :articles_tags, :tags, :resources, :categories, :categorizations, :users, :notifications, :text_filters | |
def setup | ||
@articles = [] | ||
... | ... | |
assert @articles.include?(i.is_a?(Symbol) ? contents(i) : i) | ||
end | ||
end | ||
18 | | |
18 | ||
19 | def test_content_fields | |
20 | a = Article.new | |
21 | assert_equal [:body, :extended], a.content_fields | |
22 | end | |
23 | ||
24 | def test_permalink_url | |
25 | a = contents(:article3) | |
26 | assert_equal 'http://myblog.net/articles/2004/06/01/article-3', a.permalink_url | |
27 | end | |
28 | ||
29 | def test_edit_url | |
30 | a = contents(:article3) | |
31 | assert_equal 'http://myblog.net/admin/content/edit/3', a.edit_url | |
32 | end | |
33 | ||
34 | def test_delete_url | |
35 | a = contents(:article3) | |
36 | assert_equal 'http://myblog.net/admin/content/destroy/3', a.delete_url | |
37 | end | |
38 | ||
39 | def test_feed_url | |
40 | a = contents(:article3) | |
41 | assert_equal 'http://myblog.net/xml/atom10/article/3/feed.xml', a.feed_url(:atom10) | |
42 | assert_equal 'http://myblog.net/xml/rss20/article/3/feed.xml', a.feed_url(:rss20) | |
43 | end | |
44 | ||
def test_blog | ||
a = Article.new | ||
21 | | |
47 | ||
assert_equal(1, a.blog_id) | ||
assert_kind_of(Blog, a.blog) | ||
end | ||
... | ... | |
assert_kind_of Article,b | ||
assert_equal 0, b.tags.size | ||
122 | | |
148 | ||
c = Article.new(:title => 'Foo', :keywords => 'test "tag test" web2.0') | ||
c.keywords_to_tags | ||
125 | | |
151 | ||
assert_equal 3, c.tags.size | ||
assert_equal ['test', 'tagtest', 'web2.0'].sort, c.tags.collect(&:name).sort | ||
end | ||
... | ... | |
def test_find_published | ||
@articles = this_blog.articles.find_published | ||
assert_results_are(:search_target, :article1, :article2, | ||
140 | | |
166 | :article3, :inactive_article,:xmltest, | |
167 | :spammed_article) | |
@articles = this_blog.articles.find_published(:all, | ||
:conditions => "title = 'Article 1!'") | ||
... | ... | |
:published => true) | ||
assert art.just_published? | ||
assert art.save | ||
180 | art.reload | |
assert !art.just_published? | ||
art = Article.create!(:title => 'title2', | ||
... | ... | |
def test_future_publishing | ||
assert_sets_trigger(Article.create!(:title => 'title', :body => 'body', | ||
:published => true, | ||
165 | | |
193 | :published_at => Time.now + 4.seconds)) | |
end | ||
def test_future_publishing_without_published_flag | ||
assert_sets_trigger Article.create!(:title => 'title', :body => 'body', | ||
170 | | |
198 | :published_at => Time.now + 4.seconds) | |
end | ||
def test_triggers_are_dependent | ||
... | ... | |
def assert_sets_trigger(art) | ||
assert_equal 1, Trigger.count | ||
assert Trigger.find(:first, :conditions => ['pending_item_id = ?', art.id]) | ||
184 | | |
212 | sleep 4 | |
Trigger.fire | ||
art.reload | ||
assert art.published | ||
... | ... | |
assert_equal(2, Article.find_all_by_date(2004,03).size) | ||
assert_equal(1, Article.find_all_by_date(2004,03,01).size) | ||
end | ||
279 | ||
280 | def test_withdrawal | |
281 | art = Article.find(contents(:article1).id) | |
282 | assert art.published? | |
283 | assert ! art.withdrawn? | |
284 | art.withdraw! | |
285 | assert ! art.published? | |
286 | assert art.withdrawn? | |
287 | art.reload | |
288 | assert ! art.published? | |
289 | assert art.withdrawn? | |
290 | end | |
291 | ||
292 | def test_default_filter | |
293 | a = Article.find(1) | |
294 | assert_equal 'textile', a.default_text_filter.name | |
295 | end | |
end |
rool/rails/typo/trunk/test/unit/blog_test.rb:
prev. | current | |
require File.dirname(__FILE__) + '/../test_helper' | ||
class BlogTest < Test::Unit::TestCase | ||
4 | | |
4 | fixtures :blogs, :contents, :sidebars | |
def setup | ||
@blog = Blog.find(:first) | ||
... | ... | |
end | ||
end | ||
34 | | |
35 | | |
36 | | |
37 | | |
38 | | |
39 | ||
40 | | |
41 | | |
42 | | |
43 | | |
44 | ||
def test_current_theme_path | ||
46 | | |
35 | assert_equal Theme.themes_root + "/azure", @blog.current_theme.path | |
end | ||
def test_current_theme | ||
... | ... | |
end | ||
def test_url_for | ||
54 | | |
43 | assert_equal('http://myblog.net/articles/read/1', | |
@blog.url_for(:controller => 'articles', | ||
:action => 'read', | ||
:id => 1)) | ||
end | ||
60 | | |
61 | | |
62 | | |
63 | | |
64 | | |
49 | def test_blog_has_sidebars | |
50 | assert_equal 1, @blog.sidebars.size | |
end | ||
66 | ||
67 | | |
68 | | |
69 | | |
70 | | |
71 | ||
72 | | |
73 | | |
74 | | |
75 | | |
76 | | |
77 | ||
78 | | |
79 | | |
80 | | |
81 | | |
82 | | |
end |
rool/rails/typo/trunk/test/unit/category_test.rb:
prev. | current | |
require File.dirname(__FILE__) + '/../test_helper' | ||
class CategoryTest < Test::Unit::TestCase | ||
4 | | |
4 | fixtures :contents, :categories, :categorizations, :blogs | |
def setup | ||
@category = Category.find(1) | ||
... | ... | |
Category.reorder_alpha | ||
assert_equal categories(:hardware), Category.find(:first, :order => :position) | ||
end | ||
37 | ||
38 | def test_permalink | |
39 | assert_equal 'http://myblog.net/articles/category/software', @category.permalink_url | |
40 | end | |
41 | ||
end |
rool/rails/typo/trunk/test/unit/comment_test.rb:
prev. | current | |
require 'dns_mock' | ||
class CommentTest < Test::Unit::TestCase | ||
6 | | |
6 | fixtures :contents, :feedback, :blacklist_patterns, :text_filters, :blogs | |
8 | def setup | |
9 | CachedModel.cache_reset | |
10 | end | |
11 | ||
12 | def test_permalink_url | |
13 | c = feedback(:old_comment) | |
14 | assert_equal "http://myblog.net/articles/2004/05/01/inactive-article#comment-#{c.id}", c.permalink_url | |
15 | end | |
16 | ||
17 | def test_edit_url | |
18 | c = feedback(:old_comment) | |
19 | assert_equal "http://myblog.net/admin/comments/edit/#{c.id}", c.edit_url | |
20 | end | |
21 | ||
22 | def test_delete_url | |
23 | c = feedback(:old_comment) | |
24 | assert_equal "http://myblog.net/admin/comments/destroy/#{c.id}", c.delete_url | |
25 | end | |
26 | ||
def test_save_regular | ||
9 | | |
10 | | |
28 | assert feedback(:comment2).save | |
29 | assert_equal "http://www.google.com", feedback(:comment2).url | |
end | ||
def test_save_spam | ||
14 | | |
15 | | |
33 | assert feedback(:spam_comment).save | |
34 | assert_equal "http://fakeurl.com", feedback(:spam_comment).url | |
end | ||
def test_create_comment | ||
... | ... | |
end | ||
def test_reject_spam_rbl | ||
30 | | |
31 | | |
32 | | |
33 | | |
34 | | |
35 | ||
36 | | |
49 | cmt = Comment.new do |c| | |
50 | c.author = "Spammer" | |
51 | c.body = %{This is just some random text. <a href="http://chinaaircatering.com">without any senses.</a>. Please disregard.} | |
52 | c.url = "http://buy-computer.us" | |
53 | c.ip = "212.42.230.206" | |
54 | end | |
55 | assert cmt.spam? | |
56 | assert !cmt.status_confirmed? | |
end | ||
def test_not_spam_but_rbl_lookup_succeeds | ||
40 | | |
41 | | |
42 | | |
43 | | |
44 | | |
45 | ||
46 | | |
60 | cmt = Comment.new do |c| | |
61 | c.author = "Not a Spammer" | |
62 | c.body = "Useful commentary!" | |
63 | c.url = "http://www.bofh.org.uk" | |
64 | c.ip = "10.10.10.10" | |
65 | end | |
66 | assert !cmt.spam? | |
67 | assert !cmt.status_confirmed? | |
end | ||
def test_reject_spam_pattern | ||
50 | | |
51 | | |
52 | | |
53 | | |
54 | ||
55 | | |
71 | cmt = Comment.new do |c| | |
72 | c.author = "Another Spammer" | |
73 | c.body = "Texas hold-em poker crap" | |
74 | c.url = "http://texas.hold-em.us" | |
75 | end | |
76 | assert cmt.spam? | |
77 | assert !cmt.status_confirmed? | |
end | ||
def test_reject_spam_uri_limit | ||
59 | | |
60 | | |
61 | | |
62 | | |
63 | | |
81 | c = Comment.new do |c| | |
82 | c.author = "Yet Another Spammer" | |
83 | c.body = %{ <a href="http://www.one.com/">one</a> <a href="http://www.two.com/">two</a> <a href="http://www.three.com/">three</a> <a href="http://www.four.com/">four</a> } | |
84 | c.url = "http://www.uri-limit.com" | |
85 | c.ip = "123.123.123.123" | |
86 | end | |
65 | | |
88 | assert c.spam? | |
89 | assert !c.status_confirmed? | |
end | ||
def test_reject_article_age | ||
69 | | |
70 | | |
71 | | |
72 | | |
93 | c = Comment.new do |c| | |
94 | c.author = "Old Spammer" | |
95 | c.body = "Old trackback body" | |
96 | c.article = contents(:inactive_article) | |
97 | end | |
assert ! c.save | ||
assert c.errors.invalid?('article_id') | ||
... | ... | |
end | ||
def test_article_relation | ||
91 | | |
92 | | |
116 | assert feedback(:comment2).article | |
117 | assert_equal 1, feedback(:comment2).article.id | |
end | ||
def test_xss_rejection | ||
96 | | |
97 | | |
98 | | |
99 | | |
121 | c = Comment.new do |c| | |
122 | c.body = "Test foo <script>do_evil();</script>" | |
123 | c.author = 'Bob' | |
124 | c.article_id = 1 | |
125 | end | |
# Test each filter to make sure that we don't allow scripts through. | ||
# Yes, this is ugly. | ||
... | ... | |
assert c.save | ||
assert c.errors.empty? | ||
109 | | |
135 | assert c.html(:body) !~ /<script>/ | |
end | ||
end | ||
def test_withdraw | ||
114 | | |
140 | c = Comment.find(feedback(:comment2).id) | |
assert c.withdraw! | ||
assert ! c.published? | ||
117 | | |
143 | assert c.spam? | |
144 | assert c.status_confirmed? | |
145 | c.reload | |
assert ! c.published? | ||
147 | assert c.spam? | |
148 | assert c.status_confirmed? | |
end | ||
150 | ||
151 | def test_published | |
152 | a = Article.new(:title => 'foo', :blog_id => 1) | |
153 | assert a.save | |
154 | ||
155 | assert_equal 0, a.published_comments.size | |
156 | c = a.comments.build(:body => 'foo', :author => 'bob', :published => true, :published_at => Time.now) | |
157 | assert c.save | |
158 | assert c.published? | |
159 | c.reload | |
160 | a.reload | |
161 | ||
162 | assert_equal 1, a.published_comments.size | |
163 | c.withdraw! | |
164 | ||
165 | a = Article.new(:title => 'foo', :blog_id => 1) | |
166 | assert_equal 0, a.published_comments.size | |
167 | end | |
168 | ||
169 | def test_status_confirmed | |
170 | a = contents(:spammed_article) | |
171 | assert !a.comments[0].status_confirmed? | |
172 | assert a.comments[1].status_confirmed? | |
173 | ||
174 | a.reload | |
175 | assert_equal 1, | |
176 | a.comments.find_all_by_status_confirmed(true).size | |
177 | assert_equal 1, | |
178 | a.comments.find_all_by_status_confirmed(true).size | |
179 | a.comments[0].withdraw! | |
180 | assert_equal 2, | |
181 | a.comments.find_all_by_status_confirmed(true).size | |
182 | end | |
183 | ||
184 | def test_default_filter | |
185 | a = Comment.find(:first) | |
186 | assert_equal 'markdown', a.default_text_filter.name | |
187 | end | |
end |
rool/rails/typo/trunk/test/unit/content_state/factory_test.rb:
prev. | current | |
def test_write_new_state | ||
content = MockContent.new(true) | ||
37 | | |
37 | ContentState::New.instance.enter_hook(content) | |
assert_equal false, content.published? | ||
assert_nil content.published_at | ||
... | ... | |
def test_write_publication_pending_state | ||
content = MockContent.new(true, true, 1.hour.from_now) | ||
45 | | |
45 | ContentState::PublicationPending.instance.enter_hook(content) | |
assert_equal false, content.published? | ||
assert content.published_at > Time.now | ||
end | ||
def test_write_draft_state | ||
content = MockContent.new(true, nil, nil) | ||
52 | | |
52 | ContentState::Draft.instance.enter_hook(content) | |
assert_equal false, content.published | ||
assert_nil content.published_at | ||
end | ||
def test_write_just_published_state | ||
content = MockContent.new(true, nil, nil) | ||
59 | | |
59 | ContentState::JustPublished.instance.enter_hook(content) | |
assert_equal true, content.published | ||
assert content.published_at <= Time.now | ||
published_at = 10.minutes.ago | ||
content = MockContent.new(true, nil, published_at) | ||
65 | | |
65 | ContentState::JustPublished.instance.enter_hook(content) | |
assert_equal true, content.published | ||
assert_equal published_at, content.published_at | ||
end | ||
def test_write_published_state | ||
content = MockContent.new | ||
72 | | |
72 | assert ContentState::Published.instance.enter_hook(content) | |
73 | assert_equal true, content.published | |
end | ||
class MockContent < Struct.new(:new_record, :published, :published_at) | ||
alias_method :new_record?, :new_record | ||
alias_method :published?, :published | ||
79 | ||
80 | def changed | |
81 | @changed = true | |
82 | end | |
83 | ||
84 | def changed? | |
85 | @changed | |
86 | end | |
end | ||
end |
rool/rails/typo/trunk/test/unit/magnolia_test.rb:
prev. | current | |
class MagnoliaTest < Test::Unit::TestCase | ||
def setup | ||
6 | | |
6 | @mag = ::MagnoliaAggregation.new("",false) | |
@mag.send(:parse, fixture) | ||
end | ||
rool/rails/typo/trunk/test/unit/page_test.rb:
prev. | current | |
def setup | ||
@page = Page.find(9) | ||
end | ||
9 | ||
10 | def test_permalink_url | |
11 | p = contents(:first_page) | |
12 | assert_equal 'http://myblog.net/pages/page_one', p.permalink_url | |
13 | end | |
14 | ||
15 | def test_edit_url | |
16 | p = contents(:first_page) | |
17 | assert_equal 'http://myblog.net/admin/pages/edit/9', p.edit_url | |
18 | end | |
19 | ||
20 | def test_delete_url | |
21 | p = contents(:first_page) | |
22 | assert_equal 'http://myblog.net/admin/pages/destroy/9', p.delete_url | |
23 | end | |
def test_validate | ||
a = Page.new | ||
... | ... | |
assert !b.save | ||
end | ||
40 | ||
41 | def test_default_filter | |
42 | a = Page.find(:first) | |
43 | assert_equal 'textile', a.default_text_filter.name | |
44 | end | |
end |
rool/rails/typo/trunk/test/unit/ping_test.rb:
prev. | current | |
assert_pingback_sent | ||
end | ||
36 | def test_ping_sent_on_save | |
37 | Net::HTTP.next_response = self | |
38 | ||
39 | art = Blog.default.articles.build \ | |
40 | :body => %{<link rel="pingback" href="http://anotherblog.org/xml-rpc" />}, | |
41 | :title => 'Test the pinging', | |
42 | :published => true | |
43 | assert art.save | |
44 | sent_ping = XMLRPC::Client.pings.last | |
45 | assert art.just_published? | |
46 | art.reload | |
47 | assert !art.just_published? | |
48 | end | |
49 | ||
def assert_pingback_sent | ||
Net::HTTP.next_response = self | ||
ping = contents(:article1).pings.build("url" => |
rool/rails/typo/trunk/test/unit/sidebar_test.rb:
prev. | current | |
class SidebarTest < Test::Unit::TestCase | ||
fixtures :sidebars | ||
6 | | |
7 | | |
6 | def test_available_sidebars | |
7 | assert Sidebar.available_sidebars.size >= 19 | |
end | ||
9 | ||
10 | | |
11 | | |
12 | | |
13 | | |
end |
rool/rails/typo/trunk/test/unit/tag_test.rb:
prev. | current | |
require File.dirname(__FILE__) + '/../test_helper' | ||
class TagTest < Test::Unit::TestCase | ||
4 | | |
4 | fixtures :tags, :contents, :articles_tags, :blogs | |
def setup | ||
@tag = Tag.find(1) | ||
... | ... | |
assert_equal "bar", tags.last.name | ||
assert_equal 2, tags.first.article_counter | ||
end | ||
66 | ||
67 | def test_permalink | |
68 | tag = Tag.get('foo') | |
69 | assert_equal 'http://myblog.net/articles/tag/foo', tag.permalink_url | |
70 | end | |
end |
rool/rails/typo/trunk/test/unit/text_filter_test.rb:
prev. | current | |
def test_available | ||
filters = TextFilter.available_filters | ||
36 | | |
37 | | |
38 | | |
39 | | |
40 | | |
41 | | |
36 | assert filters.include?(Typo::Textfilter::Markdown) | |
37 | assert filters.include?(Typo::Textfilter::Smartypants) | |
38 | assert filters.include?(Typo::Textfilter::Htmlfilter) | |
39 | assert filters.include?(Typo::Textfilter::Textile) | |
40 | assert filters.include?(Typo::Textfilter::Amazon) | |
41 | assert filters.include?(Typo::Textfilter::Flickr) | |
assert !filters.include?(TextFilterPlugin::Markup) | ||
assert !filters.include?(TextFilterPlugin::Macro) | ||
... | ... | |
assert types['postprocess'] | ||
assert types['other'] | ||
68 | | |
69 | | |
68 | assert types['markup'].include?(Typo::Textfilter::Markdown) | |
69 | assert types['markup'].include?(Typo::Textfilter::Textile) | |
71 | | |
71 | assert types['macropost'].include?(Typo::Textfilter::Flickr) | |
73 | | |
73 | assert types['macropre'].include?(Typo::Textfilter::Code) | |
75 | | |
76 | | |
75 | assert types['postprocess'].include?(Typo::Textfilter::Smartypants) | |
76 | assert types['postprocess'].include?(Typo::Textfilter::Amazon) | |
78 | | |
79 | | |
80 | | |
78 | assert types['other'].include?(Typo::Textfilter::Htmlfilter) | |
79 | assert types['other'].include?(Typo::Textfilter::MacroPre) | |
80 | assert types['other'].include?(Typo::Textfilter::MacroPost) | |
# There shouldn't be any 'other' plugins coming from users; they | ||
# should all be part of the core | ||
... | ... | |
def test_map | ||
map = TextFilter.filters_map | ||
90 | | |
90 | assert_equal Typo::Textfilter::Markdown, | |
map['markdown'] | ||
92 | | |
92 | assert_equal Typo::Textfilter::Smartypants, | |
map['smartypants'] | ||
94 | | |
94 | assert_equal Typo::Textfilter::Htmlfilter, | |
map['htmlfilter'] | ||
96 | | |
96 | assert_equal Typo::Textfilter::Textile, | |
map['textile'] | ||
98 | | |
98 | assert_equal Typo::Textfilter::Amazon, | |
map['amazon'] | ||
100 | | |
100 | assert_equal Typo::Textfilter::Flickr, | |
map['flickr'] | ||
end | ||
rool/rails/typo/trunk/test/unit/theme_test.rb:
prev. | current | |
end | ||
def test_theme_from_path | ||
28 | | |
28 | assert_equal "azure", Theme.theme_from_path(this_blog.current_theme.path).name | |
end | ||
def test_search_theme_directory |
rool/rails/typo/trunk/test/unit/trackback_test.rb:
prev. | current | |
require 'dns_mock' | ||
class TrackbackTest < Test::Unit::TestCase | ||
6 | | |
6 | fixtures :contents, :feedback, :blacklist_patterns, :blogs | |
8 | def test_permalink_url | |
9 | t = feedback(:trackback4) | |
10 | assert_equal "http://myblog.net/articles/2004/04/01/second-blog-article#trackback-#{t.id}", t.permalink_url | |
11 | end | |
12 | ||
13 | def test_edit_url | |
14 | t = feedback(:trackback4) | |
15 | assert_equal "http://myblog.net/admin/trackbacks/edit/#{t.id}", t.edit_url | |
16 | end | |
17 | ||
18 | def test_delete_url | |
19 | t = feedback(:trackback4) | |
20 | assert_equal "http://myblog.net/admin/trackbacks/destroy/#{t.id}", t.delete_url | |
21 | end | |
22 | ||
def test_incomplete | ||
tb = Trackback.new | ||
tb.blog_name = "Blog name" | ||
... | ... | |
assert tb.save | ||
assert tb.errors.empty? | ||
assert tb.guid.size > 15 | ||
21 | | |
36 | assert !tb.spam? | |
end | ||
def test_reject_spam_rbl | ||
25 | | |
26 | | |
27 | | |
28 | | |
29 | | |
30 | | |
40 | tb = Trackback.new do |tb| | |
41 | tb.blog_name = "Spammer" | |
42 | tb.title = "Spammy trackback" | |
43 | tb.excerpt = %{This is just some random text. <a href="http://chinaaircatering.com">without any senses.</a>. Please disregard.} | |
44 | tb.url = "http://buy-computer.us" | |
45 | tb.ip = "212.42.230.206" | |
46 | end | |
32 | | |
48 | assert tb.spam? | |
end | ||
def test_reject_spam_pattern | ||
36 | | |
37 | | |
38 | | |
39 | | |
40 | ||
41 | | |
52 | tb = Trackback.new do |tb| | |
53 | tb.blog_name = "Another Spammer" | |
54 | tb.title = "Spammy trackback" | |
55 | tb.excerpt = "Texas hold-em poker crap" | |
56 | end | |
57 | assert tb.spam? | |
end | ||
end |
rool/rails/typo/trunk/test/unit/user_test.rb:
prev. | current | |
end | ||
def test_articles_link | ||
13 | | |
14 | | |
15 | | |
13 | assert_equal 8, User.find(1).articles.size | |
14 | assert_equal 7, User.find(1).articles.find_published.size | |
15 | assert_equal 7, User.find(1).articles.published.size | |
articles = User.find(1).articles.published | ||
assert_equal articles.sort_by { |a| a.created_at }.reverse, articles |
rool/rails/typo/trunk/themes/azure/layouts/default.rhtml:
prev. | current | |
<div id="container" class="clearfix"> | ||
<div id="header"> | ||
<div id="logo"> | ||
15 | | |
15 | <h1 id="sitename"><%= link_to this_blog.blog_name, this_blog.base_url %></h1> | |
<h2 id="subtitle"><%= this_blog.blog_subtitle %></h2> | ||
</div> | ||
</div> | ||
19 | | |
19 | ||
<div id="search"> <%= render :partial => "shared/search" %></div> | ||
<% benchmark "BENCHMARK: layout/content" do %> | ||
... | ... | |
</div> | ||
<% end %> | ||
<div id="sidebar"> | ||
30 | | |
30 | ||
<div id="search-results"></div> | ||
<% benchmark "BENCHMARK: layout/sidebars" do %> | ||
<%= render_sidebars %> | ||
<% end %> | ||
35 | | |
35 | ||
<%= link_to image_tag("powered.gif"), "http://www.typosphere.org/", {:class => "powered" } %> | ||
</div> | ||
... | ... | |
<div id="footer"> | ||
<ul> | ||
<li><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0</a></li> | ||
44 | | |
44 | <li><a href="http://jigsaw.w3.org/css-validator/validator?uri=<%= this_blog.base_url %>">Valid CSS</a></li> | |
</ul> | ||
</div> | ||
</div> |
rool/rails/typo/trunk/themes/risc_os_open/layouts/default.rhtml:
prev. | current | |
<%= render 'shared/fixed_sidebar' %> | ||
41 | | |
41 | <p /> | |
42 | <div class="sidebar-node"> | |
43 | <%= render_sidebars %> | |
44 | </div> | |
</td> | ||
</tr> | ||
</table> |
rool/rails/typo/trunk/themes/scribbish/layouts/default.rhtml:
prev. | current | |
<body> | ||
<div id="container"> | ||
<div id="header"> | ||
12 | | |
12 | <h1><span><%= link_to this_blog.blog_name, this_blog.base_url %></span></h1> | |
<h2><%= this_blog.blog_subtitle %></h2> | ||
</div> | ||
... | ... | |
<div id="footer"> | ||
<hr /> | ||
34 | | |
34 | <p><%= link_to this_blog.blog_name, this_blog.base_url %></p> | |
<ul> | ||
<li>powered by <%= link_to 'typo', 'http://typosphere.org' %> / | ||
styled with <%= link_to 'scribbish', 'http://quotedprintable.com/pages/scribbish' %></li> |
rool/rails/typo/trunk/themes/scribbish/stylesheets/content.css:
prev. | current | |
background: transparent; | ||
} | ||
139 | ||
139 | #content .atomentry .title .comment_count { color: #eee; } | |
#content .atomentry .author { | ||
color: #bbb; | ||
... | ... | |
/* Flickr sidebar-node */ | ||
#sidebar #flickr { | ||
margin: 0 0 2em; | ||
336 | | |
336 | clear: both; | |
} | ||
#sidebar #flickr div { | ||
340 | | |
341 | | |
342 | | |
343 | | |
} | ||
#sidebar #flickr img { | ||
347 | | |
343 | margin: 0 0 5px; | |
344 | padding: 5px; | |
345 | border: 1px solid #ddd; | |
display: block; | ||
} | ||
#sidebar #flickr img:hover { | ||
352 | | |
350 | background: #ffc; | |
} | ||
#sidebar #flickr a { |
rool/rails/typo/trunk/themes/scribbish/views/articles/_article.rhtml:
prev. | current | |
<div class="atomentry" id="article-<%= article.id %>"> | ||
<h2 class="title"> | ||
3 | | |
4 | | |
3 | <%= (controller.action_name.include? 'permalink') ? article.title : link_to_permalink(article,article.title) %> | |
4 | <%= content_tag(:span, article.published_comments.size, :class => 'comment_count') if article.published_comments.size > 0 %> | |
</h2> | ||
<p class="author"> | ||
... | ... | |
</p> | ||
<div class="content"> | ||
13 | | |
13 | <%= article.html(:body) %> | |
<% if article.extended? -%> | ||
<div class="extended"> | ||
<% if controller.action_name == 'index' -%> | ||
18 | | |
18 | <p><%= link_to_permalink article,"Continue reading..." %></p> | |
<% else -%> | ||
20 | | |
20 | <%= article.html(:extended) %> | |
<% end -%> | ||
</div> | ||
23 | | |
23 | <% end -%> | |
</div> | ||
<ul class="meta"> | ||
<%= content_tag(:li, category_links(article), :class => 'categories') unless article.categories.empty? %> | ||
<%= content_tag(:li, tag_links(article), :class => 'tags') unless article.tags.empty? %> | ||
29 | | |
29 | <li>Meta | |
<%= trackbacks_link(article) << ',' if article.allow_pings? %> | ||
<%= comments_link(article) << ',' if article.allow_comments? %> | ||
32 | | |
33 | | |
34 | | |
32 | <a href="<%= article.permalink_url %>" rel="bookmark">permalink</a>, | |
33 | <a href="<%= url_for :controller => 'xml', :action=>'feed', :type=>'article', :format => 'rss', :id => article %>">rss</a>, | |
34 | <a href="<%= url_for :controller => 'xml', :action=>'feed', :type=>'article', :format => 'atom', :id => article %>">atom</a> | |
</li> | ||
</ul> | ||
</div> |
rool/rails/typo/trunk/themes/scribbish/views/articles/_comment.rhtml:
prev. | current | |
<ol id="comments" class="comments"> | ||
2 | | |
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
2 | <% if @article.published_comments.any? -%> | |
3 | <% for comment in @article.published_comments -%> | |
4 | <li class="comment" id="comment-<%= comment.id %>"> | |
5 | <div class="author"> | |
6 | <%= content_tag(:div, gravatar_tag(comment.email)) if this_blog.use_gravatar and comment.email %> | |
7 | <cite><%= (comment.url.blank?) ? h(comment.author) : link_to(h(comment.author), comment.url) %></cite> | |
8 | <abbr title="<%= comment.created_at.xmlschema %>"><%= distance_of_time_in_words comment.article.published_at, comment.created_at %> later:</abbr> | |
9 | </div> | |
10 | <div class="content"> | |
11 | <%= comment.html %> | |
12 | </div> | |
13 | </li> | |
14 | <% end -%> | |
15 | <% else -%> | |
16 | <li class="dummy_comment" style="display:none">No comments</li> | |
17 | <% end -%> | |
</ol> |
rool/rails/typo/trunk/themes/scribbish/views/articles/_comment_form.rhtml:
prev. | current | |
1 | ||
1 | <%= form_remote_tag :url => {:action => 'comment', :id => @article}, | |
:update => 'comments_div', | ||
3 | | |
3 | :loading => 'commentLoading()', | |
:complete => 'commentComplete()', | ||
:html => {:id => 'commentform', :class => 'comments' } %> | ||
... | ... | |
<fieldset> | ||
<legend>Comments</legend> | ||
<p> | ||
12 | | |
12 | <label>Name:<br /> | |
<%= text_field "comment", "author" %> | ||
14 | | |
14 | <small>(<%= link_to_function("leave url/email »", "Effect.toggle('extra_fields', 'blind', {duration: .3})") %>)</small> | |
</label> | ||
</p> | ||
17 | | |
18 | | |
19 | | |
20 | | |
21 | | |
22 | | |
23 | | |
24 | | |
25 | | |
26 | | |
27 | | |
28 | | |
17 | ||
18 | <div id="extra_fields" style="display:none;"> | |
19 | <p> | |
20 | <label>Email: <%= content_tag('small', "(#{link_to('gravatar', 'http://gravatar.com')} enabled)") if this_blog.use_gravatar %><br /> | |
21 | <%= text_field "comment", "email" %> | |
22 | </label> | |
23 | </p> | |
24 | <p> | |
25 | <label>Url:<br /> | |
26 | <%= text_field "comment", "url" %> | |
27 | </label> | |
28 | </p> | |
</div> | ||
30 | | |
30 | ||
<p> | ||
<label> | ||
Comments: | ||
34 | | |
35 | | |
34 | <%= content_tag('small', link_to("Textile enabled", "http://hobix.com/textile/")) if this_blog.comment_text_filter.include? 'textile' %> | |
35 | <%= content_tag('small', link_to("Markdown enabled", "http://daringfireball.net/projects/markdown/")) if this_blog.comment_text_filter.include? 'markdown' %> | |
<br /> | ||
<%= text_area 'comment', 'body' %> | ||
</label> | ||
</p> | ||
40 | | |
40 | ||
<p> | ||
42 | | |
43 | | |
42 | <%= submit_to_remote('preview', 'Preview!', | |
43 | :update => 'preview', | |
44 | :complete => "Element.show('preview')", | |
45 | :url => { :action => 'comment_preview' }) %> | |
46 | <%= submit_tag 'Submit', :onclick => "$('commentform').onsubmit();this.disabled=true;Element.hide('preview');return false;" %> | |
<%= image_tag '/images/theme/spinner.gif', :id => 'spinner', :style => 'display:none' %> | ||
</p> | ||
</fieldset> |
rool/rails/typo/trunk/themes/scribbish/views/articles/_search.rhtml:
prev. | current | |
<div id="search" class="search"> | ||
2 | | |
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
14 | | |
2 | <% form_tag({ :controller => 'articles', :action => 'search' }, | |
3 | { :method => 'get', :id => 'sform' }) do -%> | |
4 | <p><input type="text" id="q" name="q" value="" /></p> | |
5 | <% end -%> | |
6 | ||
7 | <div id="loading" class="loading" style="display:none;">Searching...</div> | |
8 | <div id="results" class="results"></div> | |
9 | <%= observe_field 'q', | |
10 | :url => { :controller => 'live', :action => 'search' }, | |
11 | :frequency => 1, | |
12 | :loading => "Element.show('loading')", | |
13 | :complete => "Element.hide('loading')", | |
14 | :update => 'results', | |
15 | :with => "'q=' + escape($F('q'))" %> | |
</div> |
rool/rails/typo/trunk/themes/scribbish/views/articles/comment_preview.rhtml:
prev. | current | |
<div class="comment preview"> | ||
<div class="author"> | ||
3 | | |
3 | <%= content_tag(:div, gravatar_tag(@comment.email)) if this_blog.use_gravatar and @comment.email %> | |
<cite><%= (@comment.url.blank?) ? h(@comment.author) : link_to(h(@comment.author), @comment.url) %></cite> | ||
<abbr>is about to say</abbr> | ||
</div> | ||
<div class="content"> | ||
8 | | |
8 | <%= @comment.html %> | |
</div> | ||
10 | ||
11 | </div> |
rool/rails/typo/trunk/themes/scribbish/views/articles/index.rhtml:
prev. | current | |
<%= render :partial => 'article', :collection => @articles %> | ||
3 | ||
3 | <% unless @pages.item_count <= this_blog.limit_article_display -%> | |
<p class="pagination">Older posts: <%= pagination_links @pages, :params => { :action => @controller.action_name } %></p> | ||
<% end -%> | ||
rool/rails/typo/trunk/themes/scribbish/views/articles/read.rhtml:
prev. | current | |
xmlns:dc="http://purl.org/dc/elements/1.1/"> | ||
<rdf:Description | ||
rdf:about="" | ||
8 | | |
8 | trackback:ping="<%= @article.trackback_url %>" | |
dc:title="<%=h @article.title.gsub(/-+/, '-') %>" | ||
10 | | |
11 | | |
10 | dc:identifier="<%= @article.permalink_url %>" | |
11 | dc:description="<%=h (@article.html.strip_html[0..255]).gsub(/-+/, '-') %>" | |
dc:creator="<%= h @article.author %>" | ||
dc:date="<%= @article.updated_at.xmlschema %>" /> | ||
</rdf:RDF> | ||
--> | ||
17 | ||
17 | <%= render :partial => 'article', :object => @article %> | |
<% if @article.allow_pings? -%> | ||
<h5><a name="trackbacks">Trackbacks</a></h5> | ||
<p> | ||
Use the following link to trackback from your own site:<br /> | ||
23 | | |
24 | | |
23 | <%= @article.trackback_url %> | |
24 | </p> | |
26 | | |
26 | <% unless @article.published_trackbacks.blank? -%> | |
<ol id="trackbacks" class="trackbacks"> | ||
28 | | |
29 | | |
30 | | |
28 | <%= render(:partial => "trackback", :collection => @article.published_trackbacks) %> | |
29 | </ol> | |
30 | <% end -%> | |
<% end -%> | ||
33 | ||
34 | | |
33 | <% if @article.allow_comments? or @article.published_comments.size > 0 -%> | |
34 | <h5><a name="comments">Comments</a></h5> | |
<p><a href="#commentform">Leave a response</a></p> | ||
36 | | |
36 | ||
<div id="comments_div"> | ||
<%= render :partial => "comment" %> | ||
</div> |
rool/rails/typo/trunk/vendor/akismet/akismet.rb:
prev. | current | |
# Heavily modified for Typo by Scott Laird | ||
# | ||
class Akismet | ||
10 | ||
require 'net/http' | ||
require 'uri' | ||
12 | require 'timeout' | |
STANDARD_HEADERS = { | ||
'User-Agent' => "Typo/#{TYPO_VERSION} | Akismet Ruby API/1.0", | ||
... | ... | |
#options[:comment_content] = comment_content | ||
def callAkismet(akismet_function, options = {}) | ||
100 | | |
101 | | |
100 | result = false | |
101 | begin | |
102 | Timeout.timeout(5) do | |
103 | http = Net::HTTP.new("#{@apiKey}.rest.akismet.com", 80, @proxyHost, @proxyPort) | |
104 | path = "/1.1/#{akismet_function}" | |
103 | | |
104 | | |
106 | options[:blog] = @blog | |
107 | params=[] | |
106 | | |
107 | | |
108 | | |
109 | options.each_key do |key| | |
110 | params.push "#{key}=#{CGI.escape(options[key].to_s)}" | |
111 | end | |
110 | | |
111 | | |
113 | data = params.join('&') | |
114 | resp, data = http.post(path, data, STANDARD_HEADERS) | |
113 | | |
114 | | |
116 | unless data == 'true' or data == 'false' or data == '' | |
117 | STDERR.puts "AKISMET error: #{data}" | |
118 | end | |
119 | ||
120 | result = (data == "true" or data == '') | |
121 | end | |
122 | rescue => err | |
123 | STDERR.puts "AKISMET exception: #{err}" | |
end | ||
116 | ||
117 | | |
125 | ||
126 | return result | |
end | ||
protected :callAkismet |
rool/rails/typo/trunk/vendor/flickr/flickr.rb:
prev. | current | |
attr_accessor :user | ||
# Replace this API key with your own (see http://www.flickr.com/services/api/misc.api_keys.html) | ||
56 | | |
56 | def initialize(api_key=FLICKR_KEY, email=nil, password=nil) | |
@api_key = api_key | ||
@host = 'http://flickr.com' | ||
@api = '/services/rest' |
rool/rails/typo/trunk/vendor/plugins/expiring_action_cache/lib/actionparamcache.rb:
prev. | current | |
def lifetime | ||
@lifetime[:time] | ||
end | ||
14 | ||
14 | ||
def lifetime=(seconds) | ||
16 | | |
16 | # Only allow the lifetime to be lowered--if one component wants | |
# lifetime=3.hours and another wants lifetime=15.minutes, then | ||
# the right thing to do is to always use lifetime=15.minutes, no | ||
# matter which order they're called in. | ||
return if @lifetime[:time] and @lifetime[:time] < seconds | ||
@lifetime[:time] = seconds | ||
end | ||
23 | ||
23 | ||
def initialize | ||
25 | | |
25 | @body, @headers, @session, @assigns = "", DEFAULT_HEADERS.merge("cookie" => []), [], [] | |
@lifetime = Hash.new | ||
end | ||
end | ||
29 | ||
29 | ||
module Caching | ||
module ActionParams | ||
def self.append_features(base) #:nodoc: | ||
... | ... | |
def expire_action_with_params(options = {}) | ||
return unless perform_caching | ||
47 | ||
47 | ||
if options == {} | ||
expire_meta_fragment(%r{ACTION_PARAM/.*}) | ||
else | ||
... | ... | |
def before(controller) | ||
return unless @actions.include?(controller.action_name.intern) | ||
meta, cache = controller.read_meta_fragment_expire(cache_key(controller)) | ||
74 | ||
74 | ||
if cache | ||
# 304 handling from Tom Fakes, | ||
# http://craz8.com/svn/trunk/plugins/action_cache/lib/action_cache.rb | ||
... | ... | |
controller.response.headers['Cache-Control'] = 'max-age=1' | ||
controller.response.headers['Last-Modified'] = meta[:cached_at].httpdate rescue nil | ||
controller.response.headers['Content-Type'] = meta[:content_type] | ||
83 | ||
83 | ||
if request_time and cached_time <= (request_time + 1) | ||
controller.render(:text => "", :status => 304) | ||
else | ||
controller.render(:text => cache) | ||
end | ||
89 | ||
89 | ||
controller.rendered_action_cache = true | ||
return false | ||
else |