Skip to content

Commit

Permalink
Add configurable text for the create account page
Browse files Browse the repository at this point in the history
Fixes #63
jimsafley committed Jul 15, 2019
1 parent 67878bd commit 1c0b49f
Showing 13 changed files with 140 additions and 43 deletions.
5 changes: 4 additions & 1 deletion Module.php
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ public function install(ServiceLocatorInterface $services)
$conn->exec('CREATE TABLE scripto_reviewer (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, scripto_project_id INT NOT NULL, INDEX IDX_A9E24DFCA76ED395 (user_id), INDEX IDX_A9E24DFCDC45463D (scripto_project_id), UNIQUE INDEX UNIQ_A9E24DFCA76ED395DC45463D (user_id, scripto_project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB;');
$conn->exec('CREATE TABLE scripto_media (id INT AUTO_INCREMENT NOT NULL, scripto_item_id INT NOT NULL, media_id INT NOT NULL, approved_by_id INT DEFAULT NULL, position INT NOT NULL, synced DATETIME NOT NULL, edited DATETIME DEFAULT NULL, edited_by VARCHAR(255) DEFAULT NULL, completed DATETIME DEFAULT NULL, completed_by VARCHAR(255) DEFAULT NULL, completed_revision INT DEFAULT NULL, approved DATETIME DEFAULT NULL, approved_revision INT DEFAULT NULL, imported_html LONGTEXT DEFAULT NULL, INDEX IDX_28ABA038DE42D3B8 (scripto_item_id), INDEX IDX_28ABA038EA9FDD75 (media_id), INDEX IDX_28ABA0382D234F6A (approved_by_id), UNIQUE INDEX UNIQ_28ABA038DE42D3B8EA9FDD75 (scripto_item_id, media_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB;');
$conn->exec('CREATE TABLE scripto_item (id INT AUTO_INCREMENT NOT NULL, scripto_project_id INT NOT NULL, item_id INT NOT NULL, synced DATETIME NOT NULL, edited DATETIME DEFAULT NULL, INDEX IDX_2A827D37DC45463D (scripto_project_id), INDEX IDX_2A827D37126F525E (item_id), UNIQUE INDEX UNIQ_2A827D37DC45463D126F525E (scripto_project_id, item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB;');
$conn->exec('CREATE TABLE scripto_project (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, item_set_id INT DEFAULT NULL, property_id INT DEFAULT NULL, is_public TINYINT(1) NOT NULL, lang VARCHAR(255) DEFAULT NULL, import_target VARCHAR(255) DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, guidelines LONGTEXT DEFAULT NULL, browse_layout VARCHAR(255) DEFAULT NULL, filter_approved TINYINT(1) NOT NULL, item_type VARCHAR(255) DEFAULT NULL, media_type VARCHAR(255) DEFAULT NULL, content_type VARCHAR(255) DEFAULT NULL, created DATETIME NOT NULL, synced DATETIME DEFAULT NULL, imported DATETIME DEFAULT NULL, INDEX IDX_E39E51087E3C61F9 (owner_id), INDEX IDX_E39E5108960278D7 (item_set_id), INDEX IDX_E39E5108549213EC (property_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB;');
$conn->exec('CREATE TABLE scripto_project (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, item_set_id INT DEFAULT NULL, property_id INT DEFAULT NULL, is_public TINYINT(1) NOT NULL, lang VARCHAR(255) DEFAULT NULL, import_target VARCHAR(255) DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, guidelines LONGTEXT DEFAULT NULL, create_account_text LONGTEXT DEFAULT NULL, browse_layout VARCHAR(255) DEFAULT NULL, filter_approved TINYINT(1) NOT NULL, item_type VARCHAR(255) DEFAULT NULL, media_type VARCHAR(255) DEFAULT NULL, content_type VARCHAR(255) DEFAULT NULL, created DATETIME NOT NULL, synced DATETIME DEFAULT NULL, imported DATETIME DEFAULT NULL, INDEX IDX_E39E51087E3C61F9 (owner_id), INDEX IDX_E39E5108960278D7 (item_set_id), INDEX IDX_E39E5108549213EC (property_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB;');
$conn->exec('ALTER TABLE scripto_reviewer ADD CONSTRAINT FK_A9E24DFCA76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE;');
$conn->exec('ALTER TABLE scripto_reviewer ADD CONSTRAINT FK_A9E24DFCDC45463D FOREIGN KEY (scripto_project_id) REFERENCES scripto_project (id) ON DELETE CASCADE;');
$conn->exec('ALTER TABLE scripto_media ADD CONSTRAINT FK_28ABA038DE42D3B8 FOREIGN KEY (scripto_item_id) REFERENCES scripto_item (id) ON DELETE CASCADE;');
@@ -98,6 +98,9 @@ public function upgrade($oldVersion, $newVersion, ServiceLocatorInterface $servi
if (Comparator::lessThan($oldVersion, '1.0.0-beta2')) {
$conn->exec('ALTER TABLE scripto_project ADD filter_approved TINYINT(1) NOT NULL');
}
if (Comparator::lessThan($oldVersion, '1.0.0-beta3')) {
$conn->exec('ALTER TABLE scripto_project ADD create_account_text LONGTEXT DEFAULT NULL');
}
}

