Skip to content

Commit

Permalink
feat: add Feature Hackathon's on Townsquare Experiment gitcoinco#6870
Browse files Browse the repository at this point in the history
  • Loading branch information
developerfred committed Jun 16, 2020
2 parents 57fa75c + 6b76d0f commit f435e54
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 25 deletions.
4 changes: 3 additions & 1 deletion app/assets/v2/css/town_square.css
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,8 @@ body.green.offer_view .announce {
.townsquare_block-header.closed::after {
content: "^"
}


#status .btn-group-toggle .btn-radio {
background-color: var(--badge-blue-bg);
color: var(--badge-blue-text);
Expand Down Expand Up @@ -1298,4 +1300,4 @@ body.green.offer_view .announce {
.dark-mode .web3modal-modal-card {
background: var(--gc-dark-violet);
color: white;
}
}
3 changes: 2 additions & 1 deletion app/retail/templates/emails/assets/css/activity_stream.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
cursor: pointer;
font-size: 12px;
padding: 3px;
background-color: #ecf0f4;
background-color: #fff;
border: 0px solid;
color: #3d23fc;
}

.dark-mode #reflink {
Expand Down
2 changes: 1 addition & 1 deletion app/retail/templates/shared/fbpixel.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
{% not pref_do_not_track %}
{% if not pref_do_not_track %}
{% if env == 'prod' %}
<!-- Facebook Pixel Code -->
<script>
Expand Down
2 changes: 1 addition & 1 deletion app/townsquare/migrations/0020_auto_20200521_1020.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Migration(migrations.Migration):

operations = [
migrations.AlterField(
model_name='pinnedpost',
model_name='PinnedPost',
name='activity',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pin', to='dashboard.Activity'),
),
Expand Down
47 changes: 47 additions & 0 deletions app/townsquare/templates/townsquare/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,44 @@
<link rel="stylesheet" href="{% static "v2/css/activity_stream.css" %}">
<link rel="stylesheet" href="{% static "v2/css/tag.css" %}">
<link rel="stylesheet" href="{% static "v2/css/theme_switcher.css" %}">
<style>
img.hackathon-card-logo{
max-height: 4rem;
max-width: 4rem;
}

.townsquare_block-header.box-collapse {
background: #fff;
padding: 10px;
border-bottom: 1px solid #ddd;
text-transform: none;
}

.box-hackathons {
background: #ffff;
border-bottom: 1px solid #ddd;
}

.box-hackathons .card {
border: none;
}

.box-hackathons .card-header {
padding: 1.75rem 1.25rem;
border-bottom: none;
background-color: transparent;
}

.box-hackathons-townsquare .hackathon-actions {
font-weight: 700;
}

.box-hackathons .view-all {
background-color: #fff;
padding: 0px 0px 0px 20px;
font-weight: 700;
}
</style>
<script src="{% static "v2/js/theme_switcher.js" %}"></script> <!-- needs to be in the head section -->
</head>

Expand Down Expand Up @@ -140,6 +178,15 @@
{% if SHOW_DRESSING %}

{% include 'townsquare/shared/tribe.html' %}


{% if hackathon_tabs|length %}
<div class="townsquare_block-header box-collapse mt-1" data-target="hackathons">
Gitcoin Hackathons
</div>
{% include 'townsquare/shared/hackathons.html' %}
{% endif %}

{% include 'townsquare/shared/reflink.html' %}

<div class="townsquare_block-header text-left my-4 mt-sm-0 mb-sm-2" data-target="actions">
Expand Down
32 changes: 14 additions & 18 deletions app/townsquare/templates/townsquare/shared/hackathons.html
Original file line number Diff line number Diff line change
@@ -1,47 +1,43 @@
{% if hackathons|length %}
<ul id=hackathons class="nav d-inline-block font-body mb-2">
{% for hackathon in hackathons|slice:":5" %}
<div class="col-xs-12 col-md-9 col-lg-8 col-xl-5 mx-auto">

<div class="card flex-row flex-wrap mb-5" id="{{hackathon.slug}}">

<div class="card-header text-center col-3 col-sm-2 px-0 border-0 my-auto">
<div id="hackathons" class="mb-4 box-hackathons">
{% for hackathon in hackathon_tabs|slice:":5" %}
<div class="box-hackathons-townsquare">
<div class="card flex-row" id="{{hackathon.slug}}">
<div class="card-header">
{% firstof hackathon.logo_svg or hackathon.logo as logo %}
{% if logo %}
<img class="hackathon-card-logo" src="{{MEDIA_URL}}{{logo}}" alt="Hackathon logo" />
{% else %}
<div class="hackathon-card-logo text-center px-3 font-caption">
{{ hackathon.name }}
{{ hackathon.title }}
</div>
{% endif %}
</div>

<div class="card-body col-9 col-sm-8">
<div class="card-body">
<h5 class="font-subheader font-weight-semibold">
<a href="{% url 'hackathon' hackathon.slug %}" class="text-black" target="_blank"
rel="noopener noreferrer">
{{ hackathon.name }}
{{ hackathon.title }}
</a>
</h5>
<div class="font-smaller-2">
<span class>From</span>
<time class="font-weight-bold"
datetime="{{ hackathon.start_date|date:'c' }}">{{ hackathon.start_date|date:"m/d/Y" }}</time>
datetime="{{ hackathon.start_date|date:'c' }}">{{ hackathon.start|date:"m/d/Y" }}</time>
<span>To</span>
<time class="font-weight-bold"
datetime="{{ hackathon.end_date|date:'c' }}">{{ hackathon.end_date|date:"m/d/Y" }}</time>
datetime="{{ hackathon.end_date|date:'c' }}">{{ hackathon.end|date:"m/d/Y" }}</time>
</div>
<div class="mt-3 hackathon-actions">
{% if hackathon.end_date|timesince <= "1 min" %}
{% if hackathon.end|timesince <= "1 min" %}
<a href="{% url 'hackathon_onboard' hackathon.slug %}">
Join Hackathon >
</a>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</ul>
<a href="https://gitcoin.co/hackathon-list/">View all ></a>
{% endif %}
<a href="https://gitcoin.co/hackathon-list/" class="view-all">View all ></a>
</div>
2 changes: 1 addition & 1 deletion app/townsquare/templates/townsquare/shared/reflink.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% if REFER_LINK %}
<div class="townsquare_block-header text-left mb-1 mt-0" data-target="reflink_container">
<div class="townsquare_block-header box-collapse text-left mb-1 mt-0" data-target="reflink_container">
Ref A Friend! <i data-toggle="tooltip" data-html="true" class="fas fa-info-circle mr-3" title="
<strong>
Gitcoin is better with friends!
Expand Down
3 changes: 1 addition & 2 deletions app/townsquare/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,8 @@ def get_sidebar_tabs(request):
connect = {
'title': hackathon.name,
'logo': hackathon.logo,
'logo_svg' hackathon.logo_svg,
'start': hackathon.start_date,
'end': hackthon.end_date,
'end': hackathon.end_date,
'slug': f'hackathon:{hackathon.pk}',
'url_slug': hackathon.slug,
'helper_text': f'Go to {hackathon.name} Townsquare.',
Expand Down

0 comments on commit f435e54

Please sign in to comment.