Explorar el Código

cards en home

dany hace 3 años
padre
commit
e0b3ab10e0
Se han modificado 1 ficheros con 30 adiciones y 30 borrados
  1. 30
    30
      gitstats

+ 30
- 30
gitstats Ver fichero

@@ -714,7 +714,7 @@ class HTMLReportCreator(ReportCreator):
714 714
 
715 715
 		self.printNav(f)
716 716
 
717
-		f.write('<dl>')
717
+		f.write('<div><div class="card-body"><dl>')
718 718
 		f.write('<dt>Project name</dt><dd>%s</dd>' % (data.projectname))
719 719
 		f.write('<dt>Generated</dt><dd>%s (in %d seconds)</dd>' % (datetime.datetime.now().strftime(format), time.time() - data.getStampCreated()))
720 720
 		f.write('<dt>Generator</dt><dd><a href="http://gitstats.sourceforge.net/">GitStats</a> (version %s), %s, %s</dd>' % (getversion(), getgitversion(), getgnuplotversion()))
@@ -724,7 +724,7 @@ class HTMLReportCreator(ReportCreator):
724 724
 		f.write('<dt>Total Lines of Code</dt><dd>%s (%d added, %d removed)</dd>' % (data.getTotalLOC(), data.total_lines_added, data.total_lines_removed))
725 725
 		f.write('<dt>Total Commits</dt><dd>%s (average %.1f commits per active day, %.1f per all days)</dd>' % (data.getTotalCommits(), float(data.getTotalCommits()) / len(data.getActiveDays()), float(data.getTotalCommits()) / data.getCommitDeltaDays()))
726 726
 		f.write('<dt>Authors</dt><dd>%s (average %.1f commits per author)</dd>' % (data.getTotalAuthors(), (1.0 * data.getTotalCommits()) / data.getTotalAuthors()))
727
-		f.write('</dl>')
727
+		f.write('</dl></div')
728 728
 
729 729
 		f.write('</body>\n</html>')
730 730
 		f.close()
@@ -755,7 +755,7 @@ class HTMLReportCreator(ReportCreator):
755 755
 			stampcur -= deltaweek
756 756
 
757 757
 		# top row: commits & bar
758
-		f.write('<table class="noborders"><tr>')
758
+		f.write('<div><div class="card-body"><table class="noborders"><tr>')
759 759
 		for i in range(0, WEEKS):
760 760
 			commits = 0
761 761
 			if weeks[i] in data.activity_by_year_week:
@@ -771,12 +771,12 @@ class HTMLReportCreator(ReportCreator):
771 771
 		f.write('</tr><tr>')
772 772
 		for i in range(0, WEEKS):
773 773
 			f.write('<td>%s</td>' % (WEEKS - i))
774
-		f.write('</tr></table>')
774
+		f.write('</tr></table></div>')
775 775
 
776 776
 		# Hour of Day
777 777
 		f.write(html_header(2, 'Hour of Day'))
778 778
 		hour_of_day = data.getActivityByHourOfDay()
779
-		f.write('<table><tr><th>Hour</th>')
779
+		f.write('<div><div class="card-body"><table><tr><th>Hour</th>')
780 780
 		for i in range(0, 24):
781 781
 			f.write('<th>%d</th>' % i)
782 782
 		f.write('</tr>\n<tr><th>Commits</th>')
@@ -798,7 +798,7 @@ class HTMLReportCreator(ReportCreator):
798 798
 				f.write('<td style="background-color: rgb(%d, 0, 0)">%.2f</td>' % (r, (100.0 * hour_of_day[i]) / totalcommits))
799 799
 			else:
800 800
 				f.write('<td>0.00</td>')
801
-		f.write('</tr></table>')
801
+		f.write('</tr></table></div>')
802 802
 		f.write('<img src="hour_of_day.png" alt="Hour of Day" />')
803 803
 		fg = open(path + '/hour_of_day.dat', 'w')
804 804
 		for i in range(0, 24):
@@ -832,7 +832,7 @@ class HTMLReportCreator(ReportCreator):
832 832
 
833 833
 		# Hour of Week
834 834
 		f.write(html_header(2, 'Hour of Week'))
835
-		f.write('<table>')
835
+		f.write('<div><div class="card-body"><table>')
836 836
 
837 837
 		f.write('<tr><th>Weekday</th>')
838 838
 		for hour in range(0, 24):
@@ -855,7 +855,7 @@ class HTMLReportCreator(ReportCreator):
855 855
 					f.write('<td></td>')
856 856
 			f.write('</tr>')
857 857
 
858
-		f.write('</table>')
858
+		f.write('</table></div>')
859 859
 
