Merge branch 'master' of github.com:locomotivecms/engine

This commit is contained in:
did 2011-07-06 21:02:51 +02:00
commit fe47b3e6c6
25 changed files with 48 additions and 37 deletions

View File

@ -35,7 +35,7 @@ See the "official website":http://www.locomotivecms.com
h2. Team h2. Team
* Developers: "Didier Lafforgue":http://www.nocoffee.fr, "Jacques Crocker":http://www.railsjedi.com * Developers: "Didier Lafforgue":http://www.nocoffee.fr, "Jacques Crocker":http://www.railsjedi.com
* Contributors: "Dirk Kelly":http://www.dirkkelly.com, "Mario Visic":http://www.mariovisic.com, "Raphael Costa":http://raphaelcosta.net (Brazilian Portuguese translation), "Bernd Hauser":http://www.designhunger.de (German translation), "Andrea Frigido":http://www.frisoft.it (Italian translation) * Contributors: "Dirk Kelly":http://www.dirkkelly.com, "Mario Visic":http://www.mariovisic.com, "Raphael Costa":http://raphaelcosta.net (Brazilian Portuguese translation), "Bernd Hauser":http://www.designhunger.de (German translation), "Andrea Frigido":http://www.frisoft.it (Italian translation), "Enrique García":https://github.com/kikito (Spanish translation), "Lars Smit":https://github.com/larssmit (Dutch translation)
* UI Designer: "Sacha Greif":http://www.sachagreif.com * UI Designer: "Sacha Greif":http://www.sachagreif.com
h2. Support h2. Support

View File

@ -1,5 +1,5 @@
module Admin module Admin
class CurrentSitesController < BaseController class CurrentSiteController < BaseController
defaults :instance_name => 'site' defaults :instance_name => 'site'

View File

@ -5,6 +5,7 @@ module Admin
def create def create
@membership = current_site.memberships.build(params[:membership]) @membership = current_site.memberships.build(params[:membership])
@membership.role = 'author' # force author by default
case @membership.process! case @membership.process!
when :create_account when :create_account

View File

@ -1,5 +1,5 @@
module Admin module Admin
class MyAccountsController < BaseController class MyAccountController < BaseController
sections 'settings', 'account' sections 'settings', 'account'

View File

@ -60,9 +60,18 @@ class Ability
can :point, Site can :point, Site
can :manage, Membership can :manage, Membership
cannot :change_role, Membership do |membership|
@membership.account_id == membership.account_id || # can not edit myself
membership.admin? # can not modify an administrator
end
end end
def setup_admin_permissions! def setup_admin_permissions!
can :manage, :all can :manage, :all
cannot :change_role, Membership do |membership|
@membership.account_id == membership.account_id # can not edit myself
end
end end
end end

View File

@ -42,7 +42,7 @@
%button{ :class => 'button light add', :type => 'button' } %button{ :class => 'button light add', :type => 'button' }
%span!= t('admin.buttons.new_item') %span!= t('admin.buttons.new_item')
- if can?(:manage, Membership) - if can?(:index, Membership)
= f.foldable_inputs :name => :memberships, :class => 'memberships off' do = f.foldable_inputs :name => :memberships, :class => 'memberships off' do
= f.semantic_fields_for :memberships do |fm| = f.semantic_fields_for :memberships do |fm|
@ -54,7 +54,7 @@
%em.email= account.email %em.email= account.email
- if current_admin != account - if can?(:change_role, membership)
.role .role
%em.editable= t("admin.memberships.roles.#{membership.role}") %em.editable= t("admin.memberships.roles.#{membership.role}")

View File

@ -136,7 +136,7 @@ de:
title: Neue Webseite title: Neue Webseite
help: "Fülle das folgende Formular aus, um eine neue Webseite zu erstellen." help: "Fülle das folgende Formular aus, um eine neue Webseite zu erstellen."
current_sites: current_site:
edit: edit:
import: Importieren import: Importieren
new_membership: Account hinzufügen new_membership: Account hinzufügen
@ -153,7 +153,7 @@ de:
title: Neuer Account title: Neuer Account
help: "Fülle das folgende Formular aus, um einen neuen Account anzulegen." help: "Fülle das folgende Formular aus, um einen neuen Account anzulegen."
my_accounts: my_account:
edit: edit:
help: "Deinen Namen kannst du durch darauf klicken ändern." help: "Deinen Namen kannst du durch darauf klicken ändern."
new_site: Neue Webseite new_site: Neue Webseite

