diff --git a/app/controllers/admin/sites_controller.rb b/app/controllers/admin/sites_controller.rb index 2ef3210c..6496f78b 100644 --- a/app/controllers/admin/sites_controller.rb +++ b/app/controllers/admin/sites_controller.rb @@ -7,7 +7,7 @@ module Admin def create @site = Site.new(params[:site]) - @site.memberships.build :account => @current_admin, :admin => true + @site.memberships.build :account => @current_admin, :role => 'admin' create! { edit_admin_my_account_url } end diff --git a/app/models/membership.rb b/app/models/membership.rb index f9d9d8a6..b9f9a270 100644 --- a/app/models/membership.rb +++ b/app/models/membership.rb @@ -3,7 +3,6 @@ class Membership include Locomotive::Mongoid::Document ## fields ## - # field :admin, :type => Boolean, :default => false field :role, :default => 'author' ## associations ## diff --git a/doc/TODO b/doc/TODO index 57dca5ef..d13c21f1 100644 --- a/doc/TODO +++ b/doc/TODO @@ -65,7 +65,10 @@ x export site x rake task to import a remote template x MERGE x remove withelist for assets since we've got now roles +- admin role is not correctly set when creating a new website - test and/or convert existing templates (the 2 of the themes section) +- the required star for file field is not shown +- tooltip to explain the difference between 1.) Admin 2.) Author 3.) Designer? - overide sort for contents - icon for redirection page in the pages section (back-office) @@ -93,7 +96,7 @@ BACKLOG: - dev -> staging -> production - sync data - import only theme assets - +- endless pagination REFACTORING: diff --git a/doc/changelogs/20110704.txt b/doc/changelogs/20110704.txt new file mode 100644 index 00000000..4fd08cea --- /dev/null +++ b/doc/changelogs/20110704.txt @@ -0,0 +1,27 @@ +Here is a pretty exhaustive list of what the BIG MERGE includes: + +- upgrade the list of gems: Rails 3.0.9, Devise 1.3.4, Rake 0.9.2, ...etc +- roles with the CanCan gem + note: 3 kind of roles. Administrator (they can do everything), Designer (like Administrator but applied on a single website), Author (only edit pages and contents) +- resizing images on the fly (ticket #79) +- tinyMCE enhancements (ticket #99): + - the locomotive image plugin has been replaced by the locomotive media plugin which allows you to upload any kind of files + - fullscreen mode, very convenient to edit a long text +- remove asset_collections: + note: the asset collections tab was confusing for users (and me too). Actually, it's like a content type with a different kind of view in the back-office (the galery view is not implemented yet) +- use dashes instead of underscores (ticket #56) + note: pages (slug) and contents (permalink) uses the parameterize String method. +- SEO (tickets #57 & #90) + - index and index/ are the same page now (301 redirection) + - add a seo_title for both the site, the page and content objects. + - write a {% seo %} liquid tag to display the title, meta (description and keywords) tags depending on the context +- fix issue about httparty (ticket #91) +- check if custom contents are organized in a category when displaying the select box for the has_one / has_many fields +- add 2 liquid global variables in the page conext: current time and date. Dates from a custom content are now comparable +- site export (but editable_elements inside a page are not correctly handled for now) +- rake task to import a remote template +- UI tweaks, a quick list of some of them + - better hints for the theme asset new/edit action + - slight modifications on forms: separator between fields, text shadow, error message redesigned, ...etc + - quick link to edit directly a model from the submenu +- a lot of internal refactoring as well as a ton of bug corrections \ No newline at end of file diff --git a/features/admin/site.feature b/features/admin/site.feature new file mode 100644 index 00000000..a702df45 --- /dev/null +++ b/features/admin/site.feature @@ -0,0 +1,23 @@ +Feature: Manage my site + In order to manage my site + As an administrator + I want to edit/delete my site + +Background: + Given I have the site: "test site" set up + And I am an authenticated user + +Scenario: Site settings are not accessible for non authenticated accounts + Given I am not authenticated + When I go to the site settings + Then I should see "Log in" + +Scenario: Add a new site + Given I go to the account settings + And I follow "new site" + Then I should see "Fill in the form below to create your new site." + When I fill in "Name" with "Acme" + And I fill in "Subdomain" with "acme" + And I press "Create" + Then I should see "Site was successfully created." + And I should be a administrator of the "Acme" site diff --git a/features/step_definitions/site_steps.rb b/features/step_definitions/site_steps.rb index 4ac96333..5e30222e 100644 --- a/features/step_definitions/site_steps.rb +++ b/features/step_definitions/site_steps.rb @@ -15,4 +15,10 @@ end Given /^I have a designer and an author$/ do Factory(:designer, :site => Site.first) Factory(:author, :site => Site.first) -end \ No newline at end of file +end + +Then /^I should be a administrator of the "([^"]*)" site$/ do |name| + site = Site.where(:name => name).first + m = site.memberships.detect { |m| m.account_id == @admin._id && m.admin? } + m.should_not be_nil +end diff --git a/features/support/paths.rb b/features/support/paths.rb index 20aecf3e..ce20e7af 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -25,6 +25,8 @@ module NavigationHelpers admin_theme_assets_path when /site settings/ edit_admin_current_site_path + when /account settings/ + edit_admin_my_account_path when /import page/ new_admin_import_path when /export page/