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
* 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
h2. Support

View File

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

View File

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

View File

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

View File

@ -60,9 +60,18 @@ class Ability
can :point, Site
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
def setup_admin_permissions!
can :manage, :all
cannot :change_role, Membership do |membership|
@membership.account_id == membership.account_id # can not edit myself
end
end
end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -67,6 +67,7 @@ x MERGE
x remove withelist for assets since we've got now roles
x admin role is not correctly set when creating a new website
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)
- export: problems with templatized pages
- 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 "Access points"
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 delete on the "admin"
And I should not see delete on the "admin"
And I should not see delete on myself
And I should see delete on the "author"