View File

@ -139,7 +139,7 @@ en:
title: New site title: New site
help: "Fill in the form below to create your new site." help: "Fill in the form below to create your new site."
current_sites: current_site:
edit: edit:
export: export export: export
import: import import: import
@ -161,7 +161,7 @@ en:
title: New account title: New account
help: "Fill in the form below to add a new account." help: "Fill in the form below to add a new account."
my_accounts: my_account:
edit: edit:
help: "Your name can be updated by clicking it. To apply your changes, click on the \"Update\" button." help: "Your name can be updated by clicking it. To apply your changes, click on the \"Update\" button."
new_site: new site new_site: new site

View File

@ -133,7 +133,7 @@ es:
title: Nuevo sitio title: Nuevo sitio
help: "Rellene el siguiente formulario para crear su nuevo sitio." help: "Rellene el siguiente formulario para crear su nuevo sitio."
current_sites: current_site:
edit: edit:
import: importar import: importar
new_membership: añadir cuenta new_membership: añadir cuenta
@ -150,7 +150,7 @@ es:
title: Nueva cuenta title: Nueva cuenta
help: "Rellene el siguiente formulario para añadir una nueva cuenta." help: "Rellene el siguiente formulario para añadir una nueva cuenta."
my_accounts: my_account:
edit: edit:
help: "Para cambiar su nombre, haga click en él." help: "Para cambiar su nombre, haga click en él."
new_site: nuevo sitio new_site: nuevo sitio

View File

@ -140,7 +140,7 @@ fr:
title: "Nouveau site" title: "Nouveau site"
help: "Remplissez le formulaire ci-dessous pour créer votre nouveau site." help: "Remplissez le formulaire ci-dessous pour créer votre nouveau site."
current_sites: current_site:
edit: edit:
export: exporter export: exporter
import: importer import: importer
@ -162,7 +162,7 @@ fr:
title: Nouveau compte title: Nouveau compte
help: "Remplissez le formulaire ci-dessous pour ajouter un nouveau compte." help: "Remplissez le formulaire ci-dessous pour ajouter un nouveau compte."
my_accounts: my_account:
edit: edit:
help: "Votre nom est modifiable en cliquant dessus. Pour appliquer votre modification, cliquez après sur le bouton \"Modifier\"" help: "Votre nom est modifiable en cliquant dessus. Pour appliquer votre modification, cliquez après sur le bouton \"Modifier\""
new_site: nouveau site new_site: nouveau site

View File

@ -134,7 +134,7 @@ it:
title: Nuovo sito title: Nuovo sito
help: "Compila il modulo sottostante per creare il nuovo sito." help: "Compila il modulo sottostante per creare il nuovo sito."
current_sites: current_site:
edit: edit:
import: importa import: importa
new_membership: aggiungi account new_membership: aggiungi account
@ -151,7 +151,7 @@ it:
title: Nuovo account title: Nuovo account
help: "Compila il modulo sottostante per aggiugere un nuovo account." help: "Compila il modulo sottostante per aggiugere un nuovo account."
my_accounts: my_account:
edit: edit:
help: "Puoi modificare il tuo nome cliccandoci sopra." help: "Puoi modificare il tuo nome cliccandoci sopra."
new_site: nuovo sito new_site: nuovo sito

View File

@ -132,7 +132,7 @@ nl:
title: Nieuwe website title: Nieuwe website
help: "Vul onderstaande formulier in om uw nieuwe website aan te maken." help: "Vul onderstaande formulier in om uw nieuwe website aan te maken."
current_sites: current_site:
edit: edit:
import: importeren import: importeren
new_membership: voeg account toe new_membership: voeg account toe
@ -149,7 +149,7 @@ nl:
title: Nieuw account title: Nieuw account
help: "Vul onderstaande formulier in om een nieuw account aan te maken" help: "Vul onderstaande formulier in om een nieuw account aan te maken"
my_accounts: my_account:
edit: edit:
help: "Uw naam kan gewijzigd worden door het aan te klikken" help: "Uw naam kan gewijzigd worden door het aan te klikken"
new_site: nieuwe website new_site: nieuwe website

