Browse Source

responsive design for workspace

bmallred 9 years ago
parent
commit
c3ac6d7bd8
2 changed files with 65 additions and 14 deletions
  1. 5 0
      html/default.html
  2. 60 14
      html/workspace.html

+ 5 - 0
html/default.html

6
            color: #444;
6
            color: #444;
7
        }
7
        }
8
8
9
        nav .brand-logo {
10
            white-space: nowrap;
11
            overflow-x: hidden;
12
        }
13
9
        p {
14
        p {
10
            line-height: 2rem;
15
            line-height: 2rem;
11
        }
16
        }

+ 60 - 14
html/workspace.html

1
{{ define "title" }}Loop: Workspace{{ end }}
1
{{ define "title" }}Loop: Workspace{{ end }}
2
{{ define "styles" }}
2
{{ define "styles" }}
3
    <style>
3
    <style>
4
        nav ul a,
5
        nav .brand-logo {
6
            color: #444;
7
        }
8
9
        nav .brand-logo {
10
            white-space: nowrap;
11
            overflow-x: hidden;
12
        }
13
14
        nav .button-collapse {
15
            color: #26a69a;
16
        }
17
4
        pre#editor {
18
        pre#editor {
5
            height: 100vh;
19
            height: 100vh;
6
        }
20
        }
71
    </style>
85
    </style>
72
{{ end }}
86
{{ end }}
73
{{ define "content" }}
87
{{ define "content" }}
74
    <div class="row">
75
88
76
        <div id="left-pane" class="col s4 m4 l2">
89
    <nav class="white" role="navigation">
90
        <div class="nav-wrapper container">
91
            <div id="slide-out" class="side-nav">
92
                <h4 class="black-text center">Loop</h4>
93
                <div class="row">
94
                    <div class="col s12">
95
                        <select class="teal-text">
96
                            <option value="" disabled>Select a directory</option>
97
                            <option value="Personal" selected>Personal</option>
98
                        </select>
99
                    </div>
100
                    <div class="col s12 center">
101
                        <a class="waves-effect waves-light btn modal-trigger" href="#modal-new-directory">New Content</a>
102
                    </div>
103
                </div>
104
                <div class="row">
105
                    <div class="col s12">
106
                        <div class="collection">
107
                            {{ range $d := .Directories }}
108
                                {{ if eq $d $.Title }}
109
                                    <a class="collection-item active" href="/{{ $.Username }}/edit/{{ $d | urlquery }}">{{ $d }}</a>
110
                                {{ else }}
111
                                    <a class="collection-item" href="/{{ $.Username }}/edit/{{ $d | urlquery }}">{{ $d }}</a>
112
                                {{ end }}
113
                            {{ end }}
114
                        </div>
115
                    </div>
116
                </div>
117
            </div>
118
            <a href="#" data-activates="slide-out" class="button-collapse"><i class="mdi-navigation-menu"></i></a>
119
            <div class="brand-logo">{{ .Title }}</div>
120
        </div>
121
    </nav>
122
123
    <div class="row">
124
        <div id="left-pane" class="col l2 hide-on-med-and-down">
77
            <div class="row">
125
            <div class="row">
78
                <div class="col s12">
126
                <div class="col s12">
79
                    <label>Workspace</label>
80
                    <select>
127
                    <select class="teal-text">
81
                        <option value="" disabled>Select a directory</option>
128
                        <option value="" disabled>Select a directory</option>
82
                        <option value="Personal" selected>Personal</option>
129
                        <option value="Personal" selected>Personal</option>
83
                    </select>
130
                    </select>
88
            </div>
135
            </div>
89
            <div class="row">
136
            <div class="row">
90
                <div class="col s12" style="overflow-y: auto;">
137
                <div class="col s12" style="overflow-y: auto;">
91
                    <ul class="collection">
138
                    <div class="collection">
92
                        {{ range $d := .Directories }}
139
                        {{ range $d := .Directories }}
93
                            <li class="collection-item avatar dismissable">
94
                                <i class="mdi-file-folder circle"></i>
95
                                <span class="title"><a href="/{{ $.Username }}/edit/{{ $d | urlquery }}">{{ $d }}</a></span>
96
                                <p><!--(3 files)--></p>
97
                                <a href="#" class="secondary-content"><i class="mdi-action-grade"></i></a>
98
                            </li>
140
                            {{ if eq $d $.Title }}
141
                                <a class="collection-item active" href="/{{ $.Username }}/edit/{{ $d | urlquery }}">{{ $d }}</a>
142
                            {{ else }}
143
                                <a class="collection-item" href="/{{ $.Username }}/edit/{{ $d | urlquery }}">{{ $d }}</a>
144
                            {{ end }}
99
                        {{ end }}
145
                        {{ end }}
100
                    </ul>
146
                    </div>
101
                </div>
147
                </div>
102
            </div>
148
            </div>
103
        </div>
149
        </div>
104
150
105
        <div id="workarea" class="col s8 m8 l10">
151
        <div id="workarea" class="col s12 m12 l10">
106
            <div class="fixed-action-btn" style="bottom: 45px; right: 24px;">
152
            <div class="fixed-action-btn" style="bottom: 45px; right: 24px;">
107
                <a id="create" class="btn-floating btn-large red" title="Edit">
153
                <a id="create" class="btn-floating btn-large red" title="Edit">
108
                    <i class="large mdi-editor-mode-edit"></i>
154
                    <i class="large mdi-editor-mode-edit"></i>
128
                            <span class="hide-on-med-and-down">Preview</span>
174
                            <span class="hide-on-med-and-down">Preview</span>
129
                        </a>
175
                        </a>
130
                    </div>
176
                    </div>
131
                    <div class="col s12 m12 l12"><h4>{{ .Title }}</h4></div>
132
                    <pre id="editor" class="col s12 m12 l12">{{ .Content }}</pre>
177
                    <pre id="editor" class="col s12 m12 l12">{{ .Content }}</pre>
133
                    <iframe id="view" class="col s12 m12 l12" style="display: none;" frameBorder="0" seamless="seamless" src="/{{ .Username }}/edit/{{ .Title | urlquery }}/preview"></iframe>
178
                    <iframe id="view" class="col s12 m12 l12" style="display: none;" frameBorder="0" seamless="seamless" src="/{{ .Username }}/edit/{{ .Title | urlquery }}/preview"></iframe>
134
                </div>
179
                </div>
304
349
305
            $('select').material_select();
350
            $('select').material_select();
306
            $('.modal-trigger').leanModal();
351
            $('.modal-trigger').leanModal();
352
            $('.button-collapse').sideNav();
307
353
308
            $('#fullscreen').click(function (event) {
354
            $('#fullscreen').click(function (event) {
309
                event.preventDefault();
355
                event.preventDefault();