Skip to content

Commit 419f73a

Browse files
committed
Added serializer data for created_time, issues
1 parent c7c5ec5 commit 419f73a

File tree

13 files changed

+178
-43
lines changed

13 files changed

+178
-43
lines changed

main/management/commands/updatecomponents.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ def handle(self, *args, **options):
115115
_component.license = github_data['license']['name']
116116
except:
117117
pass
118+
try:
119+
str_date = github_data['created_at']
120+
req_date = datetime.strptime(str_date, "%Y-%m-%dT%H:%M:%S.%fZ") #This object is timezone unaware
121+
aware_date = pytz.utc.localize(req_date) #This object is now timezone aware
122+
_component.created_time = aware_date
123+
except:
124+
pass
118125
_component.save()
119126
print str(github_data['contributors_url']) + '?client_id=' + GITHUB_CLIENT_ID + '&client_secret=' + GITHUB_CLIENT_SECRET
120127
contributors_data = get_contributors_data(str(github_data['contributors_url']) + '?client_id=' + GITHUB_CLIENT_ID + '&client_secret=' + GITHUB_CLIENT_SECRET)

main/serializers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class Meta:
5555
'name',
5656
'stars',
5757
'downloads',
58+
'created_time',
5859
'modified_time',
5960
'tags',
6061
'icon_url',
@@ -65,6 +66,7 @@ class Meta:
6566
'forks',
6667
'watchers',
6768
'no_of_contributors',
69+
'open_issues',
6870
'version',
6971
'author',
7072
'author_email',

main/views.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ def index(request):
2121

2222
def all_components(request): # requested on_load() for querying
2323
all_components = BaseComponentSerializer(Component.objects.all(), many=True)
24-
print all_components
2524
return JsonResponse({
2625
'all_components':all_components.data,
2726
})
2827

2928
def top_components(request):
3029
top_components = TopComponentSerializer(Component.objects.all().order_by('-downloads')[:10], many=True)
31-
print top_components
3230
return JsonResponse({
3331
'top_components':top_components.data,
3432
})

static/admin/css/base.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,15 @@ p.mini {
187187
margin-top: -3px;
188188
}
189189