View File

@ -131,7 +131,7 @@ pt-BR:
title: Novo site title: Novo site
help: "Preencha o formulário a seguir para criar um novo site." help: "Preencha o formulário a seguir para criar um novo site."
current_sites: current_site:
edit: edit:
import: importar import: importar
new_membership: adicionar conta new_membership: adicionar conta
@ -148,7 +148,7 @@ pt-BR:
title: Nova conta title: Nova conta
help: "Preencha o formulário a seguir para criar uma nova conta." help: "Preencha o formulário a seguir para criar uma nova conta."
my_accounts: my_account:
edit: edit:
help: "Seu nome pode ser atualizado clicando nele." help: "Seu nome pode ser atualizado clicando nele."
new_site: novo site new_site: novo site

View File

@ -35,7 +35,7 @@ de:
destroy: destroy:
notice: "Baustein wurde erfolgreich gelöscht." notice: "Baustein wurde erfolgreich gelöscht."
current_sites: current_site:
update: update:
notice: "Meine Webseite wurde erfolreich aktualisiert." notice: "Meine Webseite wurde erfolreich aktualisiert."
alert: "Meine Webseite wurde nicht aktualisiert." alert: "Meine Webseite wurde nicht aktualisiert."
@ -55,7 +55,7 @@ de:
notice: "Account wurde erfolgreich erstellt." notice: "Account wurde erfolgreich erstellt."
alert: "Account wurde nicht erstellt." alert: "Account wurde nicht erstellt."
my_accounts: my_account:
update: update:
notice: "Mein Account wurde erfolreich aktualisiert." notice: "Mein Account wurde erfolreich aktualisiert."
alert: "Mein Account wurde nicht aktualisiert." alert: "Mein Account wurde nicht aktualisiert."

View File

@ -35,7 +35,7 @@ en:
destroy: destroy:
notice: "Model was successfully deleted." notice: "Model was successfully deleted."
current_sites: current_site:
update: update:
notice: "My site was successfully updated." notice: "My site was successfully updated."
alert: "My site was not updated." alert: "My site was not updated."
@ -55,7 +55,7 @@ en:
notice: "Account was successfully created." notice: "Account was successfully created."
alert: "Account was not created." alert: "Account was not created."
my_accounts: my_account:
update: update:
notice: "My account was successfully updated." notice: "My account was successfully updated."
alert: "My account was not updated." alert: "My account was not updated."

View File

@ -35,7 +35,7 @@ es:
destroy: destroy:
notice: "Modelo eliminado con éxito." notice: "Modelo eliminado con éxito."
current_sites: current_site:
update: update:
notice: "Sitio actualizado con éxito." notice: "Sitio actualizado con éxito."
alert: "El sitio se pudo actualizar." alert: "El sitio se pudo actualizar."
@ -55,7 +55,7 @@ es:
notice: "Cuenta creada con éxito." notice: "Cuenta creada con éxito."
alert: "La cuenta no se pudo crear." alert: "La cuenta no se pudo crear."
my_accounts: my_account:
update: update:
notice: "Información de cuenta actualizada con éxito." notice: "Información de cuenta actualizada con éxito."
alert: "Mi información de cuenta no se pudo actualizar." alert: "Mi información de cuenta no se pudo actualizar."

View File

@ -35,7 +35,7 @@ fr:
destroy: destroy:
notice: "Le modèle a été supprimé avec succès." notice: "Le modèle a été supprimé avec succès."
current_sites: current_site:
update: update:
notice: "Mon site a été mis à jour avec succès." notice: "Mon site a été mis à jour avec succès."
alert: "Mon site n'a pas été mis à jour." alert: "Mon site n'a pas été mis à jour."
@ -55,7 +55,7 @@ fr:
notice: "Le compte a été crée avec succès." notice: "Le compte a été crée avec succès."
alert: "Le compte n'a pas été crée." alert: "Le compte n'a pas été crée."
my_accounts: my_account:
update: update:
notice: "Mon compte a été mis à jour avec succès." notice: "Mon compte a été mis à jour avec succès."
alert: "Mon compte n'a pas été mis à jour." alert: "Mon compte n'a pas été mis à jour."

