Verified Commit de94736c authored by Luc Didry's avatar Luc Didry Committed by Luc Didry

Fix #174 Be able to archive folders

This commit is dedicated to Xavier Coadic, who is supporting me with Ğ1. Many thanks :-)
parent a6ef13f5
Pipeline #50974 passed with stage
in 1 minute 31 seconds
......@@ -62,7 +62,7 @@ module.exports = (function () {
document.title = (c.addView() ? conf.LANG.GROUP.ADD :
conf.LANG.GROUP.EDIT_GROUP);
document.title += ' - ' + conf.SERVER.title;
c.fields = ['name', 'description', 'visibility', 'password', 'readonly', 'allowUsersToCreatePads'];
c.fields = ['name', 'description', 'visibility', 'password', 'readonly', 'allowUsersToCreatePads', 'archived'];
form.initFields(c, c.fields);
c.data.visibility('restricted');
var tagsCurrent;
......@@ -163,6 +163,9 @@ module.exports = (function () {
view.icon.allowUsersToCreatePads = function () {
return view.icon.common(conf.LANG.GROUP.INFO.ALLOW_USERS_TO_CREATE_PADS);
};
view.icon.archived = function () {
return view.icon.common(conf.LANG.GROUP.INFO.ARCHIVED);
};
/**
* ### Fields
......@@ -269,6 +272,20 @@ module.exports = (function () {
return { label: label, icon: icon };
};
view.field.archived = function (c) {
var icon = view.icon.archived();
var label = m('label', [
m('input', {
name: 'archived',
type: 'checkbox',
checked: c.data.archived(),
onchange: m.withAttr('checked', c.data.archived)
}),
[ conf.LANG.GROUP.FIELD.ARCHIVED, icon ]
]);
return { label: label, icon: icon };
};
view.field.tag = function (c) { return tag.view(c.tag); };
/**
......@@ -316,6 +333,13 @@ module.exports = (function () {
m('.form-group',
m('.col-sm-7 .col-sm-offset-4',
m('.checkbox', [
_f.archived.label,
])
)
),
m('.form-group',
m('.col-sm-7 .col-sm-offset-4',
m('.checkbox', [
_f.allowUsersToCreatePads.label,
])
)
......
......@@ -496,9 +496,6 @@ module.exports = (function () {
buttonsArray.push(m('button.cancel.btn.btn-warning', { onclick: c.quit },
[ m('i.glyphicon glyphicon-fire'), ' '+conf.LANG.GROUP.QUIT_GROUP ]));
}
h2Elements.push(
m('.btn-group.pull-right', {role:'group'}, buttonsArray)
);
var showPass = (!c.isAdmin && !c.isUser && (c.group.visibility === 'private') &&
!c.sendPass());
if (showPass) {
......@@ -508,6 +505,7 @@ module.exports = (function () {
]);
} else {
return m('section', [
m('.btn-group.pull-right', {role:'group'}, buttonsArray),
m('h2', h2Elements),
m('section.description', [ ]),
m('section.panel.panel-primary.props', [
......
......@@ -232,9 +232,9 @@ module.exports = (function () {
if (!c.filters[k](g)) { return memo; }
}
}
if (ld.includes(userGroups, g._id)) {
if (ld.includes(userGroups, g._id) && !g.archived) {
memo.bookmarked.push(g);
} else if (g.readonly) {
} else if (g.readonly || g.archived) {
memo.archived.push(g);
} else {
memo.normal.push(g);
......@@ -566,7 +566,9 @@ module.exports = (function () {
m('th', {scope: 'col'}, conf.LANG.GROUP.TAGS.TITLE),
])
),
view.archived(c)
m('tbody', [
view.archived(c)
])
])
])
]);
......
......@@ -55,7 +55,8 @@ module.exports = (function () {
* password: 'secret',
* readonly: false,
* tags: ['important', 'domain1'],
* allowUsersToCreatePads: false
* allowUsersToCreatePads: false,
* archived: false
* };
*
*/
......@@ -482,6 +483,7 @@ module.exports = (function () {
g.password = ld.isString(p.password) ? p.password : null;
g.readonly = ld.isBoolean(p.readonly) ? p.readonly : false;
g.allowUsersToCreatePads = ld.isBoolean(p.allowUsersToCreatePads) ? p.allowUsersToCreatePads : false;
g.archived = ld.isBoolean(p.archived) ? p.archived : false;
g.tags = ld.isArray(p.tags) ? p.tags : [];
return g;
};
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -192,6 +192,7 @@
},
"FIELD": {
"ALLOW_USERS_TO_CREATE_PADS": "Allow simple users of the folder to create pads?",
"ARCHIVED": "Archived",
"DESCRIPTION": "Beschreibung",
"GROUP_PARAMS": "Ordner-Parameter?",
"NAME": "Name",
......@@ -213,6 +214,7 @@
"INFO": {
"ADD_SUCCESS": "Ordner wurde erfolgreich erstellt.",
"ALLOW_USERS_TO_CREATE_PADS": "This allows users of the folder that don't have administrator rights to create pads in the folder",
"ARCHIVED": "If checked, folder will appear in the archived folders list even if it's bookmarked",
"CHAT_HISTORY_REMOVE_SUCCESS": "Der Chat-Verlauf des Pads wurde erfolgreich entfernt.",
"CHAT_HISTORY_REMOVE_SURE": "Sind Sie sicher, dass Sie den Chatverlauf dieses Pads entfernen möchten?",
"DESCRIPTION": "Eine optimale Beschreibung zu diesem Ordner.",
......@@ -227,7 +229,7 @@
"PAD_REMOVE_SUCCESS": "Pad wurde erfolgreich entfernt",
"PAD_REMOVE_SURE": "Sind Sie sicher, dass Sie dieses Pad entfernen wollen? WARNUNG: Diese Aktion ist irreversibel, das Pad wird für JEDEN gelöscht, der Zugriff darauf hat.",
"PASSWORD": "Erforderlich im privaten Modus",
"READONLY": "Wenn diese Option aktiviert ist, werden die verknüpften Pads im Nur-Lese-Modus angezeigt.",
"READONLY": "If checked, linked pads will be in readonly mode and the folder will be in the archived folders list unless it's bookmarked",
"REMOVE_SUCCESS": "Ordner wurde erfolgreich entfernt",
"REMOVE_SURE": "Sind Sie sicher, dass Sie diesen Ordner löschen wollen? WARNUNG: Diese Aktion ist irreversibel, der Ordner und seine Pads werden für JEDEN gelöscht, der Zugriff darauf hat.",
"RESIGN": "Sind Sie sicher, dass Sie von diesem Ordner verlassen wollen?",
......
......@@ -192,6 +192,7 @@
},
"FIELD": {
"ALLOW_USERS_TO_CREATE_PADS": "Allow simple users of the folder to create pads?",
"ARCHIVED": "Archived",
"DESCRIPTION": "Description",
"GROUP_PARAMS": "Folder parameters ?",
"NAME": "Name",
......@@ -213,6 +214,7 @@
"INFO": {
"ADD_SUCCESS": "Folder has been successfully created",
"ALLOW_USERS_TO_CREATE_PADS": "This allows users of the folder that don't have administrator rights to create pads in the folder",
"ARCHIVED": "If checked, folder will appear in the archived folders list even if it's bookmarked",
"CHAT_HISTORY_REMOVE_SUCCESS": "The chat history of the pad has been successfully removed",
"CHAT_HISTORY_REMOVE_SURE": "Are you sure you want to remove the chat history of this pad?",
"DESCRIPTION": "An optional long text to describe your folder",
......@@ -227,7 +229,7 @@
"PAD_REMOVE_SUCCESS": "Pad has been successfully removed",
"PAD_REMOVE_SURE": "Are you sure you want to remove this pad ? WARNING: this action is irreversible, the pad will be deleted for EVERYONE that has access to it.",
"PASSWORD": "Required in private mode",
"READONLY": "If checked, linked pads will be in readonly mode",
"READONLY": "If checked, linked pads will be in readonly mode and the folder will be in the archived folders list unless it's bookmarked",
"REMOVE_SUCCESS": "Folder has been successfully removed",
"REMOVE_SURE": "Are you sure you want to remove this folder ? WARNING: this action is irreversible, the folder and its pads will be deleted for EVERYONE that has access to it.",
"RESIGN": "Are you sure you want to resign from this folder ?",
......
......@@ -192,6 +192,7 @@
},
"FIELD": {
"ALLOW_USERS_TO_CREATE_PADS": "Allow simple users of the folder to create pads?",
"ARCHIVED": "Archived",
"DESCRIPTION": "Descripción ",
"GROUP_PARAMS": "Opciones de carpetas?",
"NAME": "Nombre",
......@@ -213,6 +214,7 @@
"INFO": {
"ADD_SUCCESS": "La carpeta ha sido creada con éxito",
"ALLOW_USERS_TO_CREATE_PADS": "This allows users of the folder that don't have administrator rights to create pads in the folder",
"ARCHIVED": "If checked, folder will appear in the archived folders list even if it's bookmarked",
"CHAT_HISTORY_REMOVE_SUCCESS": "El historial de chat del pad ha sido eliminado con éxito",
"CHAT_HISTORY_REMOVE_SURE": "¿Estás segura de que quieres eliminar el historial de chat de este pad?",
"DESCRIPTION": "Un largo texto explicativo opcional para describir su carpeta",
......@@ -227,7 +229,7 @@
"PAD_REMOVE_SUCCESS": "El pad has sido eliminado con éxito",
"PAD_REMOVE_SURE": "Esta segura de que quieres eliminar ese pad? ATENCIÓN: esta acción es irreversible, el pad será borrado PARA TODOS los que tengan acceso a él.",
"PASSWORD": "Se requiere en modo privado",
"READONLY": "Si esta opción está seleccionada, los pads enlazados estarán en modo de sólo lectura",
"READONLY": "If checked, linked pads will be in readonly mode and the folder will be in the archived folders list unless it's bookmarked",
"REMOVE_SUCCESS": "La carpeta se ha eliminado correctamente",
"REMOVE_SURE": "¿Estás segura de que quieres eliminar esta carpeta? ATENCIÓN: esta acción es irreversible, la carpeta y sus pads serán borrados PARA TODOS los que tengan acceso a ella.",
"RESIGN": "¿Estás segura de que quieres retirarse esta carpeta?",
......
......@@ -192,6 +192,7 @@
},
"FIELD": {
"ALLOW_USERS_TO_CREATE_PADS": "Autoriser les utilisateurs du dossier à créer des pads ?",
"ARCHIVED": "Archivé",
"DESCRIPTION": "Description",
"GROUP_PARAMS": "Paramètres du dossier ?",
"NAME": "Nom",
......@@ -213,6 +214,7 @@
"INFO": {
"ADD_SUCCESS": "Le dossier a été ajouté avec succès",
"ALLOW_USERS_TO_CREATE_PADS": "Ceci autorise les utilisateurs du dossier qui n’ont pas les droits d’administration à créer des pads dans le dossier",
"ARCHIVED": "Si sélectionné, le dossier apparaîtra dans la liste des dossiers archivés même s’il est mis en marque page",
"CHAT_HISTORY_REMOVE_SUCCESS": "L’historique du chat du pad a été supprimé avec succès",
"CHAT_HISTORY_REMOVE_SURE": "Voulez-vous vraiment supprimer l’historique du chat de ce pad ?",
"DESCRIPTION": "Un texte facultatif pour décrire votre dossier",
......@@ -227,7 +229,7 @@
"PAD_REMOVE_SUCCESS": "Le pad a été supprimé avec succès",
"PAD_REMOVE_SURE": "Voulez-vous vraiment supprimer ce pad ? ATTENTION, cette action est irréversible, le pad sera supprimé pour TOUTE PERSONNE y ayant accès.",
"PASSWORD": "Requis pour le mode privé",
"READONLY": "Si sélectionné les pads liés seront en lecture seule",
"READONLY": "Si sélectionné, les pads liés seront en lecture seule et le dossier apparaîtra dans la liste des dossiers archivés sauf s’il est mis en marque page",
"REMOVE_SUCCESS": "Le dossier a été supprimé avec succès",
"REMOVE_SURE": "Voulez-vous vraiment supprimer ce dossier ? ATTENTION, cette action est irréversible, le dossier et ses pads seront supprimés pour TOUTE PERSONNE y ayant accès.",
"RESIGN": "Voulez-vous vraiment quitter ce dossier ?",
......@@ -384,9 +386,9 @@
"PASSWORD_LOST": "Mot de passe perdu ?",
"PLEASE_WAIT": "Veuillez patienter, le service est en train de charger.",
"PROFILE": "Profil",
"REGISTER": "S'enregistrer",
"REGISTER": "Senregistrer",
"REMOVE_ACCOUNT": "Supprimer mon compte",
"SUBSCRIBE": "S'inscrire",
"SUBSCRIBE": "Sinscrire",
"UNDEF": "********",
"USECOLORINPADS": "Couleur dans les pads ?",
"USELOGINANDCOLORINPADS": "Identifiant et couleur dans les pads ?",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment