Skip to content

Commit

Permalink
Remove the git commits widget from the admin dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
nlalonde committed Sep 11, 2014
1 parent 0eaf023 commit d492bac
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 115 deletions.
7 changes: 0 additions & 7 deletions app/assets/javascripts/admin/controllers/admin-commits.js.es6

This file was deleted.

41 changes: 0 additions & 41 deletions app/assets/javascripts/admin/models/github_commit.js

This file was deleted.

8 changes: 0 additions & 8 deletions app/assets/javascripts/admin/routes/admin-dashboard.js.es6
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export default Discourse.Route.extend({

setupController: function(c) {
this.fetchDashboardData(c);
this.fetchGithubCommits(c);
},

fetchDashboardData: function(c) {
Expand Down Expand Up @@ -45,13 +44,6 @@ export default Discourse.Route.extend({
c.set('problemsFetchedAt', new Date());
c.loadProblems();
}
},

fetchGithubCommits: function(c) {
if( !c.get('commitsCheckedAt') || moment().subtract(1, 'hour').toDate() > c.get('commitsCheckedAt') ) {
c.set('commitsCheckedAt', new Date());
c.set('githubCommits', Discourse.GithubCommit.findAll());
}
}
});

21 changes: 0 additions & 21 deletions app/assets/javascripts/admin/templates/commits.js.handlebars

This file was deleted.

69 changes: 34 additions & 35 deletions app/assets/javascripts/admin/templates/dashboard.js.handlebars
Original file line number Diff line number Diff line change
@@ -1,38 +1,4 @@
<div class="dashboard-left">
{{#if foundProblems}}
<div class="dashboard-stats detected-problems">
<div class="look-here"><i class="fa fa-exclamation-triangle"></i></div>
<div class="problem-messages">
<p {{bind-attr class="loadingProblems:invisible"}}>
{{i18n admin.dashboard.problems_found}}
<ul {{bind-attr class="loadingProblems:invisible"}}>
{{#each problem in problems}}
<li>{{{problem}}}</li>
{{/each}}
</ul>
</p>
<p class="actions">
<small>{{i18n admin.dashboard.last_checked}}: {{problemsTimestamp}}</small>
<button {{action refreshProblems}} class="btn btn-small"><i class="fa fa-refresh"></i>{{i18n admin.dashboard.refresh_problems}}</button>
</p>
</div>
<div class="clearfix"></div>
</div>
{{else}}
{{#if thereWereProblems}}
<div class="dashboard-stats detected-problems">
<div class="look-here">&nbsp;</div>
<div class="problem-messages">
<p>
{{i18n admin.dashboard.no_problems}}
<button {{action refreshProblems}} class="btn btn-small"><i class="fa fa-refresh"></i>{{i18n admin.dashboard.refresh_problems}}</button>
</p>
</div>
<div class="clearfix"></div>
</div>
{{/if}}
{{/if}}

{{#if Discourse.SiteSettings.version_checks}}
{{partial 'admin/templates/version_checks'}}
{{/if}}
Expand Down Expand Up @@ -138,7 +104,40 @@
</div>

<div class="dashboard-right">
{{ render 'admin/templates/commits' githubCommits }}

{{#if foundProblems}}
<div class="dashboard-stats detected-problems">
<div class="look-here"><i class="fa fa-exclamation-triangle"></i></div>
<div class="problem-messages">
<p {{bind-attr class="loadingProblems:invisible"}}>
{{i18n admin.dashboard.problems_found}}
<ul {{bind-attr class="loadingProblems:invisible"}}>
{{#each problem in problems}}
<li>{{{problem}}}</li>
{{/each}}
</ul>
</p>
<p class="actions">
<small>{{i18n admin.dashboard.last_checked}}: {{problemsTimestamp}}</small>
<button {{action refreshProblems}} class="btn btn-small"><i class="fa fa-refresh"></i>{{i18n admin.dashboard.refresh_problems}}</button>
</p>
</div>
<div class="clearfix"></div>
</div>
{{else}}
{{#if thereWereProblems}}
<div class="dashboard-stats detected-problems">
<div class="look-here">&nbsp;</div>
<div class="problem-messages">
<p>
{{i18n admin.dashboard.no_problems}}
<button {{action refreshProblems}} class="btn btn-small"><i class="fa fa-refresh"></i>{{i18n admin.dashboard.refresh_problems}}</button>
</p>
</div>
<div class="clearfix"></div>
</div>
{{/if}}
{{/if}}

<div class="dashboard-stats">
<table class="table table-condensed table-hover">
Expand Down
9 changes: 6 additions & 3 deletions app/assets/stylesheets/common/admin/admin_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ section.details {

.dashboard-left {
float: left;
margin-top: 10px;
width: 60%;
}
.dashboard-right {
Expand All @@ -606,6 +607,8 @@ section.details {
}

.version-check {
margin-top: 10px;

.version-number {
font-size: 18px;
font-weight: bold;
Expand Down Expand Up @@ -790,9 +793,9 @@ table.api-keys {
}

.referred-topic-title {
width: 410px;
@include medium-width { width: 360px; }
@include small-width { width: 320px; }
width: 355px;
@include medium-width { width: 305px; }
@include small-width { width: 265px; }
}
}

Expand Down

0 comments on commit d492bac

Please sign in to comment.