mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:16:38 -06:00
FIX: Allow dashboard to load even when git version cannot be found
This commit is contained in:
parent
5276a827dd
commit
ca9ef58318
@ -117,13 +117,15 @@
|
||||
<h4>{{i18n "admin.dashboard.last_updated"}} </h4>
|
||||
<p>{{format-date model.attributes.updated_at leaveAgo="true"}}</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4>{{i18n "admin.dashboard.discourse_last_updated"}} </h4>
|
||||
<p>{{format-date model.attributes.discourse_updated_at leaveAgo="true"}}</p>
|
||||
<a rel="noopener" target="_blank" href={{model.attributes.release_notes_link}} class="btn btn-default">
|
||||
{{i18n "admin.dashboard.whats_new_in_discourse"}}
|
||||
</a>
|
||||
</div>
|
||||
{{#if model.attributes.discourse_updated_at}}
|
||||
<div>
|
||||
<h4>{{i18n "admin.dashboard.discourse_last_updated"}} </h4>
|
||||
<p>{{format-date model.attributes.discourse_updated_at leaveAgo="true"}}</p>
|
||||
<a rel="noopener" target="_blank" href={{model.attributes.release_notes_link}} class="btn btn-default">
|
||||
{{i18n "admin.dashboard.whats_new_in_discourse"}}
|
||||
</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
class AdminDashboardGeneralData < AdminDashboardData
|
||||
def get_json
|
||||
days_since_update = ((DateTime.now - Discourse.last_commit_date) / 1.day).to_i
|
||||
days_since_update = Discourse.last_commit_date ? ((DateTime.now - Discourse.last_commit_date) / 1.day).to_i : nil
|
||||
{
|
||||
updated_at: Time.zone.now.as_json,
|
||||
discourse_updated_at: Discourse.last_commit_date,
|
||||
|
Loading…
Reference in New Issue
Block a user