View File

@ -35,7 +35,7 @@ it:
destroy: destroy:
notice: "Il modello è stato eliminato con successo." notice: "Il modello è stato eliminato con successo."
current_sites: current_site:
update: update:
notice: "Il mio sito è stato modificato con successo." notice: "Il mio sito è stato modificato con successo."
alert: "Il mio sito non è stato modificato." alert: "Il mio sito non è stato modificato."
@ -55,7 +55,7 @@ it:
notice: "L'account è stato creato con successo." notice: "L'account è stato creato con successo."
alert: "L'account non è stato creato." alert: "L'account non è stato creato."
my_accounts: my_account:
update: update:
notice: "Il mio acccount è stato modificato con successo." notice: "Il mio acccount è stato modificato con successo."
alert: "Il mio account non è stato modificato." alert: "Il mio account non è stato modificato."

View File

@ -35,7 +35,7 @@ nl:
destroy: destroy:
notice: "Model is verwijderd." notice: "Model is verwijderd."
current_sites: current_site:
update: update:
notice: "Mijn website is gewijzigd." notice: "Mijn website is gewijzigd."
alert: "Mijn website gewijzigd." alert: "Mijn website gewijzigd."
@ -55,7 +55,7 @@ nl:
notice: "Account is gemaakt." notice: "Account is gemaakt."
alert: "Account is niet gemaakt." alert: "Account is niet gemaakt."
my_accounts: my_account:
update: update:
notice: "Mijn account is gewijzigd." notice: "Mijn account is gewijzigd."
alert: "Mijn account is niet gewijzigd." alert: "Mijn account is niet gewijzigd."

View File

@ -35,7 +35,7 @@ pt-BR:
destroy: destroy:
notice: "Modelo foi apagado com sucesso." notice: "Modelo foi apagado com sucesso."
current_sites: current_site:
update: update:
notice: "Meu site foi atualizado com sucesso." notice: "Meu site foi atualizado com sucesso."
alert: "Meu site não foi atualizado." alert: "Meu site não foi atualizado."
@ -55,7 +55,7 @@ pt-BR:
notice: "Conta foi criada com sucesso." notice: "Conta foi criada com sucesso."
alert: "Conta não foi criada." alert: "Conta não foi criada."
my_accounts: my_account:
update: update:
notice: "Minha conta foi atualizada com sucesso." notice: "Minha conta foi atualizada com sucesso."
alert: "Minha conta não foi atualizada." alert: "Minha conta não foi atualizada."

View File

@ -21,11 +21,11 @@ Rails.application.routes.draw do
resources :sites resources :sites
resource :current_site resource :current_site, :controller => 'current_site'
resources :accounts resources :accounts
resource :my_account resource :my_account, :controller => 'my_account'
resources :memberships resources :memberships

View File

@ -67,6 +67,7 @@ x MERGE
x remove withelist for assets since we've got now roles x remove withelist for assets since we've got now roles
x admin role is not correctly set when creating a new website x admin role is not correctly set when creating a new website
x the required star for file field is not shown x the required star for file field is not shown
x Rights to set roles (ticket #104)
- test and/or convert existing templates (the 2 of the themes section) - test and/or convert existing templates (the 2 of the themes section)
- export: problems with templatized pages - export: problems with templatized pages
- tooltip to explain the difference between 1.) Admin 2.) Author 3.) Designer? - tooltip to explain the difference between 1.) Admin 2.) Author 3.) Designer?

View File

@ -34,9 +34,9 @@ Background:
And I should see "SEO settings" And I should see "SEO settings"
And I should see "Access points" And I should see "Access points"
And I should not see the role dropdown on myself And I should not see the role dropdown on myself
And I should see the role dropdown on the "admin" And I should not see the role dropdown on the "admin"
And I should see the role dropdown on the "author" And I should see the role dropdown on the "author"
And I should see delete on the "admin" And I should not see delete on the "admin"
And I should not see delete on myself And I should not see delete on myself
And I should see delete on the "author" And I should see delete on the "author"