mirror of
https://github.com/flarum/core.git
synced 2025-08-01 22:20:21 +02:00
Implement redesign, refactor everything
- Write CSS for everything, update templates. - Refactor discussion view. Stream is split into two components (content and scrubber) which have their own responsibilities. - Extract pane functionality into a mixin. - Implement global “back button” system. You give a “paneable” target to the application controller, the back button will modulate its pane-related properties as necessary, and call an action when the button is clicked. - Extract welcome-hero into its own component. - Lots of other general improvements/refactoring. The code is quite well-commented so take a look!
This commit is contained in:
@@ -1,48 +1,35 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
// import NotificationMessage from '../models/notification-message';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
|
||||
needs: ['discussions'],
|
||||
|
||||
// The title of the forum.
|
||||
// TODO: Preload this value in the index.html payload from Laravel config.
|
||||
forumTitle: 'Ninetech Support Forum',
|
||||
// forumTitle: '<img src="tv.png" height="24" style="vertical-align: baseline; margin-right: 5px"> TV Addicts',
|
||||
// forumTitle: '<img src="gametoaid.png" height="50">',
|
||||
// forumTitle: '<i class="fa fa-stethoscope" style="font-size: 140%"></i> Med Students Forum',
|
||||
pageTitle: '',
|
||||
documentTitle: function() {
|
||||
return this.get('pageTitle') || this.get('forumTitle');
|
||||
}.property('pageTitle', 'forumTitle'),
|
||||
|
||||
_updateTitle: function() {
|
||||
// The title of the current page. This should be set as appropriate in
|
||||
// controllers/views.
|
||||
pageTitle: '',
|
||||
|
||||
// When either the forum title or the page title changes, we want to
|
||||
// refresh the document's title.
|
||||
updateTitle: function() {
|
||||
var parts = [this.get('forumTitle')];
|
||||
var pageTitle = this.get('pageTitle');
|
||||
if (pageTitle) parts.unshift(pageTitle);
|
||||
if (pageTitle) {
|
||||
parts.unshift(pageTitle);
|
||||
}
|
||||
document.title = parts.join(' - ');
|
||||
}.observes('pageTitle', 'forumTitle'),
|
||||
|
||||
// Whether or not a pane is currently pinned to the side of the interface.
|
||||
panePinned: false,
|
||||
|
||||
searchQuery: '',
|
||||
searchActive: false,
|
||||
|
||||
showDiscussionStream: false,
|
||||
|
||||
// notificationMessage: NotificationMessage.create({text: 'Sorry, you do not have permission to do that!', class: 'message-warning'}), // currently displaying notification message object
|
||||
|
||||
currentUser: null,
|
||||
|
||||
actions: {
|
||||
|
||||
hideMessage: function() {
|
||||
this.set('notificationMessage', null);
|
||||
},
|
||||
|
||||
search: function(query) {
|
||||
this.transitionToRoute('discussions', {queryParams: {searchQuery: query, sort: query ? 'relevance' : 'recent'}});
|
||||
},
|
||||
|
||||
this.transitionToRoute('index', {queryParams: {searchQuery: query, sort: query ? 'relevance' : 'recent'}});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user