public function uninstall(ServiceLocatorInterface $services)
1 change: 1 addition & 0 deletions asset/js/admin/project-form.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$(document).ready(function() {

CKEDITOR.inline(document.getElementById('o-module-scripto-guidelines'));
CKEDITOR.inline(document.getElementById('o-module-scripto-create-account-text'));

var template = $($('#reviewer-row-template').data('template'));

2 changes: 1 addition & 1 deletion config/module.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[info]
version = "1.0.0-beta2"
version = "1.0.0-beta3"
omeka_version_constraint = "^1.2.0"
name = "Scripto"
description = "Transcribe and translate items."
26 changes: 24 additions & 2 deletions data/doctrine-proxies/__CG__ScriptoEntityScriptoProject.php
Original file line number Diff line number Diff line change
@@ -64,10 +64,10 @@ public function __construct($initializer = null, $cloner = null)
public function __sleep()
{
if ($this->__isInitialized__) {
return ['__isInitialized__', 'id', 'owner', 'isPublic', 'itemSet', 'property', 'lang', 'importTarget', 'title', 'description', 'guidelines', 'browseLayout', 'filterApproved', 'itemType', 'mediaType', 'contentType', 'created', 'synced', 'imported', 'reviewers'];
return ['__isInitialized__', 'id', 'owner', 'isPublic', 'itemSet', 'property', 'lang', 'importTarget', 'title', 'description', 'guidelines', 'createAccountText', 'browseLayout', 'filterApproved', 'itemType', 'mediaType', 'contentType', 'created', 'synced', 'imported', 'reviewers'];
}

return ['__isInitialized__', 'id', 'owner', 'isPublic', 'itemSet', 'property', 'lang', 'importTarget', 'title', 'description', 'guidelines', 'browseLayout', 'filterApproved', 'itemType', 'mediaType', 'contentType', 'created', 'synced', 'imported', 'reviewers'];
return ['__isInitialized__', 'id', 'owner', 'isPublic', 'itemSet', 'property', 'lang', 'importTarget', 'title', 'description', 'guidelines', 'createAccountText', 'browseLayout', 'filterApproved', 'itemType', 'mediaType', 'contentType', 'created', 'synced', 'imported', 'reviewers'];
}

/**
@@ -386,6 +386,28 @@ public function getGuidelines()
return parent::getGuidelines();
}

/**
* {@inheritDoc}
*/
public function setCreateAccountText($createAccountText)
{

$this->__initializer__ && $this->__initializer__->__invoke($this, 'setCreateAccountText', [$createAccountText]);

return parent::setCreateAccountText($createAccountText);
}

/**
* {@inheritDoc}
*/
public function getCreateAccountText()
{

$this->__initializer__ && $this->__initializer__->__invoke($this, 'getCreateAccountText', []);

return parent::getCreateAccountText();
}

/**
* {@inheritDoc}
*/
97 changes: 58 additions & 39 deletions language/template.pot
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-03-25 13:01-0400\n"
"POT-Creation-Date: 2019-07-15 15:33-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -17,18 +17,18 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: Module.php:417
#: Module.php:422
msgid "Cannot access Scripto. Missing MediaWiki API URL."
msgstr ""

#: Module.php:449
#: Module.php:454
#, php-format
msgid ""
"The MediaWiki user does not have the necessary permissions to create the "
"page \"%s\""
msgstr ""

#: Module.php:455
#: Module.php:460
#, php-format
msgid ""
"The MediaWiki user does not have the necessary permissions to edit the page "
@@ -49,15 +49,15 @@ msgstr ""
msgid "Existing expiration time: %s"
msgstr ""

#: src/Controller/Admin/ProjectController.php:156
#: src/Controller/Admin/ProjectController.php:158
msgid "See this job for sync progress."
msgstr ""

#: src/Controller/Admin/ProjectController.php:181
#: src/Controller/Admin/ProjectController.php:183
msgid "See this job for import progress."
msgstr ""

#: src/Controller/Admin/ProjectController.php:206
#: src/Controller/Admin/ProjectController.php:208
msgid "See this job for unimport progress."
msgstr ""

@@ -449,25 +449,25 @@ msgstr ""

#: view/scripto/admin/item/browse.phtml:45
#: view/scripto/admin/media/browse.phtml:64
#: view/scripto/public-app/item/browse.phtml:33
#: view/scripto/public-app/item/browse.phtml:15
#: view/scripto/public-app/media/browse.phtml:60
msgid "Is approved"
msgstr ""

#: view/scripto/admin/item/browse.phtml:49
#: view/scripto/admin/media/browse.phtml:68
#: view/scripto/public-app/item/browse.phtml:37
#: view/scripto/public-app/item/browse.phtml:19
#: view/scripto/public-app/media/browse.phtml:64
msgid "Is not approved"
msgstr ""

#: view/scripto/admin/item/browse.phtml:53
#: view/scripto/public-app/item/browse.phtml:41
#: view/scripto/public-app/item/browse.phtml:5
msgid "Is in progress"
msgstr ""

#: view/scripto/admin/item/browse.phtml:57
#: view/scripto/public-app/item/browse.phtml:45
#: view/scripto/public-app/item/browse.phtml:9
msgid "Is new"
msgstr ""

@@ -671,7 +671,7 @@ msgstr ""

#: view/scripto/admin/media/show-talk.phtml:44
#: view/scripto/admin/media/show.phtml:45
#: view/scripto/public-app/item/browse.phtml:15
#: view/scripto/public-app/item/browse.phtml:35
#: view/scripto/public-app/media/browse.phtml:14
#: view/scripto/public-app/media/edit.phtml:34
msgid "Layout"
@@ -891,13 +891,13 @@ msgid "Browse layout"
msgstr ""

#: view/scripto/admin/project/show-details.phtml:41
#: view/scripto/public-app/item/browse.phtml:16
#: view/scripto/public-app/item/browse.phtml:36
#: view/scripto/public-app/media/browse.phtml:15
msgid "List"
msgstr ""

#: view/scripto/admin/project/show-details.phtml:43
#: view/scripto/public-app/item/browse.phtml:17
#: view/scripto/public-app/item/browse.phtml:37
#: view/scripto/public-app/media/browse.phtml:16
msgid "Grid"
msgstr ""
@@ -1056,12 +1056,15 @@ msgid "current"
msgstr ""

#: view/scripto/admin/user/contributions.phtml:93
#: view/scripto/admin/user/contributions.phtml:95
#: view/scripto/admin/user/contributions.phtml:97
#: view/scripto/admin/user/watchlist.phtml:52
#: view/scripto/admin/user/watchlist.phtml:56
#: view/scripto/public-app/user/contributions.phtml:87
#: view/scripto/public-app/user/contributions.phtml:89
#: view/scripto/public-app/user/contributions.phtml:91
#: view/scripto/public-app/user/watchlist.phtml:40
#: view/scripto/public-app/user/watchlist.phtml:42
#: view/scripto/public-app/user/watchlist.phtml:44
msgid "n/a"
msgstr ""
@@ -1209,12 +1212,12 @@ msgid "Books"
msgstr ""

#: src/ViewHelper/type_string_map.php:10 src/ViewHelper/type_string_map.php:19
#: src/Form/ProjectForm.php:128
#: src/Form/ProjectForm.php:149
msgid "Audio"
msgstr ""

#: src/ViewHelper/type_string_map.php:11 src/ViewHelper/type_string_map.php:20
#: src/Form/ProjectForm.php:134
#: src/Form/ProjectForm.php:155
msgid "Video"
msgstr ""

@@ -1226,7 +1229,7 @@ msgstr ""
msgid "Journals"
msgstr ""

#: src/ViewHelper/type_string_map.php:21 src/Form/ProjectForm.php:133
#: src/ViewHelper/type_string_map.php:21 src/Form/ProjectForm.php:154
msgid "Paper"
msgstr ""

@@ -1590,23 +1593,23 @@ msgstr ""
msgid "Entries"
msgstr ""

#: src/ViewHelper/type_string_map.php:131 src/Form/ProjectForm.php:151
#: src/ViewHelper/type_string_map.php:131 src/Form/ProjectForm.php:172
msgid "Section"
msgstr ""

#: src/ViewHelper/type_string_map.php:132 src/Form/ProjectForm.php:152
#: src/ViewHelper/type_string_map.php:132 src/Form/ProjectForm.php:173
msgid "Segment"
msgstr ""

#: src/ViewHelper/type_string_map.php:133 src/Form/ProjectForm.php:148
#: src/ViewHelper/type_string_map.php:133 src/Form/ProjectForm.php:169
msgid "Folio"
msgstr ""

#: src/ViewHelper/type_string_map.php:134 src/Form/ProjectForm.php:153
#: src/ViewHelper/type_string_map.php:134 src/Form/ProjectForm.php:174
msgid "Sheet"
msgstr ""

#: src/ViewHelper/type_string_map.php:135 src/Form/ProjectForm.php:147
#: src/ViewHelper/type_string_map.php:135 src/Form/ProjectForm.php:168
msgid "Entry"
msgstr ""

@@ -2723,13 +2726,13 @@ msgstr ""

#: src/ViewHelper/type_string_map.php:445
#: src/ViewHelper/type_string_map.php:465
#: src/ViewHelper/type_string_map.php:470 src/Form/ProjectForm.php:167
#: src/ViewHelper/type_string_map.php:470 src/Form/ProjectForm.php:188
msgid "Transcription"
msgstr ""

#: src/ViewHelper/type_string_map.php:446
#: src/ViewHelper/type_string_map.php:466
#: src/ViewHelper/type_string_map.php:471 src/Form/ProjectForm.php:168
#: src/ViewHelper/type_string_map.php:471 src/Form/ProjectForm.php:189
msgid "Translation"
msgstr ""

@@ -2851,7 +2854,7 @@ msgstr ""
msgid "A property must have an ID"
msgstr ""

#: src/Api/Adapter/ScriptoProjectAdapter.php:168
#: src/Api/Adapter/ScriptoProjectAdapter.php:174
msgid "A Scripto project title must not be null"
msgstr ""

@@ -2881,34 +2884,34 @@ msgstr ""
msgid "This project has no property. %s"
msgstr ""

#: src/Controller/Admin/ProjectController.php:43
#: src/Controller/Admin/ProjectController.php:44
msgid "Scripto project successfully created."
msgstr ""

#: src/Controller/Admin/ProjectController.php:75
#: src/Controller/Admin/ProjectController.php:77
msgid "Scripto project successfully edited."
msgstr ""

#: src/Controller/Admin/ProjectController.php:102
#: src/Controller/Admin/ProjectController.php:104
msgid "Scripto project successfully deleted"
msgstr ""

#: src/Controller/Admin/ProjectController.php:152
#: src/Controller/Admin/ProjectController.php:154
#, php-format
msgid "Syncing Scripto project. This may take a while. %s"
msgstr ""

#: src/Controller/Admin/ProjectController.php:177
#: src/Controller/Admin/ProjectController.php:179
#, php-format
msgid "Importing Scripto project text. This may take a while. %s"
msgstr ""

#: src/Controller/Admin/ProjectController.php:202
#: src/Controller/Admin/ProjectController.php:204
#, php-format
msgid "Unimporting Scripto project text. This may take a while. %s"
msgstr ""

#: src/Controller/PublicApp/IndexController.php:46
#: src/Controller/PublicApp/IndexController.php:51
msgid ""
"Your Scripto account has been created! Please check your email for a link to "
"activate your account."
@@ -2944,41 +2947,57 @@ msgstr ""
msgid "Enter guidelines for producing content for this project."
msgstr ""

#: src/Form/ProjectForm.php:85
msgid "Create account text"
msgstr ""

#: src/Form/ProjectForm.php:86
msgid "Enter text for the create account page of this project."
msgstr ""

#: src/Form/ProjectForm.php:98
msgid "Enter the language of your content using an IETF language tag."
msgstr ""

#: src/Form/ProjectForm.php:112
#: src/Form/ProjectForm.php:124
msgid "Select the default layout for public browse views."
msgstr ""

#: src/Form/ProjectForm.php:125
#: src/Form/ProjectForm.php:136
msgid "Filter approved"
msgstr ""

#: src/Form/ProjectForm.php:137
msgid "Filter out approved items from the public browse view."
msgstr ""

#: src/Form/ProjectForm.php:146
msgid ""
"Select the type of item convered by this project. This is used to clarify "
"the interface, if needed."
msgstr ""

#: src/Form/ProjectForm.php:126
#: src/Form/ProjectForm.php:147
msgid "Generic item"
msgstr ""

#: src/Form/ProjectForm.php:144
#: src/Form/ProjectForm.php:165
msgid ""
"Select the type of media covered by this project. This is used to clarify "
"the interface, if needed."
msgstr ""

#: src/Form/ProjectForm.php:145
#: src/Form/ProjectForm.php:166
msgid "Generic media"
msgstr ""

#: src/Form/ProjectForm.php:163
#: src/Form/ProjectForm.php:184
msgid ""
"Select the type of content convered by this project. This is used to clarify "
"the interface, if needed."
msgstr ""

#: src/Form/ProjectForm.php:164
#: src/Form/ProjectForm.php:185
msgid "Generic content"
msgstr ""

3 changes: 3 additions & 0 deletions src/Api/Adapter/ScriptoProjectAdapter.php
Original file line number Diff line number Diff line change
@@ -110,6 +110,9 @@ public function hydrate(Request $request, EntityInterface $entity, ErrorStore $e
if ($this->shouldHydrate($request, 'o-module-scripto:guidelines')) {
$entity->setGuidelines($request->getValue('o-module-scripto:guidelines'));
}
if ($this->shouldHydrate($request, 'o-module-scripto:create_account_text')) {
$entity->setCreateAccountText($request->getValue('o-module-scripto:create_account_text'));
}
if ($this->shouldHydrate($request, 'o-module-scripto:description')) {
$entity->setDescription($request->getValue('o-module-scripto:description'));
}
Loading

0 comments on commit 1c0b49f

Please sign in to comment.