860 860
 		# Month of Year
861 861
 		f.write(html_header(2, 'Month of Year'))
@@ -898,14 +898,14 @@ class HTMLReportCreator(ReportCreator):
898 898
 
899 899
 		# Commits by timezone
900 900
 		f.write(html_header(2, 'Commits by Timezone'))
901
-		f.write('<table><tr>')
901
+		f.write('<div><div class="card-body"><table><tr>')
902 902
 		f.write('<th>Timezone</th><th>Commits</th>')
903 903
 		max_commits_on_tz = max(data.commits_by_timezone.values())
904 904
 		for i in sorted(data.commits_by_timezone.keys(), key = lambda n : int(n)):
905 905
 			commits = data.commits_by_timezone[i]
906 906
 			r = 127 + int((float(commits) / max_commits_on_tz) * 128)
907 907
 			f.write('<tr><th>%s</th><td style="background-color: rgb(%d, 0, 0)">%d</td></tr>' % (i, r, commits))
908
-		f.write('</tr></table>')
908
+		f.write('</tr></table></div>')
909 909
 
910 910
 		f.write('</body></html>')
911 911
 		f.close()
@@ -921,12 +921,12 @@ class HTMLReportCreator(ReportCreator):
921 921
 		# Authors :: List of authors
922 922
 		f.write(html_header(2, 'List of Authors'))
923 923
 
924
-		f.write('<table class="authors sortable" id="authors">')
924
+		f.write('<div><div class="card-body"><table class="authors sortable" id="authors">')
925 925
 		f.write('<tr><th>Author</th><th>Commits (%)</th><th>+ lines</th><th>- lines</th><th>First commit</th><th>Last commit</th><th class="unsortable">Age</th><th>Active days</th><th># by commits</th></tr>')
926 926
 		for author in data.getAuthors(conf['max_authors']):
927 927
 			info = data.getAuthorInfo(author)
928 928
 			f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%d</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td>%d</td><td>%d</td></tr>' % (author, info['commits'], info['commits_frac'], info['lines_added'], info['lines_removed'], info['date_first'], info['date_last'], info['timedelta'], len(info['active_days']), info['place_by_commits']))
929
-		f.write('</table>')
929
+		f.write('</table></div>')
930 930
 
931 931
 		allauthors = data.getAuthors()
932 932
 		if len(allauthors) > conf['max_authors']:
@@ -977,7 +977,7 @@ class HTMLReportCreator(ReportCreator):
977 977
 
978 978
 		# Authors :: Author of Month
979 979
 		f.write(html_header(2, 'Author of Month'))
980
-		f.write('<table class="sortable" id="aom">')
980
+		f.write('<div><div class="card-body"><table class="sortable" id="aom">')
981 981
 		f.write('<tr><th>Month</th><th>Author</th><th>Commits (%%)</th><th class="unsortable">Next top %d</th><th>Number of authors</th></tr>' % conf['authors_top'])
982 982
 		for yymm in reversed(sorted(data.author_of_month.keys())):
983 983
 			authordict = data.author_of_month[yymm]
@@ -987,10 +987,10 @@ class HTMLReportCreator(ReportCreator):
987 987
 			next = ', '.join(authors[1:conf['authors_top']+1])
988 988
 			f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td><td>%s</td><td>%d</td></tr>' % (yymm, authors[0], commits, (100.0 * commits) / data.commits_by_month[yymm], data.commits_by_month[yymm], next, len(authors)))
989 989
 
990
-		f.write('</table>')
990
+		f.write('</table></div>')
991 991
 
992 992
 		f.write(html_header(2, 'Author of Year'))
993
-		f.write('<table class="sortable" id="aoy"><tr><th>Year</th><th>Author</th><th>Commits (%%)</th><th class="unsortable">Next top %d</th><th>Number of authors</th></tr>' % conf['authors_top'])
993
+		f.write('<div><div class="card-body"><table class="sortable" id="aoy"><tr><th>Year</th><th>Author</th><th>Commits (%%)</th><th class="unsortable">Next top %d</th><th>Number of authors</th></tr>' % conf['authors_top'])
994 994
 		for yy in reversed(sorted(data.author_of_year.keys())):
995 995
 			authordict = data.author_of_year[yy]
996 996
 			authors = getkeyssortedbyvalues(authordict)
@@ -998,7 +998,7 @@ class HTMLReportCreator(ReportCreator):
998 998
 			commits = data.author_of_year[yy][authors[0]]
999 999
 			next = ', '.join(authors[1:conf['authors_top']+1])
