Skip to content

Commit

Permalink
Issue #2 - اخبار مربوط به شورا some minor changes added, Announcement…
Browse files Browse the repository at this point in the history
… is now ready to use.
  • Loading branch information
Khedesh committed Aug 4, 2016
1 parent 5f680d5 commit 38d3416
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 28 deletions.
12 changes: 9 additions & 3 deletions base/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

from base.forms import *
from base.models import Member

from announcements.models import Announcement
from shamsi.templatetags.shamsi_template_tags import pdatetime

def home(request):
go_course = False
Expand All @@ -30,8 +31,14 @@ def home(request):
return HttpResponseRedirect(reverse('requests'))
return HttpResponseRedirect(reverse('issues'))


def index(request):
return render(request, 'index.html')
announcements = Announcement.objects.order_by('-date')[:5]
for an in announcements:
an.date = pdatetime(an.date)
return render(request, 'index.html', {
'announcements': announcements,
})


def logout(request):
Expand Down Expand Up @@ -148,4 +155,3 @@ def password_reset_change(request):
'form': form,
'sent': sent,
})

2 changes: 1 addition & 1 deletion event/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def active(self):
return datetime.datetime.now() < self.reg_end.replace(tzinfo=None)

def get_end(self):
return unicode(self.reg_end.replace(tzinfo=None))
return str(self.reg_end.replace(tzinfo=None))

def get_count(self):
return EventRegister.objects.filter(event=self).count()
Expand Down
10 changes: 1 addition & 9 deletions static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ header {
height: 60px;
font-size: 14px;
padding: 10px 50px;

}

.normal-p {
Expand Down Expand Up @@ -474,15 +475,6 @@ header .panel-heading {
margin-right: auto;
}

.bigtile {
background: #3982c1;
text-align: center;
margin: 2px;
border-width: thick;
border-color: #EEBB44;
border-style: solid;
}

.bigtile a {
font-family: Raleway, IranSans, BRoya, 'B roya', Tahoma, Arial, sans-serif;
color: #FFFFFF;
Expand Down
29 changes: 18 additions & 11 deletions templates/announcements/announcements.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,33 @@
{% block size3 %}col-lg-6 col-md-6{% endblock %}

{% block body %}
<div class="panel panel-primary panel-background-color">
<div class="panel-heading dir-rtl"> اطلاعیه‌ها</div>
<div class="panel-body">
{% for announcement in announcements %}
<div class="panel panel-default dir-rtl">
<div class="panel-heading">
<a href="{% url 'show-announcement' announcement.id %}" target="_self" class="permanent link event-link"
data-id={{ announcement.id }}>
<span class="request-id glyphicon glyphicon-tag"></span>
<div class="col-md-1 col-lg-1"></div>
<div class="col-md-10 col-lg-10">
<div class="panel panel-primary panel-background-color">

<div class="panel-heading dir-rtl"> اطلاعیه‌ها</div>
<div class="panel-body">
{% for announcement in announcements %}
<div class="panel panel-default dir-rtl">
<div class="panel-heading">
<a href="{% url 'show-announcement' announcement.id %}" target="_self"
class="permanent link event-link"
data-id={{ announcement.id }}>
<span class="request-id glyphicon glyphicon-tag"></span>
<span class="panel-title">
{{ announcement.title }}
</span>
</a>
</a>
<span id="announcement-countdown-{{ announcement.id }}" class="pull-left poll-countdown">
{{ announcement.date }}
</span>

</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>

</div>
<div class="col-md-1 col-lg-1"></div>
{% endblock %}
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
{% block body %}{% endblock %}
</div>
{% block footer %}
<footer class="footer base navbar-fixed-bottom">
<footer class="footer base">
<div class="col-lg-6 col-md-6">
<p class="english">
Designed by <a href="http://mjafar.me/" target="_blank">MJafar</a> and Semora, Powered by <a
Expand Down
36 changes: 33 additions & 3 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,48 @@

<div class="col-md-1 col-lg-1"></div>

<div class="col-md-4 col-lg-4">
<div class="col-md-4 col-lg-4 btn btn-primary ">
<div class="pull-right bigtile panel-body">
<a href="{% url 'issues' %}">سامانه رسیدگی به مشکلات رفاهی</a>
</div>
</div>
<div class="col-md-2 col-lg-2"></div>
<div class="col-md-1 col-lg-1"></div>

<div class="col-md-4 col-lg-4">
<div class="col-md-5 col-lg-5 btn btn-primary ">
<div class="pull-right bigtile panel-body">
<a href="{% url 'requests' %}">سامانه رسیدگی به مشکلات برنامه درسی</a>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12" style="height:20px"></div>

<div class="col-md-12 col-lg-12">
<div class="col-md-1 col-lg-1"></div>

<div class="col-md-10 col-lg-10 ">
<div class="panel panel-primary panel-background-color">
<div class="panel-heading dir-rtl"> اطلاعیه‌ها</div>
<div class="panel-body">
{% for announcement in announcements %}
<div class="panel panel-default dir-rtl">
<div class="panel-heading">
<a href="{% url 'show-announcement' announcement.id %}" target="_self"
class="permanent link event-link"
data-id={{ announcement.id }}>
<span class="request-id glyphicon glyphicon-tag"></span>
<span class="panel-title"> {{ announcement.title }} </span>
</a>
<span id="announcement-countdown-{{ announcement.id }}" class="pull-left poll-countdown"> {{ announcement.date }} </span>

</div>
</div>
{% endfor %}
</div>
</div>
</div>

<div class="col-md-1 col-lg-1"></div>

</div>

{% endblock %}

0 comments on commit 38d3416

Please sign in to comment.