diff --git a/scielomanager/editorialmanager/migrations/0001_initial.py b/scielomanager/editorialmanager/migrations/0001_initial.py index a6353344..9bfcddce 100644 --- a/scielomanager/editorialmanager/migrations/0001_initial.py +++ b/scielomanager/editorialmanager/migrations/0001_initial.py @@ -188,6 +188,7 @@ def backwards(self, orm): 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'enjoy_creator'", 'to': "orm['auth.User']"}), 'ctrl_vocabulary': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'current_ahead_documents': ('django.db.models.fields.IntegerField', [], {'default': '0', 'max_length': '3', 'null': 'True', 'blank': 'True'}), + 'editor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'editor_journal'", 'null': 'True', 'to': "orm['auth.User']"}), 'editor_address': ('django.db.models.fields.CharField', [], {'max_length': '512'}), 'editor_address_city': ('django.db.models.fields.CharField', [], {'max_length': '256'}), 'editor_address_country': ('scielo_extensions.modelfields.CountryField', [], {'max_length': '2'}), diff --git a/scielomanager/editorialmanager/templates/journal/journal_list.html b/scielomanager/editorialmanager/templates/journal/journal_list.html index 95002451..55d5edf5 100644 --- a/scielomanager/editorialmanager/templates/journal/journal_list.html +++ b/scielomanager/editorialmanager/templates/journal/journal_list.html @@ -68,10 +68,10 @@ {% block extrafooter %} {{ block.super }} {% endblock %} diff --git a/scielomanager/journalmanager/migrations/0060_auto__add_field_journal_editor.py b/scielomanager/journalmanager/migrations/0060_auto__add_field_journal_editor.py new file mode 100644 index 00000000..d04a0543 --- /dev/null +++ b/scielomanager/journalmanager/migrations/0060_auto__add_field_journal_editor.py @@ -0,0 +1,364 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding field 'Journal.editor' + db.add_column('journalmanager_journal', 'editor', + self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='editor_journal', null=True, to=orm['auth.User']), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Journal.editor' + db.delete_column('journalmanager_journal', 'editor_id') + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'journalmanager.aheadpressrelease': { + 'Meta': {'object_name': 'AheadPressRelease', '_ormbases': ['journalmanager.PressRelease']}, + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'press_releases'", 'to': "orm['journalmanager.Journal']"}), + 'pressrelease_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['journalmanager.PressRelease']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'journalmanager.article': { + 'Meta': {'object_name': 'Article'}, + 'front': ('jsonfield.fields.JSONField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'images_url': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'issue': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'articles'", 'to': "orm['journalmanager.Issue']"}), + 'pdf_url': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'xml_url': ('django.db.models.fields.CharField', [], {'max_length': '256'}) + }, + 'journalmanager.collection': { + 'Meta': {'ordering': "['name']", 'object_name': 'Collection'}, + 'acronym': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), + 'address': ('django.db.models.fields.TextField', [], {}), + 'address_complement': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), + 'address_number': ('django.db.models.fields.CharField', [], {'max_length': '8'}), + 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), + 'collection': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'user_collection'", 'to': "orm['auth.User']", 'through': "orm['journalmanager.UserCollections']", 'blank': 'True', 'symmetrical': 'False', 'null': 'True'}), + 'country': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), + 'fax': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'name_slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}), + 'phone': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}), + 'zip_code': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}) + }, + 'journalmanager.datachangeevent': { + 'Meta': {'object_name': 'DataChangeEvent'}, + 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'collection': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Collection']"}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'event_type': ('django.db.models.fields.CharField', [], {'max_length': '16'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + }, + 'journalmanager.institution': { + 'Meta': {'ordering': "['name']", 'object_name': 'Institution'}, + 'acronym': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), + 'address': ('django.db.models.fields.TextField', [], {}), + 'address_complement': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), + 'address_number': ('django.db.models.fields.CharField', [], {'max_length': '8'}), + 'cel': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), + 'complement': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), + 'country': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), + 'fax': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_trashed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '256', 'db_index': 'True'}), + 'phone': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), + 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'zip_code': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}) + }, + 'journalmanager.issue': { + 'Meta': {'ordering': "('created', 'id')", 'object_name': 'Issue'}, + 'cover': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'ctrl_vocabulary': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), + 'editorial_standard': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_marked_up': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_trashed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Journal']"}), + 'label': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'null': 'True', 'blank': 'True'}), + 'number': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'order': ('django.db.models.fields.IntegerField', [], {'blank': 'True'}), + 'publication_end_month': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'publication_start_month': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'publication_year': ('django.db.models.fields.IntegerField', [], {}), + 'section': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['journalmanager.Section']", 'symmetrical': 'False', 'blank': 'True'}), + 'spe_text': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), + 'suppl_text': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), + 'total_documents': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'type': ('django.db.models.fields.CharField', [], {'default': "'regular'", 'max_length': '15'}), + 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'use_license': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.UseLicense']", 'null': 'True'}), + 'volume': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}) + }, + 'journalmanager.issuetitle': { + 'Meta': {'object_name': 'IssueTitle'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'issue': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Issue']"}), + 'language': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Language']"}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '256'}) + }, + 'journalmanager.journal': { + 'Meta': {'ordering': "('title', 'id')", 'object_name': 'Journal'}, + 'abstract_keyword_languages': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'abstract_keyword_languages'", 'symmetrical': 'False', 'to': "orm['journalmanager.Language']"}), + 'acronym': ('django.db.models.fields.CharField', [], {'max_length': '16'}), + 'collections': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['journalmanager.Collection']", 'through': "orm['journalmanager.Membership']", 'symmetrical': 'False'}), + 'copyrighter': ('django.db.models.fields.CharField', [], {'max_length': '254'}), + 'cover': ('scielomanager.custom_fields.ContentTypeRestrictedFileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'enjoy_creator'", 'to': "orm['auth.User']"}), + 'ctrl_vocabulary': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'current_ahead_documents': ('django.db.models.fields.IntegerField', [], {'default': '0', 'max_length': '3', 'null': 'True', 'blank': 'True'}), + 'editor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'editor_journal'", 'null': 'True', 'to': "orm['auth.User']"}), + 'editor_address': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'editor_address_city': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'editor_address_country': ('scielo_extensions.modelfields.CountryField', [], {'max_length': '2'}), + 'editor_address_state': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'editor_address_zip': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'editor_email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), + 'editor_name': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'editor_phone1': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'editor_phone2': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}), + 'editorial_standard': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'eletronic_issn': ('django.db.models.fields.CharField', [], {'max_length': '9', 'db_index': 'True'}), + 'final_num': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'final_vol': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), + 'final_year': ('django.db.models.fields.CharField', [], {'max_length': '4', 'null': 'True', 'blank': 'True'}), + 'frequency': ('django.db.models.fields.CharField', [], {'max_length': '16'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'index_coverage': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'init_num': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}), + 'init_vol': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}), + 'init_year': ('django.db.models.fields.CharField', [], {'max_length': '4'}), + 'is_indexed_aehci': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_indexed_scie': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_indexed_ssci': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_trashed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'languages': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['journalmanager.Language']", 'symmetrical': 'False'}), + 'logo': ('scielomanager.custom_fields.ContentTypeRestrictedFileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'medline_code': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), + 'medline_title': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}), + 'national_code': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), + 'notes': ('django.db.models.fields.TextField', [], {'max_length': '254', 'null': 'True', 'blank': 'True'}), + 'other_previous_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), + 'previous_ahead_documents': ('django.db.models.fields.IntegerField', [], {'default': '0', 'max_length': '3', 'null': 'True', 'blank': 'True'}), + 'previous_title': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'prev_title'", 'null': 'True', 'to': "orm['journalmanager.Journal']"}), + 'print_issn': ('django.db.models.fields.CharField', [], {'max_length': '9', 'db_index': 'True'}), + 'pub_level': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'publication_city': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'publisher_country': ('scielo_extensions.modelfields.CountryField', [], {'max_length': '2'}), + 'publisher_name': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'publisher_state': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'scielo_issn': ('django.db.models.fields.CharField', [], {'max_length': '16'}), + 'secs_code': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), + 'short_title': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'db_index': 'True'}), + 'sponsor': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'journal_sponsor'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['journalmanager.Sponsor']"}), + 'study_areas': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'journals_migration_tmp'", 'null': 'True', 'to': "orm['journalmanager.StudyArea']"}), + 'subject_categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'journals'", 'null': 'True', 'to': "orm['journalmanager.SubjectCategory']"}), + 'subject_descriptors': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '256', 'db_index': 'True'}), + 'title_iso': ('django.db.models.fields.CharField', [], {'max_length': '256', 'db_index': 'True'}), + 'twitter_user': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'url_journal': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'url_online_submission': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'use_license': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.UseLicense']"}) + }, + 'journalmanager.journalmission': { + 'Meta': {'object_name': 'JournalMission'}, + 'description': ('django.db.models.fields.TextField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'missions'", 'to': "orm['journalmanager.Journal']"}), + 'language': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Language']", 'null': 'True'}) + }, + 'journalmanager.journaltimeline': { + 'Meta': {'object_name': 'JournalTimeline'}, + 'collection': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Collection']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['journalmanager.Journal']"}), + 'reason': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'since': ('django.db.models.fields.DateTimeField', [], {}), + 'status': ('django.db.models.fields.CharField', [], {'max_length': '16'}) + }, + 'journalmanager.journaltitle': { + 'Meta': {'object_name': 'JournalTitle'}, + 'category': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'other_titles'", 'to': "orm['journalmanager.Journal']"}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'journalmanager.language': { + 'Meta': {'ordering': "['name']", 'object_name': 'Language'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'iso_code': ('django.db.models.fields.CharField', [], {'max_length': '2'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}) + }, + 'journalmanager.membership': { + 'Meta': {'unique_together': "(('journal', 'collection'),)", 'object_name': 'Membership'}, + 'collection': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Collection']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Journal']"}), + 'reason': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), + 'since': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'status': ('django.db.models.fields.CharField', [], {'default': "'inprogress'", 'max_length': '16'}) + }, + 'journalmanager.pendedform': { + 'Meta': {'object_name': 'PendedForm'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'form_hash': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pending_forms'", 'to': "orm['auth.User']"}), + 'view_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'journalmanager.pendedvalue': { + 'Meta': {'object_name': 'PendedValue'}, + 'form': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'data'", 'to': "orm['journalmanager.PendedForm']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'value': ('django.db.models.fields.TextField', [], {}) + }, + 'journalmanager.pressrelease': { + 'Meta': {'object_name': 'PressRelease'}, + 'doi': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) + }, + 'journalmanager.pressreleasearticle': { + 'Meta': {'object_name': 'PressReleaseArticle'}, + 'article_pid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'press_release': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'articles'", 'to': "orm['journalmanager.PressRelease']"}) + }, + 'journalmanager.pressreleasetranslation': { + 'Meta': {'object_name': 'PressReleaseTranslation'}, + 'content': ('django.db.models.fields.TextField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Language']"}), + 'press_release': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'translations'", 'to': "orm['journalmanager.PressRelease']"}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'journalmanager.regularpressrelease': { + 'Meta': {'object_name': 'RegularPressRelease', '_ormbases': ['journalmanager.PressRelease']}, + 'issue': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'press_releases'", 'to': "orm['journalmanager.Issue']"}), + 'pressrelease_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['journalmanager.PressRelease']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'journalmanager.section': { + 'Meta': {'ordering': "('id',)", 'object_name': 'Section'}, + 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '21', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_trashed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'journal': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Journal']"}), + 'legacy_code': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}), + 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) + }, + 'journalmanager.sectiontitle': { + 'Meta': {'ordering': "['title']", 'object_name': 'SectionTitle'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Language']"}), + 'section': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'titles'", 'to': "orm['journalmanager.Section']"}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '256'}) + }, + 'journalmanager.sponsor': { + 'Meta': {'ordering': "['name']", 'object_name': 'Sponsor', '_ormbases': ['journalmanager.Institution']}, + 'collections': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['journalmanager.Collection']", 'symmetrical': 'False'}), + 'institution_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['journalmanager.Institution']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'journalmanager.studyarea': { + 'Meta': {'object_name': 'StudyArea'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'study_area': ('django.db.models.fields.CharField', [], {'max_length': '256'}) + }, + 'journalmanager.subjectcategory': { + 'Meta': {'object_name': 'SubjectCategory'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'term': ('django.db.models.fields.CharField', [], {'max_length': '256', 'db_index': 'True'}) + }, + 'journalmanager.translateddata': { + 'Meta': {'object_name': 'TranslatedData'}, + 'field': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'translation': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}) + }, + 'journalmanager.uselicense': { + 'Meta': {'ordering': "['license_code']", 'object_name': 'UseLicense'}, + 'disclaimer': ('django.db.models.fields.TextField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'license_code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), + 'reference_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) + }, + 'journalmanager.usercollections': { + 'Meta': {'unique_together': "(('user', 'collection'),)", 'object_name': 'UserCollections'}, + 'collection': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['journalmanager.Collection']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_manager': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + }, + 'journalmanager.userprofile': { + 'Meta': {'object_name': 'UserProfile'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) + } + } + + complete_apps = ['journalmanager'] \ No newline at end of file diff --git a/scielomanager/journalmanager/models.py b/scielomanager/journalmanager/models.py index f24e1d66..5c97ba9d 100644 --- a/scielomanager/journalmanager/models.py +++ b/scielomanager/journalmanager/models.py @@ -587,6 +587,7 @@ class Journal(caching.base.CachingMixin, models.Model): userobjects = modelmanagers.JournalManager() # Relation fields + editor = models.ForeignKey(User, verbose_name=_('Editor'), related_name='editor_journal', null=True, blank=True) creator = models.ForeignKey(User, related_name='enjoy_creator', editable=False) sponsor = models.ManyToManyField('Sponsor', verbose_name=_('Sponsor'), related_name='journal_sponsor', null=True, blank=True) previous_title = models.ForeignKey('Journal', verbose_name=_('Previous title'), related_name='prev_title', null=True, blank=True) @@ -664,7 +665,8 @@ def __unicode__(self): class Meta: ordering = ('title', 'id') permissions = (("list_journal", "Can list Journals"), - ("list_editor_journal", "Can list editor Journals")) + ("list_editor_journal", "Can list editor Journal"), + ("change_editor", "Can change editor of the journal")) def get_last_issue(self): """ diff --git a/scielomanager/journalmanager/templates/journalmanager/editor.html b/scielomanager/journalmanager/templates/journalmanager/editor.html new file mode 100644 index 00000000..dc2140cf --- /dev/null +++ b/scielomanager/journalmanager/templates/journalmanager/editor.html @@ -0,0 +1,83 @@ +{% extends "base_lv1.html" %} +{% load inctag_toolbars %} +{% load user_avatar %} +{% load modal %} +{% load i18n %} + +{% block page_title %}{{block.super}}{% endblock %} + +{% block content %} + + {% journaldash_toolbar 'editor' journal user %} + + {{block.super}} + + {% if editor %} + + + + + + + + + + + + + + + + + + + +
{% trans "Username" %}:{% trans "E-mail" %}:{% trans "Full name" %}:{% trans "Groups" %}:{% trans "Actions" %}:
+ + Gravatar + {{ editor.username }} + + + + {{ editor.email }} + + {{ editor.get_full_name }}{{ editor.groups.all|join:", " }} + + {% trans 'Change user editor' %} + +
+ {% else %} +
+ {% trans "Warning! No user was selected as editor of this journal. To be the editor user must be in 'Editors' group" %} +
+ + {% include 'journalmanager/includes/form_add_editor.html' %} + + {% endif %} + + {% modal_form title="Change editor user" modal_id="id_modal_change_editor" %} + +{% endblock %} + +{% block extrafooter %} + +{% endblock %} + diff --git a/scielomanager/journalmanager/templates/journalmanager/home_editor.html b/scielomanager/journalmanager/templates/journalmanager/home_editor.html deleted file mode 100644 index 1625b4bc..00000000 --- a/scielomanager/journalmanager/templates/journalmanager/home_editor.html +++ /dev/null @@ -1,53 +0,0 @@ -{% extends "base_lv1.html" %} -{% load i18n %} -{% load static %} -{% load get_title_for_pended %} -{% load inctag_toolbars %} - -{% block page_title %}{{block.super}}{% endblock %} - -{% block content %} -{{block.super}} -

{% trans "My Journals" %}

- - - - - - - - - - {% for journal in editor_journals %} - - - - - - {% empty %} - - - - {% endfor %} - -
{% trans "Journal Title" %}{% trans "Print ISSN" %}{% trans "Electronic ISSN" %}
-

- {% if perms.journalmanager.list_editor_journal %} - - {{ journal.title_iso }} - - {% else %} - {{ journal.title_iso }} - {% endif %} -

-
{{ journal.print_issn|default:"n.a." }}{{ journal.eletronic_issn|default:"n.a." }}
-
- - {% trans 'There are no items.' %} -
-
-{% endblock %} - diff --git a/scielomanager/journalmanager/templates/journalmanager/includes/form_add_editor.html b/scielomanager/journalmanager/templates/journalmanager/includes/form_add_editor.html new file mode 100644 index 00000000..92660262 --- /dev/null +++ b/scielomanager/journalmanager/templates/journalmanager/includes/form_add_editor.html @@ -0,0 +1,29 @@ +{% load i18n %} + +
+

{% trans 'Choose a user to be editor of this journal' %}:

+ +
+ {% csrf_token %} +
+
+ +
+
+ + {% if not request.is_ajax %} +
+
+ +
+
+ {% endif %} + +
+ +
diff --git a/scielomanager/journalmanager/templates/journalmanager/inctag_journaldash_toolbar.html b/scielomanager/journalmanager/templates/journalmanager/inctag_journaldash_toolbar.html index 583818ee..d8db9149 100644 --- a/scielomanager/journalmanager/templates/journalmanager/inctag_journaldash_toolbar.html +++ b/scielomanager/journalmanager/templates/journalmanager/inctag_journaldash_toolbar.html @@ -28,6 +28,13 @@ {% trans 'Status' %} {% endif %} + {% flag 'editorialmanager' %} + {% if perms.journalmanager.change_editor %} +
  • + {% trans 'Editor' %} +
  • + {% endif %} + {% endflag %} diff --git a/scielomanager/journalmanager/urls.py b/scielomanager/journalmanager/urls.py index db0ae779..c37458da 100644 --- a/scielomanager/journalmanager/urls.py +++ b/scielomanager/journalmanager/urls.py @@ -54,6 +54,10 @@ url(r'^user/(?P\d+)/toggle_active_collection/(?P\d+)$', views.toggle_active_collection, name='usercollection.toggle_active'), + #Editor + url(r'^(?P\d+)/editor/$', views.get_editor, name="editor.index"), + url(r'^(?P\d+)/editor/add/$', views.add_editor, name="editor.add"), + # Ajax requests url(r'^ajx/ajx1/$', views.ajx_list_issues_for_markup_files, name="ajx.list_issues_for_markup_files"), url(r'^ajx/ajx2/$', views.ajx_lookup_for_section_translation, name="ajx.lookup_for_section_translation"), diff --git a/scielomanager/journalmanager/views.py b/scielomanager/journalmanager/views.py index 6e2ce661..5ca85b06 100644 --- a/scielomanager/journalmanager/views.py +++ b/scielomanager/journalmanager/views.py @@ -16,6 +16,7 @@ from django.contrib.auth.decorators import permission_required from django.contrib.auth.decorators import user_passes_test from django.contrib.auth.models import User +from django.contrib.auth.models import Group from django.contrib import messages from django.core.urlresolvers import reverse from django.core.urlresolvers import resolve @@ -63,6 +64,72 @@ def get_first_letter(objects_all): return sorted(list(letters_set)) +def get_users_by_group(group): + """ + Get all users from group, return None if group doesnt exists. + """ + try: + editor_group = Group.objects.get(name=group) + except ObjectDoesNotExist: + return None + else: + return editor_group.user_set.all() + + +def get_editor(request, journal_id): + """ + Get the editor of the journal. + """ + users_editor = None + + journal = get_object_or_404(models.Journal, id=journal_id) + + if not journal.editor: + if not get_users_by_group('Editors'): + messages.error(request, _("Does not exist the group 'Editors'")) + else: + users_editor = get_users_by_group('Editors') + + return render_to_response('journalmanager/editor.html', + {'editor': journal.editor, + 'journal': journal, + 'users_editor': users_editor}, + context_instance=RequestContext(request)) + + +def add_editor(request, journal_id): + """ + Set any user from Editors as editor of any journal. + """ + journal = get_object_or_404(models.Journal, id=journal_id) + + if request.method == "POST": + editor_pk = request.POST.get('editor', None) + if editor_pk: + editor = User.objects.get(pk=editor_pk) + journal.editor = editor + journal.save() + messages.success(request, _("Successfully selected %s as editor of this Journal" % editor.get_full_name())) + else: + #Remove editor + journal.editor = None + journal.save() + messages.success(request, _("No user selected as editor of this journal!")) + else: + editors_group = get_users_by_group('Editors') + if not editors_group: + messages.error(request, _("Does not exist the group 'Editors'")) + else: + users_editor = editors_group + + return render_to_response('journalmanager/includes/form_add_editor.html', + {'journal': journal, + 'users_editor': users_editor}, + context_instance=RequestContext(request)) + + return HttpResponseRedirect(reverse('editor.index', args=[journal.id])) + + def index(request): if not request.user.is_authenticated():