190-
.help, p.help, form p.help {
190+
.help, p.help, form p.help, div.help, form div.help, div.help li {
191191
font-size: 11px;
192192
color: #999;
193193
}
194194

195+
div.help ul {
196+
margin-bottom: 0;
197+
}
198+
195199
.help-tooltip {
196200
cursor: help;
197201
}
@@ -410,6 +414,9 @@ input, textarea, select, .form-row p, form .button {
410414
font-weight: normal;
411415
font-size: 13px;
412416
}
417+
.form-row div.help {
418+
padding: 2px 3px;
419+
}
413420

414421
textarea {
415422
vertical-align: top;
@@ -731,7 +738,7 @@ a.deletelink:focus, a.deletelink:hover {
731738

732739
.object-tools a.viewsitelink, .object-tools a.golink,.object-tools a.addlink {
733740
background-repeat: no-repeat;
734-
background-position: 93% center;
741+
background-position: right 7px center;
735742
padding-right: 26px;
736743
}
737744

static/admin/css/changelists.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@
166166
#changelist-filter a {
167167
display: block;
168168
color: #999;
169+
text-overflow: ellipsis;
170+
overflow-x: hidden;
169171
}
170172

171173
#changelist-filter li.selected {

static/admin/css/dashboard.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121

2222
ul.actionlist li {
2323
list-style-type: none;
24-
}
25-
26-
ul.actionlist li {
2724
overflow: hidden;
2825
text-overflow: ellipsis;
2926
-o-text-overflow: ellipsis;

static/admin/css/forms.css

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ form ul.inline li {
8383
height: 26px;
8484
}
8585

86-
.aligned label + p {
86+
.aligned label + p, .aligned label + div.help, .aligned label + div.readonly {
8787
padding: 6px 0;
8888
margin-top: 0;
8989
margin-bottom: 0;
@@ -115,26 +115,32 @@ form .aligned ul.radiolist {
115115
padding: 0;
116116
}
117117

118-
form .aligned p.help {
118+
form .aligned p.help,
119+
form .aligned div.help {
119120
clear: left;
120121
margin-top: 0;
121122
margin-left: 160px;
122123
padding-left: 10px;
123124
}
124125

125-
form .aligned label + p.help {
126+
form .aligned label + p.help,
127+
form .aligned label + div.help {
126128
margin-left: 0;
127129
padding-left: 0;
128130
}
129131

130-
form .aligned p.help:last-child {
132+
form .aligned p.help:last-child,
133+
form .aligned div.help:last-child {
131134
margin-bottom: 0;
132135
padding-bottom: 0;
133136
}
134137

135138
form .aligned input + p.help,
136139
form .aligned textarea + p.help,
137-
form .aligned select + p.help {
140+
form .aligned select + p.help,
141+
form .aligned input + div.help,
142+
form .aligned textarea + div.help,
143+
form .aligned select + div.help {
138144
margin-left: 160px;
139145
padding-left: 10px;
140146
}
@@ -156,15 +162,17 @@ form .aligned table p {
156162
padding: 0 0 5px 5px;
157163
}
158164

159-
.aligned .vCheckboxLabel + p.help {
165+
.aligned .vCheckboxLabel + p.help,
166+
.aligned .vCheckboxLabel + div.help {
160167
margin-top: -4px;
161168
}
162169

163170
.colM .aligned .vLargeTextField, .colM .aligned .vXMLLargeTextField {
164171
width: 610px;
165172
}
166173

167-
.checkbox-row p.help {
174+
.checkbox-row p.help,
175+
.checkbox-row div.help {
168176
margin-left: 0;
169177
padding-left: 0;
170178
}
@@ -180,14 +188,22 @@ fieldset .field-box {
180188
width: 200px;
181189
}
182190

183-
form .wide p, form .wide input + p.help {
191+
form .wide p,
192+
form .wide input + p.help,
193+
form .wide input + div.help {
184194
margin-left: 200px;
185195
}
186196

187-
form .wide p.help {
197+
form .wide p.help,
198+
form .wide div.help {
188199
padding-left: 38px;
189200
}
190201

202+
form div.help ul {
203+
padding-left: 0;
204+
margin-left: 0;
205+
}
206+
191207
.colM fieldset.wide .vLargeTextField, .colM fieldset.wide .vXMLLargeTextField {
192208
width: 450px;
193209
}

static/admin/css/rtl.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ thead th.sorted .text {
166166
margin-left: 5px;
167167
}
168168

169+
form .aligned p.help, form .aligned div.help {
170+
clear: right;
171+
}
172+
169173
form ul.inline li {
170174
float: right;
171175
padding-right: 0;
@@ -226,6 +230,10 @@ form .form-row p.datetime {
226230
overflow: hidden;
227231
}
228232

233+
.related-widget-wrapper {
234+
float: right;
235+
}
236+
229237
/* MISC */
230238

231239
.inline-related h2, .inline-group h2 {

static/admin/js/admin/RelatedObjectLookups.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
}
163163
});
164164
$('.related-widget-wrapper select').trigger('change');
165-
$('.related-lookup').click(function(e) {
165+
$('body').on('click', '.related-lookup', function(e) {
166166
e.preventDefault();
167167
var event = $.Event('django:lookup-related');
168168
$(this).trigger(event);

static/admin/js/change_form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'use strict';
55
$(document).ready(function() {
66
var modelName = $('#django-admin-form-add-constants').data('modelName');
7-
$('.add-another').click(function(e) {
7+
$('body').on('click', '.add-another', function(e) {
88
e.preventDefault();
99
var event = $.Event('django:add-another-related');
1010
$(this).trigger(event);

0 commit comments

Comments
 (0)