Skip to content

Commit

Permalink
Merge branch 'enhancement/gh-3290-add-organization-name-column' into …
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
frjo committed Jul 26, 2023
2 parents fb2a100 + fb64ba6 commit c5ce2c0
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/setup/administrators/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Good for testing, might not be a good idea in production.

### Columns to exclude from the submission tables.

Possible values are: fund, round, status, lead, reviewers, screening_statuses, category_options, meta_terms
Possible values are: fund, round, status, lead, reviewers, screening_statuses, category_options, meta_terms, organization_name

SUBMISSIONS_TABLE_EXCLUDED_FIELDS = env.list('SUBMISSIONS_TABLE_EXCLUDED_FIELDS', [])

Expand Down
8 changes: 8 additions & 0 deletions hypha/apply/funds/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ class Meta:
def prepare_data(self, value, data, serialize):
return format_number_as_currency(str(data))

class OrganizationNameBlock(ApplicationSingleIncludeFieldBlock):
name = 'organization_name'
description = 'The name of the organization'
widget = forms.TextInput()

class Meta:
label = _('Organization name')


class EmailBlock(ApplicationMustIncludeFieldBlock):
name = 'email'
Expand Down
28 changes: 28 additions & 0 deletions hypha/apply/funds/migrations/0112_add_organization_name.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion hypha/apply/funds/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ class BaseAdminSubmissionsTable(SubmissionsTable):
lead = tables.Column(order_by=('lead__full_name',))
reviews_stats = tables.TemplateColumn(template_name='funds/tables/column_reviews.html', verbose_name=mark_safe("Reviews<div>Comp. <span class=\"counts-separator\">/</span> Assgn.</div>"), orderable=False)
screening_status = tables.Column(verbose_name=_('Screening'), accessor='screening_statuses')
organization_name = tables.Column()

class Meta(SubmissionsTable.Meta):
fields = ('title', 'phase', 'stage', 'fund', 'round', 'lead', 'submit_time', 'last_update', 'screening_status', 'reviews_stats') # type: ignore
fields = ('title', 'phase', 'stage', 'fund', 'round', 'lead', 'submit_time', 'last_update', 'screening_status', 'reviews_stats', 'organization_name') # type: ignore
sequence = fields + ('comments',)

def render_lead(self, value):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ <h5>{% trans "Address" %}</h5>
{{ object.get_address_display }}
</div>
{% endif %}
{% if object.get_organization_name_display != "-" %}
<div class="grid__cell--span-two">
<h5>{% trans "Organization name" %}</h5>
{{ object.get_organization_name_display }}
</div>
{% endif %}
</div>

<div class="rich-text rich-text--answers">
Expand Down
4 changes: 2 additions & 2 deletions hypha/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
SUBMISSIONS_DRAFT_ACCESS_STAFF_ADMIN = env.bool('SUBMISSIONS_DRAFT_ACCESS_STAFF_ADMIN', False)

# Columns to exclude from the submission tables.
# Possible values are: fund, round, status, lead, reviewers, screening_statuses, category_options, meta_terms
SUBMISSIONS_TABLE_EXCLUDED_FIELDS = env.list('SUBMISSIONS_TABLE_EXCLUDED_FIELDS', [])
# Possible values are: fund, round, status, lead, reviewers, screening_statuses, category_options, meta_terms, organization_name
SUBMISSIONS_TABLE_EXCLUDED_FIELDS = env.list('SUBMISSIONS_TABLE_EXCLUDED_FIELDS', ['organization_name'])

# Should submission automatically transition after all reviewer roles are assigned.
TRANSITION_AFTER_ASSIGNED = env.bool('TRANSITION_AFTER_ASSIGNED', False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
width: 110px;
}
}

&.organization_name { // stylelint-disable-line selector-class-pattern
@include media-query($table-breakpoint) {
width: 110px;
}
}
}

tr {
Expand Down Expand Up @@ -144,6 +150,12 @@
hyphens: auto;
}

&.organization_name { // stylelint-disable-line selector-class-pattern
@include media-query($table-breakpoint) {
padding-left: 15px;
}
}

// arrow to toggle project info - added via js
@include media-query($table-breakpoint) {
.arrow {
Expand Down

0 comments on commit c5ce2c0

Please sign in to comment.