Skip to content

Commit

Permalink
[#776] Merge with RSR v3 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperBrandt committed Oct 9, 2014
2 parents e77aeca + 3791e48 commit b096320
Show file tree
Hide file tree
Showing 20 changed files with 393 additions and 139 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ scripts/dev-vm/
dev-env
venv
scripts/dev-vm
vagrant/vagrant-ssh-conf.*


## Deployment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ def forwards(self, orm):


def backwards(self, orm):
# Renaming old table to 'rsr_user_organisation'
db.rename_table(u'rsr_employment', u'rsr_user_organisations')

# Deleting field Employment.is_approved
db.delete_column(u'rsr_employment', 'is_approved')

# Deleting field Employment.country
db.delete_column(u'rsr_employment', 'country')
db.delete_column(u'rsr_employment', 'country_id')

# Deleting field Employment.job_title
db.delete_column(u'rsr_employment', 'job_title')

# Renaming old table to 'rsr_user_organisation'
db.rename_table(u'rsr_employment', u'rsr_user_organisations')

# Deleting field 'User.avatar'
db.delete_column(u'rsr_user', 'avatar')

Expand Down
51 changes: 51 additions & 0 deletions akvo/rsr/static/rsr/v3/css/src/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* Hack for full-width columns below 570px */
@media (max-width: 570px) {
.col-ts-12 {
float: none;
width: 100%;
}
}


.navbar {
border-radius: 0;
border: none;
}

/* HEADER */
body > .navbar {
background-color: #eee;
}
.navbar.a-main {
text-transform: uppercase;
}
.navbar .btn {
padding: 4px 9px;
}
.navbar-brand {
width: 150px;
background-image: url(../../img/logo.png);
background-size: contain;
background-repeat: no-repeat;
text-indent: -999px;
margin-top: 7px;
height: 33px;
margin-left: 0;
}

/* FOOTER */
body > footer {
margin-top: 1em;
}
footer .navbar {
margin-bottom: 0;
}
#footer-body {
text-align: center;
font-size: 0;
}
#footer-body .navbar-nav {
display: inline-block;
float: none;
font-size: 14px;
}
Binary file added akvo/rsr/static/rsr/v3/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions akvo/rsr/static/rsr/v3/js/src/react-bootstrap.min.js

Large diffs are not rendered by default.

Empty file.
File renamed without changes.
16 changes: 2 additions & 14 deletions akvo/rsr/views/my_rsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,13 @@

from akvo.rsr.forms import PasswordForm, ProfileForm, UserOrganisationForm
from akvo.rsr.models import Project, User
from akvo.rest.serializers import UserSerializer
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortcuts import render, render_to_response
from django.template import RequestContext
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response


# @api_view(['PATCH'])
# def update_details(request, user_id):
# serialized = UserSerializer(user_id, data=request.DATA)
# if serialized.is_valid():
# serialized.save()
# return Response(status=status.HTTP_205_RESET_CONTENT)
# else:
# return Response(serialized.errors, status=status.HTTP_400_BAD_REQUEST)


@login_required
def my_details(request):
context = RequestContext(request)

Expand All @@ -52,6 +39,7 @@ def my_details(request):
)


@login_required
def password_change(request):
context = RequestContext(request)
if request.is_ajax() and request.method == "POST":
Expand Down
19 changes: 19 additions & 0 deletions akvo/rsr/views/organisation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-

"""Akvo RSR is covered by the GNU Affero General Public License.
See more details in the license.txt file located at the root folder of the
Akvo RSR module. For additional details on the GNU license please
see < http://www.gnu.org/licenses/agpl.html >.
"""
from akvo.rsr.models import Organisation
from django.shortcuts import get_object_or_404, render


def directory(request):
context = {'organisations': Organisation.objects.all()}
return render(request, 'organisation_directory.html', context)


def main(request, organisation_id):
context = {'o': get_object_or_404(Organisation, pk=organisation_id)}
return render(request, 'organisation_main.html', context)
19 changes: 19 additions & 0 deletions akvo/rsr/views/project_update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-

"""Akvo RSR is covered by the GNU Affero General Public License.
See more details in the license.txt file located at the root folder of the
Akvo RSR module. For additional details on the GNU license please
see < http://www.gnu.org/licenses/agpl.html >.
"""
from akvo.rsr.models import ProjectUpdate
from django.shortcuts import get_object_or_404, render


def directory(request):
context = {'updates': ProjectUpdate.objects.all()}
return render(request, 'project_update_directory.html', context)


def main(request, update_id):
context = {'update': get_object_or_404(ProjectUpdate, pk=update_id)}
return render(request, 'project_update_main.html', context)
25 changes: 25 additions & 0 deletions akvo/settings/40-pipeline.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ PIPELINE_COMPILERS = (
)