1000 1000
 			f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td><td>%s</td><td>%d</td></tr>' % (yy, authors[0], commits, (100.0 * commits) / data.commits_by_year[yy], data.commits_by_year[yy], next, len(authors)))
1001
-		f.write('</table>')
1001
+		f.write('</table></div>')
1002 1002
 
1003 1003
 		# Domains
1004 1004
 		f.write(html_header(2, 'Commits by Domains'))
@@ -1060,7 +1060,7 @@ class HTMLReportCreator(ReportCreator):
1060 1060
 
1061 1061
 		# Files :: Extensions
1062 1062
 		f.write(html_header(2, 'Extensions'))
1063
-		f.write('<table class="sortable" id="ext"><tr><th>Extension</th><th>Files (%)</th><th>Lines (%)</th><th>Lines/file</th></tr>')
1063
+		f.write('<div><div class="card-body"><table class="sortable" id="ext"><tr><th>Extension</th><th>Files (%)</th><th>Lines (%)</th><th>Lines/file</th></tr>')
1064 1064
 		for ext in sorted(data.extensions.keys()):
1065 1065
 			files = data.extensions[ext]['files']
1066 1066
 			lines = data.extensions[ext]['lines']
@@ -1069,7 +1069,7 @@ class HTMLReportCreator(ReportCreator):
1069 1069
 			except ZeroDivisionError:
1070 1070
 				loc_percentage = 0
1071 1071
 			f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%d (%.2f%%)</td><td>%d</td></tr>' % (ext, files, (100.0 * files) / data.getTotalFiles(), lines, loc_percentage, lines / files))
1072
-		f.write('</table>')
1072
+		f.write('</table></div>')
1073 1073
 
1074 1074
 		f.write('</body></html>')
1075 1075
 		f.close()
@@ -1109,7 +1109,7 @@ class HTMLReportCreator(ReportCreator):
1109 1109
 			f.write('<dt>Average commits per tag</dt><dd>%.2f</dd>' % (1.0 * data.getTotalCommits() / len(data.tags)))
1110 1110
 		f.write('</dl>')
1111 1111
 
1112
-		f.write('<table class="tags">')
1112
+		f.write('<div><div class="card-body"><table class="tags">')
1113 1113
 		f.write('<tr><th>Name</th><th>Date</th><th>Commits</th><th>Authors</th></tr>')
1114 1114
 		# sort the tags by date desc
1115 1115
 		tags_sorted_by_date_desc = map(lambda el : el[1], reversed(sorted(map(lambda el : (el[1]['date'], el[0]), data.tags.items()))))
@@ -1119,7 +1119,7 @@ class HTMLReportCreator(ReportCreator):
1119 1119
 			for i in reversed(self.authors_by_commits):
1120 1120
 				authorinfo.append('%s (%d)' % (i, data.tags[tag]['authors'][i]))
1121 1121
 			f.write('<tr><td>%s</td><td>%s</td><td>%d</td><td>%s</td></tr>' % (tag, data.tags[tag]['date'], data.tags[tag]['commits'], ', '.join(authorinfo)))
1122
-		f.write('</table>')
1122
+		f.write('</table></div>')
1123 1123
 
1124 1124
 		f.write('</body></html>')
1125 1125
 		f.close()
@@ -1338,16 +1338,16 @@ plot """
1338 1338
 
1339 1339
 	def printNav(self, f):
1340 1340
 		f.write("""
1341
-<div class="nav">
1342
-<ul>
1343
-<li><a href="index.html">General</a></li>
1344
-<li><a href="activity.html">Activity</a></li>
1345
-<li><a href="authors.html">Authors</a></li>
1346
-<li><a href="files.html">Files</a></li>
1347
-<li><a href="lines.html">Lines</a></li>
1348
-<li><a href="tags.html">Tags</a></li>
1349
-</ul>
1350
-</div>
1341
+<nav aria-label="breadcrumb">
1342
+<ol class="breadcrumb">
1343
+ <li class="breadcrumb-item" aria-current="page"><a href="index.html">General</a></li>
1344
+ <li class="breadcrumb-item" aria-current="page"><a href="activity.html">Activity</a></li>
1345
+ <li class="breadcrumb-item" aria-current="page"><a href="authors.html">Authors</a></li>
1346
+ <li class="breadcrumb-item" aria-current="page"><a href="files.html">Files</a></li>
1347
+ <li class="breadcrumb-item" aria-current="page"><a href="lines.html">Lines</a></li>
1348
+ <li class="breadcrumb-item" aria-current="page"><a href="tags.html">Tags</a></li>
1349
+</ol>
1350
+</nav>
1351 1351
 """)
1352 1352
 		
1353 1353