Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions package/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,41 +75,49 @@ class Project(BaseModel):
{
'id': NONE_STATUS,
'name': '----',
'short_name': '----',
'description': '',
},
{
'id': UNKNOWN,
'name': 'Unknown',
'short_name': 'Unknown',
'description': 'Unknown project status',
},
{
'id': LIVE__RELEASED,
'name': 'Live/Released',
'short_name': 'Live/Released',
'description': 'Project is ready to use',
},
{
'id': WORKING_PROTOTYPE__BETA,
'name': 'Working Prototype/Beta',
'short_name': 'Prototype/Beta',
'description': 'Project is working however, it still can contain some bugs',
},
{
'id': DEMO__ALPHA,
'name': 'Demo/Alpha',
'short_name': 'Demo/Alpha',
'description': 'Project can be used by people which are not afraid of bugs and has very high pain threshold',
},
{
'id': CONCEPT,
'name': 'Concept',
'short_name': 'Concept',
'description': 'Project which pretends to be a working product',
},
{
'id': ABANDONED__BROKEN,
'name': 'Abandoned/Broken',
'short_name': 'Abandoned',
'description': 'Project is no longer available or it is completely broken',
},
{
'id': OUT_OF_DATE__RETIRED,
'name': 'Out of Date/Retired',
'short_name': 'Retired',
'description': 'Project is no longer needed, because of changes in ecosystem',
},

Expand Down Expand Up @@ -428,6 +436,16 @@ def status_description(self):
)
)

@property
def short_status_name(self):
return next(
(
status['short_name']
for status in Project.STATUSES
if status['id'] == self.status
)
)


class TeamMembership(BaseModel):
account = models.ForeignKey(Account, default=None, blank=True, null=True)
Expand Down
44 changes: 44 additions & 0 deletions static/scss/new/module/_project-tile.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "../base/variables";

$gallery-size: 20;

Expand All @@ -13,6 +14,49 @@ $gallery-size: 20;
box-shadow: 0 3px 7px rgba(0,0,0,.1); // TODO: adjust EOS color
}

&__status {
background-color: black;
opacity: 0.7;
color: $m-btn-font-color-hover;
position: relative;
height: 20px;
bottom: 20px;
margin-bottom: -20px;
float: left;
width: 100%;
text-align: center;
border-bottom-style: solid;
border-bottom-width: 2px;

&--unknown {
border-bottom-color: $status-unknown;
}

&--live_released {
border-bottom-color: $status-live-released;
}

&--workingprototype_beta {
border-bottom-color: $status-working-prototype-beta;
}

&--demo_alpha {
border-bottom-color: $status-demo-alpha;
}

&--concept {
border-bottom-color: $status-concept;
}

&--abandoned_broken {
border-bottom-color: $status-abandoned-broken;
}

&--outofdate_retired {
border-bottom-color: $status-out-of-date-retired;
}
}

&__details {
float: left;
padding-left: 30px;
Expand Down
1 change: 0 additions & 1 deletion templates/package/package.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ <h1 class="m-title-panel__title">{{ package.name }}</h1>
{% endif %}
{% endif %}
</div>

</div>
<div class="row">
<div class="col-sm-6 col-lg-4">
Expand Down
9 changes: 8 additions & 1 deletion templates/package/templatetags/_project_tile.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
<div class="m-project-tile {% if style %}m-project-tile--{{style}}{% endif %}">
<a href="{{ package.get_absolute_url }}">
{% cache 300 thumbnail package style %}
<img class="m-project-tile__thumbnail" src="{% if style == 'gallery' %}{{ package.img|thumb:320 }}{% else %}{{ package.img|thumb:128 }}{% endif %}">
{% if style == 'gallery' %}
<img class="m-project-tile__thumbnail" src="{{ package.img|thumb:320 }}">
<div class="m-project-tile__status m-project-tile__status--{{ package.status|lower }}">
{{ package.get_status_display }}
</div>
{% else %}
<img class="m-project-tile__thumbnail" src="{{ package.img|thumb:128 }}">
{% endif %}
{% endcache %}
<div class="project-details m-project-tile__details">
<h3 class="m-project-tile__project-name">{{ package.name }}</h3>
Expand Down