PIPELINE_CSS = {
'rsr_v3_style': {
'source_filenames': (
'rsr/v3/css/src/main.css',
),
'output_filename': 'rsr/v3/css/build/rsr_v3.min.css',
'extra_context': {
'media': 'screen,projection',
},
},


'akvo_style': {
'source_filenames': (
'rsr/main/css/src/reset.css',
Expand Down Expand Up @@ -261,6 +272,20 @@ PIPELINE_CSS = {
}

PIPELINE_JS = {
'rsr_v3_script': {
'source_filenames': (
'rsr/v3/js/src/scripts.js',
),
'output_filename': 'rsr/v3/js/build/rsr_v3.min.js',
},
'rsr_v3_libraries': {
'source_filenames': (
'rsr/v3/js/src/react-bootstrap.min.js',
),
'output_filename': 'rsr/v3/js/build/rsr_v3_libraries.min.js',
},


'akvo_script': {
'source_filenames': (
'rsr/main/js/src/galleria.1.1.95.js',
Expand Down
100 changes: 7 additions & 93 deletions akvo/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,106 +14,16 @@
<link rel="shortcut icon" href="{{ STATIC_URL }}rsr/main/img/favicon.ico" type="image/x-icon">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

{# Bootstrap CSS #}
{# CSS #}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">

{# jQuery and Bootstrap JS #}
{# jQuery #}
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>


<style type="text/css">

/* Sticky footer styles
-------------------------------------------------- */

html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}

/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by it's height */
margin: 0 auto -60px;
}

/* Set the fixed height of the footer here */
#push,
#footer {
height: 60px;
}
#footer {
background-color: #000000;
color: #FFFFFF
}

/* Lastly, apply responsive CSS fixes as necessary */
@media (max-width: 767px) {
#footer {
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
padding-right: 20px;
}
}

/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */

.container .credit {
margin: 20px 0;
}

.navbar {
background-color: #eee;
border-radius: 0;
border: none;
}

.navbar.a-main {
text-transform: uppercase;
}

.navbar .btn {
padding: 4px 9px;
}

body > footer {
margin-top: 1em;
}
footer .navbar {
margin-bottom: 0;
}
#footer-body {
text-align: center;
font-size: 0;
}
#footer-body .navbar-nav {
display: inline-block;
float: none;
font-size: 14px;
}

/* Hack for full-width columns below 570px */
@media (max-width: 570px) {
.col-ts-12 {
float: none;
width: 100%;
}
}

</style>
{% compressed_css 'rsr_v3_style' %}

<!-- Piwik -->
{% tracking_code %}

{% block head_js %}{% endblock %}
</head>

Expand All @@ -127,5 +37,9 @@

{% include 'navigation/footer.html' %}

{# JS #}
<script src="http://fb.me/react-0.10.0.js"></script>
{% compressed_js 'rsr_v3_libraries' %}

</body>
</html>
10 changes: 7 additions & 3 deletions akvo/templates/myrsr/my_projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h2>{% trans "My project" %}s</h2>
</tr>
<tr>
<td class="media">
<a class="pull-left" href="#">
<a class="pull-left" href="#">
<img class="media-object"
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2NCIgaGVpZ2h0PSI2NCI+PHJlY3Qgd2lkdGg9IjY0IiBoZWlnaHQ9IjY0IiBmaWxsPSIjZWVlIi8+PHRleHQgdGV4dC1hbmNob3I9Im1pZGRsZSIgeD0iMzIiIHk9IjMyIiBzdHlsZT0iZmlsbDojYWFhO2ZvbnQtd2VpZ2h0OmJvbGQ7Zm9udC1zaXplOjEycHg7Zm9udC1mYW1pbHk6QXJpYWwsSGVsdmV0aWNhLHNhbnMtc2VyaWY7ZG9taW5hbnQtYmFzZWxpbmU6Y2VudHJhbCI+NjR4NjQ8L3RleHQ+PC9zdmc+"
alt="...">
Expand All @@ -28,7 +28,9 @@ <h4 class="media-heading">Title</h4>
</td>
<td>...</td>
<td>...</td>
<td>View, Edit, Publish</td>
<td>
<a href="#">View</a>, <a href="#">Edit</a>, <a href="#">Publish</a>
</td>
</tr>
<tr>
<td class="media">
Expand All @@ -44,7 +46,9 @@ <h4 class="media-heading">Title</h4>
</td>
<td>...</td>
<td>...</td>
<td>View, Edit, Publish</td>
<td>
<a href="#">View</a>, <a href="#">Edit</a>, <a href="#">Publish</a>
</td>
</tr>
</table>

Expand Down
5 changes: 2 additions & 3 deletions akvo/templates/navigation/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<div class="collapse navbar-collapse" id="navbar-collapsed">
<ul class="nav navbar-nav a-main">
<li><a href="{% url 'project-directory' %}">Projects</a></li>
<li><a href="#">Updates</a></li>
<li><a href="#">Organisations</a></li>
<li><a href="{% url 'update-directory' %}">Updates</a></li>
<li><a href="{% url 'organisation-directory' %}">Organisations</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
Expand All @@ -30,7 +30,6 @@
<li><a href="{% url 'register' %}">Register</a></li>
<li><a href="{% url 'sign_in' %}">Sign in</a></li>
{% else %}
<li><span class="badge">5</span></li>
<li><a href="{% url 'my_details' %}">MyRSR</a></li>
<li><a href="{% url 'sign_out' %}">Sign out</a></li>
{% endif %}
Expand Down
Loading

0 comments on commit b096320

Please sign in to comment.